4 |
require_once ("../gen/obj/consultation.class.php"); |
require_once ("../gen/obj/consultation.class.php"); |
5 |
|
|
6 |
class consultation extends consultation_gen { |
class consultation extends consultation_gen { |
7 |
var $maj; |
var $maj; |
8 |
function consultation($id,&$db,$debug) { |
function consultation($id,&$db,$debug) { |
9 |
$this->constructeur($id,$db,$debug); |
$this->constructeur($id,$db,$debug); |
10 |
}// fin constructeur |
}// fin constructeur |
12 |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){ |
function setValsousformulaire(&$form,$maj,$validation,$idxformulaire,$retourformulaire,$typeformulaire){ |
13 |
if ($validation==0) { |
if ($validation==0) { |
14 |
if ($maj == 0){ |
if ($maj == 0){ |
15 |
$form->setVal("dossier", $idxformulaire); |
$form->setVal("dossier", $idxformulaire); |
16 |
$form->setVal("date_envoi",date('d/m/Y')); |
$form->setVal("date_envoi",date('d/m/Y')); |
17 |
|
} |
18 |
|
if($maj == 1) { |
19 |
|
if($this->f->isAccredited('consultation_retour_avis_suivi') OR |
20 |
|
$this->f->isAccredited('consultation_retour_avis_service')) { |
21 |
|
$form->setVal("date_retour",date('d/m/Y')); |
22 |
|
} |
23 |
} |
} |
24 |
else |
} |
25 |
if ( $maj == 1 ) |
} |
26 |
$form->setVal("date_retour",date('d/m/Y')); |
|
27 |
|
function setVal(&$form, $maj, $validation, &$db) { |
28 |
|
if($maj == 1) { |
29 |
|
$form->setVal("date_retour",date('d/m/Y')); |
30 |
} |
} |
31 |
} |
} |
32 |
|
|
33 |
|
function setvalF($val) { |
34 |
|
parent::setValF($val); |
35 |
|
if($this->maj==0) { |
36 |
|
$this->valF["date_reception"]=$this->valF["date_envoi"]; |
37 |
|
} |
38 |
|
// Si un retour d'avis est modifie on passe "lu" a false |
39 |
|
if($this->maj==1 AND ($this->val[array_search("avis_consultation",$this->champs)] != $val["avis_consultation"] OR |
40 |
|
$this->val[array_search("date_retour",$this->champs)] != $val["date_retour"] OR |
41 |
|
$this->val[array_search("motivation",$this->champs)] != $val["motivation"] OR |
42 |
|
$this->val[array_search("fichier",$this->champs)] != $val["fichier"])) { |
43 |
|
$this->valF["lu"]=FALSE; |
44 |
|
$this->valF["date_retour"]=$this->dateDB(date('d/m/Y')); |
45 |
|
} |
46 |
|
|
47 |
|
} |
48 |
|
|
49 |
function setType(&$form,$maj) { |
function setType(&$form,$maj) { |
50 |
parent::setType($form,$maj); |
parent::setType($form,$maj); |
51 |
if ($maj < 2) { //ajouter et modifier [add and modify] |
if ($maj < 2) { //ajouter et modifier [add and modify] |
55 |
$form->setType('date_limite', 'hidden'); |
$form->setType('date_limite', 'hidden'); |
56 |
$form->setType('date_retour', 'hidden'); |
$form->setType('date_retour', 'hidden'); |
57 |
$form->setType('avis_consultation', 'hidden'); |
$form->setType('avis_consultation', 'hidden'); |
58 |
$form->setType('motivation', 'hidden'); |
$form->setType('motivation', 'hidden'); |
59 |
$form->setType('fichier', 'hidden'); |
$form->setType('fichier', 'hidden'); |
60 |
$form->setType('lu', 'hidden'); |
$form->setType('lu', 'hidden'); |
61 |
$form->setType('date_reception', 'hidden'); |
$form->setType('date_reception', 'hidden'); |
62 |
}else{ // modify |
}else{ // modify |
63 |
$form->setType('date_envoi', 'hiddenstaticdate'); |
if($this->f->isAccredited('consultation_retour_avis_service')) { |
64 |
$form->setType('date_limite', 'hiddenstaticdate'); |
$form->setType('dossier', 'hidden'); |
65 |
$form->setType('service', 'selecthiddenstatic'); |
$form->setType('service', 'hidden'); |
66 |
$form->setType('date_retour', 'date2'); |
$form->setType('date_envoi', 'hidden'); |
67 |
$form->setType('avis_consultation', 'select'); |
$form->setType('date_retour', 'hidden'); |
68 |
$form->setType('motivation', 'textarea'); |
$form->setType('date_reception', 'hidden'); |
69 |
$form->setType('fichier', 'upload'); |
$form->setType('date_limite', 'hidden'); |
70 |
|
$form->setType('lu', 'hidden'); |
71 |
|
$form->setType('fichier', 'upload2'); |
72 |
|
} else { |
73 |
|
$form->setType('dossier', 'hiddenstatic'); |
74 |
|
$form->setType('date_envoi', 'hiddenstaticdate'); |
75 |
|
$form->setType('date_limite', 'hiddenstaticdate'); |
76 |
|
if($this->f->isAccredited('consultation_modifier_date_reception')) { |
77 |
|
$form->setType('date_reception', 'hiddenstaticdate'); |
78 |
|
} else { |
79 |
|
$form->setType('date_reception', 'date2'); |
80 |
|
} |
81 |
|
$form->setType('service', 'selecthiddenstatic'); |
82 |
|
$form->setType('date_retour', 'date2'); |
83 |
|
$form->setType('avis_consultation', 'select'); |
84 |
|
$form->setType('motivation', 'textarea'); |
85 |
|
if(!isset($this->parameters['retourformulaire'])) { |
86 |
|
$form->setType('fichier', 'upload'); |
87 |
|
} else { |
88 |
|
$form->setType('fichier', 'upload2'); |
89 |
|
} |
90 |
|
//Affichage du champ en modification pour le prifil instructeur |
91 |
|
if(!$this->f->isAccredited('consultation_modifier_lu')) { |
92 |
|
$form->setType('lu', 'hidden'); |
93 |
|
} |
94 |
|
} |
95 |
} |
} |
|
$form->setType('dossier', 'hiddenstatic'); |
|
96 |
} |
} |
97 |
$form->setType('consultation', 'hidden'); |
$form->setType('consultation', 'hidden'); |
98 |
|
//setType pour profil service |
99 |
|
|
|
$form->setType('consultation', 'hidden'); |
|
100 |
} |
} |
101 |
|
|
102 |
// TRIGGER AVANT MODIFICATION DE DONNEES |
// TRIGGER AVANT MODIFICATION DE DONNEES |
136 |
$corps=_("Votre service est consulte concernant le dossier no")." ".$dossier['dossier']."<br/>". |
$corps=_("Votre service est consulte concernant le dossier no")." ".$dossier['dossier']."<br/>". |
137 |
_("Il concerne le terrain situe a l'adresse :")." ".utf8_decode($dossier['terrain_adresse']). |
_("Il concerne le terrain situe a l'adresse :")." ".utf8_decode($dossier['terrain_adresse']). |
138 |
" ".utf8_decode($dossier['terrain_adresse_complement'])." ".utf8_decode($dossier['terrain_cp'])." ".$dossier['terrain_ville']."<br/>". |
" ".utf8_decode($dossier['terrain_adresse_complement'])." ".utf8_decode($dossier['terrain_cp'])." ".$dossier['terrain_ville']."<br/>". |
139 |
_("Vous pouvez y acceder et rendre votre avis à l'adresse")." <a href='".$this->f->getParameter('lien_interne_vdm'). |
_("Vous pouvez y acceder et rendre votre avis a l'adresse")." <a href='".$this->f->getParameter('lien_interne_vdm'). |
140 |
"scr/form.php?obj=consultation&action=3&idx=".$this->valF['consultation']."' >". |
"scr/form.php?obj=consultation&action=3&idx=".$this->valF['consultation']."' >". |
141 |
_("Lien interne (services VDM)")."</a> "._("ou")." <a href='".$this->f->getParameter('lien_externe'). |
_("Lien interne (services VDM)")."</a> "._("ou")." <a href='".$this->f->getParameter('lien_externe'). |
142 |
"scr/form.php?obj=consultation&action=3&idx=".$this->valF['consultation']."' >". |
"scr/form.php?obj=consultation&action=3&idx=".$this->valF['consultation']."' >". |
190 |
return $annee."-".$mois."-".$jour ; |
return $annee."-".$mois."-".$jour ; |
191 |
} |
} |
192 |
|
|
193 |
// ============================================= |
// ============================================= |
194 |
// Ajout du fielset |
// Ajout du fielset |
195 |
// Add fieldset |
// Add fieldset |
196 |
// ============================================= |
// ============================================= |
197 |
function setLayout(&$form, $maj){ |
function setLayout(&$form, $maj){ |
198 |
if ( $maj < 2 OR $maj == 3 ) { |
if ( $maj < 2 OR $maj == 3 ) { |
199 |
//Champs sur lequel s'ouvre le fieldset |
if(!$this->f->isAccredited('consultation_retour_avis_service')) { |
200 |
$form->setBloc('dossier','D',""); |
//Champs sur lequel s'ouvre le fieldset |
201 |
$form->setFieldset('dossier','D',_('Consultation')); |
$form->setBloc('dossier','D',""); |
202 |
|
$form->setFieldset('dossier','D',_('Consultation')); |
203 |
//Champs sur lequel se ferme le fieldset |
|
204 |
$form->setFieldset('date_envoi','F',''); |
//Champs sur lequel se ferme le fieldset |
205 |
$form->setBloc('date_envoi','F'); |
$form->setFieldset('date_envoi','F',''); |
206 |
if ( $maj == 1 OR $maj == 3 ){ |
$form->setBloc('date_envoi','F'); |
207 |
//Champs sur lequel s'ouvre le fieldset |
} |
208 |
$form->setBloc('date_reception','D',""); |
if ( $maj == 1 OR $maj == 3 ){ |
209 |
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
//Champs sur lequel s'ouvre le fieldset |
210 |
|
$form->setBloc('date_reception','D',""); |
211 |
//Champs sur lequel se ferme le fieldset |
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
212 |
$form->setFieldset('lu','F',''); |
|
213 |
$form->setBloc('lu','F'); |
//Champs sur lequel se ferme le fieldset |
214 |
} |
$form->setFieldset('lu','F',''); |
215 |
} |
$form->setBloc('lu','F'); |
216 |
|
} |
217 |
} |
} |
218 |
|
} |
219 |
|
|
220 |
|
/** Surcharge de la methode retour afin de retourner sur la page de saisie de |
221 |
|
* code barre si besoin |
222 |
|
**/ |
223 |
|
function retour($premier = 0, $recherche = "", $tricol = "") { |
224 |
|
$params ="obj=".get_class($this); |
225 |
|
if($this->getParameter("retour")=="form") { |
226 |
|
$params .= "&idx=".$this->getParameter("idx"); |
227 |
|
$params .= "&action=3"; |
228 |
|
} |
229 |
|
$params .= "&premier=".$this->getParameter("premier"); |
230 |
|
$params .= "&tricol=".$this->getParameter("tricol"); |
231 |
|
$params .= "&recherche=".$this->getParameter("recherche"); |
232 |
|
$params .= "&selectioncol=".$this->getParameter("selectioncol"); |
233 |
|
$params .= "&advs_id=".$this->getParameter("advs_id"); |
234 |
|
$params .= "&valide=".$this->getParameter("valide"); |
235 |
|
echo "\n<a class=\"retour\" "; |
236 |
|
echo "href=\""; |
237 |
|
// |
238 |
|
|
239 |
|
if($this->getParameter("retour")=="form" AND !($this->getParameter("validation")>0 AND $this->getParameter("maj")==2 AND $this->correct)) { |
240 |
|
echo "form.php?".$params; |
241 |
|
} elseif($this->getParameter("retour")=="avis_code_barre") { |
242 |
|
echo "../app/avis_code_barre.php"; |
243 |
|
} else { |
244 |
|
echo "tab.php?".$params; |
245 |
|
} |
246 |
|
// |
247 |
|
echo "\""; |
248 |
|
echo ">"; |
249 |
|
// |
250 |
|
echo _("Retour"); |
251 |
|
// |
252 |
|
echo "</a>\n"; |
253 |
|
|
254 |
|
} |
255 |
|
|
256 |
}// fin classe |
}// fin classe |
257 |
?> |
?> |