Subversion Repositories Applications.papyrus

Rev

Rev 1490 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1490 Rev 1550
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: inscription.class.php,v 1.23 2007-06-26 09:32:33 neiluj Exp $
22
// CVS : $Id: inscription.class.php,v 1.24 2007-08-27 13:08:37 alexandre_tb Exp $
23
/**
23
/**
24
* Inscription
24
* Inscription
25
*
25
*
26
* Un module d'inscription, en general ce code est specifique a
26
* Un module d'inscription, en general ce code est specifique a
27
* un site web
27
* un site web
Line 29... Line 29...
29
*@package inscription
29
*@package inscription
30
//Auteur original :
30
//Auteur original :
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.23 $ $Date: 2007-06-26 09:32:33 $
34
*@version       $Revision: 1.24 $ $Date: 2007-08-27 13:08:37 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
Line 204... Line 204...
204
		          setLatLonForm(marker);
204
		          setLatLonForm(marker);
205
	  		    }
205
	  		    }
206
	        });' ;
206
	        });' ;
Line 207... Line 207...
207
	        
207
	        
-
 
208
			if($_REQUEST['action'] == 'modifier') {
-
 
209
				$requete_defaut = 'select a_longitude, a_latitude from annuaire where a_id='.$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID);
-
 
210
				$resultat_defaut = $GLOBALS['ins_db']->query($requete_defaut);
208
			if($_REQUEST['action'] == 'modifier') {
211
				$ligne = $resultat_defaut->fetchRow(DB_FETCHMODE_OBJECT) ;
209
				if ($this->getElementValue ('latitude') != '' && $this->getElementValue('longitude') != '') {
212
				if ($ligne->a_latitude != '' && $ligne->a_longitude != '') {
210
					$script .= '
213
					$script .= '
211
							point = new GLatLng('.$this->getElementValue('latitude').', '.$this->getElementValue('longitude').');
214
							point = new GLatLng('.$ligne->a_latitude.', '.$ligne->a_longitude.');
212
							marker = new GMarker(point, {draggable: true});
215
							marker = new GMarker(point, {draggable: true});
213
							map.addOverlay(marker);' ;
216
							map.addOverlay(marker);' ;
214
				} 
217
				} 
215
			}
218
			}
216
		    $script .= 'geocoder = new GClientGeocoder();
219
		    $script .= 'geocoder = new GClientGeocoder();
-
 
220
	    };' .
217
	    };
221
	    		'}
218
	    function showAddress() {
222
	    function showAddress() {
219
	      var adress_1 = document.getElementById("a_adresse1").value ;
223
	      var adress_1 = document.getElementById("a_adresse1").value ;
220
	      var adress_2 = document.getElementById("a_adresse2").value ;
224
	      var adress_2 = document.getElementById("a_adresse2").value ;
221
	      var ville = document.getElementById("a_ville").value ;
225
	      var ville = document.getElementById("a_ville").value ;
-
 
226
	      var cp = document.getElementById("a_code_postal").value ;
222
	      var cp = document.getElementById("a_code_postal").value ;
227
	      if (document.getElementById("a_ce_pays").type == "select-one") {
223
	      var selectIndex = document.getElementById("a_ce_pays").selectedIndex;
228
	      	var selectIndex = document.getElementById("a_ce_pays").selectedIndex;
-
 
229
	      	var pays = document.getElementById("a_ce_pays").options[selectIndex].text ;
-
 
230
	      } else {
-
 
231
	      	var pays = document.getElementById("a_ce_pays").value;
Line 224... Line 232...
224
	      var pays = document.getElementById("a_ce_pays").options[selectIndex].text ;
232
	      }
225
	      
233
	      
226
	      var address = adress_1 + \' \' + adress_2 + \' \' + \' \' + cp + \' \' + ville + \' \' +pays ;
234
	      var address = adress_1 + \' \' + adress_2 + \' \' + \' \' + cp + \' \' + ville + \' \' +pays ;
227
	      if (geocoder) {
235
	      if (geocoder) {
Line 273... Line 281...
273
					if (is_int ($tableau[$i]['nom_bdd'])) $def=$tableau[$i]['type'].$tableau[$i]['nom_bdd'];
281
					if (is_int ($tableau[$i]['nom_bdd'])) $def=$tableau[$i]['type'].$tableau[$i]['nom_bdd'];
274
							else $def = $tableau[$i]['nom_bdd'];
282
							else $def = $tableau[$i]['nom_bdd'];
275
				}
283
				}
276
				elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' || 
284
				elseif ( $tableau[$i]['type']=='texte' || $tableau[$i]['type']=='textelong' || 
277
							$tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ||
285
							$tableau[$i]['type']=='listedatedeb' || $tableau[$i]['type']=='listedatefin' ||
278
							 $tableau[$i]['type']=='champs_mail') {
286
							 $tableau[$i]['type']=='champs_mail' || $tableau[$i]['type']=='champs_cache') {
279
					$def=$tableau[$i]['nom_bdd'];					
287
					$def=$tableau[$i]['nom_bdd'];					
280
				} elseif ($tableau[$i]['type']=='carte_google') {
288
				} elseif ($tableau[$i]['type']=='carte_google') {
281
					$def = 'carte_google';
289
					$def = 'carte_google';
282
					$valeurs_par_defaut[$def] = array ('latitude' => $valeurs_par_defaut[$tableau[$i]['limite1']], 
290
					$valeurs_par_defaut[$def] = array ('latitude' => $valeurs_par_defaut[$tableau[$i]['limite1']], 
283
												'longitude' => $valeurs_par_defaut[$tableau[$i]['limite2']]);
291
												'longitude' => $valeurs_par_defaut[$tableau[$i]['limite2']]);