41 |
$this->val[array_search("avis_consultation",$this->champs)] != $val["avis_consultation"] OR |
$this->val[array_search("avis_consultation",$this->champs)] != $val["avis_consultation"] OR |
42 |
$this->val[array_search("date_retour",$this->champs)] != $val["date_retour"] OR |
$this->val[array_search("date_retour",$this->champs)] != $val["date_retour"] OR |
43 |
$this->val[array_search("motivation",$this->champs)] != $val["motivation"] OR |
$this->val[array_search("motivation",$this->champs)] != $val["motivation"] OR |
44 |
$this->val[array_search("fichier",$this->champs)] != $val["fichier"] ) |
$this->val[array_search("fichier",$this->champs)] != $val["fichier"]) |
45 |
) { |
) { |
46 |
$this->valF["lu"]=false; |
$this->valF["lu"]=false; |
47 |
} |
} |
75 |
} |
} |
76 |
|
|
77 |
function setType(&$form,$maj) { |
function setType(&$form,$maj) { |
78 |
|
// Appel du parent |
79 |
parent::setType($form,$maj); |
parent::setType($form,$maj); |
80 |
if ($maj < 2) { //ajouter et modifier [add and modify] |
// MODE - AJOUTER |
81 |
if($maj==0){ // add |
if ($maj == 0) { |
82 |
$form->setType('dossier', 'hiddenstatic'); |
// On cache alors tous les champs que nous ne voulons pas voir |
83 |
$form->setType('date_envoi', 'date2'); |
// apparaître dans le formulaire d'ajout (principalement les |
84 |
$form->setType('service', 'select'); |
// informations sur le retour d'avis) |
85 |
$form->setType('date_limite', 'hidden'); |
$form->setType('date_retour', 'hidden'); |
86 |
$form->setType('date_retour', 'hidden'); |
$form->setType('date_reception', 'hidden'); |
87 |
$form->setType('avis_consultation', 'hidden'); |
$form->setType('date_limite', 'hidden'); |
88 |
$form->setType('motivation', 'hidden'); |
$form->setType('avis_consultation', 'hidden'); |
89 |
$form->setType('fichier', 'hidden'); |
$form->setType('motivation', 'hidden'); |
90 |
|
$form->setType('fichier', 'hidden'); |
91 |
|
$form->setType('lu', 'hidden'); |
92 |
|
// On permet la modification de certains champs |
93 |
|
$form->setType('dossier', 'hiddenstatic'); |
94 |
|
$form->setType('service', 'select'); |
95 |
|
$form->setType('date_envoi', 'date2'); |
96 |
|
} |
97 |
|
// MODE - MODIFIER |
98 |
|
if ($maj == 1) { |
99 |
|
|
100 |
|
// On affiche en statique les informations qui ne sont plus |
101 |
|
// modifiables |
102 |
|
$form->setType('dossier', 'hiddenstatic'); |
103 |
|
$form->setType('date_envoi', 'hiddenstaticdate'); |
104 |
|
$form->setType('date_limite', 'hiddenstaticdate'); |
105 |
|
$form->setType('service', 'selecthiddenstatic'); |
106 |
|
|
107 |
|
// La date de réception ne peut être modifiée que par un |
108 |
|
// utilisateur en ayant spécifiquement la permission |
109 |
|
if($this->f->isAccredited('consultation_modifier_date_reception')) { |
110 |
|
$form->setType('date_reception', 'date2'); |
111 |
|
} else { |
112 |
|
$form->setType('date_reception', 'hiddenstaticdate'); |
113 |
|
} |
114 |
|
|
115 |
|
// Le marqueur lu/non lu ne peut être modifié que par un |
116 |
|
// utilisateur en ayant spécifiquement la permission |
117 |
|
if ($this->f->isAccredited('consultation_modifier_lu')) { |
118 |
|
$form->setType('lu', 'checkbox'); |
119 |
|
} else { |
120 |
$form->setType('lu', 'hidden'); |
$form->setType('lu', 'hidden'); |
121 |
|
} |
122 |
|
|
123 |
|
// Gestion du type du widget sur le champ fichier |
124 |
|
if($this->val[array_search("fichier",$this->champs)]=="" OR |
125 |
|
$this->f->isAccredited('consultation_modifier_fichier')) { |
126 |
|
// Si il n'y a jamais eu de fichier enregistré ou que |
127 |
|
// l'utilisateur a spécifiquement les droits pour modifier |
128 |
|
// un fichier déjà enregistré alors on positionne un type |
129 |
|
// de widget modifiable |
130 |
|
$form->setType('fichier', 'tmpUpload'); |
131 |
|
} else { |
132 |
|
// Si non on affiche uniquement le nom du fichier |
133 |
|
$form->setType('fichier', 'tmpUploadStatic'); |
134 |
|
} |
135 |
|
|
136 |
|
// Modification layout : écran de retour d'avis permettant |
137 |
|
// uniquement la saisie des trois champs : avis, motivation et fichier |
138 |
|
if (!$this->f->isAccredited('consultation_consulter_autre_que_retour_avis')) { |
139 |
|
|
140 |
|
// On cache alors tous les champs que nous ne voulons pas voir |
141 |
|
$form->setType('dossier', 'hidden'); |
142 |
|
$form->setType('service', 'hidden'); |
143 |
|
$form->setType('date_envoi', 'hidden'); |
144 |
|
$form->setType('date_retour', 'hidden'); |
145 |
$form->setType('date_reception', 'hidden'); |
$form->setType('date_reception', 'hidden'); |
146 |
}else{ // modify |
$form->setType('date_limite', 'hidden'); |
147 |
if($this->f->isAccredited('consultation_retour_avis_service')) { |
$form->setType('lu', 'hidden'); |
148 |
$form->setType('dossier', 'hidden'); |
|
|
$form->setType('service', 'hidden'); |
|
|
$form->setType('date_envoi', 'hidden'); |
|
|
$form->setType('date_retour', 'hidden'); |
|
|
$form->setType('date_reception', 'hidden'); |
|
|
$form->setType('date_limite', 'hidden'); |
|
|
$form->setType('lu', 'hidden'); |
|
|
// Si il n'y a pas de fichier ou que l'utilisateur a les droits |
|
|
if($this->val[array_search("fichier",$this->champs)]=="" OR |
|
|
$this->f->isAccredited('consultation_modifier_fichier')) { |
|
|
$form->setType('fichier', 'tmpUpload'); |
|
|
} else { |
|
|
$form->setType('fichier', 'hiddenstatic'); |
|
|
} |
|
|
} else { |
|
|
$form->setType('dossier', 'hiddenstatic'); |
|
|
$form->setType('date_envoi', 'hiddenstaticdate'); |
|
|
$form->setType('date_limite', 'hiddenstaticdate'); |
|
|
if(!$this->f->isAccredited('consultation_modifier_date_reception')) { |
|
|
$form->setType('date_reception', 'hiddenstaticdate'); |
|
|
} else { |
|
|
$form->setType('date_reception', 'date2'); |
|
|
} |
|
|
$form->setType('service', 'selecthiddenstatic'); |
|
|
$form->setType('date_retour', 'date2'); |
|
|
$form->setType('avis_consultation', 'select'); |
|
|
$form->setType('motivation', 'textarea'); |
|
|
// Si il n'y a pas de fichier ou que l'utilisateur a les droits |
|
|
if($this->val[array_search("fichier",$this->champs)]=="" OR |
|
|
$this->f->isAccredited('consultation_modifier_fichier')) { |
|
|
$form->setType('fichier', 'tmpUpload'); |
|
|
} else { |
|
|
$form->setType('fichier', 'hiddenstatic'); |
|
|
} |
|
|
//Affichage du champ en modification pour le prifil instructeur |
|
|
if(!$this->f->isAccredited('consultation_modifier_lu')) { |
|
|
$form->setType('lu', 'hidden'); |
|
|
} |
|
|
} |
|
149 |
} |
} |
|
} |
|
|
$form->setType('consultation', 'hidden'); |
|
|
//setType pour profil service |
|
150 |
|
|
151 |
|
} |
152 |
|
// MODE - CONSULTER |
153 |
|
if ( $maj == 3 ) { |
154 |
|
$form->setType('fichier', 'tmpUploadStatic'); |
155 |
|
} |
156 |
|
//// On cache la clé primaire |
157 |
|
//$form->setType('consultation', 'hidden'); |
158 |
} |
} |
159 |
|
|
160 |
// TRIGGER AVANT MODIFICATION DE DONNEES |
// TRIGGER AVANT MODIFICATION DE DONNEES |
253 |
// Add fieldset |
// Add fieldset |
254 |
// ============================================= |
// ============================================= |
255 |
function setLayout(&$form, $maj){ |
function setLayout(&$form, $maj){ |
256 |
if ( $maj < 2 OR $maj == 3 ) { |
|
257 |
if(!$this->f->isAccredited('consultation_retour_avis_service')) { |
// Modification layout : écran de retour d'avis permettant |
258 |
|
// uniquement la saisie des trois champs : avis, motivation et fichier |
259 |
|
if ($this->f->isAccredited('consultation_consulter_autre_que_retour_avis')) { |
260 |
|
|
261 |
//Champs sur lequel s'ouvre le fieldset |
//Champs sur lequel s'ouvre le fieldset |
262 |
$form->setBloc('dossier','D',""); |
$form->setBloc('dossier','D',""); |
263 |
$form->setFieldset('dossier','D',_('Consultation')); |
$form->setFieldset('dossier','D',_('Consultation')); |
265 |
//Champs sur lequel se ferme le fieldset |
//Champs sur lequel se ferme le fieldset |
266 |
$form->setFieldset('date_envoi','F',''); |
$form->setFieldset('date_envoi','F',''); |
267 |
$form->setBloc('date_envoi','F'); |
$form->setBloc('date_envoi','F'); |
268 |
|
|
269 |
} |
} |
270 |
if ( $maj == 1 OR $maj == 3 ){ |
|
271 |
|
// MODE - autre que AJOUTER alors on affiche un fieldset retour |
272 |
|
// d'avis |
273 |
|
if ($maj != 0) { |
274 |
|
|
275 |
//Champs sur lequel s'ouvre le fieldset |
//Champs sur lequel s'ouvre le fieldset |
276 |
$form->setBloc('date_reception','D',""); |
$form->setBloc('date_reception','D',""); |
277 |
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
$form->setFieldset('date_reception','D',_('Retour d\'avis')); |
278 |
|
|
279 |
//Champs sur lequel se ferme le fieldset |
//Champs sur lequel se ferme le fieldset |
280 |
$form->setFieldset('lu','F',''); |
$form->setFieldset('lu','F',''); |
281 |
$form->setBloc('lu','F'); |
$form->setBloc('lu','F'); |
282 |
|
|
283 |
} |
} |
|
} |
|
284 |
} |
} |
285 |
|
|
286 |
/** Surcharge de la methode retour afin de retourner sur la page de saisie de |
/** Surcharge de la methode retour afin de retourner sur la page de saisie de |