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

Diff of /trunk/sql/pgsql/consultation.inc.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.499  
changed lines
  Added in v.1167

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26