8 |
* recherche au chargement de la page. |
* recherche au chargement de la page. |
9 |
*/ |
*/ |
10 |
$('#avis_code_barre_form #consultation').focus(); |
$('#avis_code_barre_form #consultation').focus(); |
11 |
|
|
12 |
|
/** |
13 |
|
* Spécifique app/maj_dates_suivi.php pour donner le focus sur le champ |
14 |
|
* instruction au chargement de la page si la date n'est pas vide. |
15 |
|
*/ |
16 |
|
if($('#maj_dates_form #date').val()!="") { |
17 |
|
$('#maj_dates_form #instruction').focus(); |
18 |
|
} |
19 |
}); |
}); |
20 |
|
|
21 |
|
|
196 |
async: false |
async: false |
197 |
}); |
}); |
198 |
} |
} |
199 |
|
//Fonction de redirection pour le widget de recherche de dossier |
200 |
|
function widget_recherche_dossier(data,nbRes){ |
201 |
|
/*$('#msg').show(); |
202 |
|
$('#msg').html(msg_loading);*/ |
203 |
|
|
204 |
|
// S'il n'y a qu'un seul résultat, afficher un résumé |
205 |
|
if ( nbRes == 1 ){ |
206 |
|
|
207 |
|
window.location = "../scr/form.php?obj=dossier_instruction&action=3&" + |
208 |
|
"idx=" + data + "&premier=0&advs_id=&recherche=&tricol=&" + |
209 |
|
"selectioncol=&valide=&retour=tab"; |
210 |
|
} |
211 |
|
// S'il y a une liste de dossier, redirection vers le tableau |
212 |
|
else { |
213 |
|
|
214 |
|
window.location = "../scr/tab.php?obj=recherche_direct&selectioncol=0&recherche=" + data; |
215 |
|
} |
216 |
|
} |
217 |
// |
// |
218 |
function dossierdepot() |
function dossierdepot() |
219 |
{ |
{ |
308 |
**/ |
**/ |
309 |
function popupIt(objsf, link, width, height, callback, callbackParams) { |
function popupIt(objsf, link, width, height, callback, callbackParams) { |
310 |
// Insertion du conteneur du dialog |
// Insertion du conteneur du dialog |
311 |
var dialog = $('<div id=\"sousform-'+objsf+'\"></div>').insertAfter('.formControls'); |
var dialog = $('<div id=\"sousform-'+objsf+'\"></div>').insertAfter('#tabs-1 .formControls'); |
312 |
$('<input type=\"text\" name=\"recherchedyn\" id=\"recherchedyn\" value=\"\" class=\"champFormulaire\" style=\"display:none\" />').insertAfter('#sousform-'+objsf); |
$('<input type=\"text\" name=\"recherchedyn\" id=\"recherchedyn\" value=\"\" class=\"champFormulaire\" style=\"display:none\" />').insertAfter('#sousform-'+objsf); |
313 |
|
|
314 |
// execution de la requete passee en parametre |
// execution de la requete passee en parametre |
590 |
if ((url.indexOf("form.php?obj=demande&") != -1 |
if ((url.indexOf("form.php?obj=demande&") != -1 |
591 |
|| url.indexOf("form.php?obj=demande_nouveau_dossier&") != -1 |
|| url.indexOf("form.php?obj=demande_nouveau_dossier&") != -1 |
592 |
|| url.indexOf("form.php?obj=demande_dossier_existant&") != -1) |
|| url.indexOf("form.php?obj=demande_dossier_existant&") != -1) |
593 |
&& url.indexOf("&action=3") == -1 |
&& url.indexOf("&action") == -1 ){ |
|
&& url.indexOf("&action=1") == -1 ){ |
|
594 |
|
|
595 |
formatFieldReferenceCadastrale(); |
formatFieldReferenceCadastrale(); |
596 |
} |
} |
865 |
|
|
866 |
/*Réinitialise les champs et cache les champs inutiles selon la qualité du demandeur*/ |
/*Réinitialise les champs et cache les champs inutiles selon la qualité du demandeur*/ |
867 |
/*Si la qualite du demandeur est particulier */ |
/*Si la qualite du demandeur est particulier */ |
868 |
if ( $('#' + id + ' option:selected').val() == 'particulier' ){ |
if ( $('#' + id ).val() == 'particulier' ){ |
869 |
|
|
870 |
$('.personne_morale_fields input').each( |
$('.personne_morale_fields input').each( |
871 |
function(){ |
function(){ |
939 |
} |
} |
940 |
); |
); |
941 |
if( $("form[name=f1] .form-is-valid").size() == 0) { |
if( $("form[name=f1] .form-is-valid").size() == 0) { |
942 |
|
|
943 |
$('#moreFieldReferenceCadastrale' + |
$('#moreFieldReferenceCadastrale' + |
944 |
($('.moreFieldReferenceCadastrale').length - 1 )). |
($('.moreFieldReferenceCadastrale').length - 1 )). |
945 |
on("click", function() { |
on("click", function() { |
1152 |
'type="text" ' + |
'type="text" ' + |
1153 |
'onchange="VerifNum(this)" ' + |
'onchange="VerifNum(this)" ' + |
1154 |
'maxlength="4" ' + |
'maxlength="4" ' + |
1155 |
'size="4" '; |
'size="4" '+ |
1156 |
|
'placeholder="Quart." '; |
1157 |
|
|
1158 |
// désactivation des champs de référence cadastrale |
// désactivation des champs de référence cadastrale |
1159 |
if(type != 'NOUV' || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) { |
if(type != 'NOUV' || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) { |
1166 |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
1167 |
'type="text" ' + |
'type="text" ' + |
1168 |
'maxlength="3" ' + |
'maxlength="3" ' + |
1169 |
'size="3" '; |
'size="3" '+ |
1170 |
|
'placeholder="Sect." '; |
1171 |
|
|
1172 |
// désactivation des champs de référence cadastrale |
// désactivation des champs de référence cadastrale |
1173 |
if(type != 'NOUV' || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) { |
if(type != 'NOUV' || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) { |
1181 |
'type="text" ' + |
'type="text" ' + |
1182 |
'onchange="VerifNum(this)" ' + |
'onchange="VerifNum(this)" ' + |
1183 |
'maxlength="5" ' + |
'maxlength="5" ' + |
1184 |
'size="5" '; |
'size="5" '+ |
1185 |
|
'placeholder="Parc." '; |
1186 |
|
|
1187 |
// désactivation des champs de référence cadastrale |
// désactivation des champs de référence cadastrale |
1188 |
if(type != 'NOUV' || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) { |
if(type != 'NOUV' || $(".form-is-valid").size() > 0 || url.indexOf('action=3') != -1 ) { |
1236 |
$(this).show(); |
$(this).show(); |
1237 |
} |
} |
1238 |
); |
); |
1239 |
formatFieldReferenceCadastrale(); |
formatFieldReferenceCadastrale(1); |
1240 |
$('.field-type-text').show(); |
$('.field-type-text').show(); |
1241 |
$('input[type=submit]').show(); |
$('input[type=submit]').show(); |
1242 |
$('.terrain_references_cadastrales_custom').hide(); |
$('.terrain_references_cadastrales_custom').hide(); |
1293 |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
1294 |
'type="text" ' + |
'type="text" ' + |
1295 |
'maxlength="1" ' + |
'maxlength="1" ' + |
1296 |
'size="1" ' + |
'size="3" ' + |
1297 |
'value="" ' + |
'value="" ' + |
1298 |
|
'placeholder="Sep." ' + |
1299 |
'onchange="testSeparator(this);"/>' + |
'onchange="testSeparator(this);"/>' + |
1300 |
'<input ' + |
'<input ' + |
1301 |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
'class="champFormulaire reference_cadastrale_custom_field" ' + |
1303 |
'onchange="VerifNum(this)" ' + |
'onchange="VerifNum(this)" ' + |
1304 |
'maxlength="4" ' + |
'maxlength="4" ' + |
1305 |
'size="4" ' + |
'size="4" ' + |
1306 |
|
'placeholder="Parc." ' + |
1307 |
'value="" />'; |
'value="" />'; |
1308 |
} |
} |
1309 |
|
|
1335 |
|
|
1336 |
} |
} |
1337 |
|
|
1338 |
|
// Retourne la valeur d'une variable GET de l'URL |
1339 |
|
function getQuerystring(key, default_) |
1340 |
|
{ |
1341 |
|
if (default_==null) default_=""; |
1342 |
|
key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); |
1343 |
|
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); |
1344 |
|
var qs = regex.exec(window.location.href); |
1345 |
|
if(qs == null) |
1346 |
|
return default_; |
1347 |
|
else |
1348 |
|
return qs[1]; |
1349 |
|
} |
1350 |
|
|
1351 |
|
// Récupère l'id de l'enregistrement lié au lot passé en parametre puis appel popupit |
1352 |
|
function overlayCerfa(idLot) { |
1353 |
|
$.get("../app/displayLotCerfa.php?lot="+idLot, function(data) { |
1354 |
|
if(data != '') { |
1355 |
|
popupIt('donnees_techniques', |
1356 |
|
'../scr/sousform.php?obj=donnees_techniques&idx='+data+ |
1357 |
|
'&retourformulaire=lot&maj=1&idxformulaire='+idLot, |
1358 |
|
950, 700); |
1359 |
|
|
1360 |
|
} else { |
1361 |
|
// Si pas d'id retourner on créer un nouvel enregistrement de donnéees techniques |
1362 |
|
popupIt('donnees_techniques', |
1363 |
|
'../scr/sousform.php?obj=donnees_techniques&retourformulaire=lot&maj=0&idxformulaire='+idLot, |
1364 |
|
950, 700); |
1365 |
|
} |
1366 |
|
|
1367 |
|
}); |
1368 |
|
} |
1369 |
|
|
1370 |
/* |
/* |
1371 |
* Marque comme lu une consultation |
* Marque comme lu une consultation |
1372 |
*/ |
*/ |
1373 |
function markedAsRead(id, objet, objetc){ |
function portletUpdateData(id, objet, objetc, file, field, message){ |
1374 |
|
|
1375 |
/*Vérifie que l'identifiant passé en paramètre est bien un chiffre |
/*Vérifie que l'identifiant passé en paramètre est bien un chiffre |
1376 |
* et que le type d'objet est défini |
* et que le type d'objet est défini |
1377 |
* */ |
* */ |
1378 |
if ( $.isNumeric(id) && objet != '' ){ |
if ( $.isNumeric(id) && objet != '' ){ |
1379 |
|
|
1380 |
donnees = "?ido=" + id + '&obj=' + objet + '&objk=' + objetc; |
donnees = "?ido=" + id + '&obj=' + objet + '&objk=' + objetc + '&idxDossier=' + getQuerystring('idx'); |
1381 |
$.ajax({ |
$.ajax({ |
1382 |
type: "GET", |
type: "GET", |
1383 |
url: "../app/marquer_comme_lu.php" + donnees , |
url: "../app/"+file+".php" + donnees , |
1384 |
cache: false, |
cache: false, |
1385 |
success: function(html){ |
success: function(html){ |
1386 |
|
|
1387 |
$('#sousform-' + objet + ' .message').remove(); |
$('#sousform-' + objet + ' .message').remove(); |
|
|
|
1388 |
/*Change la valeur affiché et affiche un message valide*/ |
/*Change la valeur affiché et affiche un message valide*/ |
1389 |
if ( $.parseJSON(html) == "Mise a jour effectue avec succes"){ |
if ( $.parseJSON(html) == "Mise a jour effectue avec succes" || |
1390 |
|
$.parseJSON(html).indexOf("Transfert effectue avec succes") != -1 ){ |
1391 |
|
|
1392 |
|
// On modife le champ field |
1393 |
|
if ( field != '' && message != '' ){ |
1394 |
|
$('#'+field).html(message); |
1395 |
|
html = $.parseJSON(html); |
1396 |
|
} |
1397 |
|
else { |
1398 |
|
html = $.parseJSON(html).split(';'); |
1399 |
|
|
1400 |
|
$('#'+field).html(html[0]); |
1401 |
|
|
1402 |
|
html = html[1]; |
1403 |
|
} |
1404 |
|
|
|
// On modife le champ lu |
|
|
$('#lu').html('Oui'); |
|
1405 |
// On supprime l'action |
// On supprime l'action |
1406 |
$('span.lu-16').parent().parent().remove(); |
$('span.'+field+'-16').parent().parent().remove(); |
1407 |
// On affiche le message |
// On affiche le message |
1408 |
$('#sousform-' + objet + ' .subtitle').after( |
$('#sousform-' + objet + ' .subtitle').after( |
1409 |
'<div ' + |
'<div ' + |
1411 |
'<p>' + |
'<p>' + |
1412 |
'<span class="ui-icon ui-icon-info"></span>' + |
'<span class="ui-icon ui-icon-info"></span>' + |
1413 |
'<span class="text">' + |
'<span class="text">' + |
1414 |
$.parseJSON(html) + |
html + |
1415 |
'</span>' + |
'</span>' + |
1416 |
'</p>' + |
'</p>' + |
1417 |
'</div>' |
'</div>' |
1435 |
}); |
}); |
1436 |
} |
} |
1437 |
} |
} |
1438 |
|
|
1439 |
|
// Affiche le sous formulaire onglet |
1440 |
|
function redirectPortletAction(id, onglet){ |
1441 |
|
|
1442 |
|
var $tabs = $('.ui-tabs').tabs(); |
1443 |
|
|
1444 |
|
lien_onglet = $('#' + onglet).attr('href'); |
1445 |
|
lien_onglet = lien_onglet.substring( lien_onglet.length - 1, lien_onglet.length); |
1446 |
|
|
1447 |
|
$tabs.tabs('select', lien_onglet); |
1448 |
|
} |