/[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 498 by nhaye, Fri Oct 12 16:01:09 2012 UTC revision 949 by fmichon, Fri Nov 30 16:32:02 2012 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    $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 .= "INNER JOIN ".DB_PREFIXE."om_utilisateur  $table .= "
29          ON om_utilisateur.om_utilisateur=dossier.instructeur ";  LEFT JOIN ".DB_PREFIXE."instructeur
30                ON instructeur.instructeur=dossier.instructeur
31  if(isset($idx))  LEFT JOIN ".DB_PREFIXE."om_utilisateur
32    $selection=" WHERE consultation.dossier ='".$idx."'";      ON instructeur.om_utilisateur = om_utilisateur.om_utilisateur
33  else  LEFT JOIN ".DB_PREFIXE."division
34    $selection=" WHERE om_utilisateur.login='".$_SESSION['login']."'";      ON dossier.division=division.division";
35    
36  if ($retourformulaire== 'service'){  /**
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
# Line 19  if ($retourformulaire== 'service'){ Line 45  if ($retourformulaire== 'service'){
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['service_abrege'] = array(   * contexte d'un dossier d'instruction (pour l'instructeur)
51      'table' => 'service',   */
52      'colonne' => 'abrege',  if ($retourformulaire == 'dossier'
53      'type' => 'text',      OR $retourformulaire == 'dossier_instruction'
54      'libelle' => _('Service (abrege)'));      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' => 'service',      OR $retourformulaire == 'dossier_instruction_tous_clotures') {
58      'colonne' => 'libelle',      // SELECT
59      'type' => 'text',      $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  $champs['date_retour'] =          "case consultation.lu when 't' then 'Oui' else 'Non' end as \""._("lu")."\"",
69      array('colonne' => 'date_retour',      );
70            'table' => 'consultation',      // Filtre dur les données du dossier
71            'libelle' => _('Date de retour'),      $selection=" WHERE (consultation.dossier ='".$idx."')";
72            'type' => 'date',      // Ajout d'une action supplémentaire - ajout de consultations multiples
73            'where' => 'intervaldate');      $id="";
74            $lien = "../app/consultation_multiple.php?obj=$obj&idx=$idx&ret=$retourformulaire";
75  $champs['date_limite'] =      $right = array('list' => array($obj, $obj.'_ajouter'),'operator' => 'OR');
76      array('colonne' => 'date_limite',      $tab_actions['corner']['ajouter_multiple'] = array (
77            'table' => 'consultation',          'lien' => $lien,
78            'libelle' => _('Date limite'),          'id' => $id,
79            'type' => 'date',          'lib' => '<span class="om-icon om-icon-16 om-icon-fix mut-add-16" title="'._('Ajouter plusieurs').'">'._('Ajouter plusieurs').'</span>',
80            'where' => 'intervaldate');          'right' => $right,
81        );
82        //
83  $options[] =  array('type' => 'search',      if (isset($f) && $f->isUserInstructeur()
84                       'display' => true,          && $f->getDivisionFromDossier($idx) != $_SESSION["division"]) {
85                       'advanced' => $champs,          $tab_actions['corner'] = array();
86                       'default_form' => 'advanced',      }
87                       'absolute_object' => 'consultation');  }
88    
89  /**  /**
90   * Options   * Options
91   */   */
92    // On affiche le champ lu en gras
93  $options_tab[] = array(  $options[] = array(
94        "type" => "condition",
95        "field" => "case consultation.lu when 't' then 'Oui' else 'Non' end",
96        "case" => array(
97                "0" => array(
98                    "values" => array("Non", ),
99                    "style" => "non_lu",
100                    ),
101                ),
102        );
103    /**
104     * Options
105     */
106    // On met la ligne en couleur selon le type de condition
107    $options[] = array(
108      "type" => "condition",      "type" => "condition",
109      "field" => "om_collectivite.niveau",      "field" => 'CASE WHEN service.type_consultation=\'avec_avis_attendu\'
110                THEN \''._("avec avis attendu").'\'
111                WHEN service.type_consultation=\'pour_conformite\'
112                THEN \''._("pour conformite").'\'
113                WHEN service.type_consultation=\'pour_information\'
114                THEN \''._("pour information").'\'
115        END',
116      "case" => array(      "case" => array(
117          "0" => array(                   array(
118              "style" => "tab_desactive",                      "values" => array(_("avec avis attendu"), ),
119          ),                      "style" => "consultation-avec-avis-attendu",
120      ),                  ),
121                    array(
122                        "values" => array(_("pour conformite"), ),
123                        "style" => "consultation-pour-conformite",
124                    ),
125                    array(
126                        "values" => array(_("pour information"), ),
127                        "style" => "consultation-pour-information",
128                    ),
129                ),
130  );  );
131    
132  ?>  ?>

Legend:
Removed from v.498  
changed lines
  Added in v.949

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26