179 |
|
|
180 |
function changeDataSelect(tn, ds, joker){ |
function changeDataSelect(tn, ds, joker){ |
181 |
|
|
182 |
var idArrondissement = $("#"+ds+" option:selected").val(); |
var id = $("#"+ds+" option:selected").val(); |
183 |
link = "../app/listData.php?idx=" + idArrondissement + "&tn=" + tn + "&ds=" + ds; |
link = "../app/listData.php?idx=" + id + "&tn=" + tn + "&ds=" + ds; |
184 |
$.ajax({ |
$.ajax({ |
185 |
type: "GET", |
type: "GET", |
186 |
url: link, |
url: link, |
237 |
fenetreouverte = true; |
fenetreouverte = true; |
238 |
} |
} |
239 |
|
|
240 |
//$(function() { |
/* |
241 |
// if ( $('#date_demande').length > 0 && !$('#dossier_autorisation_type_detaille').is(':disabled') ) |
Ajoute le formulaire d'jout de référence cadastrale personnalisé |
242 |
// hideFields(); |
* */ |
243 |
// |
$(function() { |
|
// |
|
|
//}); |
|
|
|
|
|
function changeDemandeType(){ |
|
244 |
|
|
245 |
var idDossierAutorisationTypeDetaille = $("#dossier_autorisation_type_detaille option:selected").val(); |
url = document.location + "" ; |
246 |
|
if ( $('#date_demande').length > 0 |
247 |
if ( $.isNumeric(idDossierAutorisationTypeDetaille) ){ |
&& !$('#dossier_autorisation_type_detaille').is(':disabled') |
248 |
|
&& url.indexOf("form.php?obj=demande&action=0") != -1 ){ |
249 |
|
|
250 |
changeDataSelect('demande_type','dossier_autorisation_type_detaille'); |
$.ajax({ |
251 |
|
type: "GET", |
252 |
|
url: "sousform.php?obj=demandeur&action=0&tri=&objsf=demandeur&premiersf=0", |
253 |
|
cache: false, |
254 |
|
success: function(html){ |
255 |
|
|
256 |
|
$('.lots').append(createFieldset('test', 'test')); |
257 |
|
$('#test').html(html); |
258 |
|
$('#test').html($('#test .formEntete>#form-content').html()); |
259 |
|
$('.libelle-demande').parent().parent().remove(); |
260 |
|
|
261 |
|
obj = $('#type_demandeur').parent(); |
262 |
|
obj.empty(); |
263 |
|
obj.html( |
264 |
|
'<select id="type_demandeur" class="champFormulaire selectTypeDemandeur" name="type_demandeur" size="1">' + |
265 |
|
'<option selected="selected" value="particulier">particulier</option>' + |
266 |
|
'<option value="personne_morale">personne morale</option>' + |
267 |
|
'</select>' |
268 |
|
); |
269 |
|
|
270 |
|
setSelectCivilite(); |
271 |
|
}, |
272 |
|
async: false |
273 |
|
}); |
274 |
|
|
275 |
$('#demande_type').parent().parent().show(); |
$('.lots').append(createFieldset('Pétitionnaire(s)', 'petitionnaire')); |
276 |
|
$('#petitionnaire').after( |
277 |
$('.terrain_references_cadastrales_custom').append( |
'<div class="field field-type-text morePetitionnaire" style="display: table-row;">' + |
|
'<div class="field field-type-text" >'+ |
|
278 |
'<div class="form-libelle">' + |
'<div class="form-libelle">' + |
279 |
'<label '+ |
'<label class="libelle-more_petitionnaire" for="terrain_superficie"> + Ajouter un autre pétitionnaire </label>' + |
|
'class="libelle-terrain_references_cadastrales" '+ |
|
|
'for="terrain_references_cadastrales">'+ |
|
|
' terrain_references_cadastrales '+ |
|
|
'</label>' + |
|
280 |
'</div>' + |
'</div>' + |
281 |
'<div class="form-content reference_cadastrale_custom_fields">' + |
'<div class="form-content">' + |
|
'<input ' + |
|
|
'class="champFormulaire reference_cadastrale_custom_field" ' + |
|
|
'type="text" ' + |
|
|
'onchange="VerifNum(this)" ' + |
|
|
'maxlength="3" ' + |
|
|
'size="3" ' + |
|
|
'value="" />' + |
|
|
'<input ' + |
|
|
'class="champFormulaire reference_cadastrale_custom_field" ' + |
|
|
'type="text" ' + |
|
|
'maxlength="2" ' + |
|
|
'size="2" ' + |
|
|
'value="" />' + |
|
|
'<input ' + |
|
|
'class="champFormulaire reference_cadastrale_custom_field" ' + |
|
|
'type="text" ' + |
|
|
'onchange="VerifNum(this)" ' + |
|
|
'maxlength="4" ' + |
|
|
'size="4" ' + |
|
|
'value="" />' + |
|
282 |
'</div>' + |
'</div>' + |
283 |
'</div>' + |
'</div>'); |
284 |
'<div id="moreFieldReferenceCadastrale"> + ajouter d\'autres champs</div>' |
|
285 |
); |
$('.morePetitionnaire').click( function() { |
286 |
|
$('#fieldsetpetitionnaire .morePetitionnaire').before( |
287 |
$('#moreFieldReferenceCadastrale').click( function() { |
'<div id="petitionnaire' + $('#fieldsetpetitionnaire .fieldsetContent').size() +'" class="fieldsetContent">'+ |
288 |
$('.reference_cadastrale_custom_fields').append(newInputReferenceCadastrale()); |
$('#fieldsetpetitionnaire #formsDemandeur').val() + |
289 |
}); |
'</div>' |
290 |
|
); |
291 |
|
|
292 |
|
nb = $('#fieldsetpetitionnaire .fieldsetContent').size() - 1; |
293 |
|
|
294 |
|
changeIdNameField('petitionnaire' + nb ); |
295 |
|
|
296 |
|
addDatePicker( 'petitionnaire' + nb + '_petitionnaire_particulier_date_naissance'); |
297 |
|
|
298 |
|
setTypeDemandeur('petitionnaire' + nb, 'petitionnaire' + nb , '_petitionnaire'); |
299 |
|
}); |
300 |
|
|
301 |
$('form').submit( |
$('.lots').append(createFieldset('Délégataire', 'delegataire')); |
302 |
function(){ |
setDelegataire(); |
303 |
|
setPetitionnaire(); |
304 |
|
setTypeDemandeur('petitionnaire', 'petitionnaire_type_demandeur', ''); |
305 |
|
|
306 |
var reference_cadastrale = ''; |
hideFields(); |
307 |
|
} |
308 |
|
|
309 |
|
if ( $('#date_demande').length > 0 |
310 |
|
&& !$('#dossier_autorisation_type_detaille').is(':disabled') |
311 |
|
&& url.indexOf("form.php?obj=demande&action=1") != -1 ){ |
312 |
|
|
313 |
|
addNewFieldReferencesCadastrales(); |
314 |
|
$('#terrain_references_cadastrales').parent().parent().hide(); |
315 |
|
|
316 |
|
reference_cadastrale = $('#terrain_references_cadastrales').val(); |
317 |
|
/*Formatage de la reference cadastrale*/ |
318 |
|
if ( reference_cadastrale != '' ){ |
319 |
|
|
320 |
|
references_cadastrales = reference_cadastrale.split(';'); |
321 |
|
donnees = new Array(); |
322 |
|
|
323 |
|
i = 0 ; |
324 |
|
for ( l = 0 ; l < references_cadastrales.length - 1 ; l ++ ){ |
325 |
|
|
326 |
$('.reference_cadastrale_custom_field').each( |
k = 0; |
327 |
function(){ |
donnees[i] = ''; |
328 |
|
for ( j = k ; j < references_cadastrales[l].length ; j++ ) |
329 |
reference_cadastrale += $(this).val(); |
if ( references_cadastrales[l].charAt(j) >= 0 && references_cadastrales[l].charAt(j) <= 9 ){ |
330 |
|
donnees[i] += references_cadastrales[l].charAt(j); |
331 |
|
k++; |
332 |
|
} else { |
333 |
|
i++; |
334 |
|
break; |
335 |
} |
} |
|
); |
|
336 |
|
|
337 |
$('#terrain_references_cadastrales').val(reference_cadastrale); |
|
338 |
|
donnees[i] = ''; |
339 |
|
for ( j = k ; j < references_cadastrales[l].length ; j++ ) |
340 |
|
if ( isAlpha(references_cadastrales[l].charAt(j)) ){ |
341 |
|
donnees[i] += references_cadastrales[l].charAt(j); |
342 |
|
k++; |
343 |
|
} else { |
344 |
|
i++; |
345 |
|
break; |
346 |
|
} |
347 |
|
|
348 |
|
donnees[i] = ''; |
349 |
|
for ( j = k ; j < references_cadastrales[l].length ; j++ ) |
350 |
|
if ( references_cadastrales[l].charAt(j) >= 0 && references_cadastrales[l].charAt(j) <= 9 ){ |
351 |
|
donnees[i] += references_cadastrales[l].charAt(j); |
352 |
|
k++; |
353 |
|
} else { |
354 |
|
break; |
355 |
|
} |
356 |
|
|
357 |
|
m = 0 ; |
358 |
|
if ( k < references_cadastrales[l].length ){ |
359 |
|
|
360 |
|
for ( j = k ; j < references_cadastrales[l].length ; j++ ) |
361 |
|
if ( isAlpha(references_cadastrales[l].charAt(j)) ){ |
362 |
|
m++; |
363 |
|
donnees[++i] = references_cadastrales[l].charAt(j); |
364 |
|
donnees[++i] = ''; |
365 |
|
} |
366 |
|
else { |
367 |
|
donnees[i] += references_cadastrales[l].charAt(j); |
368 |
|
} |
369 |
|
} |
370 |
|
|
371 |
|
donnees[++i] = ';'; |
372 |
|
i++; |
373 |
|
|
374 |
|
if ( l > 0 ) |
375 |
|
$('.reference_cadastrale_custom_fields').append( "<br/>" + fieldReferenceCadastraleBase()); |
376 |
|
actionFormReferenceCadastrale(); |
377 |
|
|
378 |
|
if ( m > 0 ){ |
379 |
|
|
380 |
|
for ( j = 0 ; j < m ; j++ ) |
381 |
|
$('#moreFieldReferenceCadastrale' + ( $('.moreFieldReferenceCadastrale').length - 1 ) ).before(newInputReferenceCadastrale()); |
382 |
|
} |
383 |
} |
} |
384 |
); |
|
385 |
|
actionLineFormReferenceCadastrale(); |
386 |
|
|
387 |
|
$('.reference_cadastrale_custom_field').each( |
388 |
|
function(index) { |
389 |
|
$(this).val(donnees[index]) |
390 |
|
} |
391 |
|
); |
392 |
|
} |
393 |
|
} |
394 |
|
}); |
395 |
|
|
396 |
|
/* |
397 |
|
Création du formuliare pour le petitionnaire |
398 |
|
* */ |
399 |
|
function setPetitionnaire(){ |
400 |
|
$('#petitionnaire').prepend("<br/>" + $('#test').html() + "<br/>"); |
401 |
|
$('#test').parent().remove(); |
402 |
|
|
403 |
|
changeIdNameField('petitionnaire'); |
404 |
|
} |
405 |
|
|
406 |
|
/* |
407 |
|
Action au changement du select du type de demandeur |
408 |
|
* */ |
409 |
|
function setTypeDemandeur(id, selector, complement){ |
410 |
|
$('#'+selector).on('change', |
411 |
|
function() { |
412 |
|
|
413 |
|
if ( $(this).find('option:selected').first().text() == 'particulier' ) |
414 |
|
fieldTypeDemandeur('#' + id, complement, true); |
415 |
|
else |
416 |
|
fieldTypeDemandeur('#' + id, complement, false); |
417 |
|
} |
418 |
|
); |
419 |
|
} |
420 |
|
|
421 |
|
/* |
422 |
|
Création du formulaire pour le délégataire |
423 |
|
* */ |
424 |
|
function setDelegataire(){ |
425 |
|
$('#delegataire').html($('#test').html()); |
426 |
|
|
427 |
|
$('#delegataire #type_demandeur').parent().parent().remove(); |
428 |
|
$('#delegataire #personne_morale_denomination').parent().parent().remove(); |
429 |
|
$('#delegataire #personne_morale_raison_sociale').parent().parent().remove(); |
430 |
|
$('#delegataire #personne_morale_siret').parent().parent().remove(); |
431 |
|
$('#delegataire #personne_morale_categorie_juridique').parent().parent().remove(); |
432 |
|
$('#delegataire #personne_morale_civilite').parent().parent().remove(); |
433 |
|
$('#delegataire #personne_morale_nom').parent().parent().remove(); |
434 |
|
$('#delegataire #personne_morale_prenom').parent().parent().remove(); |
435 |
|
$('#delegataire #frequent').parent().parent().remove(); |
436 |
|
|
437 |
|
changeIdNameField('delegataire'); |
438 |
|
addDatePicker('delegataire_particulier_date_naissance'); |
439 |
|
} |
440 |
|
|
441 |
|
/* |
442 |
|
Change les id et name des champs |
443 |
|
* */ |
444 |
|
function changeIdNameField(name){ |
445 |
|
|
446 |
|
$('#' + name + ' input').each( |
447 |
|
function(){ |
448 |
|
$(this).attr('id', name + '_' + $(this).attr('id') ); |
449 |
|
$(this).attr('name', name + '_' + $(this).attr('name') ); |
450 |
|
} |
451 |
|
); |
452 |
|
|
453 |
|
$('#' + name + ' #type_demandeur').attr('id', name + '_' + $('#' + name + ' #type_demandeur').attr('id')); |
454 |
|
$('#' + name + ' #type_demandeur').attr('name', name + '_' + $('#' + name + ' #type_demandeur').attr('name')); |
455 |
|
|
456 |
|
$('#' + name + ' #particulier_civilite').attr('id', name + '_' + $('#' + name + ' #particulier_civilite').attr('id')); |
457 |
|
$('#' + name + ' #particulier_civilite').attr('name', name + '_' + $('#' + name + ' #particulier_civilite').attr('name')); |
458 |
|
|
459 |
|
$('#' + name + ' #personne_morale_civilite').attr('id', name + '_' + $('#' + name + ' #personne_morale_civilite').attr('id')); |
460 |
|
$('#' + name + ' #personne_morale_civilite').attr('name', name + '_' + $('#' + name + ' #personne_morale_civilite').attr('name')); |
461 |
|
|
462 |
|
|
463 |
|
} |
464 |
|
|
465 |
|
function addDatePicker(id){ |
466 |
|
|
467 |
|
$("#" + id ).datepicker({ |
468 |
|
dateFormat: dateFormat, |
469 |
|
changeMonth: true, |
470 |
|
changeYear: true, |
471 |
|
yearRange: minYear+':'+maxYear, |
472 |
|
showOn: 'button', |
473 |
|
buttonImage: '../img/calendar.png', |
474 |
|
buttonImageOnly: true, |
475 |
|
constrainInput: true |
476 |
|
}); |
477 |
|
} |
478 |
|
|
479 |
|
/* |
480 |
|
Création des select pour la civilité |
481 |
|
* */ |
482 |
|
function setSelectCivilite(){ |
483 |
|
|
484 |
|
$.ajax({ |
485 |
|
type: "GET", |
486 |
|
url: "../app/civilite.php", |
487 |
|
dataType: "json", |
488 |
|
cache: false, |
489 |
|
success: function(html){ |
490 |
|
if ( html != '' ){ |
491 |
|
|
492 |
|
$('#particulier_civilite').parent().html('<select id="particulier_civilite" class="champFormulaire" size="1" name="particulier_civilite">' + |
493 |
|
'<option value="" selected="selected">choisir particulier_civilite</option>'); |
494 |
|
$('#personne_morale_civilite').parent().html('<select id="personne_morale_civilite" class="champFormulaire" size="1" name="personne_morale_civilite">' + |
495 |
|
'<option value="" selected="selected">choisir personne_morale_civilite</option>'); |
496 |
|
|
497 |
|
civilite = html.split(';'); |
498 |
|
for ( i = 0 ; i < civilite.length - 1 ; i++ ){ |
499 |
|
|
500 |
|
$('#particulier_civilite').append('<option value="' + civilite[i] + '">' + civilite[i] + '</option>'); |
501 |
|
$('#personne_morale_civilite').append('<option value="' + civilite[i] + '">' + civilite[i] + '</option>'); |
502 |
|
} |
503 |
|
|
504 |
|
$('#particulier_civilite').append('</select>'); |
505 |
|
$('#personne_morale_civilite').append('</select>'); |
506 |
|
} |
507 |
|
}, |
508 |
|
async: false |
509 |
|
}); |
510 |
|
} |
511 |
|
|
512 |
|
/* |
513 |
|
Retourne le code HTML d'un fieldset |
514 |
|
* */ |
515 |
|
function createFieldset(name, className){ |
516 |
|
return '<fieldset class="cadre ui-corner-all ui-widget-content" id="fieldset' + className + '">' + |
517 |
|
'<legend class="ui-corner-all ui-widget-content ui-state-active">' + name + ' </legend>' + |
518 |
|
'<input id="formsDemandeur" type="hidden" val=""/>'+ |
519 |
|
'<div class="fieldsetContent " id="' + className + '">' + |
520 |
|
'</div>' + |
521 |
|
'<div class="visualClear"></div>' + |
522 |
|
'</div>' + |
523 |
|
'</fieldset>'; |
524 |
|
} |
525 |
|
|
526 |
|
/* |
527 |
|
Test str est une lettre de l'alphabet |
528 |
|
* */ |
529 |
|
function isAlpha(str) { |
530 |
|
return /^[a-zA-Z\/]+$/.test(str); |
531 |
|
} |
532 |
|
|
533 |
|
/* |
534 |
|
Ajoute les ations spécifiques pour le formulaire personnalisé d'ajout de référence cadastrale |
535 |
|
* */ |
536 |
|
function actionFormReferenceCadastrale(){ |
537 |
|
$('form').submit( |
538 |
|
function(){ |
539 |
|
|
540 |
|
var reference_cadastrale = ''; |
541 |
|
var reference_cadastrale_temp = ''; |
542 |
|
|
543 |
|
$('.reference_cadastrale_custom_field').each( |
544 |
|
function(){ |
545 |
|
|
546 |
|
if ( $(this).val() == ';' ){ |
547 |
|
|
548 |
|
reference_cadastrale += reference_cadastrale_temp + ( ( reference_cadastrale_temp != '' && reference_cadastrale_temp.length > 0 ) ? ';' : '' ); |
549 |
|
reference_cadastrale_temp = ''; |
550 |
|
} |
551 |
|
else |
552 |
|
reference_cadastrale_temp += $(this).val(); |
553 |
|
|
554 |
|
} |
555 |
|
); |
556 |
|
|
557 |
|
$('#terrain_references_cadastrales').val(reference_cadastrale); |
558 |
|
} |
559 |
|
); |
560 |
|
|
561 |
|
$('#moreFieldReferenceCadastrale' + ($('.moreFieldReferenceCadastrale').length - 1 )).on("click", function() { |
562 |
|
$(this).before(newInputReferenceCadastrale()); |
563 |
|
}); |
564 |
|
} |
565 |
|
|
566 |
|
/* |
567 |
|
Action pour l'ajout de nouvelle ligne |
568 |
|
* */ |
569 |
|
function actionLineFormReferenceCadastrale(){ |
570 |
|
$('#morelineReferenceCadastrale').click( |
571 |
|
function(){ |
572 |
|
|
573 |
|
$('.reference_cadastrale_custom_fields').append( "<br/>" + fieldReferenceCadastraleBase()); |
574 |
|
$('#moreFieldReferenceCadastrale'+ ($('.moreFieldReferenceCadastrale').length - 1 )).on("click", function() { |
575 |
|
$(this).before(newInputReferenceCadastrale()); |
576 |
|
}); |
577 |
|
} |
578 |
|
); |
579 |
|
} |
580 |
|
|
581 |
|
/* |
582 |
|
Met à jour le select demande_type dès qu'un dossier_autorisation_type_detaille est choisi |
583 |
|
* */ |
584 |
|
function changeDemandeType(){ |
585 |
|
|
586 |
|
var idDossierAutorisationTypeDetaille = $("#dossier_autorisation_type_detaille option:selected").val(); |
587 |
|
|
588 |
|
if ( $.isNumeric(idDossierAutorisationTypeDetaille) ){ |
589 |
|
|
590 |
$('.terrain_references_cadastrales_custom:').find(">:first-child").hide(); |
changeDataSelect('demande_type','dossier_autorisation_type_detaille'); |
591 |
|
if ( $('#demande_type option').size() < 2 ) |
592 |
|
showFormsDemande(); |
593 |
|
|
594 |
|
$('#demande_type').parent().parent().show(); |
595 |
|
|
596 |
|
addNewFieldReferencesCadastrales(); |
597 |
|
|
598 |
|
actionFormReferenceCadastrale(); |
599 |
|
actionLineFormReferenceCadastrale() |
600 |
} |
} |
601 |
else { |
else { |
602 |
hideFields(); |
hideFields(); |
603 |
} |
} |
604 |
} |
} |
605 |
|
|
606 |
|
/* |
607 |
|
Ajoute le code HTML des champs pour les références cadastrales |
608 |
|
* */ |
609 |
|
function addNewFieldReferencesCadastrales(){ |
610 |
|
$('.references_cadastrales_new_field').remove(); |
611 |
|
$('.moreFieldReferenceCadastrale').remove(); |
612 |
|
$('#morelineReferenceCadastrale').remove(); |
613 |
|
$('.localisation .fieldsetContent').prepend( |
614 |
|
'<div class="field field-type-text references_cadastrales_new_field" >'+ |
615 |
|
'<div class="form-libelle">' + |
616 |
|
'<label '+ |
617 |
|
'class="libelle-terrain_references_cadastrales" '+ |
618 |
|
'for="terrain_references_cadastrales">'+ |
619 |
|
' terrain_references_cadastrales '+ |
620 |
|
'</label>' + |
621 |
|
'</div>' + |
622 |
|
'<div class="form-content reference_cadastrale_custom_fields">' + |
623 |
|
fieldReferenceCadastraleBase() + |
624 |
|
'</div>' + |
625 |
|
'</div>' + |
626 |
|
'<div class="field field-type-text" id="morelineReferenceCadastrale">' + |
627 |
|
'<div class="form-libelle"></div>' + |
628 |
|
'<div class="form-content">' + |
629 |
|
' + ajouter d\'autres lignes' + |
630 |
|
'</div>' + |
631 |
|
'</div>' |
632 |
|
); |
633 |
|
$('#terrain_superficie').parent().parent().after('<div class="field field-type-text" >' + |
634 |
|
'<div class="form-libelle"></div>' + |
635 |
|
'<div class="form-content">' + |
636 |
|
'<input id="cad-adr-them" class="ui-button ui-widget ui-state-default ui-corner-all" type="button" value="Cadastrale < = > Adresse"/>' + |
637 |
|
'</div>' + |
638 |
|
'</div>' ); |
639 |
|
} |
640 |
|
|
641 |
|
/* |
642 |
|
Séparateur caché ; |
643 |
|
* */ |
644 |
|
function hiddenSeparatorField(){ |
645 |
|
return '<input ' + |
646 |
|
'class="reference_cadastrale_custom_field " ' + |
647 |
|
'type="hidden" ' + |
648 |
|
'maxlength="2" ' + |
649 |
|
'size="2" ' + |
650 |
|
'value=";" />'; |
651 |
|
} |
652 |
|
|
653 |
|
/* |
654 |
|
Ajout d'une nouvelle ligne de champ |
655 |
|
* */ |
656 |
|
function fieldReferenceCadastraleBase(){ |
657 |
|
return '<input ' + |
658 |
|
'class="champFormulaire reference_cadastrale_custom_field" ' + |
659 |
|
'type="text" ' + |
660 |
|
'onchange="VerifNum(this)" ' + |
661 |
|
'maxlength="3" ' + |
662 |
|
'size="3" ' + |
663 |
|
'value="" />' + |
664 |
|
'<input ' + |
665 |
|
'class="champFormulaire reference_cadastrale_custom_field" ' + |
666 |
|
'type="text" ' + |
667 |
|
'maxlength="2" ' + |
668 |
|
'size="2" ' + |
669 |
|
'value="" />' + |
670 |
|
'<input ' + |
671 |
|
'class="champFormulaire reference_cadastrale_custom_field" ' + |
672 |
|
'type="text" ' + |
673 |
|
'onchange="VerifNum(this)" ' + |
674 |
|
'maxlength="4" ' + |
675 |
|
'size="4" ' + |
676 |
|
'value="" />' + |
677 |
|
'<span id="moreFieldReferenceCadastrale' + $('.moreFieldReferenceCadastrale').length + '" class="moreFieldReferenceCadastrale">' + |
678 |
|
hiddenSeparatorField() + |
679 |
|
' + ajouter d\'autres champs' + |
680 |
|
'</span>'; |
681 |
|
} |
682 |
|
|
683 |
|
/* |
684 |
|
Cache les champs inutules |
685 |
|
* */ |
686 |
function hideFields(){ |
function hideFields(){ |
687 |
$('.bloc').each( |
$('.bloc').each( |
688 |
function(){ |
function(){ |
696 |
$('#demande_type').parent().parent().hide(); |
$('#demande_type').parent().parent().hide(); |
697 |
} |
} |
698 |
|
|
699 |
|
/* |
700 |
|
Affiche les champs dont on a besoin |
701 |
|
* */ |
702 |
function showFormsDemande(){ |
function showFormsDemande(){ |
703 |
$('.bloc').each( |
$('.bloc').each( |
704 |
function(){ |
function(){ |
709 |
|
|
710 |
$('.field-type-text').show(); |
$('.field-type-text').show(); |
711 |
$('input[type=submit]').show(); |
$('input[type=submit]').show(); |
712 |
|
$('.terrain_references_cadastrales_custom').hide(); |
713 |
|
|
714 |
|
$('#terrain_references_cadastrales').parent().parent().hide(); |
715 |
|
|
716 |
|
/*Cache les champs inutiles*/ |
717 |
|
fieldTypeDemandeur('#petitionnaire', '', true); |
718 |
|
|
719 |
|
$('#fieldsetpetitionnaire #formsDemandeur').val($('#petitionnaire').html()); |
720 |
|
|
721 |
|
addDatePicker( 'petitionnaire_particulier_date_naissance'); |
722 |
|
} |
723 |
|
|
724 |
|
/* |
725 |
|
Cache/montre des champs selon le type de demandeur |
726 |
|
* */ |
727 |
|
function fieldTypeDemandeur(name,complement, particulier){ |
728 |
|
|
729 |
|
if ( particulier == true ){ |
730 |
|
|
731 |
|
$( name + ' ' + name + complement + '_particulier_civilite').parent().parent().show(); |
732 |
|
$( name + ' ' + name + complement + '_particulier_nom').parent().parent().show(); |
733 |
|
$( name + ' ' + name + complement + '_particulier_prenom').parent().parent().show(); |
734 |
|
$( name + ' ' + name + complement + '_particulier_date_naissance').parent().parent().show(); |
735 |
|
$( name + ' ' + name + complement + '_particulier_commune_naissance').parent().parent().show(); |
736 |
|
$( name + ' ' + name + complement + '_particulier_departement_naissance').parent().parent().show(); |
737 |
|
|
738 |
|
$( name + ' ' + name + complement + '_personne_morale_denomination').parent().parent().hide(); |
739 |
|
$( name + ' ' + name + complement + '_personne_morale_raison_sociale').parent().parent().hide(); |
740 |
|
$( name + ' ' + name + complement + '_personne_morale_siret').parent().parent().hide(); |
741 |
|
$( name + ' ' + name + complement + '_personne_morale_categorie_juridique').parent().parent().hide(); |
742 |
|
$( name + ' ' + name + complement + '_personne_morale_civilite').parent().parent().hide(); |
743 |
|
$( name + ' ' + name + complement + '_personne_morale_nom').parent().parent().hide(); |
744 |
|
$( name + ' ' + name + complement + '_personne_morale_prenom').parent().parent().hide(); |
745 |
|
} |
746 |
|
else{ |
747 |
|
|
748 |
|
$( name + ' ' + name + complement + '_particulier_civilite').parent().parent().hide(); |
749 |
|
$( name + ' ' + name + complement + '_particulier_nom').parent().parent().hide(); |
750 |
|
$( name + ' ' + name + complement + '_particulier_prenom').parent().parent().hide(); |
751 |
|
$( name + ' ' + name + complement + '_particulier_date_naissance').parent().parent().hide(); |
752 |
|
$( name + ' ' + name + complement + '_particulier_commune_naissance').parent().parent().hide(); |
753 |
|
$( name + ' ' + name + complement + '_particulier_departement_naissance').parent().parent().hide(); |
754 |
|
|
755 |
|
$( name + ' ' + name + complement + '_personne_morale_denomination').parent().parent().show(); |
756 |
|
$( name + ' ' + name + complement + '_personne_morale_raison_sociale').parent().parent().show(); |
757 |
|
$( name + ' ' + name + complement + '_personne_morale_siret').parent().parent().show(); |
758 |
|
$( name + ' ' + name + complement + '_personne_morale_categorie_juridique').parent().parent().show(); |
759 |
|
$( name + ' ' + name + complement + '_personne_morale_civilite').parent().parent().show(); |
760 |
|
$( name + ' ' + name + complement + '_personne_morale_nom').parent().parent().show(); |
761 |
|
$( name + ' ' + name + complement + '_personne_morale_prenom').parent().parent().show(); |
762 |
|
} |
763 |
} |
} |
764 |
|
|
765 |
|
/* |
766 |
|
Action au clique sur le bouton " + ajouter d'autres champs" |
767 |
|
* */ |
768 |
function newInputReferenceCadastrale(){ |
function newInputReferenceCadastrale(){ |
769 |
return '<input ' + |
return '<input ' + |
770 |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
787 |
function widget_bind_add_action() {} |
function widget_bind_add_action() {} |
788 |
function widget_bind_edit_actions(widget_selector) {} |
function widget_bind_edit_actions(widget_selector) {} |
789 |
|
|
790 |
|
function file(fichier) { |
791 |
|
// |
792 |
|
if (fichier == "") { |
793 |
|
alert("zone vide"); |
794 |
|
} |
795 |
|
// |
796 |
|
pfenetre = window.open("../app/file.php?file="+fichier,"Visualisation","width=100,height=100,top=1,left=150,scrollbars=yes,resizable = yes"); |
797 |
|
// |
798 |
|
fenetreouverte = true; |
799 |
|
} |