' +
'
+{{MessageCount-1}}' +
'
' +
'
' +
@@ -462,6 +503,18 @@
//$scope.windowViewServerResponse.viewController.list($scope.ServerResponse);
};
+ $rootScope.$on('onsessiontimeout', function(event, args){
+
+ var eee = args.response;
+
+ $scope.sessionTimeout = true;
+ $scope.beforeSessionTimeoutModule = $scope.currentModule;
+
+ $scope.loadModule({Controller: 'Login'}, function(className, scope, isNewModule){
+
+ });
+ });
+
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//fires whenever a new module is rendered, if broadcastCreation is true on method renderModule
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js
index 614ce6d2..fa08fbb9 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchController.js
@@ -66,8 +66,8 @@
$scope.onEmpresaChange = function(selectedValue, selectedRecord){
$scope.comboEstabelecimentos.store.extraParams = {
- empresaID: selectedRecord.id,
- filter: 'sede'
+ id: selectedRecord.id,
+ filter: selectedRecord.designacao_social
};
$scope.comboEstabelecimentos.loadStore(function(response, status, headers, config, items){
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html
index 880bfd91..2971c3fb 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/SearchForm/SearchView.html
@@ -46,7 +46,7 @@
store-model=""
store-actions-get="getEstabelecimentos"
value-field="id"
- display-field="designacao_social"
+ display-field="nome"
add-empty-option="false"
on-change="onEstabelecimentoChange(selectedValue, selectedRecord)">
@@ -63,7 +63,7 @@
store-model=""
store-actions-get="getTrabalhadores"
value-field="id"
- display-field="designacao_social"
+ display-field="nome"
add-empty-option="false"
on-change="onTrabalhadorChange(selectedValue, selectedRecord)">
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/DataService.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/DataService.js
index afeedc00..29d5b988 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/DataService.js
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/DataService.js
@@ -33,6 +33,8 @@
this.convertToModel = true;
this.broadcastEvents = true;
+ $http.defaults.withCredentials = true;
+
this.get = function(){
var callbackFn = arguments[0];
@@ -82,6 +84,11 @@
}).
error(function(response, status, headers, config) {
+ if(me.broadcastEvents)
+ {
+ $rootScope.$broadcast('response', {response: response});
+ }
+
callback(callbackFn, [response, status, headers, config]);
});
@@ -114,45 +121,40 @@
}).
success(function(response, status, headers, config) {
- $rootScope.$broadcast('response', {response: response});
+ if(me.broadcastEvents)
+ {
+ $rootScope.$broadcast('response', {response: response});
+ }
if(response.success)
{
- // var idPropertyValue = editing[modelInstance.idProperty],
- // isNewRecord = (idPropertyValue == 0 || idPropertyValue == null || idPropertyValue == undefined);
+ // 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);
- // }
-
- // angular.copy(response.data, editing);
- // angular.copy(response.data, selected);
- // }
+ // 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);
+ // }
+
+ // angular.copy(response.data, editing);
+ // angular.copy(response.data, selected);
+ // }
}
callback(callbackFn, [response, selected, editing, isNewRecord]);
}).
error(function(response, status, headers, config) {
- var res = {
- success: false,
- data: null,
- messages: [
- {
- type: 'ERROR',
- messageData: 'Ocorreu um erro de sistema.'
- }
- ]
- };
-
- $rootScope.$broadcast('response', {response: res});
+ if(me.broadcastEvents)
+ {
+ $rootScope.$broadcast('response', {response: response});
+ }
callback(callbackFn, [response, selected, editing, isNewRecord]);
});
@@ -182,12 +184,20 @@
}).
success(function(response, status, headers, config) {
- $rootScope.$broadcast('response', {response: response});
+ if(me.broadcastEvents)
+ {
+ $rootScope.$broadcast('response', {response: response});
+ }
callback(callbackFn, [response]);
}).
error(function(response, status, headers, config) {
+ if(me.broadcastEvents)
+ {
+ $rootScope.$broadcast('response', {response: response});
+ }
+
callback(callbackFn, [response]);
});
};
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/HttpInterceptor.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/HttpInterceptor.js
index 32ae7246..e3b273fc 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/HttpInterceptor.js
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/HttpInterceptor.js
@@ -17,19 +17,19 @@ evoapp.factory('httpInterceptor', function ($rootScope, $q){
var ended = function(response){
- //intercept SECURITYEXCEPTION responses
- //if(!response.data.success && response.data.response)
- //{
- // if(response.data.response.ServerResponse.length > 0)
- // {
- // var sr = response.data.response.ServerResponse[0];
+ //intercept exceptions
+ if(response.data.success != undefined)
+ {
+ if(response.data.messages.length > 0)
+ {
+ var firstMessage = response.data.messages[0];
- // if(sr.MessageType == 'SECURITYEXCEPTION')
- // {
- // $rootScope.$broadcast('response', {response: response.data});
- // }
- // }
- //}
+ if(firstMessage.type == 'SESSIONTIMEOUT')
+ {
+ $rootScope.$broadcast('onsessiontimeout', {response: response.data});
+ }
+ }
+ }
activeRequests--;
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/StaticData.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/StaticData.js
new file mode 100644
index 00000000..8a07c984
--- /dev/null
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/StaticData.js
@@ -0,0 +1,16 @@
+ evoapp.factory('staticData', function($rootScope) {
+
+ //exceptions
+ var exceptions = {
+ ERROR: 'ERROR',
+ SECURITYEXCEPTION: 'SECURITYEXCEPTION',
+ SESSIONTIMEOUT: 'SESSIONTIMEOUT',
+ INFO: 'INFO',
+ QUESTION: 'QUESTION',
+ WARNING: 'WARNING'
+ };
+
+ return {
+ exceptions: exceptions
+ };
+});
\ No newline at end of file
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Utils.js b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Utils.js
index 2e4f4d50..7ab8ffcb 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Utils.js
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/app/services/Utils.js
@@ -15,6 +15,7 @@
{
case 'ERROR':
case 'SECURITYEXCEPTION':
+ case 'SESSIONTIMEOUT':
messageType = 'danger';
break;
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/css/theme.css b/trunk/SiprpWebFichasClinicas/WebContent/static/html/css/theme.css
index cb98d4c0..7d0dc77f 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/css/theme.css
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/css/theme.css
@@ -258,4 +258,8 @@ body.modal-open {
overflow: auto;
}
-
+.modal-backdrop, .modal-backdrop.fade.in {
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+ background: transparent!important;
+}
diff --git a/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html b/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html
index b4446d33..8a4a8cab 100644
--- a/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html
+++ b/trunk/SiprpWebFichasClinicas/WebContent/static/html/index.html
@@ -109,7 +109,7 @@
-
+