/[openfoncier]/trunk/sql/pgsql/consultation_tous_retours.inc.php
ViewVC logotype

Annotation of /trunk/sql/pgsql/consultation_tous_retours.inc.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 942 - (hide annotations)
Fri Nov 30 15:11:41 2012 UTC (12 years, 2 months ago) by nhaye
File size: 5459 byte(s)
Ajout d'une condition pour tester le type de consultation et afficher une couleur sur chaque type,
concatenation de 2 champs du tableau de consultation pour gagner de la place

1 nhaye 509 <?php
2 fmichon 644
3     //
4 nhaye 509 include('../gen/sql/pgsql/consultation.inc.php');
5    
6 fmichon 644 //
7     $ent = _("instruction")." -> "._("tous les retours de consultation");
8    
9     //
10     $tab_description = _("Les consultations qui sont notees comme non lues qui".
11     " concernent des dossiers d'instruction situes dans ma".
12     " division.");
13 nhaye 942 $type_consultation_field = 'CASE WHEN service.type_consultation=\'avec_avis_attendu\'
14     THEN \''._("avec avis attendu").'\'
15     WHEN service.type_consultation=\'pour_conformite\'
16     THEN \''._("pour conformite").'\'
17     WHEN service.type_consultation=\'pour_information\'
18     THEN \''._("pour information").'\'
19     END as "'._("type_consultation").'"';
20 fmichon 644 //
21 nhaye 509 $champAffiche = array(
22 nhaye 525 'consultation.consultation as "'._("consultation").'"',
23 nhaye 509 'consultation.dossier as "'._("dossier").'"',
24 nhaye 942 'concat(service.abrege,\' \',service.libelle) as "'._("service").'"',
25     $type_consultation_field,
26 nhaye 509 'to_char(consultation.date_reception ,\'DD/MM/YYYY\') as "'._("date_reception").'"',
27     'to_char(consultation.date_retour ,\'DD/MM/YYYY\') as "'._("date_retour").'"',
28     'to_char(consultation.date_limite ,\'DD/MM/YYYY\') as "'._("date_limite").'"',
29     'avis_consultation.libelle as "'._("avis_consultation").'"',
30 fmichon 890 'instructeur.nom as "'._("instructeur").'"',
31 nhaye 650 'CASE WHEN dossier.enjeu_erp is TRUE THEN \'<span class="om-icon om-icon-16 om-icon-fix enjeu_erp-16" title="'._('Enjeu ERP').'">ERP</span>\' ELSE \'\' END ||
32     CASE WHEN dossier.enjeu_urba is TRUE THEN \'<span class="om-icon om-icon-16 om-icon-fix enjeu_urba-16" title="'._('Enjeu Urba').'">URBA</span>\' ELSE \'\' END
33 nhaye 615 as "'._("enjeu").'"',
34 nhaye 509 );
35    
36 fmichon 890 $table .= "
37     LEFT JOIN ".DB_PREFIXE."instructeur
38     ON instructeur.instructeur=dossier.instructeur
39     LEFT JOIN ".DB_PREFIXE."om_utilisateur
40     ON instructeur.om_utilisateur = om_utilisateur.om_utilisateur";
41 nhaye 509
42 fmichon 890 //
43     $selection=" WHERE
44     consultation.lu IS FALSE
45     AND dossier.division = ".$_SESSION['division']."";
46 nhaye 509
47 nhaye 615 $tri=" ORDER BY dossier.enjeu_erp, dossier.enjeu_urba, consultation.date_retour";
48 nhaye 509
49     $champRecherche = array(
50     'dossier.dossier as "'._("dossier").'"',
51 fmichon 890 'instructeur.nom as "'._("instructeur").'"',
52 nhaye 509 );
53    
54     $tab_actions['corner']['ajouter']=NULL;
55 nhaye 661 $tab_actions['left']['consulter']=array('lien' => '../spg/direct_link.php?obj=dossier_instruction_tous_encours&amp;action=3'.
56     '&amp;direct_field=dossier&direct_form=consultation&direct_action=3&direct_idx=',
57 nhaye 525 'id' => '',
58 nhaye 509 'lib' => '<span class="om-icon om-icon-16 om-icon-fix consult-16" title="'._('Consulter').'">'._('Consulter').'</span>',
59     'rights' => array('list' => array($obj, $obj.'_consulter'), 'operator' => 'OR'),
60     'ordre' => 10,);
61     $tab_actions['content'] = $tab_actions['left']['consulter'];
62    
63    
64     $champs = array();
65    
66     $champs['service_abrege'] = array(
67     'table' => 'service',
68     'colonne' => 'abrege',
69     'type' => 'text',
70     'libelle' => _('Service (abrege)'));
71    
72     $champs['service'] = array(
73     'table' => 'service',
74     'colonne' => 'libelle',
75     'type' => 'text',
76     'libelle' => _('Service'));
77    
78 fmichon 890 $champs['instructeur'] =
79     array('colonne' => 'instructeur',
80     'table' => 'dossier',
81     'libelle' => _('Instructeur'),
82     'type' => 'text');
83    
84 nhaye 509 $champs['date_envoi'] =
85     array('colonne' => 'date_envoi',
86     'table' => 'consultation',
87     'libelle' => _('Date d\'envoi'),
88     'type' => 'date',
89     'where' => 'intervaldate');
90     $champs['date_retour'] =
91     array('colonne' => 'date_retour',
92     'table' => 'consultation',
93     'libelle' => _('Date de retour'),
94     'type' => 'date',
95     'where' => 'intervaldate');
96    
97     $champs['date_limite'] =
98     array('colonne' => 'date_limite',
99     'table' => 'consultation',
100     'libelle' => _('Date limite'),
101     'type' => 'date',
102     'where' => 'intervaldate');
103    
104     $options[] = array('type' => 'search',
105     'display' => true,
106     'advanced' => $champs,
107     'absolute_object' => 'consultation');
108    
109     /**
110     * Options
111     */
112    
113     $options[] = array(
114     "type" => "condition",
115     "field" => "case consultation.lu when 't' then 'Oui' else 'Non' end",
116     "case" => array(
117     "0" => array(
118     "values" => array("Non", ),
119     "style" => "consultation_non_lue",
120     ),
121     ),
122     );
123 nhaye 942 /**
124     * Options
125     */
126     // On met la ligne en couleur selon le type de condition
127     $options[] = array(
128     "type" => "condition",
129     "field" => 'CASE WHEN service.type_consultation=\'avec_avis_attendu\'
130     THEN \''._("avec avis attendu").'\'
131     WHEN service.type_consultation=\'pour_conformite\'
132     THEN \''._("pour conformite").'\'
133     WHEN service.type_consultation=\'pour_information\'
134     THEN \''._("pour information").'\'
135     END',
136     "case" => array(
137     array(
138     "values" => array(_("avec avis attendu"), ),
139     "style" => "consultation-avec-avis-attendu",
140     ),
141     array(
142     "values" => array(_("pour conformite"), ),
143     "style" => "consultation-pour-conformite",
144     ),
145     array(
146     "values" => array(_("pour information"), ),
147     "style" => "consultation-pour-information",
148     ),
149     ),
150     );
151 nhaye 509
152     ?>

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26