/[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 572 by vpihour, Wed Oct 31 15:34:17 2012 UTC revision 576 by vpihour, Fri Nov 2 10:09:06 2012 UTC
# Line 238  Line 238 
238                                              echo '</ul>';                                              echo '</ul>';
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\'>';
242                                                    echo '<div class=\'cell1 liste_gauche_them\' id=\'list-sel-ser-them-title\'>'._('Service à consulter').'</div>';
243                                                    echo '<div class=\'cell2 liste_gauche_them\' id=\'list-sel-ser-them-title\'>'._('Version papier').'</div>';
244                                                echo '</div>';
245                                          echo '</div>';                                          echo '</div>';
246                                      echo '</div>';                                      echo '</div>';
247                                      /* -- FIN --*/                                      /* -- FIN --*/
# Line 262  Line 266 
266                  echo '</div>';                  echo '</div>';
267                  echo '<div class="formControls">';                  echo '<div class="formControls">';
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="ajaxIt(\'consultation\', \'../app/consultation_multiple.php\');"                            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">';                            role="button" aria-disabled="false" 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=\');"
# Line 283  Line 287 
287                      function(){                      function(){
288                                                    
289                          var id = $(this).attr('id').split('_')[1];                          var id = $(this).attr('id').split('_')[1];
290                            var numSer = 0;
291                            var numSerWithClass = 0;
292                            
293                          $('.list-ser-them div').each(                          $('.list-ser-them div').each(
294                              function() {                              function() {
295                                            
296                                    if ( $(this).attr('id').indexOf('them') == -1 &&
297                                         $(this).attr('id').indexOf(id) == 0  &&
298                                         $(this).hasClass('liste_gauche_service_selected') )
299                                        
300                                         numSerWithClass++;                                    
301                                                                    
302                                  if ( $(this).attr('id').indexOf('them') == -1 &&                                  if ( $(this).attr('id').indexOf('them') == -1 &&
303                                       $(this).attr('id').indexOf(id) == 0 ){                                       $(this).attr('id').indexOf(id) == 0  )
304                                      $(this).toggleClass('liste_gauche_service_selected');                                      
305                                  }                                      numSer++;
306                              }                              }
307                          );                          );
308                            
309                            if ( numSerWithClass < numSer && numSerWithClass >= 0 ){
310                            
311                                 $('.list-ser-them div').each(
312                                    function() {
313                                        
314                                        if ( $(this).attr('id').indexOf('them') == -1 &&
315                                         $(this).attr('id').indexOf(id) == 0 &&
316                                         !$(this).hasClass('liste_gauche_service_selected') )
317                                        
318                                            $(this).addClass('liste_gauche_service_selected');
319                                    }
320                                );
321                            }
322                            
323                            else {
324                                
325                                $('.list-ser-them div').each(
326                                    function() {
327                                        
328                                       if ( $(this).attr('id').indexOf('them') == -1 &&
329                                        $(this).attr('id').indexOf(id) == 0  &&
330                                        $(this).hasClass('liste_gauche_service_selected') )
331                                        
332                                           $(this).removeClass('liste_gauche_service_selected');
333                                    }
334                               );
335                            }
336                      }                      }
337                  );                  );
338                                    
# Line 309  Line 350 
350                  */                  */
351                  $('.field-ser-them').on(                  $('.field-ser-them').on(
352                      'click',                      'click',
353                      '.liste_droite_service',                      '.cell1',
354                      function(){                      function(){
355                          $(this).toggleClass('liste_droite_service_selected');                          $(this).parent().toggleClass('liste_droite_service_selected');
356                      }                      }
357                  );                  );
358                                    
# Line 344  Line 385 
385                                                                    
386                                  var id = $(this).attr('id');                                  var id = $(this).attr('id');
387                                                                    
                                   
