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 |
|
} |
45 |
|
|
46 |
|
} |
47 |
|
|
48 |
function setType(&$form,$maj) { |
function setType(&$form,$maj) { |
49 |
parent::setType($form,$maj); |
parent::setType($form,$maj); |
50 |
if ($maj < 2) { //ajouter et modifier [add and modify] |
if ($maj < 2) { //ajouter et modifier [add and modify] |
54 |
$form->setType('date_limite', 'hidden'); |
$form->setType('date_limite', 'hidden'); |
55 |
$form->setType('date_retour', 'hidden'); |
$form->setType('date_retour', 'hidden'); |
56 |
$form->setType('avis_consultation', 'hidden'); |
$form->setType('avis_consultation', 'hidden'); |
57 |
$form->setType('motivation', 'hidden'); |
$form->setType('motivation', 'hidden'); |
58 |
$form->setType('fichier', 'hidden'); |
$form->setType('fichier', 'hidden'); |
59 |
$form->setType('lu', 'hidden'); |
$form->setType('lu', 'hidden'); |
60 |
$form->setType('date_reception', 'hidden'); |
$form->setType('date_reception', 'hidden'); |
61 |
}else{ // modify |
}else{ // modify |
62 |
$form->setType('date_envoi', 'hiddenstaticdate'); |
if($this->f->isAccredited('consultation_retour_avis_service')) { |
63 |
$form->setType('date_limite', 'hiddenstaticdate'); |
$form->setType('dossier', 'hidden'); |
64 |
$form->setType('service', 'selecthiddenstatic'); |
$form->setType('service', 'hidden'); |
65 |
$form->setType('date_retour', 'date2'); |
$form->setType('date_envoi', 'hidden'); |
66 |
$form->setType('avis_consultation', 'select'); |
$form->setType('date_retour', 'hidden'); |
67 |
$form->setType('motivation', 'textarea'); |
$form->setType('date_reception', 'hidden'); |
68 |
$form->setType('fichier', 'upload2'); |
$form->setType('date_limite', 'hidden'); |
69 |
|
$form->setType('lu', 'hidden'); |
70 |
|
$form->setType('fichier', 'upload2'); |
71 |
|
} else { |
72 |
|
$form->setType('dossier', 'hiddenstatic'); |
73 |
|
$form->setType('date_envoi', 'hiddenstaticdate'); |
74 |
|
$form->setType('date_limite', 'hiddenstaticdate'); |
75 |
|
if($this->f->isAccredited('consultation_modifier_date_reception')) { |
76 |
|
$form->setType('date_reception', 'hiddenstaticdate'); |
77 |
|
} else { |
78 |
|
$form->setType('date_reception', 'date2'); |
79 |
|
} |
80 |
|
$form->setType('service', 'selecthiddenstatic'); |
81 |
|
$form->setType('date_retour', 'date2'); |
82 |
|
$form->setType('avis_consultation', 'select'); |
83 |
|
$form->setType('motivation', 'textarea'); |
84 |
|
if(!isset($this->parameters['retourformulaire'])) { |
85 |
|
$form->setType('fichier', 'upload'); |
86 |
|
} else { |
87 |
|
$form->setType('fichier', 'upload2'); |
88 |
|
} |
89 |
|
//Affichage du champ en modification pour le prifil instructeur |
90 |
|
if(!$this->f->isAccredited('consultation_modifier_lu')) { |
91 |
|
$form->setType('lu', 'hidden'); |
92 |
|
} |
93 |
|
} |
94 |
} |
} |
|
$form->setType('dossier', 'hiddenstatic'); |
|
95 |
} |
} |
96 |
$form->setType('consultation', 'hidden'); |
$form->setType('consultation', 'hidden'); |
97 |
|
//setType pour profil service |
98 |
|
|
|
$form->setType('consultation', 'hidden'); |
|
99 |
} |
} |
100 |
|
|
101 |
// TRIGGER AVANT MODIFICATION DE DONNEES |
// TRIGGER AVANT MODIFICATION DE DONNEES |
189 |
return $annee."-".$mois."-".$jour ; |
return $annee."-".$mois."-".$jour ; |
190 |
} |
} |
191 |
|
|
192 |
// ============================================= |
// ============================================= |
193 |
// Ajout du fielset |
// Ajout du fielset |
194 |
// Add fieldset |
// Add fieldset |
195 |
// ============================================= |
// ============================================= |
196 |
function setLayout(&$form, $maj){ |
function setLayout(&$form, $maj){ |
197 |
if ( $maj < 2 OR $maj == 3 ) { |
if ( $maj < 2 OR $maj == 3 ) { |
198 |
//Champs sur lequel s'ouvre le fieldset |
if(!$this->f->isAccredited('consultation_retour_avis_service')) { |
199 |
$form->setBloc('dossier','D',""); |
//Champs sur lequel s'ouvre le fieldset |
200 |
$form->setFieldset('dossier','D',_('Consultation')); |
$form->setBloc('dossier','D',""); |
201 |
|
$form->setFieldset('dossier','D',_('Consultation')); |
202 |
//Champs sur lequel se ferme le fieldset |
|
203 |
$form->setFieldset('date_envoi','F',''); |
//Champs sur lequel se ferme le fieldset |
204 |
$form->setBloc('date_envoi','F'); |
$form->setFieldset('date_envoi','F',''); |
205 |
if ( $maj == 1 OR $maj == 3 ){ |
$form->setBloc('date_envoi','F'); |
206 |
//Champs sur lequel s'ouvre le fieldset |
} |
207 |
$form->setBloc('date_reception','D',""); |
if ( $maj == 1 OR $maj == 3 ){ |
208 |
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
//Champs sur lequel s'ouvre le fieldset |
209 |
|
$form->setBloc('date_reception','D',""); |
210 |
//Champs sur lequel se ferme le fieldset |
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
211 |
$form->setFieldset('lu','F',''); |
|
212 |
$form->setBloc('lu','F'); |
//Champs sur lequel se ferme le fieldset |
213 |
} |
$form->setFieldset('lu','F',''); |
214 |
} |
$form->setBloc('lu','F'); |
215 |
|
} |
216 |
} |
} |
217 |
|
} |
218 |
|
|
219 |
|
/** Surcharge de la methode retour afin de retourner sur la page de saisie de |
220 |
|
* code barre si besoin |
221 |
|
**/ |
222 |
|
function retour($premier = 0, $recherche = "", $tricol = "") { |
223 |
|
$params ="obj=".get_class($this); |
224 |
|
if($this->getParameter("retour")=="form") { |
225 |
|
$params .= "&idx=".$this->getParameter("idx"); |
226 |
|
$params .= "&action=3"; |
227 |
|
} |
228 |
|
$params .= "&premier=".$this->getParameter("premier"); |
229 |
|
$params .= "&tricol=".$this->getParameter("tricol"); |
230 |
|
$params .= "&recherche=".$this->getParameter("recherche"); |
231 |
|
$params .= "&selectioncol=".$this->getParameter("selectioncol"); |
232 |
|
$params .= "&advs_id=".$this->getParameter("advs_id"); |
233 |
|
$params .= "&valide=".$this->getParameter("valide"); |
234 |
|
echo "\n<a class=\"retour\" "; |
235 |
|
echo "href=\""; |
236 |
|
// |
237 |
|
|
238 |
|
if($this->getParameter("retour")=="form" AND !($this->getParameter("validation")>0 AND $this->getParameter("maj")==2 AND $this->correct)) { |
239 |
|
echo "form.php?".$params; |
240 |
|
} elseif($this->getParameter("retour")=="avis_code_barre") { |
241 |
|
echo "../app/avis_code_barre.php"; |
242 |
|
} else { |
243 |
|
echo "tab.php?".$params; |
244 |
|
} |
245 |
|
// |
246 |
|
echo "\""; |
247 |
|
echo ">"; |
248 |
|
// |
249 |
|
echo _("Retour"); |
250 |
|
// |
251 |
|
echo "</a>\n"; |
252 |
|
|
253 |
|
} |
254 |
|
|
255 |
}// fin classe |
}// fin classe |
256 |
?> |
?> |