62 |
|
|
63 |
var id = $("#"+ds+" option:selected").val(); |
var id = $("#"+ds+" option:selected").val(); |
64 |
link = "../app/listData.php?idx=" + id + "&tn=" + tn + "&ds=" + ds; |
link = "../app/listData.php?idx=" + id + "&tn=" + tn + "&ds=" + ds; |
65 |
|
var val_tn = $('#'+tn).val(); |
66 |
$.ajax({ |
$.ajax({ |
67 |
type: "GET", |
type: "GET", |
68 |
url: link, |
url: link, |
71 |
success: function(html){ |
success: function(html){ |
72 |
|
|
73 |
$('#'+tn).empty(); |
$('#'+tn).empty(); |
74 |
|
var selected = ""; |
75 |
|
if(val_tn == "") { |
76 |
|
selected=' selected="selected"'; |
77 |
|
} |
78 |
if ( joker == true ) |
if ( joker == true ) |
79 |
$('#'+tn).append( |
$('#'+tn).append( |
80 |
'<option value="" selected="selected">*</option>' |
'<option value=""'+selected+'>*</option>' |
81 |
); |
); |
82 |
else |
else { |
83 |
$('#'+tn).append( |
$('#'+tn).append( |
84 |
'<option value="" selected="selected">Choisir ' + tn + '</option>' |
'<option value=""'+selected+'>Choisir ' + tn + '</option>' |
85 |
); |
); |
86 |
|
} |
87 |
if ( html !== '' ){ |
if ( html !== '' ){ |
88 |
|
|
89 |
html = html.split(';'); |
html = html.split(';'); |
90 |
for ( i = 0 ; i < html.length - 1 ; i++ ){ |
for ( i = 0 ; i < html.length - 1 ; i++ ){ |
91 |
|
|
92 |
html_temp = html[i].split('_'); |
html_temp = html[i].split('_'); |
93 |
|
selected = ""; |
94 |
|
if(val_tn == html_temp[0]) { |
95 |
|
selected=' selected="selected"'; |
96 |
|
} |
97 |
$('#'+tn).append( |
$('#'+tn).append( |
98 |
'<option value="'+html_temp[0]+'" >'+html_temp[1]+'</option>' |
'<option value="'+html_temp[0]+'"'+selected+' >'+html_temp[1]+'</option>' |
99 |
); |
); |
100 |
|
|
101 |
} |
} |
102 |
} |
} |
103 |
}, |
}, |
288 |
modal: true, |
modal: true, |
289 |
width: width, |
width: width, |
290 |
height: height, |
height: height, |
291 |
|
position: 'center', |
292 |
}); |
}); |
293 |
}, |
}, |
294 |
async : false |
async : false |
352 |
function getDemandeurId(type) { |
function getDemandeurId(type) { |
353 |
var id_demandeur=$('#id_retour').val(); |
var id_demandeur=$('#id_retour').val(); |
354 |
if($.isNumeric(id_demandeur)) { |
if($.isNumeric(id_demandeur)) { |
|
if(type != 'petitionnaire') { |
|
|
$('#add_'+type).hide(); |
|
|
} |
|
|
|
|
355 |
afficherDemandeur(id_demandeur,type); |
afficherDemandeur(id_demandeur,type); |
356 |
om_initialize_content(); |
om_initialize_content(); |
357 |
} |
} |
366 |
url: '../app/afficher_synthese_demandeur.view.php?iddemandeur='+id+'&type='+type, |
url: '../app/afficher_synthese_demandeur.view.php?iddemandeur='+id+'&type='+type, |
367 |
cache: false, |
cache: false, |
368 |
success: function(html){ |
success: function(html){ |
369 |
$(html).insertBefore('#add_'+type).fadeIn(500);; |
$(html).insertBefore('#add_'+type).fadeIn(500); |
370 |
} |
|
371 |
|
}, |
372 |
|
async:false |
373 |
}); |
}); |
374 |
|
affichageBoutonsDemandeurs(); |
375 |
} |
} |
376 |
|
|
377 |
/** |
/** |
378 |
* Function permettant de modifier un demandeur |
* Function permettant de modifier un demandeur |
379 |
*/ |
*/ |
380 |
function editDemandeur(id,type,id_css) { |
function editDemandeur(obj,id,type,id_css) { |
381 |
popupIt(type, |
popupIt(type, |
382 |
'../scr/sousform.php?obj='+type+'&action=1'+ |
'../scr/sousform.php?obj='+obj+'&action=1'+ |
383 |
'&retourformulaire=demande&idx='+id, 780, 500, |
'&retourformulaire=demande&idx='+id, 780, 'auto', |
384 |
replaceDemandeur, {'type':type,'id': id, 'id_css':id_css}); |
replaceDemandeur, {'type':type,'id': id, 'id_css':id_css}); |
385 |
changeDemandeurType('qualite'); |
affichageBoutonsDemandeurs(); |
|
addSearchIcon(); |
|
|
addDivDialog('.bloc_demandeur'); |
|
386 |
} |
} |
387 |
|
|
388 |
/** |
/** |
407 |
if(div_class == "delegataire") { |
if(div_class == "delegataire") { |
408 |
$('#add_delegataire').fadeIn(500); |
$('#add_delegataire').fadeIn(500); |
409 |
} |
} |
410 |
if(div_class == "petitionnaire_principal") { |
affichageBoutonsDemandeurs(); |
411 |
|
} |
412 |
|
|
413 |
|
/** |
414 |
|
* Fonction permettant d'afficher et cacher les boutons d'ajout de demandeurs |
415 |
|
*/ |
416 |
|
function affichageBoutonsDemandeurs(){ |
417 |
|
// Affichage du bouton d'ajout du petitionnaire principal |
418 |
|
if($('input[name=petitionnaire_principal][type=hidden]').size() == 1) { |
419 |
|
$('#add_petitionnaire_principal').hide(); |
420 |
|
} else { |
421 |
$('#add_petitionnaire_principal').fadeIn(500); |
$('#add_petitionnaire_principal').fadeIn(500); |
422 |
} |
} |
423 |
|
// Affichage du bouton d'ajout du delegataire |
424 |
|
if($('input[name=petitionnaire_principal][type=hidden]').size() == 1 |
425 |
|
|| $('input[name=delegataire][type=hidden]').size() == 1) { |
426 |
|
$('#delegataire').fadeIn(500); |
427 |
|
if($('input[name=delegataire][type=hidden]').size() == 0) { |
428 |
|
$('#add_delegataire').fadeIn(500); |
429 |
|
} else { |
430 |
|
$('#add_delegataire').hide(); |
431 |
|
} |
432 |
|
} else { |
433 |
|
$('#delegataire').hide(); |
434 |
|
} |
435 |
|
// Affichage du bouton d'ajout de petitionnaires |
436 |
|
if($('input[name=petitionnaire_principal][type=hidden]').size() == 0) { |
437 |
|
$('#add_petitionnaire').hide(); |
438 |
|
} else { |
439 |
|
$('#add_petitionnaire').fadeIn(500); |
440 |
|
} |
441 |
} |
} |
442 |
|
|
443 |
/** |
/** |
450 |
addSearchIcon(); |
addSearchIcon(); |
451 |
addDivDialog('.bloc_demandeur'); |
addDivDialog('.bloc_demandeur'); |
452 |
} |
} |
453 |
if($('input[name=petitionnaire_principal][type=hidden]').size() == 1) { |
affichageBoutonsDemandeurs(); |
|
$('#add_petitionnaire_principal').hide(); |
|
|
} |
|
|
if($('input[name=delegataire][type=hidden]').size() == 1) { |
|
|
$('#add_delegataire').hide(); |
|
|
} |
|
454 |
// Bind de la fonction permettant l'ajout du pétitionnaire principal |
// Bind de la fonction permettant l'ajout du pétitionnaire principal |
455 |
$("#formulaire").on("click","#add_petitionnaire_principal", function() { |
$("#formulaire").on("click","#add_petitionnaire_principal", function() { |
456 |
popupIt('petitionnaire', |
popupIt('petitionnaire', |
457 |
'../scr/sousform.php?obj=petitionnaire&action=0'+ |
'../scr/sousform.php?obj=petitionnaire&action=0'+ |
458 |
'&retourformulaire=demande&principal=true', 780, 500, |
'&retourformulaire=demande&principal=true', 780, 'auto', |
459 |
getDemandeurId, 'petitionnaire_principal'); |
getDemandeurId, 'petitionnaire_principal'); |
460 |
}); |
}); |
461 |
// Bind de la fonction permettant l'ajout du délégataire |
// Bind de la fonction permettant l'ajout du délégataire |
462 |
$("#formulaire").on("click","#add_delegataire", function(event) { |
$("#formulaire").on("click","#add_delegataire", function(event) { |
463 |
popupIt('delegataire', |
popupIt('delegataire', |
464 |
'../scr/sousform.php?obj=delegataire&action=0'+ |
'../scr/sousform.php?obj=delegataire&action=0'+ |
465 |
'&retourformulaire=demande', 780, 500, |
'&retourformulaire=demande', 780, 'auto', |
466 |
getDemandeurId, 'delegataire'); |
getDemandeurId, 'delegataire'); |
467 |
}); |
}); |
468 |
// Bind de la fonction permettant l'ajout des pétitionnaires |
// Bind de la fonction permettant l'ajout des pétitionnaires |
469 |
$("#formulaire").on("click","#add_petitionnaire", function(event) { |
$("#formulaire").on("click","#add_petitionnaire", function(event) { |
470 |
popupIt('petitionnaire', |
popupIt('petitionnaire', |
471 |
'../scr/sousform.php?obj=petitionnaire&action=0'+ |
'../scr/sousform.php?obj=petitionnaire&action=0'+ |
472 |
'&retourformulaire=demande', 780, 500, |
'&retourformulaire=demande', 780, 'auto', |
473 |
getDemandeurId, 'petitionnaire'); |
getDemandeurId, 'petitionnaire'); |
474 |
}); |
}); |
475 |
|
|
476 |
|
|
477 |
url = document.location + "" ; |
url = document.location + "" ; |
478 |
|
if (url.indexOf("form.php?obj=demande&") != -1 |
479 |
|
&& url.indexOf("&action=3") == -1 ) { |
480 |
|
changeDemandeType(); |
481 |
|
} |
482 |
|
|
483 |
if (url.indexOf("form.php?obj=demande&") != -1 |
if (url.indexOf("form.php?obj=demande&") != -1 |
484 |
&& url.indexOf("&action=0") != -1 ){ |
&& url.indexOf("&action=0") != -1 ){ |
485 |
/*Cache les champs avant que dossier_autorisation_type_detaille soit choisi*/ |
/*Cache les champs avant que dossier_autorisation_type_detaille soit choisi*/ |
486 |
hideFields(); |
hideFields(); |
487 |
} |
} |
488 |
|
|
489 |
if (url.indexOf("form.php?obj=demande&") != -1 |
if (url.indexOf("form.php?obj=demande&") != -1 |
490 |
&& url.indexOf("&action=1") != -1 ){ |
&& url.indexOf("&action=1") != -1 ){ |
491 |
|
|
623 |
*/ |
*/ |
624 |
function addSearchIcon(){ |
function addSearchIcon(){ |
625 |
|
|
626 |
$('.search_particulier_fields, .search_personne_morale_fields').each(function() { |
$("#form-content:not(.form-is-valid) .search_particulier_fields,"+ |
627 |
|
"#form-content:not(.form-is-valid) .search_personne_morale_fields").each(function() { |
628 |
/*Ajout de l'icône après le champs dénomination et nom de la personne morale*/ |
/*Ajout de l'icône après le champs dénomination et nom de la personne morale*/ |
629 |
|
|
630 |
$(this). |
$(this). |
688 |
url: "../app/findPetitionnaire.php" + donnees , |
url: "../app/findPetitionnaire.php" + donnees , |
689 |
cache: false, |
cache: false, |
690 |
success: function(obj){ |
success: function(obj){ |
|
console.log($.parseJSON(obj)); |
|
691 |
var freq = $.parseJSON(obj); |
var freq = $.parseJSON(obj); |
692 |
var res=''; |
var res=''; |
693 |
/*Si la recherche a donné des résultats*/ |
/*Si la recherche a donné des résultats*/ |
728 |
|
|
729 |
} |
} |
730 |
var id = $('#dialog select option:selected').val(); |
var id = $('#dialog select option:selected').val(); |
731 |
ajaxIt('petitionnaire', |
if($.isNumeric(id)) { |
732 |
'../scr/sousform.php?obj=petitionnaire&action=1&retourformulaire=demande&idx='+id); |
ajaxIt('petitionnaire', |
733 |
|
'../scr/sousform.php?obj=petitionnaire&action=1&retourformulaire=demande&idx='+id); |
734 |
|
} |
735 |
// Fermeture de l'overlay |
// Fermeture de l'overlay |
736 |
$(this).dialog( "close" ); |
$(this).dialog( "close" ).empty(); |
737 |
} |
} |
738 |
} |
} |
739 |
}); |
}); |
909 |
|
|
910 |
var idDossierAutorisationTypeDetaille = |
var idDossierAutorisationTypeDetaille = |
911 |
$("#dossier_autorisation_type_detaille option:selected").val(); |
$("#dossier_autorisation_type_detaille option:selected").val(); |
|
|
|
912 |
/* Récupère les données saisies dans les champs pour la référence cadastrale */ |
/* Récupère les données saisies dans les champs pour la référence cadastrale */ |
913 |
getDataFieldReferenceCadastrale(); |
getDataFieldReferenceCadastrale(); |
914 |
|
|
919 |
showFormsDemande(); |
showFormsDemande(); |
920 |
|
|
921 |
$('#demande_type').parent().parent().show(); |
$('#demande_type').parent().parent().show(); |
|
|
|
|
formatFieldReferenceCadastrale(); |
|
922 |
} |
} |
923 |
else { |
else { |
924 |
hideFields(); |
hideFields(); |
973 |
'value=";" />'; |
'value=";" />'; |
974 |
} |
} |
975 |
|
|
976 |
|
/** |
977 |
|
* Test si la demande est sur dossier existant ou non |
978 |
|
**/ |
979 |
|
function isDossierExistant() { |
980 |
|
var id_demande_type = $('#demande_type').val(); |
981 |
|
var res = ""; |
982 |
|
$.ajax({ |
983 |
|
type: "GET", |
984 |
|
url: "../app/getDemandeNature.php?iddemandetype=" + id_demande_type , |
985 |
|
cache: false, |
986 |
|
async: false, |
987 |
|
success: function(val){ |
988 |
|
res = val; |
989 |
|
} |
990 |
|
}); |
991 |
|
return res; |
992 |
|
} |
993 |
/* |
/* |
994 |
Ajout d'une nouvelle ligne de champ |
Ajout d'une nouvelle ligne de champ |
995 |
* */ |
* */ |
996 |
function fieldReferenceCadastraleBase(){ |
function fieldReferenceCadastraleBase(){ |
997 |
return '<input ' + |
var type = isDossierExistant(); |
998 |
|
var reference_cadastrale = '<input ' + |
999 |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
1000 |
'type="text" ' + |
'type="text" ' + |
1001 |
'onchange="VerifNum(this)" ' + |
'onchange="VerifNum(this)" ' + |
1002 |
'maxlength="4" ' + |
'maxlength="4" ' + |
1003 |
'size="4" ' + |
'size="4" '; |
1004 |
'value="" />' + |
// désactivation des champs de référence cadastrale |
1005 |
'<input ' + |
if(type != 'NOUV') { |
1006 |
|
reference_cadastrale += 'disabled="disabled" '; |
1007 |
|
} |
1008 |
|
reference_cadastrale += 'value="" />'; |
1009 |
|
|
1010 |
|
reference_cadastrale += '<input ' + |
1011 |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
1012 |
'type="text" ' + |
'type="text" ' + |
1013 |
'maxlength="3" ' + |
'maxlength="3" ' + |
1014 |
'size="3" ' + |
'size="3" '; |
1015 |
'value="" '+ |
if(type != 'NOUV') { |
1016 |
'onchange="if ( !isAlpha(this.value) ){ alert(\'Vous ne devez saisir que des lettres dans ce champs.\'); this.value = \'\'; }"/>' + |
reference_cadastrale += 'disabled="disabled" '; |
1017 |
'<input ' + |
} |
1018 |
|
reference_cadastrale += 'value="" '+ |
1019 |
|
'onchange="if ( !isAlpha(this.value) ){ alert(\'Vous ne devez saisir que des lettres dans ce champs.\'); this.value = \'\'; }"/>'; |
1020 |
|
reference_cadastrale += '<input ' + |
1021 |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
1022 |
'type="text" ' + |
'type="text" ' + |
1023 |
'onchange="VerifNum(this)" ' + |
'onchange="VerifNum(this)" ' + |
1024 |
'maxlength="5" ' + |
'maxlength="5" ' + |
1025 |
'size="5" ' + |
'size="5" '; |
1026 |
'value="" />' + |
if(type != 'NOUV') { |
1027 |
'<span id="moreFieldReferenceCadastrale' + $('.moreFieldReferenceCadastrale').length + '" class="moreFieldReferenceCadastrale">' + |
reference_cadastrale += 'disabled="disabled" '; |
1028 |
|
} |
1029 |
|
reference_cadastrale += 'value="" />'; |
1030 |
|
if(type == 'NOUV') { |
1031 |
|
reference_cadastrale += '<span id="moreFieldReferenceCadastrale' + |
1032 |
|
$('.moreFieldReferenceCadastrale').length + |
1033 |
|
'" class="moreFieldReferenceCadastrale">' + |
1034 |
hiddenSeparatorField() + |
hiddenSeparatorField() + |
1035 |
' + ajouter d\'autres champs' + |
' + ajouter d\'autres champs' + |
1036 |
'</span>'; |
'</span>'; |
1037 |
|
} |
1038 |
|
|
1039 |
|
|
1040 |
|
return reference_cadastrale; |
1041 |
} |
} |
1042 |
|
|
1043 |
/** |
/** |
1064 |
$(this).show(); |
$(this).show(); |
1065 |
} |
} |
1066 |
); |
); |
1067 |
|
formatFieldReferenceCadastrale(); |
1068 |
$('.field-type-text').show(); |
$('.field-type-text').show(); |
1069 |
$('input[type=submit]').show(); |
$('input[type=submit]').show(); |
1070 |
$('.terrain_references_cadastrales_custom').hide(); |
$('.terrain_references_cadastrales_custom').hide(); |
1117 |
changeDemandeurType('qualite'); |
changeDemandeurType('qualite'); |
1118 |
addSearchIcon(); |
addSearchIcon(); |
1119 |
addDivDialog('.bloc_demandeur'); |
addDivDialog('.bloc_demandeur'); |
1120 |
|
|
1121 |
} |
} |
1122 |
|
|
1123 |
/* |
/* |
1131 |
if ( $.isNumeric(id) && objet != '' ){ |
if ( $.isNumeric(id) && objet != '' ){ |
1132 |
|
|
1133 |
donnees = "?ido=" + id + '&obj=' + objet + '&objk=' + objetc; |
donnees = "?ido=" + id + '&obj=' + objet + '&objk=' + objetc; |
|
alert(donnees); |
|
1134 |
$.ajax({ |
$.ajax({ |
1135 |
type: "GET", |
type: "GET", |
1136 |
url: "../app/marquer_comme_lu.php" + donnees , |
url: "../app/marquer_comme_lu.php" + donnees , |
1142 |
/*Change la valeur affiché et affiche un message valide*/ |
/*Change la valeur affiché et affiche un message valide*/ |
1143 |
if ( $.parseJSON(html) == "Mise a jour effectue avec succes"){ |
if ( $.parseJSON(html) == "Mise a jour effectue avec succes"){ |
1144 |
|
|
1145 |
|
// On modife le champ lu |
1146 |
$('#lu').html('Oui'); |
$('#lu').html('Oui'); |
1147 |
|
// On supprime l'action |
1148 |
|
$('span.lu-16').parent().parent().remove(); |
1149 |
|
// On affiche le message |
1150 |
$('#sousform-' + objet + ' .subtitle').after( |
$('#sousform-' + objet + ' .subtitle').after( |
1151 |
'<div ' + |
'<div ' + |
1152 |
'class="message ui-widget ui-corner-all ui-state-highlight ui-state-valid">' + |
'class="message ui-widget ui-corner-all ui-state-highlight ui-state-valid">' + |