Subversion Repositories Applications.papyrus

Rev

Rev 805 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 805 Rev 810
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.fonct.php,v 1.14 2006-04-04 12:23:05 florian Exp $
22
// CVS : $Id: inscription.fonct.php,v 1.15 2006-04-10 14:01:36 florian Exp $
23
// CVS : $Id: inscription.fonct.php,v 1.14 2006-04-04 12:23:05 florian Exp $
23
// CVS : $Id: inscription.fonct.php,v 1.15 2006-04-10 14:01:36 florian Exp $
24
/**
24
/**
25
* Fonctions du module inscription
25
* Fonctions du module inscription
26
*
26
*
27
* Fonctions du module inscription
27
* Fonctions du module inscription
28
*
28
*
Line 30... Line 30...
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
*@author        Florian Schmitt <florian@ecole-et-nature.org>
33
*@author        Florian Schmitt <florian@ecole-et-nature.org>
34
*@copyright     Tela-Botanica 2000-2004
34
*@copyright     Tela-Botanica 2000-2004
35
*@version       $Revision: 1.14 $ $Date: 2006-04-04 12:23:05 $
35
*@version       $Revision: 1.15 $ $Date: 2006-04-10 14:01:36 $
36
*@version       $Revision: 1.14 $ $Date: 2006-04-04 12:23:05 $
36
*@version       $Revision: 1.15 $ $Date: 2006-04-10 14:01:36 $
37
// +------------------------------------------------------------------------------------------------------+
37
// +------------------------------------------------------------------------------------------------------+
38
*/
38
*/
Line 39... Line 39...
39
 
39
 
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
// |                                            ENTETE du PROGRAMME                                       |
41
// |                                            ENTETE du PROGRAMME                                       |
Line 42... Line 42...
42
// +------------------------------------------------------------------------------------------------------+
42
// +------------------------------------------------------------------------------------------------------+
43
 
43
 
44
include_once 'inscription.fonct.wiki.php' ;
44
include_once 'inscription.fonct.wiki.php' ;
45
include_once 'inscription.class.php' ;
45
include_once 'inscription.class.php' ;
46
if (INS_UTILISE_SPIP) include_once 'inscription.fonct.spip.php' ;
46
if (INS_UTILISE_SPIP) include_once 'inscription.fonct.spip.php' ;
47
require_once 'HTML/QuickForm.php' ;
47
//require_once 'HTML/QuickForm.php' ;
Line 48... Line 48...
48
require_once 'HTML/QuickForm/checkbox.php' ;
48
//require_once 'HTML/QuickForm/checkbox.php' ;
49
require_once 'HTML/QuickForm/password.php' ;
49
//require_once 'HTML/QuickForm/password.php' ;
50
 
50
 
Line 84... Line 84...
84
        $url = 'http://'.$GLOBALS['ins_url']->host.'/'.INS_URL_PREFIXE.$chaine ;
84
        $url = 'http://'.$GLOBALS['ins_url']->host.'/'.INS_URL_PREFIXE.$chaine ;
85
    } else {
85
    } else {
86
        $url = str_replace ('&amp;', '&', $GLOBALS['ins_url']->getURL()) ;
86
        $url = str_replace ('&amp;', '&', $GLOBALS['ins_url']->getURL()) ;
87
    }
87
    }
Line 88... Line 88...
88
    
88
    
89
    require_once "HTML/Template/IT.php";
89
    require_once PAP_CHEMIN_RACINE.'api/pear/HTML/Template/IT.php';
90
    $tpl = new HTML_Template_IT() ;
90
    $tpl = new HTML_Template_IT() ;
91
    // Le gabarit du mail est dans un template
91
    // Le gabarit du mail est dans un template
92
    // template 2
92
    // template 2
93
    $requete = 'select it_template from inscription_template where it_id_template=2'.
93
    $requete = 'select it_template from inscription_template where it_id_template=2'.
