Subversion Repositories eFlore/Archives.herbiers

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?php
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1                                                                                      |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
// +------------------------------------------------------------------------------------------------------+
// | This file is part of Herbier - Administration.                                                       |
// |                                                                                                      |
// | Foobar is free software; you can redistribute it and/or modify                                       |
// | it under the terms of the GNU General Public License as published by                                 |
// | the Free Software Foundation; either version 2 of the License, or                                    |
// | (at your option) any later version.                                                                  |
// |                                                                                                      |
// | Foobar is distributed in the hope that it will be useful,                                            |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                        |
// | GNU General Public License for more details.                                                         |
// |                                                                                                      |
// | You should have received a copy of the GNU General Public License                                    |
// | along with Foobar; if not, write to the Free Software                                                |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: hb_admin.php,v 1.1 2005-11-23 10:32:32 jp_milcent Exp $
/**
* Herbier Administration
*
* Interface d'administration des herbiers.
*
*@package Herbier-Administration
//Auteur original :
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
//Autres auteurs :
*@author        Jean-Pascal MILCENT <jpm@clapas.org>
*@copyright     Tela-Botanica 2000-2005
*@version       $Revision: 1.1 $ $Date: 2005-11-23 10:32:32 $
// +------------------------------------------------------------------------------------------------------+
*/

// +------------------------------------------------------------------------------------------------------+
// |                                            ENTETE du PROGRAMME                                       |
// +------------------------------------------------------------------------------------------------------+
/** Inclusion du fichier de configuration de l'application Herbier - Administration. */
require_once HB_CHEMIN_APPLI.'hb_admin'.GEN_SEP.'configuration'.GEN_SEP.'hba_config.inc.php';

// Stockage des styles de l'application Administration
GEN_stockerStyleExterne('hb_admin', HBA_CHEMIN_STYLE.'hb_admin.css');

// Appel du fichier de traduction des textes de l'application Administration de Herbier
if (file_exists(HBA_CHEMIN_LANGUES.'hba_langue_'.HB_I18N.'.inc.php')) {
    /** Inclusion du fichier de traduction de l'application Administration de Herbier. */
    include_once HBA_CHEMIN_LANGUES.'hba_langue_'.HB_I18N.'.inc.php';
} else {
    /** Inclusion du fichier de traduction fr par défaut. */
    include_once HBA_CHEMIN_LANGUES.'hba_langue_fr.inc.php';
}

/** Inclusion de la classe "form" de l'API Formulaire. */
require_once HB_CHEMIN_API_FORMULAIRE.'FORM_formulaire.class.php';
/** Inclusion de la classe "form" de l'API Formulaire. */
require_once HB_CHEMIN_API_FORMULAIRE.'FORM_formulaire_table.class.php';

/** Inclusion du fichier de fonctions permettant d'ajouter, modifier ou supprimer des 
* informations dans la base de données Herbier. */
require_once HBA_CHEMIN_BIBLIO.'hba_manipulation.fonct.php';

/** Inclusion de la classe principale d'Herbier : herbier */
require_once HB_CHEMIN_BIBLIO.'hb_herbier.class.php';
/** Inclusion de la classe Herbier : collection */
require_once HB_CHEMIN_BIBLIO.'hb_collection.class.php';
/** Inclusion de la classe Herbier : indic */
require_once HB_CHEMIN_BIBLIO.'hb_indic.class.php';
/** Inclusion de la classe Herbier : indic_hist */
require_once HB_CHEMIN_BIBLIO.'hb_indic_hist.class.php';
/** Inclusion de la classe Herbier : organisation */
require_once HB_CHEMIN_BIBLIO.'hb_organisation.class.php';
/** Inclusion de la classe Herbier : type */
require_once HB_CHEMIN_BIBLIO.'hb_type.class.php';
/** Inclusion de la classe Herbier : equipe */
require_once HB_CHEMIN_BIBLIO.'hb_equipe.class.php';
/** Inclusion de la classe Herbier : utilisateur */
require_once HB_CHEMIN_BIBLIO.'hb_utilisateur.class.php';

// Initialisation de variables
$sortie .= '<!-- Herbier - Administration : DEBUT -->'."\n";

// +------------------------------------------------------------------------------------------------------+
// |                                            CORPS du PROGRAMME                                        |
// +------------------------------------------------------------------------------------------------------+

