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 |
|
|
* Surcharge du lien de retour permettant de linker l'id du demandeur |
150 |
|
|
* recement ajouté |
151 |
|
|
**/ |
152 |
|
|
function retoursousformulaire($idxformulaire, $retourformulaire, $val, |
153 |
|
|
$objsf, $premiersf, $tricolsf, $validation, |
154 |
|
|
$idx, $maj, $retour) { |
155 |
|
|
|
156 |
|
|
if($retourformulaire == "demande") { |
157 |
|
|
echo "\n<a class=\"retour\" "; |
158 |
|
|
echo "href=\""; |
159 |
|
|
echo "#"; |
160 |
|
|
echo "\" "; |
161 |
|
|
echo "onclick=\"insertDemandeurId('".$this->valF['demandeur']; |
162 |
|
|
// |
163 |
|
|
|
164 |
|
|
// |
165 |
|
|
echo "');"; |
166 |
|
|
echo "\""; |
167 |
|
|
echo ">"; |
168 |
|
|
// |
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 |
vpihour |
633 |
}// fin classe |
179 |
|
|
?> |