/[openfoncier]/trunk/app/js/script.js
ViewVC logotype

Diff of /trunk/app/js/script.js

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

revision 1060 by vpihour, Thu Dec 13 16:51:05 2012 UTC revision 1084 by vpihour, Mon Dec 17 17:14:59 2012 UTC
# Line 58  function VerifNumdec(champ) { Line 58  function VerifNumdec(champ) {
58            
59  }  }
60  // Ce widget permet de charger les données d'un select en ajax  // Ce widget permet de charger les données d'un select en ajax
61  function changeDataSelect(tn, ds, joker){  function changeDataSelect(tableName, linkedField, joker){
62                var id_dossierAutorisation = $("#dossier_autorisation").val();
63      var id = $("#"+ds).val();      var id = $("#"+linkedField).val();
64      link = "../app/listData.php?idx=" + id + "&tn=" + tn + "&ds=" + ds;      link = "../app/listData.php?idx=" + id + "&tableName=" + tableName +
65      var val_tn = $('#'+tn).val();              "&linkedField=" + linkedField ;
66        if(id_dossierAutorisation != "") {
67            link += "&nature=EXIST";
68        }
69        var val_tableName = $('#'+tableName).val();
70      $.ajax({      $.ajax({
71          type: "GET",          type: "GET",
72          url: link,          url: link,
# Line 70  function changeDataSelect(tn, ds, joker) Line 74  function changeDataSelect(tn, ds, joker)
74          dataType: "json",          dataType: "json",
75          success: function(html){          success: function(html){
76                            
77              $('#'+tn).empty();              $('#'+tableName).empty();
78              var selected = "";              var selected = "";
79              if(val_tn == "") {              if(val_tableName == "") {
80                  selected=' selected="selected"';                  selected=' selected="selected"';
81              }              }
82              if ( joker == true )              if ( joker == true )
83                  $('#'+tn).append(                  $('#'+tableName).append(
84                      '<option value=""'+selected+'>*</option>'                      '<option value=""'+selected+'>*</option>'
85                  );                  );
86              else {              else {
87                  $('#'+tn).append(                  $('#'+tableName).append(
88                      '<option value=""'+selected+'>Choisir ' + tn + '</option>'                      '<option value=""'+selected+'>Choisir ' + tableName + '</option>'
89                  );                  );
90              }              }
91              if ( html !== '' ){              if ( html !== '' ){
# Line 91  function changeDataSelect(tn, ds, joker) Line 95  function changeDataSelect(tn, ds, joker)
95                                            
96                      html_temp = html[i].split('_');                      html_temp = html[i].split('_');
97                      selected = "";                      selected = "";
98                      if(val_tn == html_temp[0]) {                      if(val_tableName == html_temp[0]) {
99                          selected=' selected="selected"';                          selected=' selected="selected"';
100                      }                      }
101                      $('#'+tn).append(                      $('#'+tableName).append(
102                          '<option value="'+html_temp[0]+'"'+selected+' >'+html_temp[1]+'</option>'                          '<option value="'+html_temp[0]+'"'+selected+' >'+html_temp[1]+'</option>'
103                      );                      );
104                                            
# Line 147  window.location="../pdf/pdfetat.php?obj= Line 151  window.location="../pdf/pdfetat.php?obj=
151  +document.f1.datedebut.value+"&datefin="+document.f1.datefin.value;  +document.f1.datedebut.value+"&datefin="+document.f1.datefin.value;
152  }  }
153  //  //
154  function dossier_m(){  function dossier_reglementaire(){
155  window.location="../pdf/pdfetat.php?obj=dossier_m&idx=demo";        
156  /*Requete AJAX vers le fichier edition_m.php pour mettre à jour les dossiers*/      $('#bouton-PDF').remove();
157  $.ajax({      $("#msg").html(msg_loading);
158      type: "GET",          
159      url: "../app/edition_m.php?update",      /*Requete AJAX vers le fichier edition_reglementaire.php pour mettre à jour les dossiers*/
160      cache: false,      $.ajax({
161      success: function(html){          type: "GET",
162          if ( html.length > 2 ){          url: "../app/edition_reglementaire.php?update",
163            cache: false,
164            success: function(html){
165                            
166              alert(html);              $('#msg').html(
167          }                  '<div class="message ui-widget ui-corner-all ui-state-highlight">'+
168      },                      '<p>'+
169      async: false                          '<span class="ui-icon ui-icon-info"></span>'+
170  });                          '<span class="text">'+
171                            '</span>'+
172                        '</p>'+
173                    '</div>'
174                );
175                
176                if ( html.length > 2 ){
177                    
178                    $("#msg .message").addClass("ui-state-error");
179                    $("#msg .text").html(html);
180                }
181                else {
182                    
183                    $("#msg .message").addClass("ui-state-valid");
184                    $("#msg .text").html("PDF affiche avec succes !");
185                    window.open("../pdf/pdfetat.php?obj=dossier_m&idx=demo");
186                }
187            },
188            async: false
189        });
190  }  }
191  //  //
192  function dossierdepot()  function dossierdepot()
# Line 394  function editDemandeur(obj,id,type,id_cs Line 419  function editDemandeur(obj,id,type,id_cs
419   **/   **/
420  function replaceDemandeur(obj) {  function replaceDemandeur(obj) {
421      var new_demandeur=$('#id_retour').val();      var new_demandeur=$('#id_retour').val();
422      $.ajax({      if($.isNumeric(new_demandeur)) {
423          type: "GET",          $.ajax({
424          url: '../app/afficher_synthese_demandeur.view.php?iddemandeur='+new_demandeur+'&type='+obj.type,              type: "GET",
425          cache: false,              url: '../app/afficher_synthese_demandeur.view.php?iddemandeur='+new_demandeur+'&type='+obj.type,
426          success: function(html){              cache: false,
427              $(obj.id_css).replaceWith(html);              success: function(html){
428          }                  $(obj.id_css).replaceWith(html);
429      });              }
430            });
431        }
432  }  }
433  /**  /**
434   * Function permettant de remplacer un contenu déjà existant   * Function permettant de remplacer un contenu déjà existant
# Line 1122  function showFormsDemande(){ Line 1149  function showFormsDemande(){
1149          if($('input[name=delegataire]').size() != -1) {          if($('input[name=delegataire]').size() != -1) {
1150              removeDemandeur("delegataire_" + $('input[name=delegataire]').val());              removeDemandeur("delegataire_" + $('input[name=delegataire]').val());
1151          }          }
1152          $('input[name=petitionnaire]').each(function(){  
1153            $('#listePetitionnaires input.demandeur_id').each(function(){
1154              if($(this).size() != -1) {              if($(this).size() != -1) {
1155                  removeDemandeur("petitionnaire" + $(this).val());  
1156                    removeDemandeur("petitionnaire_" + $(this).val());
1157              }              }
1158          });          });
1159      }      }

Legend:
Removed from v.1060  
changed lines
  Added in v.1084

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26