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