Rev 1731 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1731 | Rev 1822 | ||
---|---|---|---|
1 | <%@ page import="pt.estgp.estgweb.web.UserSessionProxy" %> |
1 | <%@ page import="pt.estgp.estgweb.web.UserSessionProxy" %> |
2 | <%@ page contentType="text/html; charset=UTF-8" language="java"%> |
2 | <%@ page contentType="text/html; charset=UTF-8" language="java"%> |
3 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
3 | <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html" %> |
4 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
4 | <%@ taglib uri="/WEB-INF/tlds/struts-nested.tld" prefix="nested" %> |
5 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
5 | <%@ taglib uri="/WEB-INF/tlds/struts-logic.tld" prefix="logic" %> |
6 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
6 | <%@ taglib uri="/WEB-INF/tlds/struts-bean.tld" prefix="bean" %> |
7 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
7 | <%@ taglib uri="/WEB-INF/tlds/struts-tiles.tld" prefix="tiles" %> |
8 | <%@ taglib prefix="baco" uri="http://www.estgp.pt/baco/" %> |
8 | <%@ taglib prefix="baco" uri="/WEB-INF/tlds/baco.tld" %> |
9 | <%--Esta declaracao tem de estar antes das proximas que sao dependentes desta--%> |
9 | <%--Esta declaracao tem de estar antes das proximas que sao dependentes desta--%> |
10 | <script> |
10 | <script> |
11 | var GLOBAL_BacoAngularAppDependencies = []; |
11 | var GLOBAL_BacoAngularAppDependencies = []; |
12 | var bacoAngularApp = angular.module('BacoAngularApp', GLOBAL_BacoAngularAppDependencies); |
12 | var bacoAngularApp = angular.module('BacoAngularApp', GLOBAL_BacoAngularAppDependencies); |
13 | 13 | ||
14 | 14 | ||
15 | 15 | ||
16 | 16 | ||
17 | /* Isto daria para colocar numa app nossa lá no meio para adicionar material vindo do Ajax |
17 | /* Isto daria para colocar numa app nossa lá no meio para adicionar material vindo do Ajax |
18 | bacoAngularApp.directive('dynamic', function ($compile) { |
18 | bacoAngularApp.directive('dynamic', function ($compile) { |
19 | return { |
19 | return { |
20 | replace: true, |
20 | replace: true, |
21 | link: function (scope, ele, attrs) { |
21 | link: function (scope, ele, attrs) { |
22 | scope.$watch(attrs.dynamic, function(html) { |
22 | scope.$watch(attrs.dynamic, function(html) { |
23 | if (!html) { |
23 | if (!html) { |
24 | return; |
24 | return; |
25 | } |
25 | } |
26 | ele.html((typeof(html) === 'string') ? html : html.data); |
26 | ele.html((typeof(html) === 'string') ? html : html.data); |
27 | $compile(ele.contents())(scope); |
27 | $compile(ele.contents())(scope); |
28 | }); |
28 | }); |
29 | } |
29 | } |
30 | }; |
30 | }; |
31 | }); |
31 | }); |
32 | */ |
32 | */ |
33 | /** |
33 | /** |
34 | * AngularHelper : Contains methods that help using angular without being in the scope of an angular controller or directive |
34 | * AngularHelper : Contains methods that help using angular without being in the scope of an angular controller or directive |
35 | */ |
35 | */ |
36 | var AngularHelper = (function () { |
36 | var AngularHelper = (function () { |
37 | var AngularHelper = function () { }; |
37 | var AngularHelper = function () { }; |
38 | 38 | ||
39 | /** |
39 | /** |
40 | * ApplicationName : Default application name for the helper |
40 | * ApplicationName : Default application name for the helper |
41 | */ |
41 | */ |
42 | var defaultApplicationName = "myDefaultAppName"; |
42 | var defaultApplicationName = "myDefaultAppName"; |
43 | 43 | ||
44 | /** |
44 | /** |
45 | * Compile : Compile html with the rootScope of an application |
45 | * Compile : Compile html with the rootScope of an application |
46 | * and replace the content of a target element with the compiled html |
46 | * and replace the content of a target element with the compiled html |
47 | * @$targetDom : The dom in which the compiled html should be placed |
47 | * @$targetDom : The dom in which the compiled html should be placed |
48 | * @htmlToCompile : The html to compile using angular |
48 | * @htmlToCompile : The html to compile using angular |
49 | * @applicationName : (Optionnal) The name of the application (use the default one if empty) |
49 | * @applicationName : (Optionnal) The name of the application (use the default one if empty) |
50 | */ |
50 | */ |
51 | AngularHelper.Compile = function ($targetDom, htmlToCompile, applicationName) { |
51 | AngularHelper.Compile = function ($targetDom, htmlToCompile, applicationName) { |
52 | var $injector = angular.injector(["ng", applicationName || defaultApplicationName]); |
52 | var $injector = angular.injector(["ng", applicationName || defaultApplicationName]); |
53 | 53 | ||
54 | $injector.invoke(["$compile", "$rootScope", function ($compile, $rootScope) { |
54 | $injector.invoke(["$compile", "$rootScope", function ($compile, $rootScope) { |
55 | //Get the scope of the target, use the rootScope if it does not exists |
55 | //Get the scope of the target, use the rootScope if it does not exists |
56 | var $scope = $targetDom.html(htmlToCompile).scope(); |
56 | var $scope = $targetDom.html(htmlToCompile).scope(); |
57 | $compile($targetDom)($scope || $rootScope); |
57 | $compile($targetDom)($scope || $rootScope); |
58 | $rootScope.$digest(); |
58 | $rootScope.$digest(); |
59 | }]); |
59 | }]); |
60 | } |
60 | } |
61 | 61 | ||
62 | return AngularHelper; |
62 | return AngularHelper; |
63 | })(); |
63 | })(); |
64 | </script> |
64 | </script> |
65 | 65 | ||
66 | 66 | ||
67 | <jsp:include page="intranetTools/files-upload-form.jsp"/> |
67 | <jsp:include page="intranetTools/files-upload-form.jsp"/> |
68 | 68 | ||
69 | 69 | ||
70 | <link rel="stylesheet" href="<%=request.getContextPath()%>/js/angularjs/angular-ui-tree/angular-ui-tree.min.css"> |
70 | <link rel="stylesheet" href="<%=request.getContextPath()%>/js/angularjs/angular-ui-tree/angular-ui-tree.min.css"> |
71 | <script type="text/javascript" src="<%=request.getContextPath()%>/js/angularjs/angular-ui-tree/angular-ui-tree.js"></script> |
71 | <script type="text/javascript" src="<%=request.getContextPath()%>/js/angularjs/angular-ui-tree/angular-ui-tree.js"></script> |
72 | 72 | ||
73 | 73 | ||
74 | <script> |
74 | <script> |
75 | //COLOCAR WEB-MESSAGES WARNING E ERROR NUMA MODAL DEPOIS DE CARREGAR A PAGINA |
75 | //COLOCAR WEB-MESSAGES WARNING E ERROR NUMA MODAL DEPOIS DE CARREGAR A PAGINA |
76 | //ESTE METODO É DE AMBITO AUTOMATICO VAI BUSCAR ERROS, REPARE NA CLASSE web-messages-errors-baco que é |
76 | //ESTE METODO É DE AMBITO AUTOMATICO VAI BUSCAR ERROS, REPARE NA CLASSE web-messages-errors-baco que é |
77 | //colocada pelo Struts nos prefixos a partir da conf no MessageResources |
77 | //colocada pelo Struts nos prefixos a partir da conf no MessageResources |
78 | //Todas as mensagens desta classe são apanhadas e colocadas na modal de erros abaixo |
78 | //Todas as mensagens desta classe são apanhadas e colocadas na modal de erros abaixo |
79 | //seguidamente são mostradas em Modal |
79 | //seguidamente são mostradas em Modal |
80 | $(document).ready(function() |
80 | $(document).ready(function() |
81 | { |
81 | { |
82 | if($(".web-messages-errors-baco").length) |
82 | if($(".web-messages-errors-baco").length) |
83 | { |
83 | { |
84 | var webMessages= ""; |
84 | var webMessages= ""; |
85 | $(".web-messages-errors-baco").each( function() |
85 | $(".web-messages-errors-baco").each( function() |
86 | { |
86 | { |
87 | webMessages += $(this).html(); |
87 | webMessages += $(this).html(); |
88 | }); |
88 | }); |
89 | $('#errorsBacoModal .content-errors').html(webMessages); |
89 | $('#errorsBacoModal .content-errors').html(webMessages); |
90 | $('.modal').modal("hide"); |
90 | $('.modal').modal("hide"); |
91 | $('#errorsBacoModal').modal({ |
91 | $('#errorsBacoModal').modal({ |
92 | show: 'true' |
92 | show: 'true' |
93 | }); |
93 | }); |
94 | } |
94 | } |
95 | }); |
95 | }); |
96 | /* function modalWebMessages(title) |
96 | /* function modalWebMessages(title) |
97 | { |
97 | { |
98 | if($(".web-messages").length) |
98 | if($(".web-messages").length) |
99 | { |
99 | { |
100 | $("#modalWebMessages modal-title").html(title); |
100 | $("#modalWebMessages modal-title").html(title); |
101 | $('#modalWebMessages .content-web-messages').html( $(".web-messages").html()); |
101 | $('#modalWebMessages .content-web-messages').html( $(".web-messages").html()); |
102 | $('#modalWebMessages .content-aditional').html( ""); |
102 | $('#modalWebMessages .content-aditional').html( ""); |
103 | $('.modal').modal("hide"); |
103 | $('.modal').modal("hide"); |
104 | $('#modalWebMessages').modal({ |
104 | $('#modalWebMessages').modal({ |
105 | show: 'true' |
105 | show: 'true' |
106 | }); |
106 | }); |
107 | } |
107 | } |
108 | }*/ |
108 | }*/ |
109 | function modalWebMessages(title,aditionalHtml) |
109 | function modalWebMessages(title,aditionalHtml) |
110 | { |
110 | { |
111 | if($(".web-messages").length) |
111 | if($(".web-messages").length) |
112 | { |
112 | { |
113 | $("#modalWebMessages .modal-title").html(title); |
113 | $("#modalWebMessages .modal-title").html(title); |
114 | 114 | ||
115 | var webMessages= ""; |
115 | var webMessages= ""; |
116 | $(".web-messages").each( function() |
116 | $(".web-messages").each( function() |
117 | { |
117 | { |
118 | webMessages += $(this).html(); |
118 | webMessages += $(this).html(); |
119 | }); |
119 | }); |
120 | $('#modalWebMessages .content-web-messages').html( webMessages); |
120 | $('#modalWebMessages .content-web-messages').html( webMessages); |
121 | if(aditionalHtml) |
121 | if(aditionalHtml) |
122 | $('#modalWebMessages .content-aditional').html( aditionalHtml); |
122 | $('#modalWebMessages .content-aditional').html( aditionalHtml); |
123 | $('.modal').modal("hide"); |
123 | $('.modal').modal("hide"); |
124 | $('#modalWebMessages').modal({ |
124 | $('#modalWebMessages').modal({ |
125 | show: 'true' |
125 | show: 'true' |
126 | }); |
126 | }); |
127 | } |
127 | } |
128 | } |
128 | } |
129 | function modalWebMessagesGivenContainer(title,refContainer) |
129 | function modalWebMessagesGivenContainer(title,refContainer) |
130 | { |
130 | { |
131 | if($(refContainer + " .web-messages").length) |
131 | if($(refContainer + " .web-messages").length) |
132 | { |
132 | { |
133 | $("#modalWebMessages .modal-title").html(title); |
133 | $("#modalWebMessages .modal-title").html(title); |
134 | var webMessages= ""; |
134 | var webMessages= ""; |
135 | $(refContainer + " .web-messages").each( function() |
135 | $(refContainer + " .web-messages").each( function() |
136 | { |
136 | { |
137 | webMessages += $(this).html(); |
137 | webMessages += $(this).html(); |
138 | }); |
138 | }); |
139 | $('#modalWebMessages .content-web-messages').html(webMessages); |
139 | $('#modalWebMessages .content-web-messages').html(webMessages); |
140 | $('#modalWebMessages .content-aditional').html( ""); |
140 | $('#modalWebMessages .content-aditional').html( ""); |
141 | $('.modal').modal("hide"); |
141 | $('.modal').modal("hide"); |
142 | $('#modalWebMessages').modal({ |
142 | $('#modalWebMessages').modal({ |
143 | show: 'true' |
143 | show: 'true' |
144 | }); |
144 | }); |
145 | } |
145 | } |
146 | } |
146 | } |
147 | function modalWebMessagesGivenContainerAndTarget(title,refContainer,targetOkUrl) |
147 | function modalWebMessagesGivenContainerAndTarget(title,refContainer,targetOkUrl) |
148 | { |
148 | { |
149 | if($(refContainer + " .web-messages").length) |
149 | if($(refContainer + " .web-messages").length) |
150 | { |
150 | { |
151 | $("#modalWebMessages .modal-title").html(title); |
151 | $("#modalWebMessages .modal-title").html(title); |
152 | var webMessages= ""; |
152 | var webMessages= ""; |
153 | $(refContainer + " .web-messages").each( function() |
153 | $(refContainer + " .web-messages").each( function() |
154 | { |
154 | { |
155 | webMessages += $(this).html(); |
155 | webMessages += $(this).html(); |
156 | }); |
156 | }); |
157 | $('#modalWebMessages .content-web-messages').html(webMessages); |
157 | $('#modalWebMessages .content-web-messages').html(webMessages); |
158 | $('#modalWebMessages .content-aditional').html( ""); |
158 | $('#modalWebMessages .content-aditional').html( ""); |
159 | $('.modal').modal("hide"); |
159 | $('.modal').modal("hide"); |
160 | $('#modalWebMessages').modal({ |
160 | $('#modalWebMessages').modal({ |
161 | show: 'true' |
161 | show: 'true' |
162 | }); |
162 | }); |
163 | $("#modalWebMessages button[data-dismiss='modal']").unbind( "click" ); |
163 | $("#modalWebMessages button[data-dismiss='modal']").unbind( "click" ); |
164 | $("#modalWebMessages button[data-dismiss='modal']").click( |
164 | $("#modalWebMessages button[data-dismiss='modal']").click( |
165 | function() |
165 | function() |
166 | { |
166 | { |
167 | window.location.href = targetOkUrl; |
167 | window.location.href = targetOkUrl; |
168 | } |
168 | } |
169 | ); |
169 | ); |
170 | } |
170 | } |
171 | } |
171 | } |
172 | </script> |
172 | </script> |
173 | 173 | ||
174 | <div class="modal fade" id="errorsBacoModal" role="dialog" > |
174 | <div class="modal fade" id="errorsBacoModal" role="dialog" > |
175 | <div class="modal-dialog" data-width="960" style="display: block; width: 960px; margin-top: 50px;" aria-hidden="false"> |
175 | <div class="modal-dialog" data-width="960" style="display: block; width: 960px; margin-top: 50px;" aria-hidden="false"> |
176 | 176 | ||
177 | <!-- Modal content--> |
177 | <!-- Modal content--> |
178 | <div class="modal-content"> |
178 | <div class="modal-content"> |
179 | <div class="modal-header"> |
179 | <div class="modal-header"> |
180 | <h1 class="modal-title">Existem Avisos</h1> |
180 | <h1 class="modal-title">Existem Avisos</h1> |
181 | </div> |
181 | </div> |
182 | <div class="modal-body"> |
182 | <div class="modal-body"> |
183 | <div class="panel panel-default"> |
183 | <div class="panel panel-default"> |
184 | <div class="panel-body content-errors" > |
184 | <div class="panel-body content-errors" > |
185 | 185 | ||
186 | </div> |
186 | </div> |
187 | </div> |
187 | </div> |
188 | 188 | ||
189 | <button type="button" class="btn btn-default" data-dismiss="modal">Entendi</button> |
189 | <button type="button" class="btn btn-default" data-dismiss="modal">Entendi</button> |
190 | </div> |
190 | </div> |
191 | </div> |
191 | </div> |
192 | 192 | ||
193 | </div> |
193 | </div> |
194 | </div> |
194 | </div> |
195 | 195 | ||
196 | <div class="modal fade" id="modalWebMessages" role="dialog" > |
196 | <div class="modal fade" id="modalWebMessages" role="dialog" > |
197 | <div class="modal-dialog" data-width="960" style="display: block; width: 960px; margin-top: 50px;" aria-hidden="false"> |
197 | <div class="modal-dialog" data-width="960" style="display: block; width: 960px; margin-top: 50px;" aria-hidden="false"> |
198 | 198 | ||
199 | <!-- Modal content--> |
199 | <!-- Modal content--> |
200 | <div class="modal-content"> |
200 | <div class="modal-content"> |
201 | <div class="modal-header"> |
201 | <div class="modal-header"> |
202 | <h1 class="modal-title"></h1> |
202 | <h1 class="modal-title"></h1> |
203 | </div> |
203 | </div> |
204 | <div class="modal-body"> |
204 | <div class="modal-body"> |
205 | <div class="panel panel-default"> |
205 | <div class="panel panel-default"> |
206 | <div class="panel-body content-web-messages" > |
206 | <div class="panel-body content-web-messages" > |
207 | 207 | ||
208 | </div> |
208 | </div> |
209 | </div> |
209 | </div> |
210 | <div class="content-aditional" > |
210 | <div class="content-aditional" > |
211 | 211 | ||
212 | </div> |
212 | </div> |
213 | <button type="button" class="btn btn-default" data-dismiss="modal">Entendi</button> |
213 | <button type="button" class="btn btn-default" data-dismiss="modal">Entendi</button> |
214 | </div> |
214 | </div> |
215 | </div> |
215 | </div> |
216 | 216 | ||
217 | </div> |
217 | </div> |
218 | </div> |
218 | </div> |
219 | 219 | ||
220 | 220 | ||
221 | <div class="modal fade" id="historyFilesModal" role="dialog" > |
221 | <div class="modal fade" id="historyFilesModal" role="dialog" > |
222 | <div class="modal-dialog" data-width="960" style="display: block; width: 960px; margin-top: 50px;" aria-hidden="false"> |
222 | <div class="modal-dialog" data-width="960" style="display: block; width: 960px; margin-top: 50px;" aria-hidden="false"> |
223 | 223 | ||
224 | <!-- Modal content--> |
224 | <!-- Modal content--> |
225 | <div class="modal-content"> |
225 | <div class="modal-content"> |
226 | <div class="modal-header"> |
226 | <div class="modal-header"> |
227 | <h1 class="modal-title"><bean:message key="data.history.title"/></h1> |
227 | <h1 class="modal-title"><bean:message key="data.history.title"/></h1> |
228 | </div> |
228 | </div> |
229 | <div class="modal-body"> |
229 | <div class="modal-body"> |
230 | <div class="panel panel-default"> |
230 | <div class="panel panel-default"> |
231 | <div class="panel-body" id="contentForm"> |
231 | <div class="panel-body" id="contentForm"> |
232 | <form class="form-horizontal" onsubmit="submitDataVersionForm();return false;"> |
232 | <form class="form-horizontal" onsubmit="submitDataVersionForm();return false;"> |
233 | <div class="form-group"> |
233 | <div class="form-group"> |
234 | <label class="control-label col-sm-4" for="filesVersionsId"><bean:message key="data.history.form.input"/></label> |
234 | <label class="control-label col-sm-4" for="filesVersionsId"><bean:message key="data.history.form.input"/></label> |
235 | <div class="col-sm-6"> |
235 | <div class="col-sm-6"> |
236 | <input type="text" id="filesVersionsId" class="form-control"/> |
236 | <input type="text" id="filesVersionsId" class="form-control"/> |
237 | </div> |
237 | </div> |
238 | </div> |
238 | </div> |
239 | <input type="button" class="btn btn-default" onclick="submitDataVersionForm()" value="<bean:message key="submit"/>"/> |
239 | <input type="button" class="btn btn-default" onclick="submitDataVersionForm()" value="<bean:message key="submit"/>"/> |
240 | <button type="button" class="btn btn-danger" data-dismiss="modal"><bean:message key="cancel"/></button> |
240 | <button type="button" class="btn btn-danger" data-dismiss="modal"><bean:message key="cancel"/></button> |
241 | </form> |
241 | </form> |
242 | </div> |
242 | </div> |
243 | </div> |
243 | </div> |
244 | <div class="panel panel-default"> |
244 | <div class="panel panel-default"> |
245 | <div class="panel-body" id="contentVersions"> |
245 | <div class="panel-body" id="contentVersions"> |
246 | 246 | ||
247 | </div> |
247 | </div> |
248 | </div> |
248 | </div> |
249 | <button type="button" class="btn btn-danger" data-dismiss="modal"><bean:message key="cancel"/></button> |
249 | <button type="button" class="btn btn-danger" data-dismiss="modal"><bean:message key="cancel"/></button> |
250 | </div> |
250 | </div> |
251 | </div> |
251 | </div> |
252 | 252 | ||
253 | </div> |
253 | </div> |
254 | </div> |
254 | </div> |
255 | 255 | ||
256 | 256 | ||
257 | 257 | ||
258 | 258 | ||
259 | <script> |
259 | <script> |
260 | 260 | ||
261 | function alertModal(msg) |
261 | function alertModal(msg) |
262 | { |
262 | { |
263 | $('#alertModal').find('.InfoMessageToUser').html(msg); |
263 | $('#alertModal').find('.InfoMessageToUser').html(msg); |
264 | $('#alertModal').modal({ |
264 | $('#alertModal').modal({ |
265 | show: 'true' |
265 | show: 'true' |
266 | }); |
266 | }); |
267 | } |
267 | } |
268 | function infoModal(msg) |
268 | function infoModal(msg) |
269 | { |
269 | { |
270 | $('.dynamicInfoModal').find('.InfoMessageToUser').html(msg); |
270 | $('.dynamicInfoModal').find('.InfoMessageToUser').html(msg); |
271 | $('.dynamicInfoModal').modal({ |
271 | $('.dynamicInfoModal').modal({ |
272 | show: 'true' |
272 | show: 'true' |
273 | }); |
273 | }); |
274 | } |
274 | } |
275 | 275 | ||
276 | $(document).ready(function(){ |
276 | $(document).ready(function(){ |
277 | $('.confirmModal').on('show.bs.modal', function(e) { |
277 | $('.confirmModal').on('show.bs.modal', function(e) { |
278 | $(this).find('.btn-ok').attr('href', $(e.relatedTarget).data('href')); |
278 | $(this).find('.btn-ok').attr('href', $(e.relatedTarget).data('href')); |
279 | $(this).find('.ConfirmMessageToUser').html($(e.relatedTarget).data('message')); |
279 | $(this).find('.ConfirmMessageToUser').html($(e.relatedTarget).data('message')); |
280 | }); |
280 | }); |
281 | 281 | ||
282 | $('.dynamicInfoModal').on('show.bs.modal', function(e) |
282 | $('.dynamicInfoModal').on('show.bs.modal', function(e) |
283 | { |
283 | { |
284 | if(e.relatedTarget && e.relatedTarget.data('message')) |
284 | if(e.relatedTarget && e.relatedTarget.data('message')) |
285 | { |
285 | { |
286 | $(this).find('.InfoMessageToUser').html($(e.relatedTarget).data('message')); |
286 | $(this).find('.InfoMessageToUser').html($(e.relatedTarget).data('message')); |
287 | } |
287 | } |
288 | }); |
288 | }); |
289 | 289 | ||
290 | $('.alertModal').on('show.bs.modal', function(e) |
290 | $('.alertModal').on('show.bs.modal', function(e) |
291 | { |
291 | { |
292 | if(e.relatedTarget && e.relatedTarget.data('message')) |
292 | if(e.relatedTarget && e.relatedTarget.data('message')) |
293 | { |
293 | { |
294 | $(this).find('.InfoMessageToUser').html($(e.relatedTarget).data('message')); |
294 | $(this).find('.InfoMessageToUser').html($(e.relatedTarget).data('message')); |
295 | } |
295 | } |
296 | }); |
296 | }); |
297 | 297 | ||
298 | $('.maximize-button').click(function(e) |
298 | $('.maximize-button').click(function(e) |
299 | { |
299 | { |
300 | $($(e.currentTarget).data("target")).toggleClass('fullscreen'); |
300 | $($(e.currentTarget).data("target")).toggleClass('fullscreen'); |
301 | }); |
301 | }); |
302 | 302 | ||
303 | 303 | ||
304 | 304 | ||
305 | 305 | ||
306 | $('.confirmModalFunction').on('show.bs.modal', function(e) { |
306 | $('.confirmModalFunction').on('show.bs.modal', function(e) { |
307 | callbackscript = $(e.relatedTarget).data('script'); |
307 | callbackscript = $(e.relatedTarget).data('script'); |
308 | $(this).find('.btn-ok').unbind('click').click( |
308 | $(this).find('.btn-ok').unbind('click').click( |
309 | function(){ |
309 | function(){ |
310 | eval(callbackscript); |
310 | eval(callbackscript); |
311 | } |
311 | } |
312 | ); |
312 | ); |
313 | $(this).find('.ConfirmMessageToUser').html($(e.relatedTarget).data('message')); |
313 | $(this).find('.ConfirmMessageToUser').html($(e.relatedTarget).data('message')); |
314 | }); |
314 | }); |
315 | 315 | ||
316 | $('.confirmModal').on('show.bs.modal', function(e) { |
316 | $('.confirmModal').on('show.bs.modal', function(e) { |
317 | href = $(e.relatedTarget).data('href'); |
317 | href = $(e.relatedTarget).data('href'); |
318 | $(this).find('.btn-ok').unbind('click').click( |
318 | $(this).find('.btn-ok').unbind('click').click( |
319 | function(){ |
319 | function(){ |
320 | window.location=href; |
320 | window.location=href; |
321 | } |
321 | } |
322 | ); |
322 | ); |
323 | $(this).find('.ConfirmMessageToUser').html($(e.relatedTarget).data('message')); |
323 | $(this).find('.ConfirmMessageToUser').html($(e.relatedTarget).data('message')); |
324 | }); |
324 | }); |
325 | 325 | ||
326 | 326 | ||
327 | 327 | ||
328 | 328 | ||
329 | }); |
329 | }); |
330 | </script> |
330 | </script> |
331 | <style> |
331 | <style> |
332 | .fullscreen{ |
332 | .fullscreen{ |
333 | z-index: 9999; |
333 | z-index: 9999; |
334 | width: 100%; |
334 | width: 100%; |
335 | height: 100%; |
335 | height: 100%; |
336 | position: fixed; |
336 | position: fixed; |
337 | top: 0; |
337 | top: 0; |
338 | left: 0; |
338 | left: 0; |
339 | } |
339 | } |
340 | </style> |
340 | </style> |
341 | 341 | ||
342 | <%-- |
342 | <%-- |
343 | PODEMOS CRIAR OUTRAS MODAL DA CLASSE MODAL CONFIRM sempre que quisermos |
343 | PODEMOS CRIAR OUTRAS MODAL DA CLASSE MODAL CONFIRM sempre que quisermos |
344 | A função generica acima permite que qualquer modal da classe .modalConfirm |
344 | A função generica acima permite que qualquer modal da classe .modalConfirm |
345 | seja automaticamente preenchida com os campos ConfirmMessageToUser vindos |
345 | seja automaticamente preenchida com os campos ConfirmMessageToUser vindos |
346 | do attributo data-message e com o btn-ok vindo do data-href |
346 | do attributo data-message e com o btn-ok vindo do data-href |
347 | --%> |
347 | --%> |
348 | <div class="modal fade confirmModal" id="confirm-ModalGeneric" tabindex="-1" role="dialog" > |
348 | <div class="modal fade confirmModal" id="confirm-ModalGeneric" tabindex="-1" role="dialog" > |
349 | <div class="modal-dialog" data-width="450" style="display: block; width: 450px; margin-top: 50px;" aria-hidden="false"> |
349 | <div class="modal-dialog" data-width="450" style="display: block; width: 450px; margin-top: 50px;" aria-hidden="false"> |
350 | <div class="modal-content"> |
350 | <div class="modal-content"> |
351 | <div class="modal-header"> |
351 | <div class="modal-header"> |
352 | <h4 class="modal-title">Tem a certeza que deseja efectuar a seguinte operação?</h4> |
352 | <h4 class="modal-title">Tem a certeza que deseja efectuar a seguinte operação?</h4> |
353 | </div> |
353 | </div> |
354 | <div class="modal-body"> |
354 | <div class="modal-body"> |
355 | 355 | ||
356 | <p class="ConfirmMessageToUser"> |
356 | <p class="ConfirmMessageToUser"> |
357 | 357 | ||
358 | </p> |
358 | </p> |
359 | 359 | ||
360 | </div> |
360 | </div> |
361 | <div class="modal-footer"> |
361 | <div class="modal-footer"> |
362 | <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> |
362 | <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> |
363 | <button class="btn btn-danger btn-ok">Sim</button> |
363 | <button class="btn btn-danger btn-ok">Sim</button> |
364 | </div> |
364 | </div> |
365 | </div> |
365 | </div> |
366 | </div> |
366 | </div> |
367 | </div> |
367 | </div> |
368 | 368 | ||
369 | 369 | ||
370 | <div class="modal fade confirmModalFunction" id="confirm-ModalFunction" tabindex="-1" role="dialog" > |
370 | <div class="modal fade confirmModalFunction" id="confirm-ModalFunction" tabindex="-1" role="dialog" > |
371 | <div class="modal-dialog" data-width="450" style="display: block; width: 450px; margin-top: 50px;" aria-hidden="false"> |
371 | <div class="modal-dialog" data-width="450" style="display: block; width: 450px; margin-top: 50px;" aria-hidden="false"> |
372 | <div class="modal-content"> |
372 | <div class="modal-content"> |
373 | <div class="modal-header"> |
373 | <div class="modal-header"> |
374 | <h4 class="modal-title">Tem a certeza que deseja efectuar a seguinte operação?</h4> |
374 | <h4 class="modal-title">Tem a certeza que deseja efectuar a seguinte operação?</h4> |
375 | </div> |
375 | </div> |
376 | <div class="modal-body"> |
376 | <div class="modal-body"> |
377 | 377 | ||
378 | <p class="ConfirmMessageToUser"> |
378 | <p class="ConfirmMessageToUser"> |
379 | 379 | ||
380 | </p> |
380 | </p> |
381 | 381 | ||
382 | </div> |
382 | </div> |
383 | <div class="modal-footer"> |
383 | <div class="modal-footer"> |
384 | <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> |
384 | <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button> |
385 | <a class="btn btn-danger btn-ok">Sim</a> |
385 | <a class="btn btn-danger btn-ok">Sim</a> |
386 | </div> |
386 | </div> |
387 | </div> |
387 | </div> |
388 | </div> |
388 | </div> |
389 | </div> |
389 | </div> |
390 | 390 | ||
391 | <div class="modal fade dynamicInfoModal" id="dynamicInfo-ModalGeneric" tabindex="-1" role="dialog" > |
391 | <div class="modal fade dynamicInfoModal" id="dynamicInfo-ModalGeneric" tabindex="-1" role="dialog" > |
392 | <div class="modal-dialog" data-width="450" style="display: block; width: 450px; margin-top: 50px;" aria-hidden="false"> |
392 | <div class="modal-dialog" data-width="450" style="display: block; width: 450px; margin-top: 50px;" aria-hidden="false"> |
393 | <div class="modal-content"> |
393 | <div class="modal-content"> |
394 | <div class="modal-header"> |
394 | <div class="modal-header"> |
395 | <h4 class="modal-title">Informação</h4> |
395 | <h4 class="modal-title">Informação</h4> |
396 | </div> |
396 | </div> |
397 | <div class="modal-body"> |
397 | <div class="modal-body"> |
398 | 398 | ||
399 | <p class="InfoMessageToUser"> |
399 | <p class="InfoMessageToUser"> |
400 | 400 | ||
401 | </p> |
401 | </p> |
402 | 402 | ||
403 | </div> |
403 | </div> |
404 | <div class="modal-footer"> |
404 | <div class="modal-footer"> |
405 | <button type="button" class="btn btn-default" data-dismiss="modal">Ok</button> |
405 | <button type="button" class="btn btn-default" data-dismiss="modal">Ok</button> |
406 | </div> |
406 | </div> |
407 | </div> |
407 | </div> |
408 | </div> |
408 | </div> |
409 | </div> |
409 | </div> |
410 | 410 | ||
411 | <div class="modal fade alertModal" id="alertModal" tabindex="-1" role="dialog" > |
411 | <div class="modal fade alertModal" id="alertModal" tabindex="-1" role="dialog" > |
412 | <div class="modal-dialog" data-width="450" style="display: block; width: 450px; margin-top: 50px;" aria-hidden="false"> |
412 | <div class="modal-dialog" data-width="450" style="display: block; width: 450px; margin-top: 50px;" aria-hidden="false"> |
413 | <div class="modal-content"> |
413 | <div class="modal-content"> |
414 | <div class="modal-header"> |
414 | <div class="modal-header"> |
415 | <h4 class="modal-title">Alerta</h4> |
415 | <h4 class="modal-title">Alerta</h4> |
416 | </div> |
416 | </div> |
417 | <div class="modal-body"> |
417 | <div class="modal-body"> |
418 | <div class="alert alert-warning InfoMessageToUser"> |
418 | <div class="alert alert-warning InfoMessageToUser"> |
419 | 419 | ||
420 | </div> |
420 | </div> |
421 | </div> |
421 | </div> |
422 | <div class="modal-footer"> |
422 | <div class="modal-footer"> |
423 | <button type="button" class="btn btn-default" data-dismiss="modal">Ok</button> |
423 | <button type="button" class="btn btn-default" data-dismiss="modal">Ok</button> |
424 | </div> |
424 | </div> |
425 | </div> |
425 | </div> |
426 | </div> |
426 | </div> |
427 | </div> |
427 | </div> |
428 | 428 | ||
429 | 429 | ||
430 | <script> |
430 | <script> |
431 | $(document).ready(function(){ |
431 | $(document).ready(function(){ |
432 | $('#modalAjaxRequest').on('show.bs.modal', function(e) |
432 | $('#modalAjaxRequest').on('show.bs.modal', function(e) |
433 | { |
433 | { |
434 | reloadAjaxRequestModal($(e.relatedTarget)); |
434 | reloadAjaxRequestModal($(e.relatedTarget)); |
435 | }); |
435 | }); |
436 | }); |
436 | }); |
437 | function reloadAjaxRequestModal(target) |
437 | function reloadAjaxRequestModal(target) |
438 | { |
438 | { |
439 | $("#modalAjaxRequest .modal-title .title-wrap").html($(target).data('title')); |
439 | $("#modalAjaxRequest .modal-title .title-wrap").html($(target).data('title')); |
440 | $("#modalAjaxRequest .contentAjaxRequest").html('Por favor aguarde ... <img src="<%=request.getContextPath()%>/imgs/wait.gif"/>'); |
440 | $("#modalAjaxRequest .contentAjaxRequest").html('Por favor aguarde ... <img src="<%=request.getContextPath()%>/imgs/wait.gif"/>'); |
441 | var ajaxCallbackParameters = { |
441 | var ajaxCallbackParameters = { |
442 | 'callback-target-url': $(target).data('callbackTargetUrl'), |
442 | 'callback-target-url': $(target).data('callbackTargetUrl'), |
443 | 'callback-target-function': $(target).data('callbackTargetFunction'), |
443 | 'callback-target-function': $(target).data('callbackTargetFunction'), |
444 | 'callback-target-function-token-parameter': $(target).data('callbackTargetFunctionTokenParameter') |
444 | 'callback-target-function-token-parameter': $(target).data('callbackTargetFunctionTokenParameter') |
445 | }; |
445 | }; |
446 | $.post($(target).data('href'), |
446 | $.post($(target).data('href'), |
447 | ajaxCallbackParameters |
447 | ajaxCallbackParameters |
448 | , function(data) { |
448 | , function(data) { |
449 | $("#modalAjaxRequest .contentAjaxRequest").html(data); |
449 | $("#modalAjaxRequest .contentAjaxRequest").html(data); |
450 | evaluateTableSortersInside("#modalAjaxRequest"); |
450 | evaluateTableSortersInside("#modalAjaxRequest"); |
451 | invokeChosenSelects(); |
451 | invokeChosenSelects(); |
452 | 452 | ||
453 | $('#modalAjaxRequest .reloadAjaxRequestModal').on("click", |
453 | $('#modalAjaxRequest .reloadAjaxRequestModal').on("click", |
454 | function(e){ |
454 | function(e){ |
455 | reloadAjaxRequestModal(e.currentTarget); |
455 | reloadAjaxRequestModal(e.currentTarget); |
456 | } |
456 | } |
457 | ); |
457 | ); |
458 | }); |
458 | }); |
459 | } |
459 | } |
460 | </script> |
460 | </script> |
461 | 461 | ||
462 | <div class="modal fade" id="modalAjaxRequest" role="dialog" > |
462 | <div class="modal fade" id="modalAjaxRequest" role="dialog" > |
463 | <div class="modal-dialog" data-width="960" style="display: block; width: 960px; margin-top: 50px;" aria-hidden="false"> |
463 | <div class="modal-dialog" data-width="960" style="display: block; width: 960px; margin-top: 50px;" aria-hidden="false"> |
464 | 464 | ||
465 | <!-- Modal content--> |
465 | <!-- Modal content--> |
466 | <div class="modal-content"> |
466 | <div class="modal-content"> |
467 | <div class="modal-header clearfix"> |
467 | <div class="modal-header clearfix"> |
468 | <h3 class="modal-title"> |
468 | <h3 class="modal-title"> |
469 | <label class="title-wrap"></label> |
469 | <label class="title-wrap"></label> |
470 | <button type="button" class="btn btn-danger btn-xs pull-right" data-dismiss="modal"><span class="glyphicon glyphicon-remove small"></span></button> |
470 | <button type="button" class="btn btn-danger btn-xs pull-right" data-dismiss="modal"><span class="glyphicon glyphicon-remove small"></span></button> |
471 | </h3> |
471 | </h3> |
472 | </div> |
472 | </div> |
473 | <div class="modal-body"> |
473 | <div class="modal-body"> |
474 | <div class="contentAjaxRequest"> |
474 | <div class="contentAjaxRequest"> |
475 | 475 | ||
476 | </div> |
476 | </div> |
477 | <button type="button" class="btn btn-danger" data-dismiss="modal">Sair</button> |
477 | <button type="button" class="btn btn-danger" data-dismiss="modal">Sair</button> |
478 | </div> |
478 | </div> |
479 | </div> |
479 | </div> |
480 | </div> |
480 | </div> |
481 | </div> |
481 | </div> |
482 | 482 | ||
483 | 483 | ||
484 | <div class="modal fade" id="modalPleaseWait" role="dialog" > |
484 | <div class="modal fade" id="modalPleaseWait" role="dialog" > |
485 | <div class="modal-dialog" data-width="960" style="display: block; width: 960px; margin-top: 50px;" aria-hidden="false"> |
485 | <div class="modal-dialog" data-width="960" style="display: block; width: 960px; margin-top: 50px;" aria-hidden="false"> |
486 | <!-- Modal content--> |
486 | <!-- Modal content--> |
487 | <div class="modal-content"> |
487 | <div class="modal-content"> |
488 | <div class="modal-header clearfix"> |
488 | <div class="modal-header clearfix"> |
489 | <h3 class="modal-title"> |
489 | <h3 class="modal-title"> |
490 | <label class="title-wrap"></label> |
490 | <label class="title-wrap"></label> |
491 | </h3> |
491 | </h3> |
492 | </div> |
492 | </div> |
493 | <div class="modal-body"> |
493 | <div class="modal-body"> |
494 | <div class="panel panel-info"> |
494 | <div class="panel panel-info"> |
495 | <div class="panel-body"> |
495 | <div class="panel-body"> |
496 | <p>Por favor aguarde um momento, o sistema está a carregar <img src="<%=request.getContextPath()%>/imgs/wait.gif"/></p> |
496 | <p>Por favor aguarde um momento, o sistema está a carregar <img src="<%=request.getContextPath()%>/imgs/wait.gif"/></p> |
497 | </div> |
497 | </div> |
498 | </div> |
498 | </div> |
499 | </div> |
499 | </div> |
500 | </div> |
500 | </div> |
501 | </div> |
501 | </div> |
502 | </div> |
502 | </div> |
503 | 503 | ||
504 | 504 | ||
505 | 505 | ||
506 | <jsp:include page="/auth/loginWidget.jsp"/> |
506 | <jsp:include page="/auth/loginWidget.jsp"/> |