Subversion Repositories eFlore/Archives.herbiers

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 jp_milcent 1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This file is part of Herbier - Administration.                                                       |
9
// |                                                                                                      |
10
// | Foobar is free software; you can redistribute it and/or modify                                       |
11
// | it under the terms of the GNU General Public License as published by                                 |
12
// | the Free Software Foundation; either version 2 of the License, or                                    |
13
// | (at your option) any later version.                                                                  |
14
// |                                                                                                      |
15
// | Foobar is distributed in the hope that it will be useful,                                            |
16
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
17
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
18
// | GNU General Public License for more details.                                                         |
19
// |                                                                                                      |
20
// | You should have received a copy of the GNU General Public License                                    |
21
// | along with Foobar; if not, write to the Free Software                                                |
22
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
23
// +------------------------------------------------------------------------------------------------------+
8 jp_milcent 24
// CVS : $Id: hb_admin.php,v 1.2 2006-10-31 10:31:36 jp_milcent Exp $
2 jp_milcent 25
/**
26
* Herbier Administration
27
*
28
* Interface d'administration des herbiers.
29
*
30
*@package Herbier-Administration
31
//Auteur original :
32
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
33
//Autres auteurs :
34
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
35
*@copyright     Tela-Botanica 2000-2005
8 jp_milcent 36
*@version       $Revision: 1.2 $ $Date: 2006-10-31 10:31:36 $
2 jp_milcent 37
// +------------------------------------------------------------------------------------------------------+
38
*/
39
 
40
// +------------------------------------------------------------------------------------------------------+
41
// |                                            ENTETE du PROGRAMME                                       |
42
// +------------------------------------------------------------------------------------------------------+
43
/** Inclusion du fichier de configuration de l'application Herbier - Administration. */
8 jp_milcent 44
require_once HB_CHEMIN_MODULE.'hb_admin'.GEN_SEP.'configuration'.GEN_SEP.'hba_config.inc.php';
2 jp_milcent 45
 
46
// Stockage des styles de l'application Administration
47
GEN_stockerStyleExterne('hb_admin', HBA_CHEMIN_STYLE.'hb_admin.css');
48
 
49
// Appel du fichier de traduction des textes de l'application Administration de Herbier
50
if (file_exists(HBA_CHEMIN_LANGUES.'hba_langue_'.HB_I18N.'.inc.php')) {
51
    /** Inclusion du fichier de traduction de l'application Administration de Herbier. */
52
    include_once HBA_CHEMIN_LANGUES.'hba_langue_'.HB_I18N.'.inc.php';
53
} else {
54
    /** Inclusion du fichier de traduction fr par défaut. */
55
    include_once HBA_CHEMIN_LANGUES.'hba_langue_fr.inc.php';
56
}
57
 
58
/** Inclusion de la classe "form" de l'API Formulaire. */
59
require_once HB_CHEMIN_API_FORMULAIRE.'FORM_formulaire.class.php';
60
/** Inclusion de la classe "form" de l'API Formulaire. */
61
require_once HB_CHEMIN_API_FORMULAIRE.'FORM_formulaire_table.class.php';
62
 
63
/** Inclusion du fichier de fonctions permettant d'ajouter, modifier ou supprimer des
64
* informations dans la base de données Herbier. */
65
require_once HBA_CHEMIN_BIBLIO.'hba_manipulation.fonct.php';
66
 