if (!defined('HBA_ARGUMENT_AUTH') || HBA_ARGUMENT_AUTH == FALSE || (HBA_ARGUMENT_AUTH == TRUE && $GLOBALS['_HERBIER_']['auth']->getAuth())) {
    // Initialisation de variables
    if (!isset($_REQUEST['action']) || empty($_REQUEST['action'])) {
        $_REQUEST['action'] = HBA_ACTION_ANNULER;
    }
    // Création de l'objet "façade" H_Herbier().
    $un_herbier = new H_Herbier($GLOBALS['_HERBIER_']['auth']->getAuthData(HB_BDD_TAB_ANNUAIRE_CHP_ID));
    
    // Test sur les droits de la personne.
    if ($un_herbier->utilisateur->getDroit()) {
        switch ($_REQUEST['action']) {
            
            // Gestion des organisations
            case HBA_ACTION_HERBIER_AJOUT :
                GEN_stockerFichierScript('hb_admin', HBA_CHEMIN_SCRIPT.'hb_admin.js');
                $sortie .= nouveau($un_herbier);
                break;
            case HBA_ACTION_HERBIER_VERIF :
                GEN_stockerFichierScript('hb_admin', HBA_CHEMIN_SCRIPT.'hb_admin.js');
                $retour = nouveau_v(&$un_herbier);
                if (is_bool($retour) && $retour == TRUE) {
                    $sortie .= menu($un_herbier);
                } else {
                    $sortie .= $retour;
                }
                break;
            case HBA_ACTION_COLL_DEROULER :
            case MOD_HERB :
                $sortie .= mod_herb($un_herbier);
                break;
            case MOD_ADM :
                $sortie .= mod_adm($un_herbier);
                break;
            case MOD_ADM_V :
                $sortie .= mod_adm_v($un_herbier).mod_herb($un_herbier);
                break;
            case SUPPR_HERB :
                $sortie .= suppr_herb($un_herbier).menu($un_herbier);
                break;
            case NOUVEAU_HERB4 :
                $sortie .= nouveau_herb4($un_herbier).mod_herb($un_herbier);
                break;
            
            // Gestion des collections
            case NOUV_COLL :
                $sortie .= nouv_coll($un_herbier);
                break;
            case MOD_DESC :
                $sortie .= mod_desc($un_herbier);
                break;
            case MOD_DESC_V :
                $sortie .= mod_desc_v($un_herbier).mod_herb($un_herbier);
                break;
            case SUPPR_COLL :
                $sortie .= suppr_coll($un_herbier).mod_herb($un_herbier);
                break;
            
            // Gestion de l'équipe
            case NOUV_TEAM :
                $sortie .= nouv_team($un_herbier);
                break;
            case NOUV_TEAM_V :
                $sortie .= nouv_team_v($un_herbier).mod_herb($un_herbier);
                break;
            case MOD_STAFF :
                $sortie .= mod_staff($un_herbier);
                break;
            case MOD_STAFF_V :
                $sortie .= mod_staff_v($un_herbier).mod_herb($un_herbier);
                break;
            case SUPPR_STAFF :
                $sortie .= suppr_staff($un_herbier).mod_herb($un_herbier);
                break;
            
            // Gestion des notes
            case NOUV_INDIC :
                $sortie .= nouv_indic($un_herbier);
                break;
            case NOUV_INDIC_V :
                $sortie .= nouv_indic_v($un_herbier).mod_herb($un_herbier);
                break;
            case MOD_NOTE :
                $sortie .= mod_note($un_herbier);
                break;
            case MOD_NOTE_V :
                $sortie .= mod_note_v($un_herbier).mod_herb($un_herbier);
                break;
            case SUPPR_NOTE :
                $sortie .= suppr_note($un_herbier).mod_herb($un_herbier);
                break;
            
            // Gestion des correspondants
            case NOUVEAU_CORR :
                $sortie .= parcourrirAnnu($un_herbier, NOUVEAU_CORR_V);
                break;
            case NOUVEAU_CORR_V :
                $sortie .= nouveau_corr_v($un_herbier).menu($un_herbier);
                break;
            case SUPPR_CORR:
                $sortie .= suppr_corr($un_herbier).menu($un_herbier);
                break;
            
            // Gestion des rédacteurs
            case NOUV_RED :
                $sortie .= parcourrirAnnu($un_herbier, NOUV_RED_V);
                break;
            case NOUV_RED_V :
                $sortie .= nouveau_red_v($un_herbier).menu($un_herbier);
                break;
            case SUPPR_RED :
                $sortie .= suppr_red($un_herbier).menu($un_herbier);
                break;
            
            // Affichage par défaut
            default :
                $sortie .= menu($un_herbier);
                break;
        }
    } else {
        $sortie .= fournirAideInscription();
    }
} elseif (HBA_ARGUMENT_AUTH == 1) {
    $sortie .= GEN_afficherInfoIdentification($GLOBALS['_HERBIER_']['url']->getURL());
} else {
    $sortie .=  '<p class="pap_erreur">'.
                'ERREUR : problème!'.'<br />'.'LIGNE : '. __LINE__ .'<br />'.'FICHIER : '. __FILE__ .
                '</p>';
}

// +------------------------------------------------------------------------------------------------------+
// |                                            PIED du PROGRAMME                                         |
// +------------------------------------------------------------------------------------------------------+
$sortie .= '<!-- Herbier - Administration : FIN -->'."\n";


/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.2  2005/05/18 07:30:13  jpm
* Correction des bogues et derniers réglages avant mise en ligne du site v4.
*
* Revision 1.1  2005/04/06 13:34:00  jpm
* Ajout du fichier principal de l'application Administration.
*
*
* +-- Fin du code ----------------------------------------------------------------------------------------+
*/
?>