JSPopupAtribuicaoFuncao.js
5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<script type="text/javascript">
/*
**********************************************************************************
* *
* @package URBEM CNM - Soluções em Gestão Pública *
* @copyright (c) 2013 Confederação Nacional de Municípos *
* @author Confederação Nacional de Municípios *
* *
* O URBEM CNM é um software livre; você pode redistribuí-lo e/ou modificá-lo sob *
* os termos da Licença Pública Geral GNU conforme publicada pela Fundação do *
* Software Livre (FSF - Free Software Foundation); na versão 2 da Licença. *
* *
* Este programa é distribuído na expectativa de que seja útil, porém, *
* SEM NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU *
* ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral do GNU *
* para mais detalhes. *
* *
* Você deve ter recebido uma cópia da Licença Pública Geral do GNU "LICENCA.txt" *
* com este programa; se não, escreva para a Free Software Foundation Inc., *
* no endereço 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* *
**********************************************************************************
*/
</script>
<?php
/**
* Arquivo de instância para manutenção de funções
* Data de Criação: 25/07/2005
* @author Analista: Cassiano
* @author Desenvolvedor: Cassiano
$Revision: 3075 $
$Name$
$Author: pablo $
$Date: 2005-11-29 14:45:45 -0200 (Ter, 29 Nov 2005) $
Casos de uso: uc-01.03.95
*/
?>
<script type="text/javascript">
function AdicionaFuncao(stControle){
var mensagem = '';
var funcao = (document.frm.stFuncao) ? document.frm.stFuncao.value : '';
eval(document.frm.stFuncaoEval.value);
if (funcao == 0) {
mensagem += "@Campo Função deve ser preenchido/selecionado!( )";
}
if (mensagem == ''){
document.frm.stFuncaoEval.value = '';
document.frm.stCtrl.value = stControle;
document.frm.action = '<?=$pgOcul;?>?<?=Sessao::getId();?>&stFuncao='+funcao;
document.frm.submit();
} else {
alertaAviso(mensagem,'form','erro','<?=Sessao::getId();?>');
return false;
}
}
function AdicionaValorVariavel(stControle){
var mensagem = '';
var valor = (document.frm.stValor) ? document.frm.stValor.value : '';
var variavel= (document.frm.stVariavel) ? document.frm.stVariavel.value : '';
var stSelecionado = '';
if (variavel == 0 && valor.length == 0) {
mensagem += "@Campo Valor / Variável deve ser preenchido/selecionado!( )";
}else{
if(variavel == 0){
stSelecionado = valor;
}else{
stSelecionado = variavel;
}
}
if (mensagem == ''){
document.frm.stCtrl.value = stControle;
document.frm.action = '<?=$pgOcul;?>?<?=Sessao::getId();?>&stSelecionado='+stSelecionado;
document.frm.submit();
} else {
alertaAviso(mensagem,'form','erro','<?=Sessao::getId();?>');
return false;
}
}
function Adiciona(stSelecionado){
document.frm.stCtrl.value = 'MontaCondicaoBotoes';
document.frm.action = '<?=$pgOcul;?>?<?=Sessao::getId();?>&stSelecionado='+stSelecionado;
document.frm.submit();
}
function LimpaValorVariavel(){
document.frm.stValor.value = '';
document.frm.stVariavel.options[0].selected=true;
}
function PreencheComboFuncao(obCampo){
var boVer = false;
for(var inCount=0; inCount<document.frm.stFuncao.options.length; inCount++){
if(document.frm.stFuncao.options[inCount].value == obCampo.value){
boVer = true;
document.frm.stFuncao.options[inCount].selected=true;
}
}
if(!boVer){
obCampo.value='';
document.frm.stFuncao.options[0].selected=true;
}
//document.frm.stFuncao.options[0].selected=true;
}
function Ok(){
var mensagem = '';
var stFuncao = document.frm.stFuncao.value;
var stValidaParametros = document.frm.stValidaParametros.value;
if ( stFuncao == 0 && stFuncao.length == 0 ){
mensagem = '@Campo Função deve ser informado!( )';
}else{
eval(stValidaParametros);
}
if (mensagem == ''){
document.frm.action = '<?=$pgProc;?>?<?=Sessao::getId();?>';
document.frm.submit();
} else {
alertaAviso(mensagem,'form','erro','<?=Sessao::getId();?>');
return false;
}
}
function buscaDado(stControle){
document.frm.stCtrl.value = stControle;
document.frm.action = '<?=$pgOcul;?>?<?=Sessao::getId();?>';
document.frm.submit();
document.frm.action = '<?=$pgProc;?>?<?=Sessao::getId();?>';
}
</script>