67
/** Inclusion de la classe principale d'Herbier : herbier */
68
require_once HB_CHEMIN_BIBLIO.'hb_herbier.class.php';
69
/** Inclusion de la classe Herbier : collection */
70
require_once HB_CHEMIN_BIBLIO.'hb_collection.class.php';
71
/** Inclusion de la classe Herbier : indic */
72
require_once HB_CHEMIN_BIBLIO.'hb_indic.class.php';
73
/** Inclusion de la classe Herbier : indic_hist */
74
require_once HB_CHEMIN_BIBLIO.'hb_indic_hist.class.php';
75
/** Inclusion de la classe Herbier : organisation */
76
require_once HB_CHEMIN_BIBLIO.'hb_organisation.class.php';
77
/** Inclusion de la classe Herbier : type */
78
require_once HB_CHEMIN_BIBLIO.'hb_type.class.php';
79
/** Inclusion de la classe Herbier : equipe */
80
require_once HB_CHEMIN_BIBLIO.'hb_equipe.class.php';
81
/** Inclusion de la classe Herbier : utilisateur */
82
require_once HB_CHEMIN_BIBLIO.'hb_utilisateur.class.php';
83
 
84
// Initialisation de variables
85
$sortie .= '<!-- Herbier - Administration : DEBUT -->'."\n";
86
 
87
// +------------------------------------------------------------------------------------------------------+
88
// |                                            CORPS du PROGRAMME                                        |
89
// +------------------------------------------------------------------------------------------------------+
90
 
