Commit e1822a08efc5a4f9abbd4b17e98e5b5e2cdd9cbb
1 parent
15823b63
Implementação do modal
Showing
1 changed file
with
128 additions
and
2 deletions
Show diff stats
pen_procedimento_expedir.php
@@ -164,7 +164,8 @@ try { | @@ -164,7 +164,8 @@ try { | ||
164 | $respostaExpedir = $objExpedirProcedimentosRN->expedirProcedimento($objExpedirProcedimentoDTO); | 164 | $respostaExpedir = $objExpedirProcedimentosRN->expedirProcedimento($objExpedirProcedimentoDTO); |
165 | 165 | ||
166 | //Adiciona o botão Fechar para a janela | 166 | //Adiciona o botão Fechar para a janela |
167 | - echo '<input type="button" onclick="javascript:window.close()" class="botao_fechar" value="Fechar" style="margin-left: 84%; margin-top: 4%;"/>'; | 167 | + echo '<script>$("#btnFechar", window.parent.document).show(); $(".ui-dialog-buttonpane", window.parent.document).show(); $(".infraBarraProgressoMiolo").css("background-color", "green");</script>'; |
168 | + //Botão para fechar a janela | ||
168 | } catch(\Exception $e) { | 169 | } catch(\Exception $e) { |
169 | $objPaginaSEI->processarExcecao($e); | 170 | $objPaginaSEI->processarExcecao($e); |
170 | } | 171 | } |
@@ -213,6 +214,72 @@ $objPaginaSEI->montarStyle(); | @@ -213,6 +214,72 @@ $objPaginaSEI->montarStyle(); | ||
213 | #lblMotivosUrgencia {position:absolute;left:0%;top:10%;width:50%;} | 214 | #lblMotivosUrgencia {position:absolute;left:0%;top:10%;width:50%;} |
214 | #selMotivosUrgencia {position:absolute;left:0%;top:48%;width:51%;} | 215 | #selMotivosUrgencia {position:absolute;left:0%;top:48%;width:51%;} |
215 | 216 | ||
217 | + | ||
218 | +/* dialog styles */ | ||
219 | +.ui-button-text { | ||
220 | + background-color: #fff; | ||
221 | + border-style: outset; | ||
222 | + border: .1em solid; | ||
223 | + text-align: center; | ||
224 | + font-size: 1em; | ||
225 | + border-color: #666 #666 #666 #666; | ||
226 | + color: black; | ||
227 | +} | ||
228 | + | ||
229 | +.ui-dialog-titlebar { | ||
230 | + background: #0394c8; | ||
231 | + border-color: #cccccc; | ||
232 | + display: block; | ||
233 | +} | ||
234 | + | ||
235 | +.stop-scrolling { | ||
236 | + overflow:hidden; | ||
237 | + height: 100%; | ||
238 | + left: 0; | ||
239 | + -webkit-overflow-scrolling: touch; | ||
240 | + position: fixed; | ||
241 | + top: 0; | ||
242 | + width: 100%; | ||
243 | +} | ||
244 | + | ||
245 | +.ui-dialog .ui-dialog-buttonpane { | ||
246 | + background-color: #e2ebed; | ||
247 | + padding: 1.3em 1em .5em .4em; | ||
248 | + display: block; | ||
249 | +} | ||
250 | + | ||
251 | +#form-dialog { | ||
252 | + background-color: #ffffff; | ||
253 | +} | ||
254 | + | ||
255 | +.ui-dialog .ui-widget .ui-widget-content .ui-corner-all .ui-front .ui-dialog-buttons .ui-draggable { | ||
256 | + border-style: outset; | ||
257 | + border: .1em solid; | ||
258 | + border-color: #666 #666 #666 #666; | ||
259 | + display: block; | ||
260 | +} | ||
261 | + | ||
262 | +.ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-dialog-buttons ui-draggable ui-resizable{ | ||
263 | + border-style: outset; | ||
264 | + border: .1em solid; | ||
265 | + border-color: #666 #666 #666 #666; | ||
266 | +} | ||
267 | + | ||
268 | +.ui-dialog-titlebar-close span{ | ||
269 | + /*background-image: none !important;*/ | ||
270 | + background-color: #fff; | ||
271 | + border-style: none !important; | ||
272 | + border: none !important; | ||
273 | + text-align: center; | ||
274 | +} | ||
275 | + | ||
276 | +/*.ui-widget-header .ui-icon {*/ | ||
277 | +/* background-image: none !important;*/ | ||
278 | +/*}*/ | ||
279 | + | ||
280 | +.ui-dialog-titlebar-close span { | ||
281 | + background-color: transparent !important; | ||
282 | +} | ||
216 | </style> | 283 | </style> |
217 | <?php $objPaginaSEI->montarJavaScript(); ?> | 284 | <?php $objPaginaSEI->montarJavaScript(); ?> |
218 | <script type="text/javascript"> | 285 | <script type="text/javascript"> |
@@ -454,6 +521,65 @@ function abrirJanela(nome,largura,altura){ | @@ -454,6 +521,65 @@ function abrirJanela(nome,largura,altura){ | ||
454 | return janela; | 521 | return janela; |
455 | } | 522 | } |
456 | 523 | ||
524 | +function abrirModal(nome,largura,altura, url){ | ||
525 | + | ||
526 | + var largura = largura || 100; | ||
527 | + var altura = altura || 100; | ||
528 | + | ||
529 | + var div = parent.document.getElementById('divInfraModalFundo'); | ||
530 | + | ||
531 | + if (div==null){ | ||
532 | + div = parent.document.createElement('div'); | ||
533 | + div.id = 'divInfraModalFundo'; | ||
534 | + div.className = 'infraFundoTransparente'; | ||
535 | + | ||
536 | + if (INFRA_IE > 0 && INFRA_IE < 7){ | ||
537 | + ifr = parent.document.createElement('iframe'); | ||
538 | + ifr.className = 'infraFundoIE'; | ||
539 | + div.appendChild(ifr); | ||
540 | + }else{ | ||
541 | + } | ||
542 | + parent.document.body.appendChild(div); | ||
543 | + } | ||
544 | + | ||
545 | + var $dialog = $("<div id='form-dialog'></div>") | ||
546 | + .dialog({ | ||
547 | + autoOpen: false, | ||
548 | + modal: true, | ||
549 | + height: 'auto', | ||
550 | + width: 600, | ||
551 | + resizable: false, | ||
552 | + closeOnEscape: false, | ||
553 | + open: function (ev, ui) { | ||
554 | + $(this).parent().appendTo("form").css("z-index", "9000"); //Move the div first | ||
555 | + $(this).parent().appendTo("body").css("background-color", "white"); | ||
556 | + $(this).append('<iframe id="'+nome+'" allowtransparency="true" frameborder="0" width="100%" height="100%" name="'+nome+'"></iframe>'); | ||
557 | + }, | ||
558 | + close: function (type, data) { | ||
559 | + var strDestino = '<?php print $objSessaoSEI->assinarLink( | ||
560 | + 'controlador.php?acao=procedimento_trabalhar&acao_origem=procedimento_controlar&acao_retorno=procedimento_controlar&id_procedimento='.$idProcedimento); ?>'; | ||
561 | + | ||
562 | + if(strDestino) { | ||
563 | + window.top.location = strDestino; | ||
564 | + } | ||
565 | + }, | ||
566 | + buttons: { | ||
567 | + Fechar : { | ||
568 | + text: 'Fechar', | ||
569 | + id: 'btnFechar', | ||
570 | + click: function () { | ||
571 | + $(this).dialog("close"); | ||
572 | + } | ||
573 | + } | ||
574 | + } | ||
575 | + }); | ||
576 | + | ||
577 | + janela = $dialog.dialog("open"); | ||
578 | + $("#btnFechar").hide(); | ||
579 | + | ||
580 | + return janela; | ||
581 | +} | ||
582 | + | ||
457 | function abrirBarraProgresso(form, action, largura, altura){ | 583 | function abrirBarraProgresso(form, action, largura, altura){ |
458 | 584 | ||
459 | if (typeof(form.onsubmit) == 'function' && !form.onsubmit()){ | 585 | if (typeof(form.onsubmit) == 'function' && !form.onsubmit()){ |
@@ -461,7 +587,7 @@ function abrirBarraProgresso(form, action, largura, altura){ | @@ -461,7 +587,7 @@ function abrirBarraProgresso(form, action, largura, altura){ | ||
461 | } | 587 | } |
462 | 588 | ||
463 | var nomeJanela = 'janelaProgresso' + (new Date()).getTime(); | 589 | var nomeJanela = 'janelaProgresso' + (new Date()).getTime(); |
464 | - objJanelaExpedir = abrirJanela(nomeJanela, largura, altura); | 590 | + objJanelaExpedir = abrirModal(nomeJanela, largura, altura, location.href); |
465 | form.target = nomeJanela; | 591 | form.target = nomeJanela; |
466 | form.action = action; | 592 | form.action = action; |
467 | form.submit(); | 593 | form.submit(); |
-
Modal