1 |
<?php |
2 |
//$Id$ |
3 |
//gen openMairie le 11/04/2013 15:49 |
4 |
|
5 |
require_once ("../obj/om_dbform.class.php"); |
6 |
|
7 |
class avis_decision_gen extends om_dbform { |
8 |
var $table="avis_decision"; |
9 |
var $clePrimaire="avis_decision"; |
10 |
var $typeCle="N"; |
11 |
var $required_field=array( |
12 |
"avis_decision", |
13 |
"libelle" |
14 |
); |
15 |
var $retourformulaire; |
16 |
|
17 |
function setvalF($val) { |
18 |
//affectation valeur formulaire |
19 |
$this->valF['libelle'] = $val['libelle']; |
20 |
if ($val['typeavis'] == "") { |
21 |
$this->valF['typeavis'] = ""; // -> default |
22 |
} else { |
23 |
$this->valF['typeavis'] = $val['typeavis']; |
24 |
} |
25 |
if ($val['sitadel'] == "") { |
26 |
$this->valF['sitadel'] = ""; // -> default |
27 |
} else { |
28 |
$this->valF['sitadel'] = $val['sitadel']; |
29 |
} |
30 |
if ($val['sitadel_motif'] == "") { |
31 |
$this->valF['sitadel_motif'] = ""; // -> default |
32 |
} else { |
33 |
$this->valF['sitadel_motif'] = $val['sitadel_motif']; |
34 |
} |
35 |
if (!is_numeric($val['avis_decision'])) { |
36 |
$this->valF['avis_decision'] = ""; // -> requis |
37 |
} else { |
38 |
$this->valF['avis_decision'] = $val['avis_decision']; |
39 |
} |
40 |
} |
41 |
|
42 |
//================================================= |
43 |
//cle primaire automatique [automatic primary key] |
44 |
//================================================== |
45 |
|
46 |
function setId(&$db) { |
47 |
//numero automatique |
48 |
$this->valF[$this->clePrimaire] = $db->nextId(DB_PREFIXE.$this->table); |
49 |
} |
50 |
|
51 |
function setValFAjout($val) { |
52 |
//numero automatique -> pas de controle ajout cle primaire |
53 |
} |
54 |
|
55 |
function verifierAjout() { |
56 |
//numero automatique -> pas de verfication de cle primaire |
57 |
} |
58 |
|
59 |
//========================== |
60 |
// Formulaire [form] |
61 |
//========================== |
62 |
|
63 |
function setType(&$form,$maj) { |
64 |
//type |
65 |
if ($maj==0){ //ajout |
66 |
$form->setType('avis_decision','hidden');// cle automatique |
67 |
$form->setType('libelle','text'); |
68 |
$form->setType('typeavis','text'); |
69 |
$form->setType('sitadel','text'); |
70 |
$form->setType('sitadel_motif','text'); |
71 |
}// fin ajout |
72 |
if ($maj==1){ //modifier |
73 |
$form->setType('avis_decision','hiddenstatic'); |
74 |
$form->setType('libelle','text'); |
75 |
$form->setType('typeavis','text'); |
76 |
$form->setType('sitadel','text'); |
77 |
$form->setType('sitadel_motif','text'); |
78 |
}// fin modifier |
79 |
if ($maj==2){ //supprimer |
80 |
$form->setType('libelle','hiddenstatic'); |
81 |
$form->setType('typeavis','hiddenstatic'); |
82 |
$form->setType('sitadel','hiddenstatic'); |
83 |
$form->setType('sitadel_motif','hiddenstatic'); |
84 |
$form->setType('avis_decision','hiddenstatic'); |
85 |
}//fin supprimer |
86 |
if ($maj==3){ //consulter |
87 |
$form->setType('avis_decision','static'); |
88 |
$form->setType('libelle','static'); |
89 |
$form->setType('typeavis','static'); |
90 |
$form->setType('sitadel','static'); |
91 |
$form->setType('sitadel_motif','static'); |
92 |
}//fin consulter |
93 |
} |
94 |
|
95 |
function setOnchange(&$form,$maj) { |
96 |
//javascript controle client |
97 |
$form->setOnchange('avis_decision','VerifNum(this)'); |
98 |
} |
99 |
/** |
100 |
* Methode setTaille |
101 |
*/ |
102 |
function setTaille(&$form, $maj) { |
103 |
$form->setTaille("libelle", 30); |
104 |
$form->setTaille("typeavis", 10); |
105 |
$form->setTaille("sitadel", 10); |
106 |
$form->setTaille("sitadel_motif", 10); |
107 |
$form->setTaille("avis_decision", 11); |
108 |
} |
109 |
|
110 |
/** |
111 |
* Methode setMax |
112 |
*/ |
113 |
function setMax(&$form, $maj) { |
114 |
$form->setMax("libelle", 30); |
115 |
$form->setMax("typeavis", 1); |
116 |
$form->setMax("sitadel", 1); |
117 |
$form->setMax("sitadel_motif", 1); |
118 |
$form->setMax("avis_decision", 11); |
119 |
} |
120 |
|
121 |
|
122 |
function setLib(&$form,$maj) { |
123 |
//libelle des champs |
124 |
$form->setLib('libelle',_('libelle')); |
125 |
$form->setLib('typeavis',_('typeavis')); |
126 |
$form->setLib('sitadel',_('sitadel')); |
127 |
$form->setLib('sitadel_motif',_('sitadel_motif')); |
128 |
$form->setLib('avis_decision',_('avis_decision')); |
129 |
} |
130 |
|
131 |
function setSelect(&$form, $maj,&$db,$debug) { |
132 |
if(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc.php")) |
133 |
include ("../sql/".$db->phptype."/".$this->table.".form.inc.php"); |
134 |
elseif(file_exists ("../sql/".$db->phptype."/".$this->table.".form.inc")) |
135 |
include ("../sql/".$db->phptype."/".$this->table.".form.inc"); |
136 |
}// fin select |
137 |
|
138 |
//================================== |
139 |
// sous Formulaire [subform] |
140 |
//================================== |
141 |
|
142 |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,&$db,$DEBUG=null){ |
143 |
$this->retourformulaire = $retourformulaire; |
144 |
}// fin setValsousformulaire |
145 |
|
146 |
//================================== |
147 |
// cle secondaire [secondary key] |
148 |
//================================== |
149 |
/** |
150 |
* Methode clesecondaire |
151 |
*/ |
152 |
function cleSecondaire($id, &$db = NULL, $val = array(), $DEBUG = false) { |
153 |
// On appelle la methode de la classe parent |
154 |
parent::cleSecondaire($id, $db, $val, $DEBUG); |
155 |
// Verification de la cle secondaire : dossier |
156 |
$this->rechercheTable($db, "dossier", "avis_decision", $id); |
157 |
// Verification de la cle secondaire : dossier_autorisation |
158 |
$this->rechercheTable($db, "dossier_autorisation", "avis_decision", $id); |
159 |
// Verification de la cle secondaire : evenement |
160 |
$this->rechercheTable($db, "evenement", "avis_decision", $id); |
161 |
// Verification de la cle secondaire : instruction |
162 |
$this->rechercheTable($db, "instruction", "avis_decision", $id); |
163 |
} |
164 |
|
165 |
|
166 |
}// fin classe |
167 |
?> |