/[openfoncier]/trunk/app/js/script.js
ViewVC logotype

Contents of /trunk/app/js/script.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 544 - (show annotations)
Mon Oct 29 16:25:36 2012 UTC (12 years, 3 months ago) by nhaye
File MIME type: application/javascript
File size: 4940 byte(s)
Création d'une classe "abstraite" virtual_dbform.class.php
création de la classe demande_encours (accessible aux services),
création de la classe consultation_retour_service (permettant un retour d'avis des services),
ajout d'une méthode d'affichage de dialog box (jquery-ui dialog), fonctionne de la même façon que ajaxIt,
correction des entrées de menu,
ajout des droits necessaires.


1 // specific openfoncier ========================================================
2
3 function bible(){
4 if(fenetreouverte==true)
5 pfenetre.close();
6 var ev=document.f2.evenement.value;
7 var idx=document.f2.dossier.value;
8 pfenetre=window.open("../app/bible.php?ev="+ev+"&idx="+idx,"bible","scrollbars=yes,width=600,height=600,top=120,left=120");
9 fenetreouverte=true;
10 }
11
12 function bible2()
13 {
14 if(fenetreouverte==true)
15 pfenetre.close();
16 var ev=document.f2.evenement.value;
17 var idx=document.f2.dossier.value;
18 pfenetre=window.open("../app/bible2.php?ev="+ev+"&idx="+idx,"bible","scrollbars=yes,width=600,height=600,top=120,left=120");
19 fenetreouverte=true;
20 }
21
22 function bible_auto(){
23 if(fenetreouverte==true)
24 pfenetre.close();
25 var ev=document.f2.evenement.value;
26 var idx=document.f2.dossier.value;
27 pfenetre=window.open("../app/bible_auto.php?idx="+idx+"&ev="+ev,"evenement","width=600,height=300,top=120,left=120");
28 fenetreouverte=true;
29 }
30
31 function dossierads_d(debut)
32 {
33 //if(fenetreouverte==true)
34 window.location="../pdf/pdfetat.php?obj=dossier_ads_d&nature="
35 +document.f1.nature.value+"&idx=demo&datedebut="
36 +document.f1.datedebut.value+"&datefin="+document.f1.datefin.value;
37 }
38
39 function dossierdepot()
40 {
41 //if(fenetreouverte==true)
42 window.location="../pdf/pdfetat.php?obj=dossier_depot&nature="+
43 document.f1.nature.value+"&idx=demo&datedebut="+
44 document.f1.datedebut.value+"&datefin="+document.f1.datefin.value;
45 }
46
47 function dossierads()
48 {
49 //if(fenetreouverte==true)
50 window.location="../pdf/pdfetat.php?obj=dossier_ads&nature="+
51 document.f1.nature.value+"&idx=demo&datedebut="+
52 document.f1.datedebut.value+"&datefin="+document.f1.datefin.value;
53 }
54
55
56 function VerifNumdec(champ) {
57 champ.value = champ.value.replace(",", "."); // remplacement de la virgule
58 //if (champ.value.lastIndexOf(".") == -1){ // champ decimal
59 if (isNaN(champ.value)) {
60 alert(msg_alert_error_verifnum);
61 champ.value = "";
62 return;
63 }
64 //}
65
66 }
67 /* -- Debut -- */
68 function messageIt(objsf, link, empty) {
69 // recuperation du terme recherche
70 var recherche = document.getElementById("recherchedyn");
71 if (recherche != null) {
72 link += "&recherche="+recherche.value;
73 }else {
74 link += "&recherche=";
75 }
76 // execution de la requete en POST
77 $.ajax({
78 type: "GET",
79 url: link,
80 cache: false,
81 success: function(html){
82 (empty == true )?$("#sousform-"+objsf).empty():'';
83 $("#sousform-"+objsf).append(html);
84 om_initialize_content();
85 },
86 async: false
87 });
88 }
89
90 /* Plugin jQuery qui lance un espèce d'appel AJAX vers un script PHP de téléchargement de fichier*/
91 jQuery.download = function(url, data, method){
92 //url and data options required
93 if( url && data ){
94 //data can be string of parameters or array/object
95 data = typeof data == 'string' ? data : jQuery.param(data);
96 //split params into form inputs
97 var inputs = '';
98 jQuery.each(data.split('&'), function(){
99 var pair = this.split('=');
100 inputs+='<input type="hidden" name="'+ pair[0] +'" value="'+ pair[1] +'" />';
101 });
102 //send request
103 jQuery('<form action="'+ url +'" method="'+ (method||'post') +'">'+inputs+'</form>')
104 .prependTo('body').submit().remove();
105 };
106 };
107
108 /* -- FIN -- */
109 function popupIt(objsf, link) {
110 // Insertion du conteneur du dialog
111 var dialog = $('<div id=\"sousform-'+objsf+'\"></div>').insertAfter('.formControls');
112 $('<input type=\"text\" name=\"recherchedyn\" id=\"recherchedyn\" value=\"\" class=\"champFormulaire\" style=\"display:none\" />').insertAfter('#sousform-'+objsf);
113
114 // execution de la requete passee en parametre
115 // (idem ajaxIt + callback)
116 $.ajax({
117 type: "GET",
118 url: link,
119 cache: false,
120 success: function(html){
121 //Suppression d'un precedent dialog
122 dialog.empty();
123 //Ajout du contenu recupere
124 dialog.append(html);
125 //Initialisation du theme OM
126 om_initialize_content();
127 //Creation du dialog
128 $(dialog).dialog({
129 //OnClose suppression du contenu
130 close: function(ev, ui) {
131 $(this).remove();
132 },
133 resizable: false,
134 modal: true,
135 width: 700,
136 height: 520,
137 });
138 },
139 async : false
140 });
141 //Modification des boutons retours du sous formulaire pour fermer le dialog
142 $('#sousform-'+objsf).on("mousedown",'a.retour',function() {
143 $('#sousform-'+objsf+' a.retour').attr('onclick','');
144 });
145 $('#sousform-'+objsf).on("click",'a.retour',function() {
146 $(dialog).dialog('close').remove();
147 });
148 return false;
149 }

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26