/[openfoncier]/trunk/gen/obj/servitude_ligne.class.php
ViewVC logotype

Contents of /trunk/gen/obj/servitude_ligne.class.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 307 - (show annotations)
Wed Mar 28 13:52:33 2012 UTC (12 years, 10 months ago) by atreal
File size: 4744 byte(s)
genfull avec le nouveau openmairie :
- traductions
- taille des champs d'après la base
- import des nouvelles librairies

1 <?php
2 //$Id$
3 //gen openMairie le 28/03/2012 15:35
4 require_once ("../obj/om_dbform.class.php");
5
6 class servitude_ligne_gen extends om_dbform {
7 var $table="servitude_ligne";
8 var $clePrimaire="servitude_ligne";
9 var $typeCle="N";
10 var $retourformulaire;
11
12 function setvalF($val) {
13 //affectation valeur formulaire
14 $this->valF['servitude_ligne'] = $val['servitude_ligne'];
15 $this->valF['libelle'] = $val['libelle'];
16 $this->valF['observation'] = $val['observation'];
17 $this->valF['perimetre'] = $val['perimetre'];
18 $this->valF['description'] = $val['description'];
19 $this->valF['geom'] = $val['geom'];
20 }
21
22 //=================================================
23 //cle primaire automatique [automatic primary key]
24 //==================================================
25
26 function setId(&$db) {
27 //numero automatique
28 $this->valF[$this->table] = $db->nextId(DB_PREFIXE.$this->table);
29 }
30
31 function setValFAjout($val) {
32 //numero automatique -> pas de controle ajout cle primaire
33 }
34
35 function verifierAjout() {
36 //numero automatique -> pas de verfication de cle primaire
37 }
38
39 //====================================
40 // verifier avant validation [verify]
41 //=====================================
42 /**
43 * Methode verifier
44 */
45 function verifier($val = array(), &$db = NULL, $DEBUG = false) {
46 // On appelle la methode de la classe parent
47 parent::verifier($val, $db, $DEBUG);
48 // On verifie si le champ n'est pas vide
49 if ($this->valF['libelle'] == "") {
50 $this->correct = false;
51 $this->addToMessage(_("Le champ")." "._("libelle")." "._("est obligatoire"));
52 }
53 }
54
55
56 //==========================
57 // Formulaire [form]
58 //==========================
59
60 function setType(&$form,$maj) {
61 //type
62 if ($maj==0){ //ajout
63 $form->setType('servitude_ligne','hidden');// cle automatique
64 $form->setType('libelle','text');
65 $form->setType('observation','text');
66 $form->setType('perimetre','text');
67 $form->setType('description','textarea');
68 $form->setType('geom','text');
69 }// fin ajout
70 if ($maj==1){ //modifier
71 $form->setType('servitude_ligne','hiddenstatic');
72 $form->setType('libelle','text');
73 $form->setType('observation','text');
74 $form->setType('perimetre','text');
75 $form->setType('description','textarea');
76 $form->setType('geom','text');
77 }// fin modifier
78 if ($maj==2){ //supprimer
79 $form->setType('servitude_ligne','hiddenstatic');
80 $form->setType('libelle','hiddenstatic');
81 $form->setType('observation','hiddenstatic');
82 $form->setType('perimetre','hiddenstatic');
83 $form->setType('description','hiddenstatic');
84 $form->setType('geom','hiddenstatic');
85 }//fin supprimer
86 }
87
88 function setOnchange(&$form,$maj) {
89 //javascript controle client
90 $form->setOnchange('servitude_ligne','VerifNum(this)');
91 $form->setOnchange('perimetre','VerifNum(this)');
92 }
93 /**
94 * Methode setTaille
95 */
96 function setTaille(&$form, $maj) {
97 $form->setTaille("servitude_ligne", 4);
98 $form->setTaille("libelle", 20);
99 $form->setTaille("observation", 30);
100 $form->setTaille("perimetre", 4);
101 $form->setTaille("description", 80);
102 $form->setTaille("geom", 10);
103 }
104
105 /**
106 * Methode setMax
107 */
108 function setMax(&$form, $maj) {
109 $form->setMax("servitude_ligne", 4);
110 $form->setMax("libelle", 20);
111 $form->setMax("observation", 80);
112 $form->setMax("perimetre", 4);
113 $form->setMax("description", 6);
114 $form->setMax("geom", -5);
115 }
116
117
118 function setLib(&$form,$maj) {
119 //libelle des champs
120 $form->setLib('servitude_ligne',_('servitude_ligne'));
121 $form->setLib('libelle',_('libelle'));
122 $form->setLib('observation',_('observation'));
123 $form->setLib('perimetre',_('perimetre'));
124 $form->setLib('description',_('description'));
125 $form->setLib('geom',_('geom'));
126 }
127
128 //==================================
129 // sous Formulaire [subform]
130 //==================================
131
132 function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,&$db,$DEBUG=null){
133 $this->retourformulaire = $retourformulaire;
134 }// fin setValsousformulaire
135
136 //==================================
137 // cle secondaire [secondary key]
138 //==================================
139
140 }// fin classe
141 ?>

Properties

Name Value
svn:executable *

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26