diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js index f1daf912..013b9f56 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form1/Form1Controller.js @@ -32,7 +32,6 @@ $('#modalDocumentosTrabalhador').modal('show'); } }); - }; $scope.edit = function(selected){ @@ -62,15 +61,6 @@ }, 0); - //test - //selected = testModel; - - //$scope.editForm.$reset(); - - //$scope.selected = selected; - - //$scope.editing = angular.copy(selected); - //listeners //$scope.$watch('editing.ficha.trabalhador_data_nascimento', function(newVal, oldVal){ @@ -100,11 +90,16 @@ $scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing, isNewRecord){ - //TODO: check the need for other keys!!! - if(response.data) + if(response.success && complete) { - $scope.editing.ficha.id = response.data.ficha.id; + globals.plugins.hideSideMenu(); + + $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){ + + scope.storeResumoTrabalhador.refresh(); + }); } + }); } }; @@ -201,7 +196,15 @@ label: 'Gravar', className: 'btn-success', callback: function() { - $scope.save(false); + $scope.save(false); + + globals.plugins.hideSideMenu(); + + $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){ + + scope.storeResumoTrabalhador.refresh(); + }); + } } } diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js index c33f1c98..3c6a1c4b 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Form2/Form2Controller.js @@ -59,10 +59,14 @@ $scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing, isNewRecord){ - //TODO: check the need for other keys!!! - if(response.data) + if(response.success && complete) { - $scope.editing.ficha.id = response.data.ficha.id; + globals.plugins.hideSideMenu(); + + $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){ + + scope.storeResumoTrabalhador.refresh(); + }); } }); } @@ -95,7 +99,14 @@ label: 'Gravar', className: 'btn-success', callback: function() { - $scope.save(false); + $scope.save(false); + + globals.plugins.hideSideMenu(); + + $scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){ + + scope.storeResumoTrabalhador.refresh(); + }); } } } diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html index 8c0aa0a5..51031e3a 100644 --- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html +++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html @@ -92,10 +92,11 @@
| Autor | -+ | Estado | ++ | {{item.concluido ? 'Concluido' : 'Em Aberto'}} |
|---|