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 |
} |
} |
|
else |
|
|
if ( $maj == 1 ) |
|
|
$form->setVal("date_retour",date('d/m/Y')); |
|
18 |
} |
} |
19 |
} |
} |
20 |
|
|
21 |
function setvalF($val) { |
function setvalF($val) { |
22 |
parent::setValF($val); |
parent::setValF($val); |
23 |
// Si un retour d'avis est modifie on passe "lu" a false |
// Si un retour d'avis est modifie on passe "lu" a false |
24 |
if($this->val[array_search("avis_consultation",$this->champs)] != $val["avis_consultation"] OR |
if($this->maj==1 AND ($this->val[array_search("avis_consultation",$this->champs)] != $val["avis_consultation"] OR |
25 |
$this->val[array_search("date_retour",$this->champs)] != $val["date_retour"] OR |
$this->val[array_search("date_retour",$this->champs)] != $val["date_retour"] OR |
26 |
$this->val[array_search("motivation",$this->champs)] != $val["motivation"] OR |
$this->val[array_search("motivation",$this->champs)] != $val["motivation"] OR |
27 |
$this->val[array_search("fichier",$this->champs)] != $val["fichier"]) { |
$this->val[array_search("fichier",$this->champs)] != $val["fichier"])) { |
28 |
$this->valF["lu"]=FALSE; |
$this->valF["lu"]=FALSE; |
29 |
|
$this->valF["date_retour"]=$this->dateDB(date('d/m/Y')); |
30 |
} |
} |
31 |
|
|
32 |
} |
} |
45 |
$form->setType('lu', 'hidden'); |
$form->setType('lu', 'hidden'); |
46 |
$form->setType('date_reception', 'hidden'); |
$form->setType('date_reception', 'hidden'); |
47 |
}else{ // modify |
}else{ // modify |
48 |
$form->setType('date_envoi', 'hiddenstaticdate'); |
if($this->f->isAccredited('consultation_retour_avis_service')) { |
49 |
$form->setType('date_limite', 'hiddenstaticdate'); |
$form->setType('dossier', 'hidden'); |
50 |
$form->setType('service', 'selecthiddenstatic'); |
$form->setType('service', 'hidden'); |
51 |
$form->setType('date_retour', 'date2'); |
$form->setType('date_envoi', 'hidden'); |
52 |
$form->setType('avis_consultation', 'select'); |
$form->setType('date_retour', 'hidden'); |
53 |
$form->setType('motivation', 'textarea'); |
$form->setType('date_reception', 'hidden'); |
54 |
$form->setType('fichier', 'upload2'); |
$form->setType('date_limite', 'hidden'); |
|
if(!$this->f->isAccredited('consultation_modifier_lu')) { |
|
55 |
$form->setType('lu', 'hidden'); |
$form->setType('lu', 'hidden'); |
56 |
|
} else { |
57 |
|
$form->setType('date_envoi', 'hiddenstaticdate'); |
58 |
|
$form->setType('date_limite', 'hiddenstaticdate'); |
59 |
|
$form->setType('service', 'selecthiddenstatic'); |
60 |
|
$form->setType('date_retour', 'date2'); |
61 |
|
$form->setType('avis_consultation', 'select'); |
62 |
|
$form->setType('motivation', 'textarea'); |
63 |
|
$form->setType('fichier', 'upload2'); |
64 |
|
//Affichage du champ en modification pour le prifil instructeur |
65 |
|
if(!$this->f->isAccredited('consultation_modifier_lu')) { |
66 |
|
$form->setType('lu', 'hidden'); |
67 |
|
} |
68 |
} |
} |
69 |
} |
} |
70 |
$form->setType('dossier', 'hiddenstatic'); |
$form->setType('dossier', 'hiddenstatic'); |
71 |
} |
} |
72 |
$form->setType('consultation', 'hidden'); |
$form->setType('consultation', 'hidden'); |
73 |
|
//setType pour profil service |
74 |
|
|
75 |
} |
} |
76 |
|
|
165 |
return $annee."-".$mois."-".$jour ; |
return $annee."-".$mois."-".$jour ; |
166 |
} |
} |
167 |
|
|
168 |
// ============================================= |
// ============================================= |
169 |
// Ajout du fielset |
// Ajout du fielset |
170 |
// Add fieldset |
// Add fieldset |
171 |
// ============================================= |
// ============================================= |
172 |
function setLayout(&$form, $maj){ |
function setLayout(&$form, $maj){ |
173 |
if ( $maj < 2 OR $maj == 3 ) { |
if ( $maj < 2 OR $maj == 3 ) { |
174 |
//Champs sur lequel s'ouvre le fieldset |
if(!$this->f->isAccredited('consultation_retour_avis_service')) { |
175 |
$form->setBloc('dossier','D',""); |
//Champs sur lequel s'ouvre le fieldset |
176 |
$form->setFieldset('dossier','D',_('Consultation')); |
$form->setBloc('dossier','D',""); |
177 |
|
$form->setFieldset('dossier','D',_('Consultation')); |
178 |
//Champs sur lequel se ferme le fieldset |
|
179 |
$form->setFieldset('date_envoi','F',''); |
//Champs sur lequel se ferme le fieldset |
180 |
$form->setBloc('date_envoi','F'); |
$form->setFieldset('date_envoi','F',''); |
181 |
if ( $maj == 1 OR $maj == 3 ){ |
$form->setBloc('date_envoi','F'); |
182 |
//Champs sur lequel s'ouvre le fieldset |
} |
183 |
$form->setBloc('date_reception','D',""); |
if ( $maj == 1 OR $maj == 3 ){ |
184 |
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
//Champs sur lequel s'ouvre le fieldset |
185 |
|
$form->setBloc('date_reception','D',""); |
186 |
//Champs sur lequel se ferme le fieldset |
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
187 |
$form->setFieldset('lu','F',''); |
|
188 |
$form->setBloc('lu','F'); |
//Champs sur lequel se ferme le fieldset |
189 |
} |
$form->setFieldset('lu','F',''); |
190 |
} |
$form->setBloc('lu','F'); |
191 |
|
} |
192 |
} |
} |
193 |
|
} |
194 |
|
|
195 |
}// fin classe |
}// fin classe |
196 |
?> |
?> |