/[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 584 by vpihour, Fri Nov 2 17:15:30 2012 UTC revision 596 by vpihour, Mon Nov 5 14:39:47 2012 UTC
# Line 131  Line 131 
131                      $row['them_lib'].                      $row['them_lib'].
132                  '</div>                  '</div>
133                      <div                      <div
134                          class="liste_gauche_service '.$name.'"                          class="liste_gauche_service t'.$name.'"
135                          id="'.$name.'" >                          id="t'.$name.'" >
136                          '.$row['ser_lib'].'                          '.$row['ser_lib'].'
137                          <input id="'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked' ).'/>                          <input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked="checked"' ).'/>
138                      </div>                      </div>
139                  ';                  ';
140              }              }
# Line 144  Line 144 
144                                    
145                  $liste_gauche .= '                  $liste_gauche .= '
146                      <div                      <div
147                          class="liste_gauche_service '.$name.'"                          class="liste_gauche_service t'.$name.'"
148                          id="'.$name.'" >                          id="t'.$name.'" >
149                          '.$row['ser_lib'].'                          '.$row['ser_lib'].'
150                          <input id="'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked' ).'/>                          <input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked="checked"' ).'/>
151                      </div>                      </div>
152                  ';                  ';
153              }              }
# Line 184  Line 184 
184                      (($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '0' : '1' ).'_';                      (($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '0' : '1' ).'_';
185              $liste_gauche .= '              $liste_gauche .= '
186                  <div                  <div
187                      class="liste_gauche_service '.$name.'"                      class="liste_gauche_service t'.$name.'"
188                      id="'.$name.'" >                      id="t'.$name.'" >
189                      '.$row['libelle'].'&nbsp;                      '.$row['libelle'].'&nbsp;
190                      <input id="'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked' ).'/>                      <input class="t'.$name.'" type="checkbox" '.(($row['consultation_papier'] == '' || $row['consultation_papier'] == FALSE ) ? '' : 'checked="checked"' ).'/>
191                  </div>                  </div>
192              ';              ';
193          }          }
# Line 204  Line 204 
204              echo '<form onsubmit="ajaxIt(\'consultation\', \'../app/consultation_multiple.php\');return false;"              echo '<form onsubmit="ajaxIt(\'consultation\', \'../app/consultation_multiple.php\');return false;"
205                    method="get" action="" name="f2" id="form_val">';                    method="get" action="" name="f2" id="form_val">';
206                  echo '<div class="formEntete ui-corner-all">';                  echo '<div class="formEntete ui-corner-all">';
207                      echo "<div id='form-content'>";                      echo "<div>";
208                          echo '<div class="bloc">';                          echo '<div class="bloc">';
209                              echo "<fieldset class='cadre ui-corner-all ui-widget-content'>\n";                              echo "<fieldset class='cadre ui-corner-all ui-widget-content'>\n";
210                                  echo "\t<legend class='ui-corner-all ui-widget-content ui-state-active'>".                                  echo "\t<legend class='ui-corner-all ui-widget-content ui-state-active'>".
# Line 218  Line 218 
218                                              echo '</label>';                                              echo '</label>';
219                                          echo '</div>';                                          echo '</div>';
220                                          echo '<div class="form-content">';                                          echo '<div class="form-content">';
221                                              echo '<input id="dossier" class="champFormulaire" type="hidden" value="'.$idx.'" name="dossier"/>';                                              echo '<input class="champFormulaire" type="hidden" value="'.$idx.'" name="dossier"/>';
222                                              echo $idx;                                              echo $idx;
223                                          echo '</div>';                                          echo '</div>';
224                                      echo '</div>';                                      echo '</div>';
# Line 239  Line 239 
239                                          echo '</div>';                                          echo '</div>';
240                                          echo '<div class="list-sel-ser-them">';                                          echo '<div class="list-sel-ser-them">';
241                                              echo '<div class=\'row\'>';                                              echo '<div class=\'row\'>';
242                                                  echo '<div class=\'cell1 liste_gauche_them\' id=\'list-sel-ser-them-title\'>'._('Service a consulter').'</div>';                                                  echo '<div class=\'cell1 liste_droite_title list-sel-ser-them-title\'>'._('Service a consulter').'</div>';
243                                                  echo '<div class=\'cell2 liste_gauche_them\' id=\'list-sel-ser-them-title\'>'._('Version papier').'</div>';                                                  echo '<div class=\'cell2 liste_droite_title list-sel-ser-them-title\'>'._('Version papier').'</div>';
244                                              echo '</div>';                                              echo '</div>';
245                                          echo '</div>';                                          echo '</div>';
246                                      echo '</div>';                                      echo '</div>';
# Line 268  Line 268 
268                      echo '<input class="om-button ui-button ui-widget ui-state-default ui-corner-all"                      echo '<input class="om-button ui-button ui-widget ui-state-default ui-corner-all"
269                            type="button" onclick="if ( $(\'.liste_gauche_service_selected\').length > 0 && $(\'#date_envoi\').val() != \'\' ) { ajaxIt(\'consultation\', \'../app/consultation_multiple.php\'); } else alert(\'Veuillez choisir au moins un service et une date d envoi\');"                            type="button" onclick="if ( $(\'.liste_gauche_service_selected\').length > 0 && $(\'#date_envoi\').val() != \'\' ) { ajaxIt(\'consultation\', \'../app/consultation_multiple.php\'); } else alert(\'Veuillez choisir au moins un service et une date d envoi\');"
270                            value="Ajouter le(s) enregistrement(s) de la table : \'Consultation\'"                            value="Ajouter le(s) enregistrement(s) de la table : \'Consultation\'"
271                            role="button" aria-disabled="false" id="button_val">';                            id="button_val">';
272                      echo '<a class="retour" onclick="ajaxIt(\'consultation\', \'../scr/soustab.php?obj='.$obj.'&retourformulaire='.$retourformulaire.'&idxformulaire='.$idx.'&premier=0&tricol=\');"                      echo '<a class="retour" onclick="ajaxIt(\'consultation\', \'../scr/soustab.php?obj='.$obj.'&retourformulaire='.$retourformulaire.'&idxformulaire='.$idx.'&premier=0&tricol=\');"
273                            href="#">';                            href="#">';
274                         echo 'Retour';                         echo 'Retour';
# Line 280  Line 280 
280          echo "          echo "
281          <script language='javascript' type='text/javascript'>          <script language='javascript' type='text/javascript'>
282              $(function(){              $(function(){
283                    
284                  /*                  /*
285                      Sélectionne tous les services d'un thème au clique sur celui ci.                      Sélectionne tous les services d'un thème au clique sur celui ci.
286                  */                  */
# Line 294  Line 295 
295                              function() {                              function() {
296                                                                                    
297                                  if ( $(this).attr('id').indexOf('them') == -1 &&                                  if ( $(this).attr('id').indexOf('them') == -1 &&
298                                       $(this).attr('id').indexOf(id) == 0  &&                                       $(this).attr('id').indexOf(id) == 1  &&
299                                       $(this).hasClass('liste_gauche_service_selected') )                                       $(this).hasClass('liste_gauche_service_selected') )
300                                                                            
301                                       numSerWithClass++;                                                                           numSerWithClass++;                                    
302                                                                    
303                                  if ( $(this).attr('id').indexOf('them') == -1 &&                                  if ( $(this).attr('id').indexOf('them') == -1 &&
304                                       $(this).attr('id').indexOf(id) == 0  )                                       $(this).attr('id').indexOf(id) == 1  )
305                                                                            
306                                      numSer++;                                      numSer++;
307                              }                              }
# Line 312  Line 313 
313                                  function() {                                  function() {
314                                                                            
315                                      if ( $(this).attr('id').indexOf('them') == -1 &&                                      if ( $(this).attr('id').indexOf('them') == -1 &&
316                                       $(this).attr('id').indexOf(id) == 0 &&                                       $(this).attr('id').indexOf(id) == 1 &&
317                                       !$(this).hasClass('liste_gauche_service_selected') )                                       !$(this).hasClass('liste_gauche_service_selected') )
318                                                                            
319                                          $(this).addClass('liste_gauche_service_selected');                                          $(this).addClass('liste_gauche_service_selected');
# Line 326  Line 327 
327                                  function() {                                  function() {
328                                                                            
329                                     if ( $(this).attr('id').indexOf('them') == -1 &&                                     if ( $(this).attr('id').indexOf('them') == -1 &&
330                                      $(this).attr('id').indexOf(id) == 0  &&                                      $(this).attr('id').indexOf(id) == 1  &&
331                                      $(this).hasClass('liste_gauche_service_selected') )                                      $(this).hasClass('liste_gauche_service_selected') )
332                                                                            
333                                         $(this).removeClass('liste_gauche_service_selected');                                         $(this).removeClass('liste_gauche_service_selected');
# Line 352  Line 353 
353                      'click',                      'click',
354                      '.cell1',                      '.cell1',
355                      function(){                      function(){
356                          $(this).parent().toggleClass('liste_droite_service_selected');                          if ( !$(this).hasClass('liste_droite_title') )
357                                $(this).parent().toggleClass('liste_droite_service_selected');
358                      }                      }
359                  );                  );
360                                    
# Line 361  Line 363 
363                      'input[type=checkbox]',                      'input[type=checkbox]',
364                      function(){                      function(){
365                                                    
366                          old_id = $(this).attr('id');                          old_id = $(this).attr('class');
367                                                    
368                          tab_don = old_id.split('_');                          tab_don = old_id.split('_');
369                                                    
370                          new_id = tab_don[0] + '_' + tab_don[1] + '_' + ((tab_don[2] == 0 ) ? 1 : 0 ) + '_';                          new_id = tab_don[0] + '_' + tab_don[1] + '_' + ((tab_don[2] == 0 ) ? 1 : 0 ) + '_';
371    
372                          changeOneData( ';' + tab_don[1] + '_' + tab_don[2], ';' + tab_don[1] + '_' + ((tab_don[2] == 0) ? 1 : 0) );                          changeOneData( ';' + tab_don[1] + '_' + tab_don[2], ';' + tab_don[1] + '_' + ((tab_don[2] == 0) ? 1 : 0) );
373                          $('div[name=\"' + $(this).attr('class') + '\"]').attr('id', new_id);                          $('div[class=\"' + old_id + '\"]').attr('class', new_id);
374                          $(this).attr('id', new_id);                          $(this).attr('class', new_id);
375    
376                      }                      }
377                  );                  );
# Line 383  Line 385 
385                          $('.liste_gauche_service_selected').each(                          $('.liste_gauche_service_selected').each(
386                              function(i) {                              function(i) {
387                                                                    
388                                  var id = $(this).attr('id');                                  var name = $(this).attr('name');
389                                                                    
390                                  if ( listServ.length > 0 && listServ.indexOf(id.split('_')[1]) != -1 )                                  if ( listServ.length > 0 && listServ.indexOf(name.split('_')[1]) != -1 )
391                                      return;                                      return;
392                                  listServ[i] = id.split('_')[1];                                  listServ[i] = name.split('_')[1];
393                                  data += ';' + id.split('_')[1] + '_' + id.split('_')[2] ;                                  data += ';' + name.split('_')[1] + '_' + name.split('_')[2] ;
394                                                                    
395                              }                              }
396                          );                          );
# Line 418  Line 420 
420                          $('.liste_droite_service_selected').each(                          $('.liste_droite_service_selected').each(
421                              function() {                              function() {
422                                                                    
423                                  var id = $('#'+ $(this).attr('id') + ' .cell1 div').attr('id');                                  var name = $('#'+ $(this).attr('id') + ' .cell1 div').attr('name');
424                                                                    
425                                  manageListServ('.list-ser-them div', id, 1);                                  manageListServ('.list-ser-them div', name, 1);
426                                  data += ';' + id.split('_')[1] + '_' + id.split('_')[2] ;                                  data += ';' + name.split('_')[1] + '_' + name.split('_')[2] ;
427                                                                    
428                                  $(this).remove();                                  $(this).remove();
429                              }                              }
# Line 443  Line 445 
445              /*              /*
446                  Affiche ou cache un élément qui n'est pas une thématique et dont son identifiant correspond.                  Affiche ou cache un élément qui n'est pas une thématique et dont son identifiant correspond.
447              */              */
448              function manageListServ( objet ,id, type){              function manageListServ( objet , name, type){
449            
450                  $(objet).each(                  $(objet).each(
451                      function() {                      function() {
452                                                    
453                          if ( isNotthemIsOneServ(this, id) ){                          if ( isNotthemIsOneServ(this, name) ){
454                              if ( type == 0 )                              if ( type == 0 )
455                                                            
456                                  $(this).hide() ;                                  $(this).hide() ;
# Line 513  Line 515 
515                      $('.list-sel-ser-them').empty();                      $('.list-sel-ser-them').empty();
516                      $('.list-sel-ser-them').append(''+                      $('.list-sel-ser-them').append(''+
517                                  '<div class=\'row\'>'+                                  '<div class=\'row\'>'+
518                                      '<div class=\'cell1 liste_gauche_them\' id=\'list-sel-ser-them-title\'>"._('Service a consulter')."</div>'+                                      '<div class=\'cell1 liste_droite_title list-sel-ser-them-title\'>"._('Service a consulter')."</div>'+
519                                      '<div class=\'cell2 liste_gauche_them\' id=\'list-sel-ser-them-title\'>"._('Version papier')."</div>'+                                      '<div class=\'cell2 liste_droite_title list-sel-ser-them-title\'>"._('Version papier')."</div>'+
520                                  '</div>') ;                                  '</div>') ;
521                  }                  }
522                                    
# Line 532  Line 534 
534                          data += ';' + id.split('_')[1] + '_' + id.split('_')[2] ;                          data += ';' + id.split('_')[1] + '_' + id.split('_')[2] ;
535                                                    
536                          $('.list-sel-ser-them').append(                          $('.list-sel-ser-them').append(
537                              '<div class=\'row liste_droite_service\' id=\'' + i + '\'>'+                              '<div class=\'row liste_droite_service\'>'+
538                                  '<div class=\'cell1\'>'+                                  '<div class=\'cell1\'>'+
539                                      '<div name=\'' + $(this).attr('id') + '\' id=\'' + $(this).attr('id') + '\'>'+                                      '<div class=\'' + $(this).attr('id') + '\' name=\'' + $(this).attr('id') + '\'>'+
540                                          $(this).html().split('<')[0]+                                          $(this).html().split('<')[0]+
541                                      '</div>'+                                      '</div>'+
542                                  '</div>' +                                  '</div>' +

Legend:
Removed from v.584  
changed lines
  Added in v.596

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26