3 |
|
|
4 |
include('../gen/sql/pgsql/consultation.inc.php'); |
include('../gen/sql/pgsql/consultation.inc.php'); |
5 |
|
|
6 |
|
// |
7 |
|
$case_type_consultation = 'CASE WHEN service.type_consultation=\'avec_avis_attendu\' |
8 |
|
THEN \''._("avec avis attendu").'\' |
9 |
|
WHEN service.type_consultation=\'pour_conformite\' |
10 |
|
THEN \''._("pour conformite").'\' |
11 |
|
WHEN service.type_consultation=\'pour_information\' |
12 |
|
THEN \''._("pour information").'\' |
13 |
|
END'; |
14 |
|
$case_consultation_lu = "case consultation.lu when 't' then 'Oui' else 'Non' end"; |
15 |
// SELECT |
// SELECT |
16 |
$champAffiche = array( |
$champAffiche = array( |
17 |
'consultation.consultation as "'._("consultation").'"', |
'consultation.consultation as "'._("consultation").'"', |
20 |
'to_char(consultation.date_reception ,\'DD/MM/YYYY\') as "'._("date_reception").'"', |
'to_char(consultation.date_reception ,\'DD/MM/YYYY\') as "'._("date_reception").'"', |
21 |
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
22 |
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
23 |
'service.libelle as "'._("service").'"', |
'concat(service.abrege,\' \',service.libelle) as "'._("service").'"', |
24 |
|
$case_type_consultation.' as "'._("type_consultation").'"', |
25 |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
26 |
"case consultation.lu when 't' then 'Oui' else 'Non' end as \""._("lu")."\"", |
'instructeur.nom as "'._("instructeur").'"', |
27 |
|
'division.code as "'._("division").'"', |
28 |
|
$case_consultation_lu." as \""._("lu")."\"", |
29 |
); |
); |
30 |
|
|
31 |
|
$table .= " |
32 |
|
LEFT JOIN ".DB_PREFIXE."instructeur |
33 |
|
ON instructeur.instructeur=dossier.instructeur |
34 |
|
LEFT JOIN ".DB_PREFIXE."om_utilisateur |
35 |
|
ON instructeur.om_utilisateur = om_utilisateur.om_utilisateur |
36 |
|
LEFT JOIN ".DB_PREFIXE."division |
37 |
|
ON dossier.division=division.division"; |
38 |
|
|
39 |
/** |
/** |
40 |
* Gestion particulière de l'affichage du listing des consultations dans le |
* Gestion particulière de l'affichage du listing des consultations dans le |
41 |
* contexte d'un dossier d'instruction (pour un service consulté) |
* contexte d'un dossier d'instruction (pour un service consulté) |
58 |
OR $retourformulaire == 'dossier_instruction_tous_encours' |
OR $retourformulaire == 'dossier_instruction_tous_encours' |
59 |
OR $retourformulaire == 'dossier_instruction_mes_clotures' |
OR $retourformulaire == 'dossier_instruction_mes_clotures' |
60 |
OR $retourformulaire == 'dossier_instruction_tous_clotures') { |
OR $retourformulaire == 'dossier_instruction_tous_clotures') { |
61 |
|
// |
62 |
|
$case_consultation_lu = "case when consultation.avis_consultation is null then '' |
63 |
|
else case consultation.lu |
64 |
|
when 't' then 'Oui' |
65 |
|
else 'Non' |
66 |
|
end |
67 |
|
end"; |
68 |
// SELECT |
// SELECT |
69 |
$champAffiche = array( |
$champAffiche = array( |
70 |
'consultation.consultation as "'._("consultation").'"', |
'consultation.consultation as "'._("consultation").'"', |
73 |
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
74 |
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
75 |
'service.libelle as "'._("service").'"', |
'service.libelle as "'._("service").'"', |
76 |
|
$case_type_consultation.' as "'._("type_consultation").'"', |
77 |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
78 |
"case consultation.lu when 't' then 'Oui' else 'Non' end as \""._("lu")."\"", |
$case_consultation_lu." as \""._("lu")."\"", |
79 |
); |
); |
80 |
// Filtre dur les données du dossier |
// Filtre dur les données du dossier |
81 |
$selection=" WHERE (consultation.dossier ='".$idx."')"; |
$selection=" WHERE (consultation.dossier ='".$idx."')"; |
89 |
'lib' => '<span class="om-icon om-icon-16 om-icon-fix mut-add-16" title="'._('Ajouter plusieurs').'">'._('Ajouter plusieurs').'</span>', |
'lib' => '<span class="om-icon om-icon-16 om-icon-fix mut-add-16" title="'._('Ajouter plusieurs').'">'._('Ajouter plusieurs').'</span>', |
90 |
'right' => $right, |
'right' => $right, |
91 |
); |
); |
92 |
|
// |
93 |
|
if (isset($f) && $f->isUserInstructeur() |
94 |
|
&& $f->getDivisionFromDossier($idx) != $_SESSION["division"]) { |
95 |
|
$tab_actions['corner'] = array(); |
96 |
|
} |
97 |
} |
} |
98 |
|
|
99 |
/** |
/** |
102 |
// On affiche le champ lu en gras |
// On affiche le champ lu en gras |
103 |
$options[] = array( |
$options[] = array( |
104 |
"type" => "condition", |
"type" => "condition", |
105 |
"field" => "case consultation.lu when 't' then 'Oui' else 'Non' end", |
"field" => $case_consultation_lu, |
106 |
"case" => array( |
"case" => array( |
107 |
"0" => array( |
"0" => array( |
108 |
"values" => array("Non", ), |
"values" => array("Non", ), |
109 |
"style" => "non_lu", |
"style" => "non_lu", |
110 |
), |
), |
111 |
), |
), |
112 |
|
); |
113 |
|
/** |
114 |
|
* Options |
115 |
|
*/ |
116 |
|
// On met la ligne en couleur selon le type de condition |
117 |
|
$options[] = array( |
118 |
|
"type" => "condition", |
119 |
|
"field" => $case_type_consultation, |
120 |
|
"case" => array( |
121 |
|
array( |
122 |
|
"values" => array(_("avec avis attendu"), ), |
123 |
|
"style" => "consultation-avec-avis-attendu", |
124 |
|
), |
125 |
|
array( |
126 |
|
"values" => array(_("pour conformite"), ), |
127 |
|
"style" => "consultation-pour-conformite", |
128 |
|
), |
129 |
|
array( |
130 |
|
"values" => array(_("pour information"), ), |
131 |
|
"style" => "consultation-pour-information", |
132 |
|
), |
133 |
|
), |
134 |
); |
); |
135 |
|
|
136 |
?> |
?> |