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