1 |
vpihour |
633 |
<?php |
2 |
|
|
//$Id$ |
3 |
|
|
//gen openMairie le 08/11/2012 14:59 |
4 |
|
|
|
5 |
|
|
require_once ("../gen/obj/demandeur.class.php"); |
6 |
|
|
|
7 |
|
|
class demandeur extends demandeur_gen { |
8 |
|
|
|
9 |
|
|
function demandeur($id,&$db,$debug) { |
10 |
|
|
$this->constructeur($id,$db,$debug); |
11 |
|
|
}// fin constructeur |
12 |
vpihour |
703 |
|
13 |
vpihour |
805 |
/* |
14 |
|
|
* Pays par défaut : France |
15 |
|
|
*/ |
16 |
|
|
function setVal(&$form, $maj, $validation, &$db) { |
17 |
|
|
if($maj == 0) { |
18 |
|
|
$form->setVal("pays",'France'); |
19 |
|
|
} |
20 |
|
|
} |
21 |
|
|
|
22 |
|
|
/* |
23 |
|
|
* Ajout du fielset |
24 |
|
|
* Add fieldset |
25 |
|
|
*/ |
26 |
vpihour |
703 |
function setLayout(&$form, $maj){ |
27 |
|
|
if ( $maj < 2 OR $maj == 3 ) { |
28 |
|
|
|
29 |
vpihour |
805 |
$form->setBloc('particulier_civilite','D',"", "bloc_demandeur"); |
30 |
|
|
$form->setBloc('particulier_civilite','D',"", "particulier_fields"); |
31 |
vpihour |
703 |
|
32 |
vpihour |
805 |
$form->setBloc('particulier_civilite','D',""); |
33 |
|
|
$form->setBloc('particulier_civilite','F'); |
34 |
|
|
|
35 |
|
|
$form->setBloc('particulier_nom','D',"","group search_particulier_fields"); |
36 |
|
|
$form->setBloc('particulier_prenom','F'); |
37 |
|
|
|
38 |
|
|
$form->setBloc('particulier_date_naissance','D',"","group"); |
39 |
|
|
$form->setBloc('particulier_commune_naissance','F'); |
40 |
|
|
|
41 |
|
|
$form->setBloc('particulier_departement_naissance','D',""); |
42 |
|
|
$form->setBloc('particulier_departement_naissance','F'); |
43 |
|
|
|
44 |
vpihour |
703 |
$form->setBloc('particulier_departement_naissance','F'); |
45 |
|
|
|
46 |
vpihour |
805 |
$form->setBloc('personne_morale_denomination','D',"", "personne_morale_fields"); |
47 |
vpihour |
703 |
|
48 |
vpihour |
805 |
$form->setBloc('personne_morale_denomination','D',"","group"); |
49 |
|
|
$form->setBloc('personne_morale_denomination','D',"", "search_personne_morale_fields"); |
50 |
|
|
$form->setBloc('personne_morale_denomination','F'); |
51 |
|
|
$form->setBloc('personne_morale_raison_sociale','F'); |
52 |
|
|
|
53 |
|
|
$form->setBloc('personne_morale_siret','D',""); |
54 |
|
|
$form->setBloc('personne_morale_siret','F'); |
55 |
|
|
|
56 |
|
|
$form->setBloc('personne_morale_categorie_juridique','D',""); |
57 |
|
|
$form->setBloc('personne_morale_categorie_juridique','F'); |
58 |
|
|
|
59 |
|
|
$form->setBloc('personne_morale_civilite','D',""); |
60 |
|
|
$form->setBloc('personne_morale_civilite','F'); |
61 |
|
|
|
62 |
|
|
$form->setBloc('personne_morale_nom','D',"", "group"); |
63 |
|
|
$form->setBloc('personne_morale_nom','D',"", "search_personne_morale_fields"); |
64 |
|
|
$form->setBloc('personne_morale_nom','F'); |
65 |
|
|
$form->setBloc('personne_morale_prenom','F'); |
66 |
|
|
|
67 |
vpihour |
703 |
$form->setBloc('personne_morale_prenom','F'); |
68 |
|
|
|
69 |
vpihour |
805 |
$form->setBloc('numero','D',""); |
70 |
vpihour |
703 |
|
71 |
vpihour |
805 |
$form->setBloc('numero','D',"","group"); |
72 |
|
|
$form->setBloc('voie','F'); |
73 |
|
|
|
74 |
|
|
$form->setBloc('complement','D',""); |
75 |
|
|
$form->setBloc('complement','F'); |
76 |
|
|
|
77 |
|
|
$form->setBloc('lieu_dit','D',"","group"); |
78 |
|
|
$form->setBloc('localite','F'); |
79 |
|
|
|
80 |
|
|
$form->setBloc('code_postal','D',"","group"); |
81 |
|
|
$form->setBloc('cedex','F'); |
82 |
|
|
|
83 |
|
|
$form->setBloc('pays','D',"", "","group"); |
84 |
|
|
$form->setBloc('division_territoriale','F'); |
85 |
|
|
|
86 |
|
|
$form->setBloc('telephone_fixe','D',"", "group"); |
87 |
|
|
$form->setBloc('indicatif','F'); |
88 |
|
|
|
89 |
|
|
$form->setBloc('frequent','F'); |
90 |
vpihour |
703 |
$form->setBloc('frequent','F'); |
91 |
|
|
} |
92 |
|
|
} |
93 |
vpihour |
799 |
|
94 |
|
|
/* |
95 |
|
|
* Select pour les champs qualite et type_demandeur |
96 |
|
|
*/ |
97 |
|
|
function setType(&$form,$maj) { |
98 |
|
|
parent::setType($form,$maj); |
99 |
|
|
if ($maj < 2) { //ajouter et modifier |
100 |
|
|
|
101 |
|
|
$form->setType('type_demandeur', 'select'); |
102 |
|
|
$form->setType('qualite', 'select'); |
103 |
|
|
} |
104 |
|
|
} |
105 |
|
|
|
106 |
|
|
/* |
107 |
|
|
* Select pour le type_demandeur et qualite |
108 |
|
|
*/ |
109 |
|
|
function setSelect(&$form, $maj,&$db,$debug) { |
110 |
|
|
parent::setSelect($form, $maj,$db,$debug); |
111 |
|
|
|
112 |
|
|
/*Lors d'un ajout ou d'une modification*/ |
113 |
|
|
if( $maj < 2 ){ |
114 |
|
|
|
115 |
|
|
/* type_demandeur*/ |
116 |
|
|
$contenu=array(); |
117 |
|
|
|
118 |
|
|
$contenu[0][0]=""; |
119 |
|
|
$contenu[1][0]=_('choisir')." "._('type_demandeur'); |
120 |
|
|
$contenu[0][1]="petitionnaire"; |
121 |
|
|
$contenu[1][1]=_('petitionnaire'); |
122 |
|
|
$contenu[0][2]="delegataire"; |
123 |
|
|
$contenu[1][2]=_('delegataire'); |
124 |
|
|
|
125 |
|
|
$form->setSelect("type_demandeur",$contenu); |
126 |
|
|
|
127 |
|
|
/* qualite*/ |
128 |
|
|
$contenu=array(); |
129 |
|
|
|
130 |
vpihour |
805 |
$contenu[0][0]="particulier"; |
131 |
|
|
$contenu[1][0]=_('particulier'); |
132 |
|
|
$contenu[0][1]="personne_morale"; |
133 |
|
|
$contenu[1][1]=_('personne morale'); |
134 |
vpihour |
799 |
|
135 |
|
|
$form->setSelect("qualite",$contenu); |
136 |
|
|
} |
137 |
|
|
} |
138 |
|
|
|
139 |
|
|
/* |
140 |
|
|
* Ajoute l'action javascript sur |
141 |
|
|
*/ |
142 |
|
|
function setOnchange(&$form,$maj){ |
143 |
|
|
parent::setOnchange($form,$maj); |
144 |
|
|
|
145 |
|
|
$form->setOnchange("qualite","changeDemandeurType('qualite');"); |
146 |
|
|
} |
147 |
nhaye |
802 |
|
148 |
|
|
/** |
149 |
nhaye |
807 |
* Ajout d'un champs caché permettant de linker l'id du demandeur |
150 |
|
|
* recement ajouté |
151 |
|
|
**/ |
152 |
|
|
function sousFormSpecificContent($maj) { |
153 |
|
|
if(isset($this->valF['demandeur']) AND !empty($this->valF['demandeur'])) { |
154 |
|
|
echo "<input id=\"id_retour\" name=\"idRetour\" type=\"hidden\" value=\"". |
155 |
|
|
$this->valF['demandeur']."\" />"; |
156 |
|
|
} |
157 |
|
|
} |
158 |
|
|
/** |
159 |
nhaye |
802 |
* Surcharge du lien de retour permettant de linker l'id du demandeur |
160 |
|
|
* recement ajouté |
161 |
|
|
**/ |
162 |
|
|
function retoursousformulaire($idxformulaire, $retourformulaire, $val, |
163 |
|
|
$objsf, $premiersf, $tricolsf, $validation, |
164 |
|
|
$idx, $maj, $retour) { |
165 |
nhaye |
807 |
if($retourformulaire === "demande") { |
166 |
nhaye |
802 |
echo "\n<a class=\"retour\" "; |
167 |
nhaye |
807 |
echo "href=\"#\">"; |
168 |
nhaye |
802 |
// |
169 |
|
|
echo _("Retour"); |
170 |
|
|
// |
171 |
|
|
echo "</a>\n"; |
172 |
|
|
} else { |
173 |
|
|
parent::retoursousformulaire($idxformulaire, $retourformulaire, $val, |
174 |
|
|
$objsf, $premiersf, $tricolsf, $validation, |
175 |
|
|
$idx, $maj, $retour); |
176 |
|
|
} |
177 |
|
|
} |
178 |
nhaye |
807 |
|
179 |
|
|
/** |
180 |
|
|
* Ajout du paramètre principal |
181 |
|
|
*/ |
182 |
|
|
function getDataSubmitSousForm() { |
183 |
|
|
// |
184 |
|
|
$datasubmit = ""; |
185 |
|
|
$datasubmit .= "../scr/sousform.php"; |
186 |
|
|
$datasubmit .= "?"; |
187 |
|
|
$datasubmit .= "obj=".get_class($this); |
188 |
|
|
$datasubmit .= "&validation=".$this->getParameter("validation"); |
189 |
|
|
if ($this->getParameter("idx") != "]") { |
190 |
|
|
// |
191 |
|
|
if ($this->getParameter("maj") == 1) { // modifier |
192 |
|
|
$datasubmit .= "&action=1"; |
193 |
|
|
$datasubmit .= "&idx=".$this->getParameter("idx"); |
194 |
|
|
} else { // supprimer |
195 |
|
|
$datasubmit .= "&action=2"; |
196 |
|
|
$datasubmit .= "&idx=".$this->getParameter("idx"); |
197 |
|
|
} |
198 |
|
|
} |
199 |
|
|
$datasubmit .= "&premiersf=".$this->getParameter("premiersf"); |
200 |
|
|
$datasubmit .= "&retourformulaire=".$this->getParameter("retourformulaire"); |
201 |
|
|
$datasubmit .= "&trisf=".$this->getParameter("tricolsf"); |
202 |
|
|
$datasubmit .= "&idxformulaire=".$this->getParameter("idxformulaire"); |
203 |
|
|
$datasubmit .= "&principal=".$this->getParameter("principal"); |
204 |
|
|
// |
205 |
|
|
return $datasubmit; |
206 |
|
|
} |
207 |
vpihour |
633 |
}// fin classe |
208 |
|
|
?> |