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

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
João Maurício 12 years ago
parent d6cc0a2a10
commit 1da8d52f59

@ -32,7 +32,6 @@
$('#modalDocumentosTrabalhador').modal('show'); $('#modalDocumentosTrabalhador').modal('show');
} }
}); });
}; };
$scope.edit = function(selected){ $scope.edit = function(selected){
@ -62,15 +61,6 @@
}, 0); }, 0);
//test
//selected = testModel;
//$scope.editForm.$reset();
//$scope.selected = selected;
//$scope.editing = angular.copy(selected);
//listeners //listeners
//$scope.$watch('editing.ficha.trabalhador_data_nascimento', function(newVal, oldVal){ //$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){ $scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing, isNewRecord){
//TODO: check the need for other keys!!! if(response.success && complete)
if(response.data)
{ {
$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', label: 'Gravar',
className: 'btn-success', className: 'btn-success',
callback: function() { callback: function() {
$scope.save(false); $scope.save(false);
globals.plugins.hideSideMenu();
$scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){
scope.storeResumoTrabalhador.refresh();
});
} }
} }
} }

@ -59,10 +59,14 @@
$scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing, isNewRecord){ $scope.storeFichasClinicas.upsert($scope.selected, $scope.editing, function(response, selected, editing, isNewRecord){
//TODO: check the need for other keys!!! if(response.success && complete)
if(response.data)
{ {
$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', label: 'Gravar',
className: 'btn-success', className: 'btn-success',
callback: function() { callback: function() {
$scope.save(false); $scope.save(false);
globals.plugins.hideSideMenu();
$scope.$parent.loadModule({Controller: 'Search'}, function(className, scope, isNewModule){
scope.storeResumoTrabalhador.refresh();
});
} }
} }
} }

@ -92,10 +92,11 @@
<table class="table table-hover table-striped" data-store="storeFichasTrabalhador" datatable> <table class="table table-hover table-striped" data-store="storeFichasTrabalhador" datatable>
<thead> <thead>
<tr> <tr>
<th class="col-md-3 hidden-xs">Data</th> <th class="col-md-2 hidden-xs">Data</th>
<th class="col-md-3 hidden-xs">Tipo</th> <th class="col-md-3 hidden-xs">Tipo</th>
<th class="col-md-3">Autor</th> <th class="col-md-3">Autor</th>
<th class="col-md-3">&nbsp;</th> <th class="col-md-2">Estado</th>
<th class="col-md-2">&nbsp;</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -103,6 +104,7 @@
<td class="hidden-xs"><span ng-bind="item.data | date: 'yyyy-MM-dd hh:mm'"></span></td> <td class="hidden-xs"><span ng-bind="item.data | date: 'yyyy-MM-dd hh:mm'"></span></td>
<td class="hidden-xs"><span ng-bind="item.tipo"></span></td> <td class="hidden-xs"><span ng-bind="item.tipo"></span></td>
<td><span ng-bind="item.responsavel"></span></td> <td><span ng-bind="item.responsavel"></span></td>
<td><span>{{item.concluido ? 'Concluido' : 'Em Aberto'}}</span></td>
<td> <td>
<button ng-click="edit(item)" type="button" class="btn btn-xs btn-default"> <button ng-click="edit(item)" type="button" class="btn btn-xs btn-default">
<span class="glyphicon glyphicon-pencil"></span> <span class="glyphicon glyphicon-pencil"></span>

@ -79,8 +79,10 @@
me.items = response.data; me.items = response.data;
} }
callback(callbackFn, [response, status, headers, config, me.items]); if(callbackFn)
{
callback(callbackFn, [response, status, headers, config, me.items]);
}
}). }).
error(function(response, status, headers, config) { error(function(response, status, headers, config) {
@ -127,24 +129,11 @@
} }
if(response.success) if(response.success)
{ {
// var idPropertyValue = editing[modelInstance.idProperty],
// isNewRecord = (idPropertyValue == 0 || idPropertyValue == null || idPropertyValue == undefined);
if(response.data != null) if(response.data != null)
{ {
//if(angular.isArray(response.data)) angular.copy(response.data, editing);
//{ angular.copy(response.data, selected);
// response.data = modelService.toModel(me.model, response.data[0], null);
//}
//else
//{
// response.data = modelService.toModel(me.model, response.data, null);
//}
//TODO: should we remove this or create config option???
//angular.copy(response.data, editing);
//angular.copy(response.data, selected);
} }
} }
@ -210,6 +199,10 @@
this.items.push(data[n]); this.items.push(data[n]);
} }
}; };
this.refresh = function(){
me.get();
};
}; };
//pass specified values to specified function arguments //pass specified values to specified function arguments

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save