1 |
fraynaud |
3 |
<?php |
2 |
|
|
//$Id$ |
3 |
fmichon |
879 |
|
4 |
fraynaud |
3 |
include('../gen/sql/pgsql/consultation.inc.php'); |
5 |
fmichon |
958 |
|
6 |
|
|
// |
7 |
|
|
$case_type_consultation = 'CASE WHEN service.type_consultation=\'avec_avis_attendu\' |
8 |
nhaye |
942 |
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 |
fmichon |
958 |
END'; |
14 |
fmichon |
879 |
// SELECT |
15 |
|
|
$champAffiche = array( |
16 |
|
|
'consultation.consultation as "'._("consultation").'"', |
17 |
|
|
'consultation.dossier as "'._("dossier").'"', |
18 |
|
|
'to_char(consultation.date_envoi ,\'DD/MM/YYYY\') as "'._("date_envoi").'"', |
19 |
|
|
'to_char(consultation.date_reception ,\'DD/MM/YYYY\') as "'._("date_reception").'"', |
20 |
|
|
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
21 |
|
|
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
22 |
nhaye |
942 |
'concat(service.abrege,\' \',service.libelle) as "'._("service").'"', |
23 |
fmichon |
958 |
$case_type_consultation.' as "'._("type_consultation").'"', |
24 |
fmichon |
879 |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
25 |
fmichon |
893 |
'instructeur.nom as "'._("instructeur").'"', |
26 |
|
|
'division.code as "'._("division").'"', |
27 |
fmichon |
879 |
"case consultation.lu when 't' then 'Oui' else 'Non' end as \""._("lu")."\"", |
28 |
|
|
); |
29 |
|
|
|
30 |
fmichon |
893 |
$table .= " |
31 |
|
|
LEFT JOIN ".DB_PREFIXE."instructeur |
32 |
|
|
ON instructeur.instructeur=dossier.instructeur |
33 |
|
|
LEFT JOIN ".DB_PREFIXE."om_utilisateur |
34 |
|
|
ON instructeur.om_utilisateur = om_utilisateur.om_utilisateur |
35 |
|
|
LEFT JOIN ".DB_PREFIXE."division |
36 |
|
|
ON dossier.division=division.division"; |
37 |
|
|
|
38 |
fmichon |
879 |
/** |
39 |
|
|
* Gestion particulière de l'affichage du listing des consultations dans le |
40 |
|
|
* contexte d'un dossier d'instruction (pour un service consulté) |
41 |
|
|
*/ |
42 |
|
|
if ($retourformulaire == 'service') { |
43 |
nhaye |
429 |
// Actions en coin : ajouter |
44 |
nhaye |
496 |
$tab_actions['corner']['ajouter'] = NULL; |
45 |
nhaye |
429 |
// Actions a gauche : consulter |
46 |
|
|
$tab_actions['left']['consulter'] = NULL; |
47 |
fraynaud |
38 |
$selection=" where consultation.service ='".$idx."'"; |
48 |
|
|
} |
49 |
|
|
|
50 |
nhaye |
498 |
/** |
51 |
fmichon |
879 |
* Gestion particulière de l'affichage du listing des consultations dans le |
52 |
|
|
* contexte d'un dossier d'instruction (pour l'instructeur) |
53 |
vpihour |
527 |
*/ |
54 |
nhaye |
533 |
if ($retourformulaire == 'dossier' |
55 |
fmichon |
657 |
OR $retourformulaire == 'dossier_instruction' |
56 |
|
|
OR $retourformulaire == 'dossier_instruction_mes_encours' |
57 |
|
|
OR $retourformulaire == 'dossier_instruction_tous_encours' |
58 |
|
|
OR $retourformulaire == 'dossier_instruction_mes_clotures' |
59 |
|
|
OR $retourformulaire == 'dossier_instruction_tous_clotures') { |
60 |
fmichon |
879 |
// SELECT |
61 |
|
|
$champAffiche = array( |
62 |
|
|
'consultation.consultation as "'._("consultation").'"', |
63 |
|
|
'to_char(consultation.date_envoi ,\'DD/MM/YYYY\') as "'._("date_envoi").'"', |
64 |
|
|
'to_char(consultation.date_reception ,\'DD/MM/YYYY\') as "'._("date_reception").'"', |
65 |
|
|
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
66 |
|
|
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
67 |
|
|
'service.libelle as "'._("service").'"', |
68 |
fmichon |
958 |
$case_type_consultation.' as "'._("type_consultation").'"', |
69 |
fmichon |
879 |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
70 |
|
|
"case consultation.lu when 't' then 'Oui' else 'Non' end as \""._("lu")."\"", |
71 |
|
|
); |
72 |
|
|
// Filtre dur les données du dossier |
73 |
|
|
$selection=" WHERE (consultation.dossier ='".$idx."')"; |
74 |
|
|
// Ajout d'une action supplémentaire - ajout de consultations multiples |
75 |
nhaye |
533 |
$id=""; |
76 |
vpihour |
572 |
$lien = "../app/consultation_multiple.php?obj=$obj&idx=$idx&ret=$retourformulaire"; |
77 |
nhaye |
533 |
$right = array('list' => array($obj, $obj.'_ajouter'),'operator' => 'OR'); |
78 |
|
|
$tab_actions['corner']['ajouter_multiple'] = array ( |
79 |
|
|
'lien' => $lien, |
80 |
|
|
'id' => $id, |
81 |
|
|
'lib' => '<span class="om-icon om-icon-16 om-icon-fix mut-add-16" title="'._('Ajouter plusieurs').'">'._('Ajouter plusieurs').'</span>', |
82 |
|
|
'right' => $right, |
83 |
|
|
); |
84 |
fmichon |
949 |
// |
85 |
|
|
if (isset($f) && $f->isUserInstructeur() |
86 |
|
|
&& $f->getDivisionFromDossier($idx) != $_SESSION["division"]) { |
87 |
|
|
$tab_actions['corner'] = array(); |
88 |
|
|
} |
89 |
nhaye |
533 |
} |
90 |
vpihour |
527 |
|
91 |
|
|
/** |
92 |
nhaye |
498 |
* Options |
93 |
|
|
*/ |
94 |
fmichon |
879 |
// On affiche le champ lu en gras |
95 |
nhaye |
509 |
$options[] = array( |
96 |
nhaye |
498 |
"type" => "condition", |
97 |
nhaye |
509 |
"field" => "case consultation.lu when 't' then 'Oui' else 'Non' end", |
98 |
nhaye |
498 |
"case" => array( |
99 |
nhaye |
509 |
"0" => array( |
100 |
|
|
"values" => array("Non", ), |
101 |
fmichon |
879 |
"style" => "non_lu", |
102 |
nhaye |
509 |
), |
103 |
|
|
), |
104 |
nhaye |
942 |
); |
105 |
|
|
/** |
106 |
|
|
* Options |
107 |
|
|
*/ |
108 |
|
|
// On met la ligne en couleur selon le type de condition |
109 |
|
|
$options[] = array( |
110 |
|
|
"type" => "condition", |
111 |
fmichon |
958 |
"field" => $case_type_consultation, |
112 |
nhaye |
942 |
"case" => array( |
113 |
|
|
array( |
114 |
|
|
"values" => array(_("avec avis attendu"), ), |
115 |
|
|
"style" => "consultation-avec-avis-attendu", |
116 |
|
|
), |
117 |
|
|
array( |
118 |
|
|
"values" => array(_("pour conformite"), ), |
119 |
|
|
"style" => "consultation-pour-conformite", |
120 |
|
|
), |
121 |
|
|
array( |
122 |
|
|
"values" => array(_("pour information"), ), |
123 |
|
|
"style" => "consultation-pour-information", |
124 |
|
|
), |
125 |
|
|
), |
126 |
nhaye |
498 |
); |
127 |
fmichon |
879 |
|
128 |
fraynaud |
3 |
?> |