91
if (!defined('HBA_ARGUMENT_AUTH') || HBA_ARGUMENT_AUTH == FALSE || (HBA_ARGUMENT_AUTH == TRUE && $GLOBALS['_HERBIER_']['auth']->getAuth())) {
92
    // Initialisation de variables
93
    if (!isset($_REQUEST['action']) || empty($_REQUEST['action'])) {
94
        $_REQUEST['action'] = HBA_ACTION_ANNULER;
95
    }
96
    // Création de l'objet "façade" H_Herbier().
97
    $un_herbier = new H_Herbier($GLOBALS['_HERBIER_']['auth']->getAuthData(HB_BDD_TAB_ANNUAIRE_CHP_ID));
98
 
99
    // Test sur les droits de la personne.
100
    if ($un_herbier->utilisateur->getDroit()) {
101
        switch ($_REQUEST['action']) {
102
 
103
            // Gestion des organisations
104
            case HBA_ACTION_HERBIER_AJOUT :
105
                GEN_stockerFichierScript('hb_admin', HBA_CHEMIN_SCRIPT.'hb_admin.js');
106
                $sortie .= nouveau($un_herbier);
107
                break;
108
            case HBA_ACTION_HERBIER_VERIF :
109
                GEN_stockerFichierScript('hb_admin', HBA_CHEMIN_SCRIPT.'hb_admin.js');
110
                $retour = nouveau_v(&$un_herbier);
111
                if (is_bool($retour) && $retour == TRUE) {
112
                    $sortie .= menu($un_herbier);
113
                } else {
114
                    $sortie .= $retour;
115
                }
116
                break;
117
            case HBA_ACTION_COLL_DEROULER :
118
            case MOD_HERB :
119
                $sortie .= mod_herb($un_herbier);
120
                break;
121
            case MOD_ADM :
122
                $sortie .= mod_adm($un_herbier);
123
                break;
124
            case MOD_ADM_V :
125
                $sortie .= mod_adm_v($un_herbier).mod_herb($un_herbier);
126
                break;
127
            case SUPPR_HERB :
128
                $sortie .= suppr_herb($un_herbier).menu($un_herbier);
129
                break;
130
            case NOUVEAU_HERB4 :
131
                $sortie .= nouveau_herb4($un_herbier).mod_herb($un_herbier);
132
                break;
133
 
134
            // Gestion des collections
135
            case NOUV_COLL :
136
                $sortie .= nouv_coll($un_herbier);
137
                break;
138
            case MOD_DESC :
139
                $sortie .= mod_desc($un_herbier);
140
                break;
141
            case MOD_DESC_V :
142
                $sortie .= mod_desc_v($un_herbier).mod_herb($un_herbier);
143
                break;
144
            case SUPPR_COLL :
145
                $sortie .= suppr_coll($un_herbier).mod_herb($un_herbier);
146
                break;
147
 
148
            // Gestion de l'équipe
149
            case NOUV_TEAM :
150
                $sortie .= nouv_team($un_herbier);
151
                break;
152
            case NOUV_TEAM_V :
153
                $sortie .= nouv_team_v($un_herbier).mod_herb($un_herbier);
154
                break;
155
            case MOD_STAFF :
156
                $sortie .= mod_staff($un_herbier);
157
                break;
158
            case MOD_STAFF_V :
159
                $sortie .= mod_staff_v($un_herbier).mod_herb($un_herbier);
160
                break;
161
            case SUPPR_STAFF :
162
                $sortie .= suppr_staff($un_herbier).mod_herb($un_herbier);
163
                break;
164
 
165
            // Gestion des notes
166
            case NOUV_INDIC :
167
                $sortie .= nouv_indic($un_herbier);
168
                break;
169
            case NOUV_INDIC_V :
170
                $sortie .= nouv_indic_v($un_herbier).mod_herb($un_herbier);
171
                break;
172
            case MOD_NOTE :
173
                $sortie .= mod_note($un_herbier);
174
                break;
175
            case MOD_NOTE_V :
176
                $sortie .= mod_note_v($un_herbier).mod_herb($un_herbier);
177
                break;
178
            case SUPPR_NOTE :
179
                $sortie .= suppr_note($un_herbier).mod_herb($un_herbier);
180
                break;
181
 
182
            // Gestion des correspondants
183
            case NOUVEAU_CORR :
184
                $sortie .= parcourrirAnnu($un_herbier, NOUVEAU_CORR_V);
185
                break;
186
            case NOUVEAU_CORR_V :
187
                $sortie .= nouveau_corr_v($un_herbier).menu($un_herbier);
188
                break;
189
            case SUPPR_CORR:
190
                $sortie .= suppr_corr($un_herbier).menu($un_herbier);
191
                break;
192
 
193
            // Gestion des rédacteurs
194
            case NOUV_RED :
195
                $sortie .= parcourrirAnnu($un_herbier, NOUV_RED_V);
196
                break;
197
            case NOUV_RED_V :
198
                $sortie .= nouveau_red_v($un_herbier).menu($un_herbier);
199
                break;
200
            case SUPPR_RED :
201
                $sortie .= suppr_red($un_herbier).menu($un_herbier);
202
                break;
203
 
204
            // Affichage par défaut
205
            default :
206
                $sortie .= menu($un_herbier);
207
                break;
208
        }
209
    } else {
210
        $sortie .= fournirAideInscription();
211
    }
212
} elseif (HBA_ARGUMENT_AUTH == 1) {
213
    $sortie .= GEN_afficherInfoIdentification($GLOBALS['_HERBIER_']['url']->getURL());
214
} else {
215
    $sortie .=  '<p class="pap_erreur">'.
216
                'ERREUR : problème!'.'<br />'.'LIGNE : '. __LINE__ .'<br />'.'FICHIER : '. __FILE__ .
217
                '</p>';
218
}
219
 
220
// +------------------------------------------------------------------------------------------------------+
221
// |                                            PIED du PROGRAMME                                         |
222
// +------------------------------------------------------------------------------------------------------+
223
$sortie .= '<!-- Herbier - Administration : FIN -->'."\n";
224
 
225
 
226
/* +--Fin du code ----------------------------------------------------------------------------------------+
227
*
228
* $Log: not supported by cvs2svn $
8 jp_milcent 229
* Revision 1.1  2005/11/23 10:32:32  jp_milcent
230
* Ajout au dépot de l'application Herbiers.
231
* Elle doit à terme migrer dans eFlore.
232
*
2 jp_milcent 233
* Revision 1.2  2005/05/18 07:30:13  jpm
234
* Correction des bogues et derniers réglages avant mise en ligne du site v4.
235
*
236
* Revision 1.1  2005/04/06 13:34:00  jpm
237
* Ajout du fichier principal de l'application Administration.
238
*
239
*
240
* +-- Fin du code ----------------------------------------------------------------------------------------+
241
*/
242
?>