/[openfoncier]/trunk/obj/om_sig_point.class.php
ViewVC logotype

Contents of /trunk/obj/om_sig_point.class.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 326 - (show annotations)
Tue May 22 17:39:34 2012 UTC (12 years, 8 months ago) by fraynaud
File size: 8365 byte(s)
mise au point de wms + correction bug DB_PREFIXE


1 <?php
2 //$Id: om_sig_point.class.php 1232 2012-05-15 16:09:34Z fraynaud $
3 //gen openMairie le 06/04/2011 08:33
4 require_once ("../gen/obj/om_sig_point.class.php");
5
6 class om_sig_point extends om_sig_point_gen {
7
8 var $maj; // pour verification actif
9
10 function om_sig_point($id,&$db,$debug) {
11 $this->constructeur($id,$db,$debug);
12 }// fin constructeur
13
14 function setType(&$form,$maj) {
15 parent::setType($form,$maj);
16 if($maj<2){
17 $form->setType('etendue','select');
18 $form->setType('projection_externe','select');
19 $form->setType('layer_info', 'checkbox');
20 $form->setType('fond_osm','checkbox');
21 $form->setType('fond_bing','checkbox');
22 $form->setType('fond_sat','checkbox');
23 $form->setType('maj','checkbox');
24 // AB-DEB 2012-05-14 - gestion champs géométrie
25 $form->setType('type_geometrie','select');
26 // AB-FIN 2012-05-14 - gestion champs géométrie
27 $form->setType('actif', 'checkbox');
28 }
29 }
30
31 /**
32 * Methode verifier
33 */
34 function verifier($val = array(), &$db = NULL, $DEBUG = false) {
35 // On appelle la methode de la classe parent
36 parent::verifier($val, $db, $DEBUG);
37 // On verifie si le champ n'est pas vide
38 if ($this->valF['id'] == "") {
39 $this->correct = false;
40 $this->addToMessage(_("Le champ")." "._("id")." "._("est obligatoire"));
41 } else {
42 // On verifie si il y a un autre id 'actif' pour la collectivite
43 if ($this->valF['actif'] == "Oui") {
44 if ($this->maj == 0) {
45 //
46 $this->verifieractif($db, $val, $DEBUG, ']');
47 } else {
48 //
49 $this->verifieractif($db, $val, $DEBUG, $val['om_sig_point']);
50 }
51 }
52 }
53 }
54
55 function setTaille(&$form,$maj) {
56 parent::setTaille($form,$maj);
57 //taille des champs affiches (text)
58 $form->setTaille('om_sig_point',4);
59 $form->setTaille('om_collectivite',4);
60 $form->setTaille('id',20);
61 $form->setTaille('libelle',50);
62 $form->setTaille('zoom',3);
63 $form->setTaille('fond_osm',1);
64 $form->setTaille('fond_bing',1);
65 $form->setTaille('fond_sat',1);
66 $form->setTaille('etendue',60);
67 $form->setTaille('projection_externe',20);
68 $form->setTaille('maj',1);
69 // AB-DEB 2012-05-14 - gestion champs géométrie
70 $form->setTaille('lib_geometrie',50);
71 $form->setTaille('type_geometrie',30);
72 // AB-FIN 2012-05-14 - gestion champs géométrie
73 $form->setTaille('table_update',30);
74 $form->setTaille('champ',30);
75 $form->setTaille('retour',50);
76 }
77
78 function setMax(&$form,$maj) {
79 parent::setMax($form,$maj);
80 $form->setMax('om_sig_point',4);
81 $form->setMax('om_collectivite',4);
82 $form->setMax('id',50);
83 $form->setMax('libelle',50);
84 $form->setMax('zoom',3);
85 $form->setMax('fond_osm',1);
86 $form->setMax('fond_bing',1);
87 $form->setMax('fond_sat',1);
88 $form->setMax('etendue',60);
89 $form->setMax('projection_externe',60);
90 $form->setMax('url',2);
91 $form->setMax('maj',1);
92 // AB-DEB 2012-05-14 - gestion champs géométrie
93 $form->setMax('lib_geometrie',50);
94 $form->setMax('table_update',30);
95 // AB-FIN 2012-05-14 - gestion champs géométrie
96 $form->setMax('table_update',30);
97 $form->setMax('champ',30);
98 $form->setMax('retour',50);
99 }
100
101 function setOnchange(&$form,$maj) {
102 parent::setOnchange($form,$maj);
103 $form->setOnchange('zoom','VerifNum(this)');
104 }
105
106 function setSelect(&$form, $maj,&$db,$debug) {
107 parent::setSelect($form, $maj,$db,$debug);
108 if($maj<2){
109 if(file_exists ("../dyn/var_sig.inc"))
110 include ("../dyn/var_sig.inc");
111 $form->setSelect("etendue",$contenu_etendue);
112 $form->setSelect("projection_externe",$contenu_epsg);
113 // AB-DEB 2012-05-14 - gestion champs géométrie
114 $form->setSelect("type_geometrie",$type_geometrie);
115 // AB-FIN 2012-05-14 - gestion champs géométrie
116 }// fin maj
117 }
118
119 function setGroupe (&$form, $maj) {
120
121 $form->setGroupe('id','D');
122 $form->setGroupe('libelle','G');
123 $form->setGroupe('actif','F');
124
125 $form->setGroupe('zoom','D');
126 $form->setGroupe('fond_osm','G');
127 $form->setGroupe('fond_bing','G');
128 $form->setGroupe('fond_sat','G');
129 $form->setGroupe('layer_info','F');
130
131 $form->setGroupe('etendue','D');
132 $form->setGroupe('projection_externe','F');
133
134 $form->setGroupe('maj','D');
135 // AB-DEB 2012-05-14 - gestion champs géométrie
136 $form->setGroupe('lib_geometrie','G');
137 $form->setGroupe('type_geometrie','G');
138 // AB-FIN 2012-05-14 - gestion champs géométrie
139 $form->setGroupe('table_update','G');
140 $form->setGroupe('champ','F');
141 }
142
143 function setRegroupe (&$form, $maj) {
144
145 $form->setRegroupe('zoom','D',' '._('fond').' ', "collapsible");
146 $form->setRegroupe('fond_osm','G','');
147 $form->setRegroupe('fond_bing','G','');
148 $form->setRegroupe('fond_sat','G','');
149 $form->setRegroupe('layer_info','F','');
150
151 $form->setRegroupe('id','D',' '._('titre').' ', "collapsible");
152 $form->setRegroupe('libelle','G','');
153 $form->setRegroupe('actif','F','');
154
155 $form->setRegroupe('etendue','D',' '._('etendue').' ', "collapsible");
156 $form->setRegroupe('projection_externe','F','');
157
158 $form->setRegroupe('maj','D',' '._('Mise a jour').' ', "startClosed");
159 // AB-DEB 2012-05-14 - gestion champs géométrie
160 $form->setRegroupe('lib_geometrie','G','');
161 $form->setRegroupe('type_geometrie','G','');
162 // AB-FIN 2012-05-14 - gestion champs géométrie
163 $form->setRegroupe('table_update','G','');
164 $form->setRegroupe('champ','F','');
165
166 }
167
168 function setLib(&$form,$maj) {
169 parent::setLib($form,$maj);
170 //libelle des champs
171 $form->setLib('fond_osm',_('osm : '));
172 $form->setLib('fond_bing',_('bing : '));
173 $form->setLib('fond_sat',_('sat : '));
174 $form->setLib('etendue',_('etendue'));
175 $form->setLib('projection_externe',_('projection'));
176 $form->setLib('url',_('url'));
177 $form->setLib('om_sql',_('requete sql'));
178 $form->setLib('maj',_('maj'));
179 // AB-DEB 2012-05-14 - gestion champs géométrie
180 $form->setLib('lib_geometrie',_('nom géométrie'));
181 $form->setLib('type_geometrie',_('type de géométrie'));
182 // AB-FIN 2012-05-14 - gestion champs géométrie
183 $form->setLib('table_update',_(' table :'));
184 }
185
186 function setVal(&$form, $maj, $validation, &$db, $DEBUG=null) {
187 parent::setVal($form, $maj, $validation, $db, $DEBUG=null);
188 $this->maj=$maj;
189 }
190
191 function setValsousformulaire(&$form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire, &$db, $DEBUG=null) {
192 parent::setValsousformulaire($form, $maj, $validation, $idxformulaire, $retourformulaire, $typeformulaire, $db, $DEBUG=null);
193 $this->maj=$maj;
194 }
195
196 /**
197 * verification sur existence d un etat deja actif pour la collectivite
198 */
199 function verifieractif(&$db, $val, $DEBUG,$id){
200 $sql = "select om_sig_point from ".DB_PREFIXE."om_sig_point where id ='".$val['id']."'";
201 $sql.= " and om_collectivite ='".$val['om_collectivite']."'";
202 $sql.= " and actif ='Oui'";
203 if($id!=']')
204 $sql.=" and om_sig_point !='".$id."'";
205 $res = $db->query($sql);
206 if($DEBUG==1) echo $sql;
207 if (database::isError($res))
208 die($res->getMessage(). " => Echec ".$sql);
209 else{
210 $nbligne=$res->numrows();
211 if ($nbligne>0){
212 $this->addToMessage($nbligne." "._("sig_point")." "._("existant").
213 " "._("actif")." ! "._("vous ne pouvez avoir qu un sig_point")." '".
214 $val['id']."' "._("actif")." "._("par collectivite"));
215 $this->correct=False;
216 }
217 }
218 }
219
220 }// fin classe
221 ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26