/[openfoncier]/branches/3.2.x/app/js/script.js
ViewVC logotype

Diff of /branches/3.2.x/app/js/script.js

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

revision 965 by nhaye, Mon Dec 3 14:29:22 2012 UTC revision 971 by nhaye, Mon Dec 3 16:24:27 2012 UTC
# Line 279  function popupIt(objsf, link, width, hei Line 279  function popupIt(objsf, link, width, hei
279              modal: true,              modal: true,
280              width: width,              width: width,
281              height: height,              height: height,
282                position: 'center',
283            });            });
284          },          },
285          async : false          async : false
# Line 356  function afficherDemandeur(id,type) { Line 357  function afficherDemandeur(id,type) {
357          url: '../app/afficher_synthese_demandeur.view.php?iddemandeur='+id+'&type='+type,          url: '../app/afficher_synthese_demandeur.view.php?iddemandeur='+id+'&type='+type,
358          cache: false,          cache: false,
359          success: function(html){          success: function(html){
             alert(html);  
360              $(html).insertBefore('#add_'+type).fadeIn(500);              $(html).insertBefore('#add_'+type).fadeIn(500);
361    
362          },          },
# Line 371  function afficherDemandeur(id,type) { Line 371  function afficherDemandeur(id,type) {
371  function editDemandeur(obj,id,type,id_css) {  function editDemandeur(obj,id,type,id_css) {
372      popupIt(type,      popupIt(type,
373                  '../scr/sousform.php?obj='+obj+'&action=1'+                  '../scr/sousform.php?obj='+obj+'&action=1'+
374                  '&retourformulaire=demande&idx='+id, 780, 500,                  '&retourformulaire=demande&idx='+id, 780, 'auto',
375                  replaceDemandeur, {'type':type,'id': id, 'id_css':id_css});                  replaceDemandeur, {'type':type,'id': id, 'id_css':id_css});
376      affichageBoutonsDemandeurs();      affichageBoutonsDemandeurs();
377  }  }
# Line 405  function removeDemandeur(id) { Line 405  function removeDemandeur(id) {
405   * Fonction permettant d'afficher et cacher les boutons d'ajout de demandeurs   * Fonction permettant d'afficher et cacher les boutons d'ajout de demandeurs
406   */   */
407  function affichageBoutonsDemandeurs(){  function affichageBoutonsDemandeurs(){
408      console.log($('input[name=petitionnaire_principal][type=hidden]').size());      // Affichage du bouton d'ajout du petitionnaire principal
     console.log($('input[name=delegataire][type=hidden]').size());  
409      if($('input[name=petitionnaire_principal][type=hidden]').size() == 1) {      if($('input[name=petitionnaire_principal][type=hidden]').size() == 1) {
410          $('#add_petitionnaire_principal').hide();          $('#add_petitionnaire_principal').hide();
411      } else {      } else {
412          $('#add_petitionnaire_principal').fadeIn(500);          $('#add_petitionnaire_principal').fadeIn(500);
413      }      }
414        // Affichage du bouton d'ajout du delegataire
415      if($('input[name=petitionnaire_principal][type=hidden]').size() == 1      if($('input[name=petitionnaire_principal][type=hidden]').size() == 1
416         || $('input[name=delegataire][type=hidden]').size() == 1) {         || $('input[name=delegataire][type=hidden]').size() == 1) {
417          $('#delegataire').fadeIn(500);          $('#delegataire').fadeIn(500);
# Line 423  function affichageBoutonsDemandeurs(){ Line 423  function affichageBoutonsDemandeurs(){
423      } else {      } else {
424          $('#delegataire').hide();          $('#delegataire').hide();
425      }      }
426        // Affichage du bouton d'ajout de petitionnaires
427      if($('input[name=petitionnaire_principal][type=hidden]').size() == 0) {      if($('input[name=petitionnaire_principal][type=hidden]').size() == 0) {
428          $('#add_petitionnaire').hide();          $('#add_petitionnaire').hide();
429      } else {      } else {
# Line 445  $(function() { Line 446  $(function() {
446      $("#formulaire").on("click","#add_petitionnaire_principal",  function() {      $("#formulaire").on("click","#add_petitionnaire_principal",  function() {
447          popupIt('petitionnaire',          popupIt('petitionnaire',
448                  '../scr/sousform.php?obj=petitionnaire&action=0'+                  '../scr/sousform.php?obj=petitionnaire&action=0'+
449                  '&retourformulaire=demande&principal=true', 780, 500,                  '&retourformulaire=demande&principal=true', 780, 'auto',
450                  getDemandeurId, 'petitionnaire_principal');                  getDemandeurId, 'petitionnaire_principal');
451      });      });
452      // Bind de la fonction permettant l'ajout du délégataire      // Bind de la fonction permettant l'ajout du délégataire
453      $("#formulaire").on("click","#add_delegataire", function(event) {      $("#formulaire").on("click","#add_delegataire", function(event) {
454          popupIt('delegataire',          popupIt('delegataire',
455                  '../scr/sousform.php?obj=delegataire&action=0'+                  '../scr/sousform.php?obj=delegataire&action=0'+
456                  '&retourformulaire=demande', 780, 500,                  '&retourformulaire=demande', 780, 'auto',
457                  getDemandeurId, 'delegataire');                  getDemandeurId, 'delegataire');
458      });      });
459      // Bind de la fonction permettant l'ajout des pétitionnaires      // Bind de la fonction permettant l'ajout des pétitionnaires
460      $("#formulaire").on("click","#add_petitionnaire", function(event) {      $("#formulaire").on("click","#add_petitionnaire", function(event) {
461          popupIt('petitionnaire',          popupIt('petitionnaire',
462                  '../scr/sousform.php?obj=petitionnaire&action=0'+                  '../scr/sousform.php?obj=petitionnaire&action=0'+
463                  '&retourformulaire=demande', 780, 500,                  '&retourformulaire=demande', 780, 'auto',
464                  getDemandeurId, 'petitionnaire');                  getDemandeurId, 'petitionnaire');
465      });      });
466    
# Line 672  function addActionSearchIcon(id){ Line 673  function addActionSearchIcon(id){
673                  url: "../app/findPetitionnaire.php" + donnees ,                  url: "../app/findPetitionnaire.php" + donnees ,
674                  cache: false,                  cache: false,
675                  success: function(obj){                  success: function(obj){
                     console.log($.parseJSON(obj));  
676                      var freq = $.parseJSON(obj);                      var freq = $.parseJSON(obj);
677                      var res='';                      var res='';
678                      /*Si la recherche a donné des résultats*/                      /*Si la recherche a donné des résultats*/

Legend:
Removed from v.965  
changed lines
  Added in v.971

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26