/[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 1357 by fmichon, Mon Mar 11 14:20:48 2013 UTC revision 1404 by nhaye, Thu Mar 14 16:14:04 2013 UTC
# Line 124  function changeDemandeTypeDataSelect(){ Line 124  function changeDemandeTypeDataSelect(){
124    
125      // Récupération de la liste des paramètres de l'url      // Récupération de la liste des paramètres de l'url
126      var params = extractUrlParams();      var params = extractUrlParams();
127        if ( typeof params['idx_dossier'] === "undefined" ){
128            params['idx_dossier'] = '';
129        }
130    
131      link = "../app/listDemandeType.php?idx=" + params['idx_dossier'] + "datd = "+ id_datd;      link = "../app/listDemandeType.php?idx=" + params['idx_dossier'] + "&datd="+ id_datd;
132    
133      var val_tableName = $('#demande_type').val();      var val_tableName = $('#demande_type').val();
134      $.ajax({      $.ajax({
# Line 137  function changeDemandeTypeDataSelect(){ Line 140  function changeDemandeTypeDataSelect(){
140              $('#demande_type').empty();              $('#demande_type').empty();
141              var selected = "";              var selected = "";
142    
             if(val_tableName == "") {  
                 selected=' selected="selected"';  
             }  
   
143              for ( j=0 ; j < res[0].length ; j++ ){              for ( j=0 ; j < res[0].length ; j++ ){
144    
                 if(val_tableName == "") {  
                     selected=' selected="selected"';  
                 }  
145                  $('#demande_type').append(                  $('#demande_type').append(
146                      '<option value="'+res[0][j]+'"'+selected+' >'+res[1][j]+'</option>'                      '<option value="'+res[0][j]+'"'+selected+' >'+res[1][j]+'</option>'
147                  );                  );
148                                    
149              }              }
150                $('#demande_type').val(val_tableName);
151          },          },
152          async: false          async: false
153      });      });
# Line 208  function tmpUpload(champ) { Line 205  function tmpUpload(champ) {
205  function dossierads_d(debut)  function dossierads_d(debut)
206  {  {
207  //if(fenetreouverte==true)  //if(fenetreouverte==true)
208  window.location="../pdf/pdfetat.php?obj=dossier_ads_d&nature="  window.location="../pdf/pdfetat.php?obj=registre_dossiers_decisions_par_type_par_date&nature="
209  +document.f1.nature.value+"&idx=demo&datedebut="  +document.f1.nature.value+"&idx=demo&datedebut="
210  +document.f1.datedebut.value+"&datefin="+document.f1.datefin.value;  +document.f1.datedebut.value+"&datefin="+document.f1.datefin.value;
211  }  }
# Line 244  function dossier_reglementaire(){ Line 241  function dossier_reglementaire(){
241                                    
242                  $("#msg .message").addClass("ui-state-valid");                  $("#msg .message").addClass("ui-state-valid");
243                  $("#msg .text").html("PDF affiche avec succes !");                  $("#msg .text").html("PDF affiche avec succes !");
244                  window.open("../pdf/pdfetat.php?obj=dossier_m&idx=demo");                  window.open("../pdf/pdfetat.php?obj=registre_dossiers_affichage_reglementaire&idx=demo");
245              }              }
246          },          },
247          async: false          async: false
# Line 272  function widget_recherche_dossier(data,n Line 269  function widget_recherche_dossier(data,n
269  function dossierdepot()  function dossierdepot()
270  {  {
271  //if(fenetreouverte==true)  //if(fenetreouverte==true)
272      window.location="../pdf/pdfetat.php?obj=dossier_depot&nature="+      window.location="../pdf/pdfetat.php?obj=registre_dossiers_depots_par_type_par_date&nature="+
273      document.f1.nature.value+"&idx=demo&datedebut="+      document.f1.nature.value+"&idx=demo&datedebut="+
274      document.f1.datedebut.value+"&datefin="+document.f1.datefin.value;      document.f1.datedebut.value+"&datefin="+document.f1.datefin.value;
275  }  }
# Line 280  function dossierdepot() Line 277  function dossierdepot()
277  function dossierads()  function dossierads()
278  {  {
279  //if(fenetreouverte==true)  //if(fenetreouverte==true)
280      window.location="../pdf/pdfetat.php?obj=dossier_ads&nature="+      window.location="../pdf/pdfetat.php?obj=registre_dossiers_par_type_par_date&nature="+
281      document.f1.nature.value+"&idx=demo&datedebut="+      document.f1.nature.value+"&idx=demo&datedebut="+
282      document.f1.datedebut.value+"&datefin="+document.f1.datefin.value;      document.f1.datedebut.value+"&datefin="+document.f1.datefin.value;
283  }  }
# Line 607  $(function() { Line 604  $(function() {
604      });      });
605    
606      url = document.location + "" ;      url = document.location + "" ;
607      if (url.indexOf("form.php?obj=demande&") != -1      if ((
608            url.indexOf("form.php?obj=demande&") != -1 ||
609            url.indexOf("form.php?obj=dossier&") != -1 ||
610            url.indexOf("form.php?obj=dossier_instruction&") != -1
611            )
612          && url.indexOf("&action=3") == -1) {          && url.indexOf("&action=3") == -1) {
613    
614          formatFieldReferenceCadastrale();          formatFieldReferenceCadastrale();
# Line 641  $(function() { Line 642  $(function() {
642      }      }
643            
644      // Modification de demande      // Modification de demande
645      if ((url.indexOf("form.php?obj=demande&") != -1      if (
646          || url.indexOf("form.php?obj=demande_nouveau_dossier&") != -1          (
647          || url.indexOf("form.php?obj=demande_dossier_existant&") != -1)              url.indexOf("form.php?obj=demande&") != -1
648          && url.indexOf("&action") == -1 ){              || url.indexOf("form.php?obj=demande_nouveau_dossier&") != -1
649                        || url.indexOf("form.php?obj=demande_dossier_existant&") != -1
650            )
651            && url.indexOf("&action") == -1
652        ){
653    
654          formatFieldReferenceCadastrale();          formatFieldReferenceCadastrale();
655      }      }
656            
# Line 653  $(function() { Line 658  $(function() {
658      $( "#tabs" ).tabs();      $( "#tabs" ).tabs();
659                
660      // Affichage du tableau des dossier_commission au clique      // Affichage du tableau des dossier_commission au clique
661      $("#dossier_commission").click(function() {      $("#dossier_planifie").click(function() {
662                    
663          var params = extractUrlParams();          var params = extractUrlParams();
664          idx = params['idx'];          idx = params['idx'];
# Line 1170  function addNewFieldReferencesCadastrale Line 1175  function addNewFieldReferencesCadastrale
1175          '</div>';          '</div>';
1176            
1177      url = document.location + "";      url = document.location + "";
1178      if(getDemandeInfo('nature') == 'NOUV' && $(".form-is-valid").size() == 0 && url.indexOf('action=3') == -1 ) {      if((getDemandeInfo('nature') == 'NOUV' || getDemandeInfo('nature') == 'NONE' ) && $(".form-is-valid").size() == 0 && url.indexOf('action=3') == -1 ) {
1179          html += '<div class="field field-type-text" id="morelineReferenceCadastrale">' +          html += '<div class="field field-type-text" id="morelineReferenceCadastrale">' +
1180              '<div class="form-libelle"></div>' +              '<div class="form-libelle"></div>' +
1181              '<div class="form-content">' +              '<div class="form-content">' +
# Line 1182  function addNewFieldReferencesCadastrale Line 1187  function addNewFieldReferencesCadastrale
1187      $('.references_cadastrales_new_field').remove();      $('.references_cadastrales_new_field').remove();
1188      $('.moreFieldReferenceCadastrale').remove();      $('.moreFieldReferenceCadastrale').remove();
1189      $('#morelineReferenceCadastrale').remove();      $('#morelineReferenceCadastrale').remove();
1190      $('.localisation .fieldsetContent').prepend(      $('#terrain_references_cadastrales').parent().parent().before(
1191         html          html
1192     );      );
     
1193  }  }
1194    
1195  function addButtonCadastraleAdesse(){  function addButtonCadastraleAdesse(){
# Line 1217  function hiddenSeparatorField(){ Line 1221  function hiddenSeparatorField(){
1221  function getDemandeInfo(info) {  function getDemandeInfo(info) {
1222      var id_demande_type = $('#demande_type').val();      var id_demande_type = $('#demande_type').val();
1223      var res = "";      var res = "";
1224      $.ajax({      if ( typeof id_demande_type !== "undefined" ){
1225                  type: "GET",          $.ajax({
1226                  url: "../app/getDemandeInfo.php?iddemandetype=" + id_demande_type              type: "GET",
1227                          + "&info=" + info,              url: "../app/getDemandeInfo.php?iddemandetype=" + id_demande_type
1228                  cache: false,                      + "&info=" + info,
1229                  async: false,              cache: false,
1230                  success: function(val){              async: false,
1231                      res = val;              success: function(val){
1232                  }                  res = val;
1233              });              }
1234            });
1235        }
1236        else {
1237            
1238            res = "NONE"
1239        }
1240      return res;      return res;
1241  }  }
1242  /*  /*
# Line 1247  function fieldReferenceCadastraleBase(){ Line 1257  function fieldReferenceCadastraleBase(){
1257                  'placeholder="Quart." ';                  'placeholder="Quart." ';
1258                                    
1259      // désactivation des champs de référence cadastrale      // désactivation des champs de référence cadastrale
1260      if(type != 'NOUV' || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) {      if( (type != 'NOUV' &&  type != 'NONE') || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) {
1261          reference_cadastrale += 'disabled="disabled" ';          reference_cadastrale += 'disabled="disabled" ';
1262      }      }
1263            
# Line 1261  function fieldReferenceCadastraleBase(){ Line 1271  function fieldReferenceCadastraleBase(){
1271                  'placeholder="Sect." ';                  'placeholder="Sect." ';
1272            
1273      // désactivation des champs de référence cadastrale      // désactivation des champs de référence cadastrale
1274      if(type != 'NOUV' || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) {      if((type != 'NOUV'&&  type != 'NONE') || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) {
1275          reference_cadastrale += 'disabled="disabled" ';          reference_cadastrale += 'disabled="disabled" ';
1276      }      }
1277            
# Line 1276  function fieldReferenceCadastraleBase(){ Line 1286  function fieldReferenceCadastraleBase(){
1286                  'placeholder="Parc." ';                  'placeholder="Parc." ';
1287            
1288      // désactivation des champs de référence cadastrale      // désactivation des champs de référence cadastrale
1289      if(type != 'NOUV' || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) {      if((type != 'NOUV'&&  type != 'NONE') || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) {
1290          reference_cadastrale += 'disabled="disabled" ';          reference_cadastrale += 'disabled="disabled" ';
1291      }      }
1292            
# Line 1288  function fieldReferenceCadastraleBase(){ Line 1298  function fieldReferenceCadastraleBase(){
1298    
1299      // Si form validé pas de bouton      // Si form validé pas de bouton
1300      url = document.location + "";      url = document.location + "";
1301      if( type == 'NOUV' && $("form[name=f1] .form-is-valid").size() == 0 && url.indexOf('action=3') == -1 ) {      if( (type == 'NOUV' ||  type == 'NONE') && $("form[name=f1] .form-is-valid").size() == 0 && url.indexOf('action=3') == -1 ) {
1302    
1303          reference_cadastrale +=          reference_cadastrale +=
1304              '<span class="om-form-button add-16" title="Ajouter">ajouter d\'autres champs</span>';              '<span class="om-form-button add-16" title="Ajouter">ajouter d\'autres champs</span>';
# Line 1380  function showFormsDemande(){ Line 1390  function showFormsDemande(){
1390      Action au clique sur le bouton " + ajouter d'autres champs"      Action au clique sur le bouton " + ajouter d'autres champs"
1391   * */   * */
1392  function newInputReferenceCadastrale(){  function newInputReferenceCadastrale(){
1393        
1394        // Champs désactivé si le formulaire a été validé et est valide
1395        var type = getDemandeInfo('nature');
1396        var reference_cadastrale_disabled = '';
1397        if((type != 'NOUV'&&  type != 'NONE') || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) {
1398            reference_cadastrale_disabled = 'disabled="disabled" ';
1399        }
1400        
1401      return '<input ' +      return '<input ' +
1402              'class="champFormulaire reference_cadastrale_custom_field" ' +              'class="champFormulaire reference_cadastrale_custom_field" ' +
1403              'type="text" ' +              'type="text" ' +
# Line 1387  function newInputReferenceCadastrale(){ Line 1405  function newInputReferenceCadastrale(){
1405              'size="3" ' +              'size="3" ' +
1406              'value="" ' +              'value="" ' +
1407              'placeholder="Sep." ' +              'placeholder="Sep." ' +
1408                reference_cadastrale_disabled +
1409              'onchange="testSeparator(this);"/>' +              'onchange="testSeparator(this);"/>' +
1410          '<input ' +          '<input ' +
1411              'class="champFormulaire reference_cadastrale_custom_field" ' +              'class="champFormulaire reference_cadastrale_custom_field" ' +
# Line 1395  function newInputReferenceCadastrale(){ Line 1414  function newInputReferenceCadastrale(){
1414              'maxlength="4" ' +              'maxlength="4" ' +
1415              'size="4" ' +              'size="4" ' +
1416              'placeholder="Parc." ' +              'placeholder="Parc." ' +
1417                reference_cadastrale_disabled +
1418              'value="" />';              'value="" />';
1419  }  }
1420    
# Line 1677  function updateCommission(id, container) Line 1697  function updateCommission(id, container)
1697      if ( res == 1 ){      if ( res == 1 ){
1698                    
1699          $(container + ' .message').addClass("ui-state-ok");          $(container + ' .message').addClass("ui-state-ok");
1700          $(container + ' .message .text').html("Mise à jour réalisé avec succès.");          $(container + ' .message .text').html("Mise à jour réalisée avec succès.");
1701      }      }
1702      //Une erreur s'est produite      //Une erreur s'est produite
1703      else {      else {
# Line 1686  function updateCommission(id, container) Line 1706  function updateCommission(id, container)
1706          $(container + ' .message .text').html("Une erreur s'est produite la mise à jour de la commission. " +          $(container + ' .message .text').html("Une erreur s'est produite la mise à jour de la commission. " +
1707              "Veuillez contacter votre administrateur");              "Veuillez contacter votre administrateur");
1708      }      }
1709    }
1710    
1711    
1712    //Récupère les données du type de commission et les mets dans les champs
1713    function chargeDonneesCommissionType(id_commission_type){
1714    
1715        //Requête ajax de récupération des données
1716        $.ajax({
1717            type: "GET",
1718            url: "../app/getCommissionTypeInfo.php?idx=" + id_commission_type,
1719            dataType: "json",
1720            async: false,
1721            success: function(data){
1722    
1723                // Ajout des données dans les champs
1724                $('#libelle').val(data.libelle);
1725                $('#lieu_adresse_ligne1').val(data.lieu_adresse_ligne1);
1726                $('#lieu_adresse_ligne2').val(data.lieu_adresse_ligne2);
1727                $('#lieu_salle').val(data.lieu_salle);
1728                $('#listes_de_diffusion').val(data.listes_de_diffusion);
1729                $('#participants').val(data.participants);
1730            }
1731        });
1732  }  }

Legend:
Removed from v.1357  
changed lines
  Added in v.1404

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26