/[openfoncier]/trunk/app/consultation_multiple.php
ViewVC logotype

Diff of /trunk/app/consultation_multiple.php

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

revision 606 by vpihour, Tue Nov 6 09:57:46 2012 UTC revision 956 by fmichon, Mon Dec 3 01:16:25 2012 UTC
# Line 43  Line 43 
43                            
44              foreach ($donnees as $value) {              foreach ($donnees as $value) {
45                                    
46                  $sql = "SELECT delai FROM service WHERE service = $value[0]";                  $sql = "SELECT delai FROM ".DB_PREFIXE."service WHERE service = $value[0]";
47                  $res = $f->db->query($sql);                  $res = $f->db->query($sql);
48                  $f->isDatabaseError($res);                  $f->isDatabaseError($res);
49                  $row=& $res->fetchRow();                  $row=& $res->fetchRow();
# Line 86  Line 86 
86                                    
87                  echo "                  echo "
88                      <script language='javascript' type='text/javascript'>                      <script language='javascript' type='text/javascript'>
89                          $.download('../app/pdfetat.php','obj=$obj$textIdsConsultations', 'POST', $obj);                          $.download('../app/pdfetat.php','obj=consultation_avec_avis_attendu$textIdsConsultations', 'POST', 'consultation_avec_avis_attendu');
90                      </script>                      </script>
91                  ";                  ";
92              }              }
# Line 102  Line 102 
102                  ser_cat.service_categorie, ser_cat.libelle AS them_lib,                  ser_cat.service_categorie, ser_cat.libelle AS them_lib,
103                  ser.service, ser.libelle AS ser_lib, ser.consultation_papier                  ser.service, ser.libelle AS ser_lib, ser.consultation_papier
104              FROM              FROM
105                  public.lien_service_service_categorie lie,                  ".DB_PREFIXE."lien_service_service_categorie lie,
106                  public.service_categorie ser_cat,                  ".DB_PREFIXE."service_categorie ser_cat,
107                  public.service ser                  ".DB_PREFIXE."service ser
108              WHERE              WHERE
109                  ser_cat.service_categorie = lie.service_categorie AND                  ser_cat.service_categorie = lie.service_categorie AND
110                  ser.service = lie.service AND                  ser.service = lie.service AND
111                  (                  (
112                      ser.om_validite_fin <= CURRENT_DATE OR                   (ser.om_validite_debut IS NULL
113                      ser.om_validite_fin IS NULL                    AND (ser.om_validite_fin IS NULL
114                           OR ser.om_validite_fin > CURRENT_DATE))
115                     OR
116                     (ser.om_validite_debut <= CURRENT_DATE
117                      AND (ser.om_validite_fin IS NULL
118                           OR ser.om_validite_fin > CURRENT_DATE))
119                  )                  )
120                ORDER BY them_lib, ser_lib
121              ";              ";
122                    
123          $res = $f->db->query($sql);          $res = $f->db->query($sql);
124            $f->addToLog("app/consultation_multiple.php: db->query(\"".$sql."\")", VERBOSE_MODE);
125          $f->isDatabaseError($res);          $f->isDatabaseError($res);
126                    
127          $temp_ser_cat = 0;          $temp_ser_cat = 0;
128          while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) {          while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) {
129              $name = $row['service_categorie'].'_'.              $name = $row['service_categorie'].'_'.
130                      $row['service'].'_'.                      $row['service'].'_'.
131                      (($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '0' : '1' ).'_';                      (($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '0' : '1' ).'_';
132              /*On change de thématique, donc rajoute le nom de la thématique*/              /*On change de thématique, donc rajoute le nom de la thématique*/
133              if ( $temp_ser_cat != $row['service_categorie'] ){              if ( $temp_ser_cat != $row['service_categorie'] ){
134                                    
# Line 134  Line 141 
141                          class="liste_gauche_service t'.$name.'"                          class="liste_gauche_service t'.$name.'"
142                          id="t'.$name.'" >                          id="t'.$name.'" >
143                          '.$row['ser_lib'].'                          '.$row['ser_lib'].'
144                          <input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked="checked"' ).'/>                          <input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '' : 'checked="checked"' ).'/>
145                      </div>                      </div>
146                  ';                  ';
147              }              }
# Line 147  Line 154 
154                          class="liste_gauche_service t'.$name.'"                          class="liste_gauche_service t'.$name.'"
155                          id="t'.$name.'" >                          id="t'.$name.'" >
156                          '.$row['ser_lib'].'                          '.$row['ser_lib'].'
157                          <input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked="checked"' ).'/>                          <input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '' : 'checked="checked"' ).'/>
158                      </div>                      </div>
159                  ';                  ';
160              }              }
# Line 157  Line 164 
164          /*Requête qui récupère les services qui ne sont pas dans une thématique*/          /*Requête qui récupère les services qui ne sont pas dans une thématique*/
165          $sql =          $sql =
166              "SELECT service, libelle, consultation_papier              "SELECT service, libelle, consultation_papier
167              FROM public.service              FROM ".DB_PREFIXE."service
168              WHERE service NOT IN              WHERE service NOT IN
169                  (                  (
170                      SELECT service                      SELECT service
171                      FROM lien_service_service_categorie                      FROM ".DB_PREFIXE."lien_service_service_categorie
172                  )                  )
173                   AND                   AND
174                  (                  (
# Line 172  Line 179 
179                    
180          $res = $f->db->query($sql);          $res = $f->db->query($sql);
181          $f->isDatabaseError($res);          $f->isDatabaseError($res);
182                
183          if ( $res->numrows() > 0 )          if ( $res->numrows() > 0 )
184              $liste_gauche .= '              $liste_gauche .= '
185                  <div id="them_0" class="liste_gauche_them">Autres</div>';                  <div id="them_0" class="liste_gauche_them">Autres</div>';
186                    
187          while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) {          while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)) {
188                
189              /*Ajout de tous les services qui n'ont pas de thématique*/              /*Ajout de tous les services qui n'ont pas de thématique*/
190              $name = '0_'.              $name = '0_'.
191                      $row['service'].'_'.                      $row['service'].'_'.
192                      (($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '0' : '1' ).'_';                      (($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f'  ) ? '0' : '1' ).'_';
193              $liste_gauche .= '              $liste_gauche .= '
194                  <div                  <div
195                      class="liste_gauche_service t'.$name.'"                      class="liste_gauche_service t'.$name.'"
196                      id="t'.$name.'" >                      id="t'.$name.'" >
197                      '.$row['libelle'].'&nbsp;                      '.$row['libelle'].'&nbsp;
198                      <input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked="checked"' ).'/>                      <input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == 'f' ) ? '' : 'checked="checked"' ).'/>
199                  </div>                  </div>
200              ';              ';
201          }          }
# Line 508  Line 516 
516                            
517              function changeDataLeftColumn(){              function changeDataLeftColumn(){
518                                    
519                    $('.list-sel-ser-them').empty();
520                    $('.list-sel-ser-them').html(
521                        '<div class=\"row\">' +
522                            '<div class=\"cell1 liste_droite_title list-sel-ser-them-title\">Service a consulter</div>' +
523                            '<div class=\"cell2 liste_droite_title list-sel-ser-them-title\">Version papier</div>' +
524                        '</div>'
525                    );
526                    
527                  var listServ = new Array();                  var listServ = new Array();
528                  var data = '';                  var data = '';
529                                                    
                 if ( $('.liste_droite_service').length == 0 ){  
                     $('.list-sel-ser-them').empty();  
                     $('.list-sel-ser-them').append(''+  
                                 '<div class=\'row\'>'+  
                                     '<div class=\'cell1 liste_droite_title list-sel-ser-them-title\'>"._('Service a consulter')."</div>'+  
                                     '<div class=\'cell2 liste_droite_title list-sel-ser-them-title\'>"._('Version papier')."</div>'+  
                                 '</div>') ;  
                 }  
                   
530                  $('.liste_gauche_service_selected').each(                  $('.liste_gauche_service_selected').each(
531                      function(i) {                      function(i) {
532                                                    
533                          var id = $(this).attr('id');                          var id = $(this).attr('id');
                         data += ';' + id.split('_')[1] + '_' + id.split('_')[2] ;  
534                                                    
535                          if ( !$(this).is(':visible') )                          if ( $.inArray(id.split('_')[1], listServ) != -1 )                            
536                              return;                              return;
537                                                    
538                          if ( listServ.length > 0 && listServ.indexOf(id.split('_')[1]) != -1 )                          data += ';' + id.split('_')[1] + '_' + id.split('_')[2] ;
                             return;  
539                          listServ[i] = id.split('_')[1];                          listServ[i] = id.split('_')[1];
540                                                    
                           
541                          $('.list-sel-ser-them').append(                          $('.list-sel-ser-them').append(
542                              '<div id=\'s' + i + '\' class=\'row liste_droite_service\'>'+                              '<div id=\'s' + i + '\' class=\'row liste_droite_service\'>'+
543                                  '<div class=\'cell1\'>'+                                  '<div class=\'cell1\'>'+
# Line 555  Line 559 
559                                                    
560                      }                      }
561                  );                  );
   
562                  changeActionVal(data);                  changeActionVal(data);
563              }              }
564          </script>";          </script>";

Legend:
Removed from v.606  
changed lines
  Added in v.956

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26