Subversion Repositories Applications.papyrus

Rev

Rev 1428 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1428 Rev 1467
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
16
// | Lesser General Public License for more details.                                                      |
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: annuaire_backoffice.php,v 1.7 2007-06-01 13:39:52 alexandre_tb Exp $
22
// CVS : $Id: annuaire_backoffice.php,v 1.8 2007-06-25 09:59:03 alexandre_tb Exp $
23
/**
23
/**
24
* programme principal du module annuaire_moteur
24
* programme principal du module annuaire_moteur
25
*
25
*
26
* programme principal du module annuaire_moteur
26
* programme principal du module annuaire_moteur
27
*
27
*
28
*@package annuaire
28
*@package annuaire
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aucun
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.7 $
34
*@version       $Revision: 1.8 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
 
41
 
42
 
42
 
43
include_once 'configuration/bottin.config.inc.php';
43
include_once 'configuration/bottin.config.inc.php';
44
 
44
 
45
include_once INS_CHEMIN_APPLI.'bibliotheque/annuaire_backoffice.fonct.php';
45
include_once INS_CHEMIN_APPLI.'bibliotheque/annuaire_backoffice.fonct.php';
46
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.php';
46
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.class.php';
47
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.fonct.php';
47
include_once INS_CHEMIN_APPLI.'bibliotheque/inscription.fonct.php';
48
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.fonct.php';
48
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.fonct.php';
49
 
49
 
50
$lang=INS_LANGUE_DEFAUT;
50
$lang=INS_LANGUE_DEFAUT;
51
define ("ANN_MAIL_TOUS", 1) ;
51
define ("ANN_MAIL_TOUS", 1) ;
52
define ("ANN_MAIL_TOUS_ENVOIE", 2) ;
52
define ("ANN_MAIL_TOUS_ENVOIE", 2) ;
53
 
53
 
54
// Action pour valider une demande d inscription
54
// Action pour valider une demande d inscription
55
define ('ANN_ACTION_VALIDER_INSCRIPTION', 3);
55
define ('ANN_ACTION_VALIDER_INSCRIPTION', 3);
56
 
56
 
57
// Action pour supprimer une demande d inscription
57
// Action pour supprimer une demande d inscription
58
define ('ANN_ACTION_SUPPRIMER_DEMANDE_INSCRIPTION', 4);
58
define ('ANN_ACTION_SUPPRIMER_DEMANDE_INSCRIPTION', 4);
59
 
59
 
60
// Action pour supprimer un inscrit
60
// Action pour supprimer un inscrit
61
define ('ANN_ACTION_SUPPRIMER_INSCRIT', 5);
61
define ('ANN_ACTION_SUPPRIMER_INSCRIT', 5);
62
 
62
 
63
// TODO: Nom de la variable action, a modifier dans le programme
63
// TODO: Nom de la variable action, a modifier dans le programme
64
define ('ANN_VARIABLE_ACTION', 'action');
64
define ('ANN_VARIABLE_ACTION', 'action');
65
define ('INS_VARIABLE_ID_DEMANDEUR', 'id_demandeur');
65
define ('INS_VARIABLE_ID_DEMANDEUR', 'id_demandeur');
66
define ('INS_VARIABLE_ID_INSCRIT', 'id_inscrit');
66
define ('INS_VARIABLE_ID_INSCRIT', 'id_inscrit');
67
 
67
 
68
// Recherche parametres menu actif : ils ne sont pas present dans le contexte, quel dommage !
68
// Recherche parametres menu actif : ils ne sont pas present dans le contexte, quel dommage !
69
$requete_menu =  'SELECT gm_application_arguments '.
69
$requete_menu =  'SELECT gm_application_arguments '.
70
                 'FROM gen_menu '.
70
                 'FROM gen_menu '.
71
                 'WHERE gm_id_menu = '.$_GET['menu'];         
71
                 'WHERE gm_id_menu = '.$_GET['menu'];         
72
$resultat_menu = $GLOBALS['_GEN_commun']['pear_db']->query($requete_menu);
72
$resultat_menu = $GLOBALS['_GEN_commun']['pear_db']->query($requete_menu);
73
$info_menu = $resultat_menu->fetchRow(DB_FETCHMODE_OBJECT);
73
$info_menu = $resultat_menu->fetchRow(DB_FETCHMODE_OBJECT);
74
$resultat_menu->free();
74
$resultat_menu->free();
75
if (isset($info_menu->gm_application_arguments)) {
75
if (isset($info_menu->gm_application_arguments)) {
76
	$arguments = explode(' ', $info_menu->gm_application_arguments);
76
	$arguments = explode(' ', $info_menu->gm_application_arguments);
77
   	for ($i = 0; $i < count($arguments); $i++) {
77
   	for ($i = 0; $i < count($arguments); $i++) {
78
   		$attr = explode('=', $arguments[$i]);
78
   		$attr = explode('=', $arguments[$i]);
79
   		if ($attr[0] != '') {
79
   		if ($attr[0] != '') {
80
	    	$info_application->$attr[0] = (isset($attr[1]) ? $attr[1] : '');
80
	    	$info_application->$attr[0] = (isset($attr[1]) ? $attr[1] : '');
81
   		}
81
   		}
82
   	}
82
   	}
83
}
83
}
84
//cas de l'annuaire admin papyrus, on modifie certaines constantes
84
//cas de l'annuaire admin papyrus, on modifie certaines constantes
85
if (isset ($info_application->type_annuaire)  && $info_application->type_annuaire==1) {
85
if (isset ($info_application->type_annuaire)  && $info_application->type_annuaire==1) {
86
	include_once INS_CHEMIN_APPLI.'configuration/annuaire_backoffice.config.inc.php';
86
	include_once INS_CHEMIN_APPLI.'configuration/annuaire_backoffice.config.inc.php';
87
}
87
}
88
// recuperation de la configuration
88
// recuperation de la configuration
89
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.class.php';
89
include_once INS_CHEMIN_APPLI.'bibliotheque/bottin.class.php';
90
$GLOBALS['ins_config'] = inscription::getConfig();
90
$GLOBALS['ins_config'] = inscription::getConfig();
-
 
91
// Template du formulaire
-
 
92
$GLOBALS['ins_config']['ic_inscription_template'] = inscription::getTemplate(INS_TEMPLATE_FORMULAIRE, 
-
 
93
    				$GLOBALS['ins_config']['ic_id_inscription']);
91
 
94
 
92
// +------------------------------------------------------------------------------------------------------+
95
// +------------------------------------------------------------------------------------------------------+
93
// |                                            CORPS du PROGRAMME                                        |
96
// |                                            CORPS du PROGRAMME                                        |
94
// +------------------------------------------------------------------------------------------------------+
97
// +------------------------------------------------------------------------------------------------------+
95
function afficherContenuCorps () {
98
function afficherContenuCorps () {
96
	$res = '';
99
	$res = '';
97
    if (!$GLOBALS['AUTH']->getAuth())  {
100
    if (!$GLOBALS['AUTH']->getAuth())  {
98
        $res .= AUTH_formulaire_login() ;
101
        $res .= AUTH_formulaire_login() ;
99
    } else {
102
    } else {
100
        if (isset($_REQUEST[INS_CHAMPS_ID])) {
103
        if (isset($_REQUEST[INS_CHAMPS_ID])) {
101
            include_once (INS_CHEMIN_APPLI.'bibliotheque/edition_fiche.php');
104
            include_once (INS_CHEMIN_APPLI.'bibliotheque/edition_fiche.php');
102
            $GLOBALS['ins_url']->addQueryString (INS_CHAMPS_ID, $_REQUEST[INS_CHAMPS_ID]) ;
105
            $GLOBALS['ins_url']->addQueryString (INS_CHAMPS_ID, $_REQUEST[INS_CHAMPS_ID]) ;
103
            return putFrame() ;
106
            return putFrame() ;
104
        }
107
        }
105
        
108
        
106
        // Les actions 	1 => envoie d un mail a tous
109
        // Les actions 	1 => envoie d un mail a tous
107
        //				2 => valider une demande d inscription
110
        //				2 => valider une demande d inscription
108
        //				3 => supprimer une demande d inscription
111
        //				3 => supprimer une demande d inscription
109
        // 				5 => supprimer un inscrit
112
        // 				5 => supprimer un inscrit
110
        if (isset ($_GET[ANN_VARIABLE_ACTION])) {
113
        if (isset ($_GET[ANN_VARIABLE_ACTION])) {
111
            switch ($_GET[ANN_VARIABLE_ACTION]) {
114
            switch ($_GET[ANN_VARIABLE_ACTION]) {
112
            	case ANN_MAIL_TOUS :
115
            	case ANN_MAIL_TOUS :
113
            	case ANN_MAIL_TOUS_ENVOIE :
116
            	case ANN_MAIL_TOUS_ENVOIE :
114
            	include_once (INS_CHEMIN_APPLI.'bibliotheque/mail_tous.php') ;
117
            	include_once (INS_CHEMIN_APPLI.'bibliotheque/mail_tous.php') ;
115
            	return putFrame() ;
118
            	return putFrame() ;
116
            	break;
119
            	break;
117
            	case ANN_ACTION_VALIDER_INSCRIPTION : $res .= inscription::validerInscription();
120
            	case ANN_ACTION_VALIDER_INSCRIPTION : $res .= inscription::validerInscription();
118
            	break;
121
            	break;
119
            	case ANN_ACTION_SUPPRIMER_DEMANDE_INSCRIPTION: $res .= inscription::supprimerDemandeInscription();
122
            	case ANN_ACTION_SUPPRIMER_DEMANDE_INSCRIPTION: $res .= inscription::supprimerDemandeInscription();
120
            	break;
123
            	break;
121
            	case ANN_ACTION_SUPPRIMER_INSCRIT : $res .= inscription::supprimerInscription();
124
            	case ANN_ACTION_SUPPRIMER_INSCRIT : $res .= inscription::supprimerInscription();
122
            	break;
125
            	break;
123
            }
126
            }
124
        }
127
        }
125
        if (isset($_REQUEST['ajouter'])) {
128
        if (isset($_REQUEST['ajouter'])) {
126
        	return ajouterInscrit() ;	
129
        	return ajouterInscrit() ;	
127
        }
130
        }
128
        $res .= "<div>".mkengine()."</div>\n" ;
131
        $res .= "<div>".mkengine()."</div>\n" ;
129
        
132
        
130
        // Liste des inscrits en attente de moderation
133
        // Liste des inscrits en attente de moderation
131
        $res .= '<h1>'.INS_EN_ATTENTE_DE_MODERATION.'</h1>';
134
        $res .= '<h1>'.INS_EN_ATTENTE_DE_MODERATION.'</h1>';
132
        //$res .= print_r(inscription::getInscritEnAttenteModeration(), true);
135
        //$res .= print_r(inscription::getInscritEnAttenteModeration(), true);
133
        $res .= inscription::getTableauEnAttente((inscription::getInscritEnAttenteModeration()));
136
        $res .= inscription::getTableauEnAttente((inscription::getInscritEnAttenteModeration()));
134
        
137
        
135
    }
138
    }
136
    return $res ;
139
    return $res ;
137
}
140
}
138
 
141
 
139
?>
142
?>