git-svn-id: https://svn.coded.pt/svn/SIPRP@1883 bb69d46d-e84e-40c8-a05a-06db0d633741

lxbfYeaa
João Maurício 12 years ago
parent 3e2365ebfe
commit 1c4c60be1d

@ -31,10 +31,17 @@
$scope.edit = function(selected){ $scope.edit = function(selected){
$scope.$parent.loadModule({Controller: 'Form1'}, function(className, scope, isNewModule){ var module = _.where($rootScope.UserSession.tiposFichas, {id: selected.tipo_id});
if(module.length > 0)
{
var controller = module[0];
$scope.$parent.loadModule({Controller: controller.Controller}, function(className, scope, isNewModule){
scope.edit(selected); scope.edit(selected);
}); });
}
}; };
$scope.add = function(selected){ $scope.add = function(selected){
@ -101,6 +108,8 @@
$scope.storeResumoTrabalhador.get(function(response, status, headers, config, items){ $scope.storeResumoTrabalhador.get(function(response, status, headers, config, items){
if(response.data != null)
{
if(response.data.dadosTrabalhador) if(response.data.dadosTrabalhador)
{ {
$scope.dadosTrabalhador = response.data.dadosTrabalhador; $scope.dadosTrabalhador = response.data.dadosTrabalhador;
@ -109,6 +118,7 @@
var fichas = response.data.fichas; var fichas = response.data.fichas;
$scope.storeFichasTrabalhador.items = []; $scope.storeFichasTrabalhador.items = [];
$scope.storeFichasTrabalhador.loadData(fichas); $scope.storeFichasTrabalhador.loadData(fichas);
}
}); });
}; };

Loading…
Cancel
Save