2 |
//$Id$ |
//$Id$ |
3 |
|
|
4 |
include('../gen/sql/pgsql/consultation.inc.php'); |
include('../gen/sql/pgsql/consultation.inc.php'); |
5 |
$type_consultation_field = 'CASE WHEN service.type_consultation=\'avec_avis_attendu\' |
|
6 |
|
// |
7 |
|
$case_type_consultation = 'CASE WHEN service.type_consultation=\'avec_avis_attendu\' |
8 |
THEN \''._("avec avis attendu").'\' |
THEN \''._("avec avis attendu").'\' |
9 |
WHEN service.type_consultation=\'pour_conformite\' |
WHEN service.type_consultation=\'pour_conformite\' |
10 |
THEN \''._("pour conformite").'\' |
THEN \''._("pour conformite").'\' |
11 |
WHEN service.type_consultation=\'pour_information\' |
WHEN service.type_consultation=\'pour_information\' |
12 |
THEN \''._("pour information").'\' |
THEN \''._("pour information").'\' |
13 |
END as "'._("type_consultation").'"'; |
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").'"', |
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 |
'concat(service.abrege,\' \',service.libelle) as "'._("service").'"', |
'concat(service.abrege,\' \',service.libelle) as "'._("service").'"', |
24 |
$type_consultation_field, |
$case_type_consultation.' as "'._("type_consultation").'"', |
25 |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
26 |
'instructeur.nom as "'._("instructeur").'"', |
'instructeur.nom as "'._("instructeur").'"', |
27 |
'division.code as "'._("division").'"', |
'division.code as "'._("division").'"', |
28 |
"case consultation.lu when 't' then 'Oui' else 'Non' end as \""._("lu")."\"", |
$case_consultation_lu." as \""._("lu")."\"", |
29 |
); |
); |
30 |
|
|
31 |
$table .= " |
$table .= " |
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 |
$type_consultation_field, |
$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", ), |
116 |
// On met la ligne en couleur selon le type de condition |
// On met la ligne en couleur selon le type de condition |
117 |
$options[] = array( |
$options[] = array( |
118 |
"type" => "condition", |
"type" => "condition", |
119 |
"field" => 'CASE WHEN service.type_consultation=\'avec_avis_attendu\' |
"field" => $case_type_consultation, |
|
THEN \''._("avec avis attendu").'\' |
|
|
WHEN service.type_consultation=\'pour_conformite\' |
|
|
THEN \''._("pour conformite").'\' |
|
|
WHEN service.type_consultation=\'pour_information\' |
|
|
THEN \''._("pour information").'\' |
|
|
END', |
|
120 |
"case" => array( |
"case" => array( |
121 |
array( |
array( |
122 |
"values" => array(_("avec avis attendu"), ), |
"values" => array(_("avec avis attendu"), ), |