388                                  if ( listServ.length > 0 && listServ.indexOf(id.split('_')[1]) != -1 )                                  if ( listServ.length > 0 && listServ.indexOf(id.split('_')[1]) != -1 )
389                                      return;                                      return;
390                                  listServ[i] = id.split('_')[1];                                  listServ[i] = id.split('_')[1];
# Line 427  Line 467 
467                  );                  );
468              }              }
469                            
470                /*
471                    Change les actions qui sont réalisées lors de la soumission du formulaire
472                */
473              function changeActionVal(data){              function changeActionVal(data){
474                  date = $('#date_envoi').val();                  date = $('#date_envoi').val();
475                                    
476                  $('#form_val').attr(                  $('#form_val').attr(
477                      'onsubmit',                      'onsubmit',
478                      'if ( $(\'.liste_gauche_service_selected\').length > 0 && $(\'#date_envoi\').val() != \'\' ) { messageIt(\'consultation\', \'../app/consultation_multiple.php?obj=$obj&data='+data+'&idx=$idx&date_envoi='+date+'\',true);return false;' +                      'if ( $(\'.liste_gauche_service_selected\').length > 0 && $(\'#date_envoi\').val() != \'\' ) { messageIt(\'consultation\', \'../app/consultation_multiple.php?obj=$obj&data='+data+'&idx=$idx&date_envoi='+date+'\',true);return false;' +
479                      'messageIt(\'consultation\', \'../scr/soustab.php?obj=$obj&retourformulaire=$retourformulaire&idxformulaire=$idx&premier=0&tricol=\',false);} else alert(\'Veuillez choisir une service et une date d envoi\');'                      'messageIt(\'consultation\', \'../scr/soustab.php?obj=$obj&retourformulaire=$retourformulaire&idxformulaire=$idx&premier=0&tricol=\',false);} else alert(\'Veuillez choisir au moins un service et une date d envoi\');'
480                                            
481                  );                  );
482                  $('#button_val').attr(                  $('#button_val').attr(
483                      'onclick',                      'onclick',
484                      'if ( $(\'.liste_gauche_service_selected\').length > 0 && $(\'#date_envoi\').val() != \'\' ) { messageIt(\'consultation\', \'../app/consultation_multiple.php?obj=$obj&data='+data+'&idx=$idx&date_envoi='+date+'\',true);' +                      'if ( $(\'.liste_gauche_service_selected\').length > 0 && $(\'#date_envoi\').val() != \'\' ) { messageIt(\'consultation\', \'../app/consultation_multiple.php?obj=$obj&data='+data+'&idx=$idx&date_envoi='+date+'\',true);' +
485                      'messageIt(\'consultation\', \'../scr/soustab.php?obj=$obj&retourformulaire=$retourformulaire&idxformulaire=$idx&premier=0&tricol=\',false);} else alert(\'Veuillez choisir une service et une date d envoi\');'                      'messageIt(\'consultation\', \'../scr/soustab.php?obj=$obj&retourformulaire=$retourformulaire&idxformulaire=$idx&premier=0&tricol=\',false);} else alert(\'Veuillez choisir au moins un service et une date d envoi\');'
486                                            
487                  );                  );
488              }              }
489                
490                /*
491                    Change les actions qui sont réalisées lors de la soumission du formulaire
492                */
493              function changeOneData( oldData, newData) {              function changeOneData( oldData, newData) {
494                                    
495                  date = $('#date_envoi').val();                  date = $('#date_envoi').val();
# Line 467  Line 513 
513                      $('.list-sel-ser-them').empty();                      $('.list-sel-ser-them').empty();
514                      $('.list-sel-ser-them').append(''+                      $('.list-sel-ser-them').append(''+
515                                  '<div class=\'row\'>'+                                  '<div class=\'row\'>'+
516                                      '<div class=\'cell1\' id=\'list-sel-ser-them-title\'>"._('Service à consulter')."</div>'+                                      '<div class=\'cell1 liste_gauche_them\' id=\'list-sel-ser-them-title\'>"._('Service à consulter')."</div>'+
517                                      '<div class=\'cell2\' id=\'list-sel-ser-them-title\'>"._('Version papier')."</div>'+                                      '<div class=\'cell2 liste_gauche_them\' id=\'list-sel-ser-them-title\'>"._('Version papier')."</div>'+
518                                  '</div>') ;                                  '</div>') ;
519                  }                  }
520                                    

Legend:
Removed from v.572  
changed lines
  Added in v.576

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26