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