1 |
// specific openfoncier ======================================================== |
// specific openfoncier ======================================================== |
2 |
|
// OnReady |
3 |
|
$(function(){ |
4 |
|
// Document is ready |
5 |
|
$('#avis_code_barre_form #consultation').focus(); |
6 |
|
}); |
7 |
|
|
8 |
|
|
9 |
function bible(){ |
function bible(){ |
10 |
if(fenetreouverte==true) |
if(fenetreouverte==true) |
70 |
//} |
//} |
71 |
|
|
72 |
} |
} |
73 |
|
/* -- Debut -- */ |
74 |
|
function messageIt(objsf, link, empty) { |
75 |
|
// recuperation du terme recherche |
76 |
|
var recherche = document.getElementById("recherchedyn"); |
77 |
|
if (recherche != null) { |
78 |
|
link += "&recherche="+recherche.value; |
79 |
|
}else { |
80 |
|
link += "&recherche="; |
81 |
|
} |
82 |
|
// execution de la requete en GET |
83 |
|
$.ajax({ |
84 |
|
type: "GET", |
85 |
|
url: link, |
86 |
|
cache: false, |
87 |
|
success: function(html){ |
88 |
|
(empty == true )?$("#sousform-"+objsf).empty():''; |
89 |
|
$("#sousform-"+objsf).append(html); |
90 |
|
om_initialize_content(); |
91 |
|
}, |
92 |
|
async: false |
93 |
|
}); |
94 |
|
} |
95 |
|
|
96 |
|
/* Plugin jQuery qui lance un espèce d'appel AJAX vers un script PHP de téléchargement de fichier*/ |
97 |
|
jQuery.download = function(url, data, method){ |
98 |
|
//url and data options required |
99 |
|
if( url && data ){ |
100 |
|
//data can be string of parameters or array/object |
101 |
|
data = typeof data == 'string' ? data : jQuery.param(data); |
102 |
|
//split params into form inputs |
103 |
|
var inputs = ''; |
104 |
|
jQuery.each(data.split('&'), function(){ |
105 |
|
var pair = this.split('='); |
106 |
|
inputs+='<input type="hidden" name="'+ pair[0] +'" value="'+ pair[1] +'" />'; |
107 |
|
}); |
108 |
|
//send request |
109 |
|
jQuery('<form action="'+ url +'" method="'+ (method||'post') +'">'+inputs+'</form>') |
110 |
|
.prependTo('body').submit().remove(); |
111 |
|
}; |
112 |
|
}; |
113 |
|
|
114 |
|
/* -- FIN -- */ |
115 |
|
function popupIt(objsf, link) { |
116 |
|
// Insertion du conteneur du dialog |
117 |
|
var dialog = $('<div id=\"sousform-'+objsf+'\"></div>').insertAfter('.formControls'); |
118 |
|
$('<input type=\"text\" name=\"recherchedyn\" id=\"recherchedyn\" value=\"\" class=\"champFormulaire\" style=\"display:none\" />').insertAfter('#sousform-'+objsf); |
119 |
|
|
120 |
|
// execution de la requete passee en parametre |
121 |
|
// (idem ajaxIt + callback) |
122 |
|
$.ajax({ |
123 |
|
type: "GET", |
124 |
|
url: link, |
125 |
|
cache: false, |
126 |
|
success: function(html){ |
127 |
|
//Suppression d'un precedent dialog |
128 |
|
dialog.empty(); |
129 |
|
//Ajout du contenu recupere |
130 |
|
dialog.append(html); |
131 |
|
//Initialisation du theme OM |
132 |
|
om_initialize_content(); |
133 |
|
//Creation du dialog |
134 |
|
$(dialog).dialog({ |
135 |
|
//OnClose suppression du contenu |
136 |
|
close: function(ev, ui) { |
137 |
|
// Si le formulaire est submit et valide |
138 |
|
var valid=$('#sousform-'+objsf+' div.ui-state-valid'); |
139 |
|
if(valid.length > 0) { |
140 |
|
document.location.href="../scr/tab.php?obj="+$.getQuery('obj')+"&premier="+$.getQuery('premier') |
141 |
|
+"&advs_id="+$.getQuery('advs_id')+"&recherche="+$.getQuery('recherche')+"&tricol="+$.getQuery('tricol') |
142 |
|
+"&selectioncol="+$.getQuery('selectioncol'); |
143 |
|
} |
144 |
|
$(this).remove(); |
145 |
|
}, |
146 |
|
resizable: false, |
147 |
|
modal: true, |
148 |
|
width: 700, |
149 |
|
height: 520, |
150 |
|
}); |
151 |
|
}, |
152 |
|
async : false |
153 |
|
}); |
154 |
|
//Modification des boutons retours du sous formulaire pour fermer le dialog |
155 |
|
$('#sousform-'+objsf).on("mousedown",'a.retour',function() { |
156 |
|
$('#sousform-'+objsf+' a.retour').attr('onclick',''); |
157 |
|
}); |
158 |
|
$('#sousform-'+objsf).on("click",'a.retour',function() { |
159 |
|
$(dialog).dialog('close').remove(); |
160 |
|
}); |
161 |
|
return false; |
162 |
|
} |
163 |
|
|
164 |
|
// Parse URL Queries Method |
165 |
|
(function($){ |
166 |
|
$.getQuery = function( query ) { |
167 |
|
query = query.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); |
168 |
|
var expr = "[\\?&]"+query+"=([^&#]*)"; |
169 |
|
var regex = new RegExp( expr ); |
170 |
|
var results = regex.exec( window.location.href ); |
171 |
|
if( results !== null ) { |
172 |
|
return results[1]; |
173 |
|
return decodeURIComponent(results[1].replace(/\+/g, " ")); |
174 |
|
} else { |
175 |
|
return false; |
176 |
|
} |
177 |
|
}; |
178 |
|
})(jQuery); |
179 |
|
|
|
/* -- FIN -- */ |
|
180 |
|
function changeQuartier(){ |
181 |
|
|
182 |
|
var idArrondissement = $("#arrondissement option:selected").val(); |
183 |
|
if ( idArrondissement != '' && $.isNumeric(idArrondissement) ){ |
184 |
|
|
185 |
|
link = "../app/listeQuartier.php?idx=" + idArrondissement; |
186 |
|
$.ajax({ |
187 |
|
type: "GET", |
188 |
|
url: link, |
189 |
|
cache: false, |
190 |
|
success: function(html){ |
191 |
|
if ( html !== '' ){ |
192 |
|
|
193 |
|
$('#quartier').empty(); |
194 |
|
$('#quartier').append( |
195 |
|
'<option value="" selected="selected">*</option>' |
196 |
|
); |
197 |
|
|
198 |
|
html = html.split(';'); |
199 |
|
for ( i = 0 ; i < html.length - 1 ; i++ ){ |
200 |
|
|
201 |
|
html_temp = html[i].split('_'); |
202 |
|
$('#quartier').append( |
203 |
|
'<option value="'+html_temp[0]+'" >'+html_temp[1]+'</option>' |
204 |
|
); |
205 |
|
} |
206 |
|
} |
207 |
|
}, |
208 |
|
async: false |
209 |
|
}); |
210 |
|
} |
211 |
|
} |