Subversion Repositories Applications.gtt

Rev

Blame | Last modification | View Log | RSS feed

<?php

// +------------------------------------------------------------------------------------------------------+
// | PHP version 4.1                                                                                      |
// +------------------------------------------------------------------------------------------------------+
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
// +------------------------------------------------------------------------------------------------------+
// | This library is free software; you can redistribute it and/or                                        |
// | modify it under the terms of the GNU Lesser General Public                                           |
// | License as published by the Free Software Foundation; either                                         |
// | version 2.1 of the License, or (at your option) any later version.                                   |
// |                                                                                                      |
// | This library 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                                    |
// | Lesser General Public License for more details.                                                      |
// |                                                                                                      |
// | You should have received a copy of the GNU Lesser General Public                                     |
// | License along with this library; if not, write to the Free Software                                  |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
// +------------------------------------------------------------------------------------------------------+
// |@author ABDOOL RAHEEM shaheen   shaheenar50@hotmail.com                                                 |
// |@version 3                                                                                            |

// +------------------------------------------------------------------------------------------------------+
/*
*fichier contenant le menu principal de l'application de gestion du temps de travail 
*@package gtt_general
//Auteur original :
*@author        Dorian Bannier <dbannier@aol.com>
//Autres auteurs :
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
*@copyright     Copyright (C) 2003 Tela-Botanica
*/
// +------------------------------------------------------------------------------------------------------+
include_once CHEMIN_FN_GENERIQUE_AFFICHAGE;
include_once CHEMIN_MENU.'gtt_menu_admin_statut.php';
/**
*fonction traitant l'enregistrement des statuts
*/

function traiterAjouterStatut()
{
  if (isset($_POST["champ_valider_statut"]))
    {
        $i=&Statut::nextId();
        $s=new Statut($i);
        $s->setLibelleStatut($_POST["champ_nom_statut"]);
        $s->enregistrerStatut();
                
    }   
   $_POST["champ_valider_statut"]='dejaValider';
   $_POST["champ_nom_statut"]='';
}


/**
*fonction traitant la supression de statut
*/

function traiterSupprimerStatut()
{
if (isset($_POST["btn_supprimer_statut"]))
  {
    $identifiant=$_POST["champ_statut_supprimer"];
    $verif=&Statut::statutUtilise($identifiant);
    
    if($verif!=1)
    {
        $j=&Statut::supprimerStatut($identifiant);
    }else $j=0;
    if ($j==0)
    {
        echo "echec supression";
    }
  }
  $_POST["btn_supprimer_statut"]='dejaValider';
  $_POST["champ_statut_supprimer"]='';
}


/**
*fonction verifiant si statut peut etre supprime
*/
function verifStatutUtilise()
{
    $identifiant=$_POST["champ_statut_supprimer"];
    $verif=&Statut::statutUtilise($identifiant);
    if ($verif==1)return false;
    else return true;
    
    
}
/**
*fonction traitant toutes les actions du menu admin statut
*/
function traiterAdminStatut()
{
  $text=creerEntetePage(GESTION_ADMIN_STATUT_L);
  //cas ajout utilisateur
  $form=afficherMenuAjouterStatut();
  if (isset($_POST["champ_valider_statut"]) and $_POST["champ_valider_statut"]!='dejaValider' and $form->validate()) 
   {
       $form->process('traiterAjouterStatut');
       $m=afficherMenuAjouterStatut();
       $text.=$m->ToHTml();
   }else 
   {
    $text.=$form->ToHtml();   
   }
   //cas supression
   $forms=afficherMenuSupressionstatut();
   if (isset($_POST["btn_supprimer_statut"]) and $_POST["btn_supprimer_statut"]!='dejaValider' and  $forms->validate())
   {
      $forms->process('traiterSupprimerStatut');
      $m=afficherMenuSupressionStatut();
      $text.=$m->ToHtml();
   }else{
       $text.=$forms->ToHtml();
   }
   //affichage des options d'administration
    
    $formp=creerFormulaireOptionAdmin();
    $text.=$formp->ToHtml();
   //affichage des options disponibles pour l'utilisateur courant
    $text.=afficherOptionAplication($GLOBALS['idCurrentUser']);
    
   return $text;
}
?>