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

Annotation of /trunk/obj/om_sig_map.class.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 339 - (hide annotations)
Wed Jun 27 11:04:48 2012 UTC (12 years, 7 months ago) by fraynaud
File size: 8239 byte(s)
om_sig_map


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

Properties

Name Value
svn:executable *

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26