Line 125... Line 125...
125
*   @return string	HTML
125
*   @return string	HTML
126
*/
126
*/
127
function AUTH_formulaire_login() {
127
function AUTH_formulaire_login() {
Line 128... Line 128...
128
 
128
 
129
    
129
    
130
    require_once "HTML/Template/IT.php";
130
    require_once PAP_CHEMIN_RACINE.'api/pear/HTML/Template/IT.php';
131
    $tpl = new HTML_Template_IT() ;
131
    $tpl = new HTML_Template_IT() ;
132
    // Le formulaire pour se logguer est dans un template
132
    // Le formulaire pour se logguer est dans un template
133
    // template 1
133
    // template 1
Line 134... Line 134...
134
    $requete = 'select it_template from inscription_template where it_id_template=1'.
134
    $requete = 'SELECT it_template FROM inscription_template WHERE it_id_template=1'.
135
    			' and it_i18n like "%'.INS_LANGUE_DEFAUT.'"' ;
135
    			' AND it_i18n LIKE "%'.INS_LANGUE_DEFAUT.'"' ;
136
    
136
    
137
    if (!$tpl -> setTemplate($GLOBALS['ins_db']->getOne ($requete))) {
137
    if (!$tpl -> setTemplate($GLOBALS['ins_db']->getOne ($requete))) {
Line 317... Line 317...
317
 
317
 
318
/** info() - Renvoie une fiche d'information sur la personne ou la structure
318
/** info() - Renvoie une fiche d'information sur la personne ou la structure
319
*
319
*
320
* @return   text   Code HTML de la fiche
320
* @return   text   Code HTML de la fiche
321
*/
321
*/
322
function info($id=-1) {
322
function info($id=-1, $type_info='fiche') {
323
	if ($id==-1) $id=$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID);
323
	if ($id==-1) $id=$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID);
324
    $requete = 'SELECT * FROM '.INS_ANNUAIRE.' WHERE '.INS_ANNUAIRE.'.'
324
    $requete = 'SELECT * FROM '.INS_ANNUAIRE.' WHERE '.INS_ANNUAIRE.'.'
325
               .INS_CHAMPS_ID.'="'.$id.'"' ;          
325
               .INS_CHAMPS_ID.'="'.$id.'"' ;          
326
    $resultat = $GLOBALS['ins_db'] -> query($requete) ; 
326
    $resultat = $GLOBALS['ins_db'] -> query($requete) ; 
327
    if (DB::isError($resultat)) {
327
    if (DB::isError($resultat)) {
328
    	die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
328
    	die ($resultat->getMessage().'<br />'.$resultat->getDebugInfo()) ;
Line 329... Line 329...
329
    }
329
    }
-
 
330
 
-
 
331
    $ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
330
 
332
    //cas de la présentation de la fiche
331
    $ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
333
    if ($type_info=='fiche') {
332
    if ($ligne[INS_CHAMPS_EST_STRUCTURE] == 1) {
334
	    if ($ligne[INS_CHAMPS_EST_STRUCTURE] == 1) {
333
    	$res = '<h1>'.INS_FICHE_STRUCTURE.'</h1>'."\n" ;
335
	    	$res = '<h1>'.$ligne[INS_CHAMPS_NOM].'</h1>'."\n";
334
	    $res .= '<h2>'.$ligne[INS_CHAMPS_NOM].'</h2>'."\n";
336
	    	$res .= '<h2>'.INS_FICHE_STRUCTURE.'</h2>'."\n" ;		    
335
	    $res .= '<ul class="affiche_infos">'."\n";
337
		    $res .= '<ul class="affiche_infos">'."\n";
336
	    $res .= ligne_inscription(INS_SIGLE_DE_LA_STRUCTURE, $ligne[INS_CHAMPS_SIGLE_STRUCTURE]) ;
338
		    $res .= ligne_inscription(INS_SIGLE_DE_LA_STRUCTURE, $ligne[INS_CHAMPS_SIGLE_STRUCTURE]) ;
337
	    if (INS_CHAMPS_NUM_AGREMENT != '') $res .= ligne_inscription(INS_NUM_AGREMENT, $ligne[INS_CHAMPS_NUM_AGREMENT]) ;
339
		    if (INS_CHAMPS_NUM_AGREMENT != '') $res .= ligne_inscription(INS_NUM_AGREMENT, $ligne[INS_CHAMPS_NUM_AGREMENT]) ;
338
    } else {
340
	    } else {
339
    	$res = '<h1>'.INS_FICHE_PERSONNELLE.'</h1>'."\n" ;
341
	    	$res = '<h1>'.$ligne[INS_CHAMPS_PRENOM].' '.$ligne[INS_CHAMPS_NOM].'</h1>'."\n";
340
    	$res .= '<h2>'.$ligne[INS_CHAMPS_PRENOM].' '.$ligne[INS_CHAMPS_NOM].'</h2>'."\n";
342
	    	$res .= '<h2>'.INS_FICHE_PERSONNELLE.'</h2>'."\n" ;	    	
341
    	$res .= '<ul class="affiche_infos">'."\n";
343
	    	$res .= '<ul class="affiche_infos">'."\n";
342
    }
344
	    }
343
    
345
	    
344
    $res .= ligne_inscription(INS_ADRESSE_1, $ligne[INS_CHAMPS_ADRESSE_1]) ;
346
	    $res .= ligne_inscription(INS_ADRESSE_1, $ligne[INS_CHAMPS_ADRESSE_1]) ;
345
    $res .= ligne_inscription(INS_ADRESSE_2, $ligne[INS_CHAMPS_ADRESSE_2]) ;
347
	    $res .= ligne_inscription(INS_ADRESSE_2, $ligne[INS_CHAMPS_ADRESSE_2]) ;
346
    $res .= ligne_inscription(INS_CODE_POSTAL, $ligne[INS_CHAMPS_CODE_POSTAL]) ;
348
	    $res .= ligne_inscription(INS_CODE_POSTAL, $ligne[INS_CHAMPS_CODE_POSTAL]) ;
347
    $res .= ligne_inscription(INS_VILLE, $ligne[INS_CHAMPS_VILLE]) ;
349
	    $res .= ligne_inscription(INS_VILLE, $ligne[INS_CHAMPS_VILLE]) ;
348
    $pays = new ListeDePays($GLOBALS['ins_db']) ;
350
	    $pays = new ListeDePays($GLOBALS['ins_db']) ;
349
    $res .= ligne_inscription(INS_PAYS, $pays->getNomPays($ligne[INS_CHAMPS_PAYS], INS_LANGUE_DEFAUT)) ;
351
	    $res .= ligne_inscription(INS_PAYS, $pays->getNomPays($ligne[INS_CHAMPS_PAYS], INS_LANGUE_DEFAUT)) ;
350
    $res .= ligne_inscription(INS_TELEPHONE, $ligne[INS_CHAMPS_TELEPHONE]) ;
352
	    $res .= ligne_inscription(INS_TELEPHONE, $ligne[INS_CHAMPS_TELEPHONE]) ;
351
    $res .= ligne_inscription(INS_FAX, $ligne[INS_CHAMPS_FAX]) ;
353
	    $res .= ligne_inscription(INS_FAX, $ligne[INS_CHAMPS_FAX]) ;
352
    if (INS_UTILISE_WIKINI) {
354
	    if (INS_UTILISE_WIKINI) {
353
		$res .= ligne_inscription (INS_NOM_WIKI, $ligne[INS_CHAMPS_NOM_WIKINI]) ;
-
 
354
	}
-
 
355
    if ($GLOBALS['AUTH']->getAuth()) $res .= ligne_inscription(INS_EMAIL, '<a href="mailto:'.$ligne[INS_CHAMPS_MAIL].'">'.$ligne[INS_CHAMPS_MAIL].'</a>');
355
			$res .= ligne_inscription (INS_NOM_WIKI, $ligne[INS_CHAMPS_NOM_WIKINI]) ;
356
    else $res .= '<br /><p class="zone_info">'.INS_PAS_IDENTIFIE.'</p>'."\n";
356
		}
357
    if ($ligne[INS_CHAMPS_SITE_INTERNET]!='') {
357
	    if ($ligne[INS_CHAMPS_SITE_INTERNET]!='') {
358
    	$res .= ligne_inscription(INS_SITE_INTERNET, '<a href="'.$ligne[INS_CHAMPS_SITE_INTERNET].'" onclick="javascript:window.open(this.href);return false;">'.$ligne[INS_CHAMPS_SITE_INTERNET].'</a>');
-
 
359
    }
-
 
360
    $res .= '</ul>'."\n";
-
 
361
    if ($id==$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID)) {
-
 
362
	    $res .= '<br />'."\n";
-
 
363
	    $res .= '<ul>'."\n";
-
 
364
	    if ($ligne[INS_CHAMPS_VISIBLE] == 1) {
-
 
365
	    	$res .= '<li>'.INS_VOUS_APPARAISSEZ.'</li>'."\n";
-
 
366
	    } else $res .= '<li>'.INS_VOUS_APPARAISSEZ_PAS.'</li>'."\n";
-
 
367
	    if ($ligne[INS_CHAMPS_LETTRE] == 1) {
-
 
368
	    	$res .= '<li>'.INS_VOUS_RECEVEZ_LETTRE.'</li>'."\n";
-
 
369
	    } else $res .= '<li>'.INS_VOUS_RECEVEZ_PAS_LETTRE.'</li>'."\n";
-
 
370
	    $res .= '</ul>'."\n";
-
 
371
	    $res .= '<br />'."\n";
358
	    	$res .= ligne_inscription(INS_SITE_INTERNET, '<a href="'.$ligne[INS_CHAMPS_SITE_INTERNET].'" onclick="javascript:window.open(this.href);return false;">'.$ligne[INS_CHAMPS_SITE_INTERNET].'</a>');
372
	    $res .= '<ul>'."\n";;
359
	    }
373
	    $res .= '<li><a href="'.$GLOBALS['ins_url']->getURL().'&amp;action=modifier&amp;form_structure='.$ligne[INS_CHAMPS_EST_STRUCTURE].'">'.INS_MODIFIER_INSCRIPTION.'</a></li>'."\n" ;
-
 
374
	    $res .= '<li><a href="'.$GLOBALS['ins_url']->getURL().'&amp;action=supprimer&amp;form_structure='.$ligne[INS_CHAMPS_EST_STRUCTURE].'" onclick="javascript:return confirm(\''.INS_SUPPRIMER_INSCRIPTION.'?\');">'.INS_SUPPRIMER_INSCRIPTION.'</a></li>'."\n" ;
360
	    if ($GLOBALS['AUTH']->getAuth()) $res .= ligne_inscription(INS_EMAIL, '<a href="mailto:'.$ligne[INS_CHAMPS_MAIL].'">'.$ligne[INS_CHAMPS_MAIL].'</a>');
-
 
361
	    else $res .= '<br /><p class="zone_info">'.INS_PAS_IDENTIFIE.'</p>'."\n";
-
 
362
	    $res .= '</ul>'."\n";
-
 
363
	    if ($id==$GLOBALS['AUTH']->getAuthData(INS_CHAMPS_ID)) {
-
 
364
		    $res .= '<br />'."\n";
-
 
365
		    $res .= '<ul>'."\n";
-
 
366
		    if ($ligne[INS_CHAMPS_VISIBLE] == 1) {
-
 
367
		    	$res .= '<li>'.INS_VOUS_APPARAISSEZ.'</li>'."\n";
-
 
368
		    } else $res .= '<li>'.INS_VOUS_APPARAISSEZ_PAS.'</li>'."\n";
-
 
369
		    if ($ligne[INS_CHAMPS_LETTRE] == 1) {
-
 
370
		    	$res .= '<li>'.INS_VOUS_RECEVEZ_LETTRE.'</li>'."\n";
-
 
371
		    } else $res .= '<li>'.INS_VOUS_RECEVEZ_PAS_LETTRE.'</li>'."\n";
-
 
372
		    $res .= '</ul>'."\n";
-
 
373
		    $res .= '<br />'."\n";
-
 
374
		    $res .= '<ul>'."\n";;
-
 
375
		    $res .= '<li><a href="'.$GLOBALS['ins_url']->getURL().'&amp;action=modifier&amp;form_structure='.$ligne[INS_CHAMPS_EST_STRUCTURE].'">'.INS_MODIFIER_INSCRIPTION.'</a></li>'."\n" ;
-
 
376
		    $res .= '<li><a href="'.$GLOBALS['ins_url']->getURL().'&amp;action=supprimer&amp;form_structure='.$ligne[INS_CHAMPS_EST_STRUCTURE].'" onclick="javascript:return confirm(\''.INS_SUPPRIMER_INSCRIPTION.'?\');">'.INS_SUPPRIMER_INSCRIPTION.'</a></li>'."\n" ;
-
 
377
		    $res .= '<li><a href="'.$GLOBALS['ins_url']->getURL().'&amp;action=deconnexion">'.INS_DECONNEXION.'</a></li>'."\n" ;
-
 
378
		    $res .= '</ul>'."\n";
-
 
379
	    } 
-
 
380
    } elseif ($type_info=='abonnement') {
-
 
381
    	$res = '<h1>'.$ligne[INS_CHAMPS_PRENOM].' '.$ligne[INS_CHAMPS_NOM].'</h1>'."\n";
-
 
382
    	$res .= '<h2>'.INS_GESTION_DES_ABONNEMENTS.'</h2>'."\n" ;
-
 
383
    	include_once PAP_CHEMIN_RACINE.'client/bazar/configuration/baz_config.inc.php' ;
-
 
384
    	include_once PAP_CHEMIN_RACINE.'client/bazar/bibliotheque/bazar.fonct.php' ;
-
 
385
    	$GLOBALS['id_user']=$GLOBALS['AUTH']->getAuthData(BAZ_CHAMPS_ID);
-
 
386
    	$res .= baz_s_inscrire();
-
 
387
    			
-
 
388
    } elseif ($type_info=='actus') {
-
 
389
    	$res = '<h1>'.INS_ACTUALITES_DEPOSEES.'</h1>'."\n" ;
-
 
390
		    $res .= '<h2>'.$ligne[INS_CHAMPS_PRENOM].' '.$ligne[INS_CHAMPS_NOM].'</h2>'."\n";
-
 
391
    } elseif ($type_info=='ressources') {
-
 
392
    	$res = '<h1>'.INS_RESSOURCES_ASSOCIEES.'</h1>'."\n" ;
-
 
393
		    $res .= '<h2>'.$ligne[INS_CHAMPS_PRENOM].' '.$ligne[INS_CHAMPS_NOM].'</h2>'."\n";
-
 
394
    } elseif ($type_info=='competences') {
375
	    $res .= '<li><a href="'.$GLOBALS['ins_url']->getURL().'&amp;action=deconnexion">'.INS_DECONNEXION.'</a></li>'."\n" ;
395
    	$res = '<h1>'.INS_COMPETENCES_ASSOCIEES.'</h1>'."\n" ;
376
	    $res .= '</ul>'."\n";
396
		$res .= '<h2>'.$ligne[INS_CHAMPS_PRENOM].' '.$ligne[INS_CHAMPS_NOM].'</h2>'."\n";
377
    }
397
    }
Line 664... Line 684...
664
}
684
}
Line 665... Line 685...
665
 
685
 
666
/* +--Fin du code ----------------------------------------------------------------------------------------+
686
/* +--Fin du code ----------------------------------------------------------------------------------------+
667
*
687
*
-
 
688
* $Log: not supported by cvs2svn $
-
 
689
* Revision 1.14  2006/04/04 12:23:05  florian
-
 
690
* modifs affichage fiches, généricité de la carto, modification totale de l'appli annuaire
668
* $Log: not supported by cvs2svn $
691
*
669
* Revision 1.13  2006/03/21 10:25:33  alexandre_tb
692
* Revision 1.13  2006/03/21 10:25:33  alexandre_tb
670
* ajout d'un template pour le mail de confirmation
693
* ajout d'un template pour le mail de confirmation
671
*
694
*
672
* Revision 1.12  2006/03/15 11:02:35  alexandre_tb
695
* Revision 1.12  2006/03/15 11:02:35  alexandre_tb