-
+
diff --git a/trunk/SiprpWebFichasClinicas/.settings/org.eclipse.wst.ws.service.policy.prefs b/trunk/SiprpWebFichasClinicas/.settings/org.eclipse.wst.ws.service.policy.prefs
new file mode 100644
index 00000000..9cfcabe1
--- /dev/null
+++ b/trunk/SiprpWebFichasClinicas/.settings/org.eclipse.wst.ws.service.policy.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+org.eclipse.wst.ws.service.policy.projectEnabled=false
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/WEB-INF/lib/jersey-media-multipart-2.7.jar b/trunk/SiprpWebFichasClinicas/WebContent/WEB-INF/lib/jersey-media-multipart-2.7.jar
new file mode 100644
index 00000000..e796fcc1
Binary files /dev/null and b/trunk/SiprpWebFichasClinicas/WebContent/WEB-INF/lib/jersey-media-multipart-2.7.jar differ
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/WEB-INF/lib/mimepull-1.9.3.jar b/trunk/SiprpWebFichasClinicas/WebContent/WEB-INF/lib/mimepull-1.9.3.jar
new file mode 100644
index 00000000..c3234556
Binary files /dev/null and b/trunk/SiprpWebFichasClinicas/WebContent/WEB-INF/lib/mimepull-1.9.3.jar differ
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Documents/DocumentsController.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Documents/DocumentsController.js
index 85bc29ad..637e3b77 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Documents/DocumentsController.js
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Documents/DocumentsController.js
@@ -36,18 +36,23 @@
$scope.storeDocuments = new globals.dataService.store({
model: null,
+ serviceBase: window.evoapp.DOCPATH,
actions: {
- //get: 'GetDisciplines',
- //upsert: 'UpsertDiscipline',
- //destroy: 'DeleteDiscipline'
+ get: 'documentosList',
+ upsert: 'documento',
+ destroy: 'removerDocumento'
}
});
$scope.list = function(){
-
- //$scope.storeDocuments.get(function(response, status, headers, config, items){
+
+ $scope.storeDocuments.extraParams = {
+ trabalhadorID: $scope.selectedTrabalhador.trabalhador_id
+ };
+
+ $scope.storeDocuments.get( function(response, status, headers, config, items){
- //});
+ });
};
$scope.add = function(){
@@ -88,20 +93,25 @@
if(isValid)
{
//TODO: store upsert
-
$scope.uploadDocument();
+ $scope.list();
}
};
- $scope.destroy = function(){
+ $scope.destroy = function(){
globals.message.confirm({
question: 'Tem a certeza que deseja continuar?',
answer: function(result){
-
if(result)
{
+ $scope.storeDocuments.extraParams = {
+ documentoID: $scope.editing.id
+ };
+ $scope.storeDocuments.destroy( function(response, status, headers, config, items){
+ $scope.list();
+ });
}
}
});
@@ -109,31 +119,25 @@
$scope.cancel = function(){
- //if($scope.isNewRecord)
- //{
- // $scope.isNewRecord = false;
-
- // $scope.list();
- //}
+ if($scope.isNewRecord)
+ {
+ $scope.isNewRecord = false;
+ $scope.list();
+ }
$scope.showList = true;
$scope.showEdit = false;
};
$scope.download = function(item){
-
- globals.message.alert({
- message: 'Abrir o documento: ' + item.nome,
- callback: function(){
-
- }
- });
+ window.location.assign( window.evoapp.DOCPATH + "documentos/getDocumento?documentoID=" + encodeURIComponent( item.id ) );
};
$scope.uploadDocument = function(){
if($scope.fileInputDocument)
{
+ $scope.editing.trabalhador_id = $scope.selectedTrabalhador.trabalhador_id;
$scope.fileInputDocument.upload($scope.editing, function(result, textStatus, jqXHR){
var data = result.data[0];
@@ -147,7 +151,5 @@
};
$scope.$on('afterrender', function(event, args){
-
- $scope.storeDocuments.loadData(documentos);
});
-});
\ No newline at end of file
+});
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Documents/DocumentsView.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Documents/DocumentsView.html
index 643b76fe..d6c356cd 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Documents/DocumentsView.html
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/Documents/DocumentsView.html
@@ -58,14 +58,12 @@
-
-
-
+
@@ -80,4 +78,4 @@
-
\ No newline at end of file
+
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js
index 4ffda2e4..e0f71565 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js
@@ -12,6 +12,14 @@
}
});
+ $scope.numDocumentos = new globals.dataService.store({
+ model: 0,
+ serviceBase: window.evoapp.DOCPATH,
+ actions: {
+ get: 'documentosCount'
+ }
+ });
+
$scope.storeFichasTrabalhador = new globals.dataService.store();
$scope.dadosTrabalhador = null;
@@ -132,7 +140,17 @@
var fichas = response.data.fichas;
$scope.storeFichasTrabalhador.loadData(fichas);
}
- });
+ });
+
+ $scope.numDocumentos.extraParams = {
+ trabalhadorID: selectedRecord.id
+ };
+
+ $scope.numDocumentos.get( function(response)
+ {
+
+ });
+
}
};
@@ -149,7 +167,7 @@
$scope.openModalDocumentos = function(){
$scope.modalDocumentos.show({
-
+ selectedTrabalhador: $scope.dadosTrabalhador
});
$scope.modalDocumentos.viewController.list();
@@ -162,8 +180,8 @@
$scope.openModalAcidentesTrabalho = function(){
- $scope.modalAcidentesTrabalho.show({
-
+ $scope.modalAcidentesTrabalho.show({
+ selectedTrabalhador: $scope.dadosTrabalhador
});
$scope.modalAcidentesTrabalho.viewController.list();
@@ -227,4 +245,4 @@
});
});
-});
\ No newline at end of file
+});
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html
index 13b3e09d..1a146848 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html
@@ -152,7 +152,7 @@