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

lxbfYeaa
João Maurício 12 years ago
parent d6cc0a2a10
commit 1da8d52f59

@ -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();
});
}
});
}
};
@ -202,6 +197,14 @@
className: 'btn-success',
callback: function() {
$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){
//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();
});
}
});
}
@ -96,6 +100,13 @@
className: 'btn-success',
callback: function() {
$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>
<thead>
<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">Autor</th>
<th class="col-md-3">&nbsp;</th>
<th class="col-md-2">Estado</th>
<th class="col-md-2">&nbsp;</th>
</tr>
</thead>
<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.tipo"></span></td>
<td><span ng-bind="item.responsavel"></span></td>
<td><span>{{item.concluido ? 'Concluido' : 'Em Aberto'}}</span></td>
<td>
<button ng-click="edit(item)" type="button" class="btn btn-xs btn-default">
<span class="glyphicon glyphicon-pencil"></span>

@ -79,8 +79,10 @@
me.items = response.data;
}
if(callbackFn)
{
callback(callbackFn, [response, status, headers, config, me.items]);
}
}).
error(function(response, status, headers, config) {
@ -128,23 +130,10 @@
if(response.success)
{
// var idPropertyValue = editing[modelInstance.idProperty],
// isNewRecord = (idPropertyValue == 0 || idPropertyValue == null || idPropertyValue == undefined);
if(response.data != null)
{
//if(angular.isArray(response.data))
//{
// 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);
angular.copy(response.data, editing);
angular.copy(response.data, selected);
}
}
@ -210,6 +199,10 @@
this.items.push(data[n]);
}
};
this.refresh = function(){
me.get();
};
};
//pass specified values to specified function arguments

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