134 |
$(dialog).dialog({ |
$(dialog).dialog({ |
135 |
//OnClose suppression du contenu |
//OnClose suppression du contenu |
136 |
close: function(ev, ui) { |
close: function(ev, ui) { |
|
//Spécifique à la modification de consultation par retour d'avis de service |
|
|
var redirect = $('<form name="redirect" method="GET" action="../scr/tab.php">'+ |
|
|
'<input type="hidden" name="obj" value="'+$.getQuery('obj')+'" />'+ |
|
|
'<input type="hidden" name="premier" value="'+$.getQuery('premier')+'" />'+ |
|
|
'<input type="hidden" name="advs_id" value="'+$.getQuery('advs_id')+'" />'+ |
|
|
'<input type="hidden" name="recherche" value="'+$.getQuery('recherche')+'" />'+ |
|
|
'<input type="hidden" name="tricol" value="'+$.getQuery('tricol')+'" />'+ |
|
|
'<input type="hidden" name="selectioncol" value="'+$.getQuery('selectioncol')+'" />'+ |
|
|
'</form>').insertAfter('.formControls'); |
|
|
|
|
137 |
// Si le formulaire est submit et valide |
// Si le formulaire est submit et valide |
138 |
var valid=$('#sousform-'+objsf+' div.ui-state-valid'); |
var valid=$('#sousform-'+objsf+' div.ui-state-valid'); |
139 |
if(valid.length > 0) { |
if(valid.length > 0) { |
140 |
redirect.submit(); |
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(); |
$(this).remove(); |
145 |
}, |
}, |
177 |
}; |
}; |
178 |
})(jQuery); |
})(jQuery); |
179 |
|
|
180 |
function changeQuartier(){ |
function changeDataSelect(tn, ds, joker){ |
|
|
|
|
var idArrondissement = $("#arrondissement option:selected").val(); |
|
|
if ( idArrondissement != '' && $.isNumeric(idArrondissement) ){ |
|
181 |
|
|
182 |
link = "../app/listeQuartier.php?idx=" + idArrondissement; |
var idArrondissement = $("#"+ds+" option:selected").val(); |
183 |
$.ajax({ |
link = "../app/listData.php?idx=" + idArrondissement + "&tn=" + tn + "&ds=" + ds; |
184 |
type: "GET", |
$.ajax({ |
185 |
url: link, |
type: "GET", |
186 |
cache: false, |
url: link, |
187 |
success: function(html){ |
cache: false, |
188 |
if ( html !== '' ){ |
dataType: "json", |
189 |
|
success: function(html){ |
190 |
|
|
191 |
|
$('#'+tn).empty(); |
192 |
|
|
193 |
|
if ( joker == true ) |
194 |
|
$('#'+tn).append( |
195 |
|
'<option value="" selected="selected">*</option>' |
196 |
|
); |
197 |
|
else |
198 |
|
$('#'+tn).append( |
199 |
|
'<option value="" selected="selected">Choisir ' + tn + '</option>' |
200 |
|
); |
201 |
|
|
202 |
|
if ( html !== '' ){ |
203 |
|
|
204 |
|
html = html.split(';'); |
205 |
|
for ( i = 0 ; i < html.length - 1 ; i++ ){ |
206 |
|
|
207 |
$('#quartier').empty(); |
html_temp = html[i].split('_'); |
208 |
$('#quartier').append( |
$('#'+tn).append( |
209 |
'<option value="" selected="selected">*</option>' |
'<option value="'+html_temp[0]+'" >'+html_temp[1]+'</option>' |
210 |
); |
); |
|
|
|
|
html = html.split(';'); |
|
|
for ( i = 0 ; i < html.length - 1 ; i++ ){ |
|
|
|
|
|
html_temp = html[i].split('_'); |
|
|
$('#quartier').append( |
|
|
'<option value="'+html_temp[0]+'" >'+html_temp[1]+'</option>' |
|
|
); |
|
|
} |
|
211 |
} |
} |
212 |
}, |
} |
213 |
async: false |
}, |
214 |
}); |
async: false |
215 |
|
}); |
216 |
|
} |
217 |
|
function vuploadMulti(champ) { |
218 |
|
// |
219 |
|
if (fenetreouverte == true) { |
220 |
|
pfenetre.close(); |
221 |
|
} |
222 |
|
// |
223 |
|
pfenetre = window.open("../spg/upload.php?origine="+champ+"&form="+$('input[name='+champ+']').closest('form').attr('name'),"upload","width=400,height=300,top=120,left=120"); |
224 |
|
//pfenetre = window.open("../spg/upload2.php?origine="+champ,"upload2","width=300,height=100,top=120,left=120"); |
225 |
|
// |
226 |
|
fenetreouverte = true; |
227 |
|
} |
228 |
|
function tmpUpload(champ) { |
229 |
|
// |
230 |
|
if (fenetreouverte == true) { |
231 |
|
pfenetre.close(); |
232 |
} |
} |
233 |
|
// |
234 |
|
pfenetre = window.open("../app/tmpUpload.php?origine="+champ+"&form="+$('input[name='+champ+']').closest('form').attr('name'),"upload","width=400,height=300,top=120,left=120"); |
235 |
|
//pfenetre = window.open("../spg/upload2.php?origine="+champ,"upload2","width=300,height=100,top=120,left=120"); |
236 |
|
// |
237 |
|
fenetreouverte = true; |
238 |
|
} |
239 |
|
|
240 |
|
$(function() { |
241 |
|
hideFields(); |
242 |
|
}); |
243 |
|
|
244 |
|
function changeDemandeType(){ |
245 |
|
|
246 |
|
var idDossierAutorisationTypeDetaille = $("#dossier_autorisation_type_detaille option:selected").val(); |
247 |
|
|
248 |
|
if ( $.isNumeric(idDossierAutorisationTypeDetaille) ){ |
249 |
|
|
250 |
|
changeDataSelect('demande_type','dossier_autorisation_type_detaille'); |
251 |
|
|
252 |
|
$('#demande_type').parent().parent().show(); |
253 |
|
} |
254 |
|
else { |
255 |
|
hideFields(); |
256 |
|
} |
257 |
|
} |
258 |
|
|
259 |
|
function hideFields(){ |
260 |
|
$('.bloc').each( |
261 |
|
function(){ |
262 |
|
if ( !$(this).hasClass('dossier_type') && !$(this).hasClass('dossier_type_demande_date') ) |
263 |
|
$(this).hide(); |
264 |
|
} |
265 |
|
); |
266 |
|
|
267 |
|
$('.field-type-text').hide(); |
268 |
|
$('input[type=submit]').hide(); |
269 |
|
$('#demande_type').parent().parent().hide(); |
270 |
|
} |
271 |
|
|
272 |
|
function showFormsDemande(){ |
273 |
|
$('.bloc').each( |
274 |
|
function(){ |
275 |
|
if ( !$(this).hasClass('dossier_type') && !$(this).hasClass('dossier_type_demande_date') ) |
276 |
|
$(this).show(); |
277 |
|
} |
278 |
|
); |
279 |
|
|
280 |
|
$('.field-type-text').show(); |
281 |
|
$('input[type=submit]').show(); |
282 |
} |
} |