1 |
fraynaud |
3 |
<?php |
2 |
|
|
//$Id$ |
3 |
fmichon |
879 |
|
4 |
fraynaud |
3 |
include('../gen/sql/pgsql/consultation.inc.php'); |
5 |
nhaye |
429 |
|
6 |
fmichon |
879 |
// SELECT |
7 |
|
|
$champAffiche = array( |
8 |
|
|
'consultation.consultation as "'._("consultation").'"', |
9 |
|
|
'consultation.dossier as "'._("dossier").'"', |
10 |
|
|
'to_char(consultation.date_envoi ,\'DD/MM/YYYY\') as "'._("date_envoi").'"', |
11 |
|
|
'to_char(consultation.date_reception ,\'DD/MM/YYYY\') as "'._("date_reception").'"', |
12 |
|
|
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
13 |
|
|
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
14 |
|
|
'service.libelle as "'._("service").'"', |
15 |
nhaye |
935 |
'service.type_consultation as "'._("type_consultation").'"', |
16 |
fmichon |
879 |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
17 |
fmichon |
893 |
'instructeur.nom as "'._("instructeur").'"', |
18 |
|
|
'division.code as "'._("division").'"', |
19 |
fmichon |
879 |
"case consultation.lu when 't' then 'Oui' else 'Non' end as \""._("lu")."\"", |
20 |
|
|
); |
21 |
|
|
|
22 |
fmichon |
893 |
$table .= " |
23 |
|
|
LEFT JOIN ".DB_PREFIXE."instructeur |
24 |
|
|
ON instructeur.instructeur=dossier.instructeur |
25 |
|
|
LEFT JOIN ".DB_PREFIXE."om_utilisateur |
26 |
|
|
ON instructeur.om_utilisateur = om_utilisateur.om_utilisateur |
27 |
|
|
LEFT JOIN ".DB_PREFIXE."division |
28 |
|
|
ON dossier.division=division.division"; |
29 |
|
|
|
30 |
fmichon |
879 |
/** |
31 |
|
|
* Gestion particulière de l'affichage du listing des consultations dans le |
32 |
|
|
* contexte d'un dossier d'instruction (pour un service consulté) |
33 |
|
|
*/ |
34 |
|
|
if ($retourformulaire == 'service') { |
35 |
nhaye |
429 |
// Actions en coin : ajouter |
36 |
nhaye |
496 |
$tab_actions['corner']['ajouter'] = NULL; |
37 |
nhaye |
429 |
// Actions a gauche : consulter |
38 |
|
|
$tab_actions['left']['consulter'] = NULL; |
39 |
fraynaud |
38 |
$selection=" where consultation.service ='".$idx."'"; |
40 |
|
|
} |
41 |
|
|
|
42 |
nhaye |
498 |
/** |
43 |
fmichon |
879 |
* Gestion particulière de l'affichage du listing des consultations dans le |
44 |
|
|
* contexte d'un dossier d'instruction (pour l'instructeur) |
45 |
vpihour |
527 |
*/ |
46 |
nhaye |
533 |
if ($retourformulaire == 'dossier' |
47 |
fmichon |
657 |
OR $retourformulaire == 'dossier_instruction' |
48 |
|
|
OR $retourformulaire == 'dossier_instruction_mes_encours' |
49 |
|
|
OR $retourformulaire == 'dossier_instruction_tous_encours' |
50 |
|
|
OR $retourformulaire == 'dossier_instruction_mes_clotures' |
51 |
|
|
OR $retourformulaire == 'dossier_instruction_tous_clotures') { |
52 |
fmichon |
879 |
// SELECT |
53 |
|
|
$champAffiche = array( |
54 |
|
|
'consultation.consultation as "'._("consultation").'"', |
55 |
|
|
'to_char(consultation.date_envoi ,\'DD/MM/YYYY\') as "'._("date_envoi").'"', |
56 |
|
|
'to_char(consultation.date_reception ,\'DD/MM/YYYY\') as "'._("date_reception").'"', |
57 |
|
|
'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"', |
58 |
|
|
'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"', |
59 |
|
|
'service.libelle as "'._("service").'"', |
60 |
nhaye |
935 |
'service.type_consultation as "'._("type_consultation").'"', |
61 |
fmichon |
879 |
'avis_consultation.libelle as "'._("avis_consultation").'"', |
62 |
|
|
"case consultation.lu when 't' then 'Oui' else 'Non' end as \""._("lu")."\"", |
63 |
|
|
); |
64 |
|
|
// Filtre dur les données du dossier |
65 |
|
|
$selection=" WHERE (consultation.dossier ='".$idx."')"; |
66 |
|
|
// Ajout d'une action supplémentaire - ajout de consultations multiples |
67 |
nhaye |
533 |
$id=""; |
68 |
vpihour |
572 |
$lien = "../app/consultation_multiple.php?obj=$obj&idx=$idx&ret=$retourformulaire"; |
69 |
nhaye |
533 |
$right = array('list' => array($obj, $obj.'_ajouter'),'operator' => 'OR'); |
70 |
|
|
$tab_actions['corner']['ajouter_multiple'] = array ( |
71 |
|
|
'lien' => $lien, |
72 |
|
|
'id' => $id, |
73 |
|
|
'lib' => '<span class="om-icon om-icon-16 om-icon-fix mut-add-16" title="'._('Ajouter plusieurs').'">'._('Ajouter plusieurs').'</span>', |
74 |
|
|
'right' => $right, |
75 |
|
|
); |
76 |
|
|
} |
77 |
vpihour |
527 |
|
78 |
|
|
/** |
79 |
nhaye |
498 |
* Options |
80 |
|
|
*/ |
81 |
fmichon |
879 |
// On affiche le champ lu en gras |
82 |
nhaye |
509 |
$options[] = array( |
83 |
nhaye |
498 |
"type" => "condition", |
84 |
nhaye |
509 |
"field" => "case consultation.lu when 't' then 'Oui' else 'Non' end", |
85 |
nhaye |
498 |
"case" => array( |
86 |
nhaye |
509 |
"0" => array( |
87 |
|
|
"values" => array("Non", ), |
88 |
fmichon |
879 |
"style" => "non_lu", |
89 |
nhaye |
509 |
), |
90 |
|
|
), |
91 |
nhaye |
498 |
); |
92 |
fmichon |
879 |
|
93 |
fraynaud |
3 |
?> |