1 |
<?php |
2 |
//$Id$ |
3 |
//gen openMairie le 28/03/2012 15:35 |
4 |
require_once ("../obj/om_dbform.class.php"); |
5 |
|
6 |
class pos_gen extends om_dbform { |
7 |
var $table="pos"; |
8 |
var $clePrimaire="pos"; |
9 |
var $typeCle="A"; |
10 |
var $retourformulaire; |
11 |
|
12 |
function setvalF($val) { |
13 |
//affectation valeur formulaire |
14 |
$this->valF['pos'] = $val['pos']; |
15 |
$this->valF['libelle'] = $val['libelle']; |
16 |
$this->valF['geom'] = $val['geom']; |
17 |
} |
18 |
|
19 |
//==================================== |
20 |
// verifier avant validation [verify] |
21 |
//===================================== |
22 |
/** |
23 |
* Methode verifier |
24 |
*/ |
25 |
function verifier($val = array(), &$db = NULL, $DEBUG = false) { |
26 |
// On appelle la methode de la classe parent |
27 |
parent::verifier($val, $db, $DEBUG); |
28 |
// On verifie si le champ n'est pas vide |
29 |
if ($this->valF['libelle'] == "") { |
30 |
$this->correct = false; |
31 |
$this->addToMessage(_("Le champ")." "._("libelle")." "._("est obligatoire")); |
32 |
} |
33 |
} |
34 |
|
35 |
|
36 |
//========================== |
37 |
// Formulaire [form] |
38 |
//========================== |
39 |
|
40 |
function setType(&$form,$maj) { |
41 |
//type |
42 |
if ($maj==0){ //ajout |
43 |
$form->setType('pos','text'); |
44 |
$form->setType('libelle','text'); |
45 |
$form->setType('geom','text'); |
46 |
}// fin ajout |
47 |
if ($maj==1){ //modifier |
48 |
$form->setType('pos','hiddenstatic'); |
49 |
$form->setType('libelle','text'); |
50 |
$form->setType('geom','text'); |
51 |
}// fin modifier |
52 |
if ($maj==2){ //supprimer |
53 |
$form->setType('pos','hiddenstatic'); |
54 |
$form->setType('libelle','hiddenstatic'); |
55 |
$form->setType('geom','hiddenstatic'); |
56 |
}//fin supprimer |
57 |
} |
58 |
|
59 |
function setOnchange(&$form,$maj) { |
60 |
//javascript controle client |
61 |
} |
62 |
/** |
63 |
* Methode setTaille |
64 |
*/ |
65 |
function setTaille(&$form, $maj) { |
66 |
$form->setTaille("pos", 10); |
67 |
$form->setTaille("libelle", 30); |
68 |
$form->setTaille("geom", 10); |
69 |
} |
70 |
|
71 |
/** |
72 |
* Methode setMax |
73 |
*/ |
74 |
function setMax(&$form, $maj) { |
75 |
$form->setMax("pos", 10); |
76 |
$form->setMax("libelle", 40); |
77 |
$form->setMax("geom", -5); |
78 |
} |
79 |
|
80 |
|
81 |
function setLib(&$form,$maj) { |
82 |
//libelle des champs |
83 |
$form->setLib('pos',_('pos')); |
84 |
$form->setLib('libelle',_('libelle')); |
85 |
$form->setLib('geom',_('geom')); |
86 |
} |
87 |
|
88 |
//================================== |
89 |
// sous Formulaire [subform] |
90 |
//================================== |
91 |
|
92 |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire,&$db,$DEBUG=null){ |
93 |
$this->retourformulaire = $retourformulaire; |
94 |
}// fin setValsousformulaire |
95 |
|
96 |
//================================== |
97 |
// cle secondaire [secondary key] |
98 |
//================================== |
99 |
/** |
100 |
* Methode clesecondaire |
101 |
*/ |
102 |
function cleSecondaire($id, &$db = NULL, $val = array(), $DEBUG = false) { |
103 |
// On appelle la methode de la classe parent |
104 |
parent::cleSecondaire($id, $db, $val, $DEBUG); |
105 |
// Verification de la cle secondaire : parcelle |
106 |
$this->rechercheTable($db, "parcelle", "pos", $id); |
107 |
// Verification de la cle secondaire : dossier |
108 |
$this->rechercheTable($db, "dossier", "pos", $id); |
109 |
} |
110 |
|
111 |
|
112 |
}// fin classe |
113 |
?> |