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 |
else |
if($maj == 1) { |
19 |
if ( $maj == 1 ) |
$form->setVal("date_retour",date('d/m/Y')); |
20 |
$form->setVal("date_retour",date('d/m/Y')); |
} |
21 |
|
} |
22 |
|
} |
23 |
|
|
24 |
|
function setVal(&$form, $maj, $validation, &$db) { |
25 |
|
if($maj == 1) { |
26 |
|
$form->setVal("date_retour",date('d/m/Y')); |
27 |
} |
} |
28 |
} |
} |
29 |
|
|
30 |
|
function setvalF($val) { |
31 |
|
parent::setValF($val); |
32 |
|
if($this->maj==0) { |
33 |
|
$this->valF["date_reception"]=$this->valF["date_envoi"]; |
34 |
|
} |
35 |
|
// Si un retour d'avis est modifie on passe "lu" a false |
36 |
|
if($this->maj==1 AND ($this->val[array_search("avis_consultation",$this->champs)] != $val["avis_consultation"] OR |
37 |
|
$this->val[array_search("date_retour",$this->champs)] != $val["date_retour"] OR |
38 |
|
$this->val[array_search("motivation",$this->champs)] != $val["motivation"] OR |
39 |
|
$this->val[array_search("fichier",$this->champs)] != $val["fichier"])) { |
40 |
|
$this->valF["lu"]=FALSE; |
41 |
|
$this->valF["date_retour"]=$this->dateDB(date('d/m/Y')); |
42 |
|
} |
43 |
|
|
44 |
|
} |
45 |
|
|
46 |
function setType(&$form,$maj) { |
function setType(&$form,$maj) { |
47 |
parent::setType($form,$maj); |
parent::setType($form,$maj); |
48 |
if ($maj < 2) { //ajouter et modifier [add and modify] |
if ($maj < 2) { //ajouter et modifier [add and modify] |
52 |
$form->setType('date_limite', 'hidden'); |
$form->setType('date_limite', 'hidden'); |
53 |
$form->setType('date_retour', 'hidden'); |
$form->setType('date_retour', 'hidden'); |
54 |
$form->setType('avis_consultation', 'hidden'); |
$form->setType('avis_consultation', 'hidden'); |
55 |
$form->setType('motivation', 'hidden'); |
$form->setType('motivation', 'hidden'); |
56 |
$form->setType('fichier', 'hidden'); |
$form->setType('fichier', 'hidden'); |
57 |
$form->setType('lu', 'hidden'); |
$form->setType('lu', 'hidden'); |
58 |
$form->setType('date_reception', 'hidden'); |
$form->setType('date_reception', 'hidden'); |
59 |
}else{ // modify |
}else{ // modify |
60 |
$form->setType('date_envoi', 'hiddenstaticdate'); |
if($this->f->isAccredited('consultation_retour_avis_service')) { |
61 |
$form->setType('date_limite', 'hiddenstaticdate'); |
$form->setType('dossier', 'hidden'); |
62 |
$form->setType('service', 'selecthiddenstatic'); |
$form->setType('service', 'hidden'); |
63 |
$form->setType('date_retour', 'date2'); |
$form->setType('date_envoi', 'hidden'); |
64 |
$form->setType('avis_consultation', 'select'); |
$form->setType('date_retour', 'hidden'); |
65 |
$form->setType('motivation', 'textarea'); |
$form->setType('date_reception', 'hidden'); |
66 |
$form->setType('fichier', 'upload'); |
$form->setType('date_limite', 'hidden'); |
67 |
|
$form->setType('lu', 'hidden'); |
68 |
|
$form->setType('fichier', 'upload2'); |
69 |
|
} else { |
70 |
|
$form->setType('dossier', 'hiddenstatic'); |
71 |
|
$form->setType('date_envoi', 'hiddenstaticdate'); |
72 |
|
$form->setType('date_limite', 'hiddenstaticdate'); |
73 |
|
$form->setType('date_reception', 'hiddenstaticdate'); |
74 |
|
$form->setType('service', 'selecthiddenstatic'); |
75 |
|
$form->setType('date_retour', 'date2'); |
76 |
|
$form->setType('avis_consultation', 'select'); |
77 |
|
$form->setType('motivation', 'textarea'); |
78 |
|
if(!isset($this->parameters['retourformulaire'])) { |
79 |
|
$form->setType('fichier', 'upload'); |
80 |
|
} else { |
81 |
|
$form->setType('fichier', 'upload2'); |
82 |
|
} |
83 |
|
//Affichage du champ en modification pour le prifil instructeur |
84 |
|
if(!$this->f->isAccredited('consultation_modifier_lu')) { |
85 |
|
$form->setType('lu', 'hidden'); |
86 |
|
} |
87 |
|
} |
88 |
} |
} |
|
$form->setType('dossier', 'hiddenstatic'); |
|
89 |
} |
} |
90 |
$form->setType('consultation', 'hidden'); |
$form->setType('consultation', 'hidden'); |
91 |
|
//setType pour profil service |
92 |
|
|
|
$form->setType('consultation', 'hidden'); |
|
93 |
} |
} |
94 |
|
|
95 |
// TRIGGER AVANT MODIFICATION DE DONNEES |
// TRIGGER AVANT MODIFICATION DE DONNEES |
129 |
$corps=_("Votre service est consulte concernant le dossier no")." ".$dossier['dossier']."<br/>". |
$corps=_("Votre service est consulte concernant le dossier no")." ".$dossier['dossier']."<br/>". |
130 |
_("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']). |
131 |
" ".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/>". |
132 |
_("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'). |
133 |
"scr/form.php?obj=consultation&action=3&idx=".$this->valF['consultation']."' >". |
"scr/form.php?obj=consultation&action=3&idx=".$this->valF['consultation']."' >". |
134 |
_("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'). |
135 |
"scr/form.php?obj=consultation&action=3&idx=".$this->valF['consultation']."' >". |
"scr/form.php?obj=consultation&action=3&idx=".$this->valF['consultation']."' >". |
183 |
return $annee."-".$mois."-".$jour ; |
return $annee."-".$mois."-".$jour ; |
184 |
} |
} |
185 |
|
|
186 |
// ============================================= |
// ============================================= |
187 |
// Ajout du fielset |
// Ajout du fielset |
188 |
// Add fieldset |
// Add fieldset |
189 |
// ============================================= |
// ============================================= |
190 |
function setLayout(&$form, $maj){ |
function setLayout(&$form, $maj){ |
191 |
if ( $maj < 2 OR $maj == 3 ) { |
if ( $maj < 2 OR $maj == 3 ) { |
192 |
//Champs sur lequel s'ouvre le fieldset |
if(!$this->f->isAccredited('consultation_retour_avis_service')) { |
193 |
$form->setBloc('dossier','D',""); |
//Champs sur lequel s'ouvre le fieldset |
194 |
$form->setFieldset('dossier','D',_('Consultation')); |
$form->setBloc('dossier','D',""); |
195 |
|
$form->setFieldset('dossier','D',_('Consultation')); |
196 |
//Champs sur lequel se ferme le fieldset |
|
197 |
$form->setFieldset('date_envoi','F',''); |
//Champs sur lequel se ferme le fieldset |
198 |
$form->setBloc('date_envoi','F'); |
$form->setFieldset('date_envoi','F',''); |
199 |
if ( $maj == 1 OR $maj == 3 ){ |
$form->setBloc('date_envoi','F'); |
200 |
//Champs sur lequel s'ouvre le fieldset |
} |
201 |
$form->setBloc('date_reception','D',""); |
if ( $maj == 1 OR $maj == 3 ){ |
202 |
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
//Champs sur lequel s'ouvre le fieldset |
203 |
|
$form->setBloc('date_reception','D',""); |
204 |
//Champs sur lequel se ferme le fieldset |
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
205 |
$form->setFieldset('lu','F',''); |
|
206 |
$form->setBloc('lu','F'); |
//Champs sur lequel se ferme le fieldset |
207 |
} |
$form->setFieldset('lu','F',''); |
208 |
} |
$form->setBloc('lu','F'); |
209 |
|
} |
210 |
} |
} |
211 |
|
} |
212 |
|
|
213 |
}// fin classe |
}// fin classe |
214 |
?> |
?> |