10 |
$this->constructeur($id,$db,$debug); |
$this->constructeur($id,$db,$debug); |
11 |
}// fin constructeur |
}// fin constructeur |
12 |
|
|
13 |
// ============================================= |
/* |
14 |
// Ajout du fielset |
* Pays par défaut : France |
15 |
// Add fieldset |
*/ |
16 |
// ============================================= |
function setVal(&$form, $maj, $validation, &$db) { |
17 |
function setLayout(&$form, $maj){ |
if($maj == 0) { |
18 |
if ( $maj < 2 OR $maj == 3 ) { |
$form->setVal("pays",'France'); |
|
|
|
|
//Champs sur lequel s'ouvre le fieldset |
|
|
$form->setBloc('particulier_civilite','D',"", "particulier_fields"); |
|
|
|
|
|
$form->setBloc('particulier_civilite','D',""); |
|
|
$form->setBloc('particulier_civilite','F'); |
|
|
|
|
|
$form->setBloc('particulier_nom','D',"","group search_particulier_fields"); |
|
|
$form->setBloc('particulier_prenom','F'); |
|
|
|
|
|
$form->setBloc('particulier_date_naissance','D',"","group"); |
|
|
$form->setBloc('particulier_commune_naissance','F'); |
|
|
|
|
|
$form->setBloc('particulier_departement_naissance','D',""); |
|
|
$form->setBloc('particulier_departement_naissance','F'); |
|
|
|
|
|
$form->setBloc('particulier_departement_naissance','F'); |
|
|
|
|
|
$form->setBloc('personne_morale_denomination','D',"", "personne_morale_fields"); |
|
|
|
|
|
$form->setBloc('personne_morale_denomination','D',"","group search_personne_morale_fields"); |
|
|
$form->setBloc('personne_morale_raison_sociale','F'); |
|
|
|
|
|
$form->setBloc('personne_morale_siret','D',""); |
|
|
$form->setBloc('personne_morale_siret','F'); |
|
|
|
|
|
$form->setBloc('personne_morale_categorie_juridique','D',""); |
|
|
$form->setBloc('personne_morale_categorie_juridique','F'); |
|
|
|
|
|
$form->setBloc('personne_morale_civilite','D',""); |
|
|
$form->setBloc('personne_morale_civilite','F'); |
|
|
|
|
|
$form->setBloc('personne_morale_nom','D',"", "group"); |
|
|
$form->setBloc('personne_morale_prenom','F'); |
|
|
|
|
|
$form->setBloc('personne_morale_prenom','F'); |
|
|
|
|
|
$form->setBloc('numero','D',""); |
|
|
|
|
|
$form->setBloc('numero','D',"","group"); |
|
|
$form->setBloc('voie','F'); |
|
|
|
|
|
$form->setBloc('complement','D',""); |
|
|
$form->setBloc('complement','F'); |
|
|
|
|
|
$form->setBloc('lieu_dit','D',"","group"); |
|
|
$form->setBloc('localite','F'); |
|
|
|
|
|
$form->setBloc('code_postal','D',"","group"); |
|
|
$form->setBloc('cedex','F'); |
|
|
|
|
|
$form->setBloc('pays','D',"", "","group"); |
|
|
$form->setBloc('division_territoriale','F'); |
|
|
|
|
|
$form->setBloc('telephone_fixe','D',"", "group"); |
|
|
$form->setBloc('indicatif','F'); |
|
|
|
|
|
$form->setBloc('frequent','F'); |
|
19 |
} |
} |
20 |
} |
} |
21 |
|
|
29 |
$form->setType('type_demandeur', 'select'); |
$form->setType('type_demandeur', 'select'); |
30 |
$form->setType('qualite', 'select'); |
$form->setType('qualite', 'select'); |
31 |
} |
} |
32 |
|
$form->setType('demandeur', 'hidden'); |
33 |
} |
} |
34 |
|
|
35 |
/* |
/* |
56 |
/* qualite*/ |
/* qualite*/ |
57 |
$contenu=array(); |
$contenu=array(); |
58 |
|
|
59 |
$contenu[0][0]=""; |
$contenu[0][0]="particulier"; |
60 |
$contenu[1][0]=_('choisir')." "._('qualite'); |
$contenu[1][0]=_('particulier'); |
61 |
$contenu[0][1]="particulier"; |
$contenu[0][1]="personne_morale"; |
62 |
$contenu[1][1]=_('particulier'); |
$contenu[1][1]=_('personne morale'); |
|
$contenu[0][2]="personne_morale"; |
|
|
$contenu[1][2]=_('personne morale'); |
|
63 |
|
|
64 |
$form->setSelect("qualite",$contenu); |
$form->setSelect("qualite",$contenu); |
65 |
} |
} |
73 |
|
|
74 |
$form->setOnchange("qualite","changeDemandeurType('qualite');"); |
$form->setOnchange("qualite","changeDemandeurType('qualite');"); |
75 |
} |
} |
76 |
|
|
77 |
|
/** |
78 |
|
* Ajout d'un champs caché permettant de linker l'id du demandeur |
79 |
|
* recement ajouté |
80 |
|
**/ |
81 |
|
function sousFormSpecificContent($maj) { |
82 |
|
if(isset($this->valF['demandeur']) AND !empty($this->valF['demandeur'])) { |
83 |
|
echo "<input id=\"id_retour\" name=\"idRetour\" type=\"hidden\" value=\"". |
84 |
|
$this->valF['demandeur']."\" />"; |
85 |
|
} |
86 |
|
} |
87 |
|
/** |
88 |
|
* Surcharge du lien de retour permettant de linker l'id du demandeur |
89 |
|
* recement ajouté |
90 |
|
**/ |
91 |
|
function retoursousformulaire($idxformulaire, $retourformulaire, $val, |
92 |
|
$objsf, $premiersf, $tricolsf, $validation, |
93 |
|
$idx, $maj, $retour) { |
94 |
|
if($retourformulaire === "demande") { |
95 |
|
echo "\n<a class=\"retour\" "; |
96 |
|
echo "href=\"#\">"; |
97 |
|
// |
98 |
|
echo _("Retour"); |
99 |
|
// |
100 |
|
echo "</a>\n"; |
101 |
|
} else { |
102 |
|
parent::retoursousformulaire($idxformulaire, $retourformulaire, $val, |
103 |
|
$objsf, $premiersf, $tricolsf, $validation, |
104 |
|
$idx, $maj, $retour); |
105 |
|
} |
106 |
|
} |
107 |
|
|
108 |
|
/** |
109 |
|
* Ajout du paramètre principal |
110 |
|
*/ |
111 |
|
function getDataSubmitSousForm() { |
112 |
|
// |
113 |
|
$datasubmit = ""; |
114 |
|
$datasubmit .= "../scr/sousform.php"; |
115 |
|
$datasubmit .= "?"; |
116 |
|
$datasubmit .= "obj=".get_class($this); |
117 |
|
$datasubmit .= "&validation=".$this->getParameter("validation"); |
118 |
|
if ($this->getParameter("idx") != "]") { |
119 |
|
// |
120 |
|
if ($this->getParameter("maj") == 1) { // modifier |
121 |
|
$datasubmit .= "&action=1"; |
122 |
|
$datasubmit .= "&idx=".$this->getParameter("idx"); |
123 |
|
} else { // supprimer |
124 |
|
$datasubmit .= "&action=2"; |
125 |
|
$datasubmit .= "&idx=".$this->getParameter("idx"); |
126 |
|
} |
127 |
|
} |
128 |
|
$datasubmit .= "&premiersf=".$this->getParameter("premiersf"); |
129 |
|
$datasubmit .= "&retourformulaire=".$this->getParameter("retourformulaire"); |
130 |
|
$datasubmit .= "&trisf=".$this->getParameter("tricolsf"); |
131 |
|
$datasubmit .= "&idxformulaire=".$this->getParameter("idxformulaire"); |
132 |
|
$datasubmit .= "&principal=".$this->getParameter("principal"); |
133 |
|
// |
134 |
|
return $datasubmit; |
135 |
|
} |
136 |
|
|
137 |
|
/** |
138 |
|
* Synthèse des demandeurs pour le formulaire de la demande |
139 |
|
*/ |
140 |
|
function afficherSynthese($type, $linkable) { |
141 |
|
|
142 |
|
// Conteneur du demandeur |
143 |
|
echo "<div class=\"".$type."\" id=\"".$type."_".$this->val[array_search('demandeur', $this->champs)]."\">\n"; |
144 |
|
if($linkable) { |
145 |
|
echo "<a href=\"#\" onclick=\"removeDemandeur('". |
146 |
|
$type."_".$this->val[array_search('demandeur', $this->champs)]. |
147 |
|
"'); return false;\"> |
148 |
|
<span class=\"demandeur_del om-icon om-icon-16 om-icon-fix delete-16\" title=\"". |
149 |
|
_("Supprimer le demandeur")."\">"._("Supprimer le demandeur")."</span> |
150 |
|
</a>"; |
151 |
|
} |
152 |
|
// Valeur de formulaire à retourner |
153 |
|
echo "<input type=\"hidden\" name=\"".$type. |
154 |
|
(($type == "petitionnaire")? "[]":"" ). |
155 |
|
"\" value=\"".$this->val[array_search('demandeur', $this->champs)]."\" />\n"; |
156 |
|
// Lien de modification du demandeur |
157 |
|
if($linkable) { |
158 |
|
echo "<a class=\"edit_demandeur\" href=\"#\" |
159 |
|
onclick=\"editDemandeur('".$this->val[array_search('demandeur', $this->champs)]."','". |
160 |
|
$this->val[array_search('type_demandeur', $this->champs)]."',". |
161 |
|
$type."_".$this->val[array_search('demandeur', $this->champs)]. |
162 |
|
");return false;\">\n"; |
163 |
|
} |
164 |
|
// Affichage des infos du demandeur |
165 |
|
if($this->val[array_search('qualite', $this->champs)] == 'particulier') { |
166 |
|
if(!empty($this->val[array_search('civilite', $this->champs)])) { |
167 |
|
$sql = "SELECT libelle FROM ".DB_PREFIXE."civilite WHERE civilite=". |
168 |
|
$this->val[array_search('civilite', $this->champs)]; |
169 |
|
$civilite = $this->f->db->getone($sql); |
170 |
|
$this->f->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
171 |
|
$this->f->isDatabaseError($civilite); |
172 |
|
echo $civilite." "; |
173 |
|
} |
174 |
|
echo $this->val[array_search('particulier_nom', $this->champs)]." ". |
175 |
|
$this->val[array_search('particulier_prenom', $this->champs)]."<br/>\n"; |
176 |
|
} else { |
177 |
|
echo $this->val[array_search('personne_morale_raison_sociale', $this->champs)]." ". |
178 |
|
$this->val[array_search('personne_morale_denomination', $this->champs)]."<br/>\n"; |
179 |
|
if(!empty($this->val[array_search('personne_morale_civilite', $this->champs)])) { |
180 |
|
$sql = "SELECT libelle FROM ".DB_PREFIXE."civilite WHERE civilite=". |
181 |
|
$this->val[array_search('personne_morale_civilite', $this->champs)]; |
182 |
|
$civilite = $this->f->db->getone($sql); |
183 |
|
$this->f->addToLog("db->getone(\"".$sql."\");", VERBOSE_MODE); |
184 |
|
$this->f->isDatabaseError($civilite); |
185 |
|
echo $civilite." "; |
186 |
|
} |
187 |
|
echo $this->val[array_search('personne_morale_nom', $this->champs)]." ". |
188 |
|
$this->val[array_search('personne_morale_nom', $this->champs)]."<br/>\n"; |
189 |
|
} |
190 |
|
echo (($this->val[array_search('numero', $this->champs)] != "")? |
191 |
|
$this->val[array_search('numero', $this->champs)]." " : ""). |
192 |
|
(($this->val[array_search('voie', $this->champs)] != "")? |
193 |
|
$this->val[array_search('voie', $this->champs)]." " : ""). |
194 |
|
(($this->val[array_search('complement', $this->champs)] != "")? |
195 |
|
$this->val[array_search('complement', $this->champs)]." " : "")."<br/>\n". |
196 |
|
(($this->val[array_search('code_postal', $this->champs)] != "")? |
197 |
|
$this->val[array_search('code_postal', $this->champs)]." " : ""). |
198 |
|
(($this->val[array_search('localite', $this->champs)] != "")? |
199 |
|
$this->val[array_search('localite', $this->champs)]." " : ""). |
200 |
|
(($this->val[array_search('bp', $this->champs)] != "")? |
201 |
|
$this->val[array_search('bp', $this->champs)]." " : ""). |
202 |
|
(($this->val[array_search('cedex', $this->champs)] != "")? |
203 |
|
$this->val[array_search('cedex', $this->champs)]." " : "")."<br/>\n". |
204 |
|
(($this->val[array_search('telephone_fixe', $this->champs)] != "")? |
205 |
|
$this->val[array_search('telephone_fixe', $this->champs)]." " : ""). |
206 |
|
(($this->val[array_search('telephone_mobile', $this->champs)] != "")? |
207 |
|
$this->val[array_search('telephone_mobile', $this->champs)]." " : ""); |
208 |
|
if($linkable) { |
209 |
|
echo "</a>\n"; |
210 |
|
} |
211 |
|
echo "</div>\n"; |
212 |
|
} |
213 |
|
|
214 |
}// fin classe |
}// fin classe |
215 |
?> |
?> |