Subversion Repositories Applications.gtt

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 jpm 1
<?php
2
 
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU Lesser General Public                                           |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | Lesser General Public License for more details.                                                      |
17
// |                                                                                                      |
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                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
22
// |@author ABDOOL RAHEEM shaheen   shaheenar50@hotmail.com                                                 |
23
// |@version 3                                                                                            |
24
 
25
// +------------------------------------------------------------------------------------------------------+
26
/*
27
*fichier contenant le menu principal de l'application de gestion du temps de travail
28
*@package gtt_general
29
//Auteur original :
30
*@author        Dorian Bannier <dbannier@aol.com>
31
//Autres auteurs :
32
*@author        Jean-Pascal MILCENT <jpm@tela-botanica.org>
33
*@copyright     Copyright (C) 2003 Tela-Botanica
34
*/
35
// +------------------------------------------------------------------------------------------------------+
36
include_once CHEMIN_MENU.'gtt_menu_admin_statut.php';
37
/**
38
*fonction traitant l'enregistrement des statuts
39
*/
40
 
41
function traiterAjouterStatut()
42
{
43
  if (isset($_POST["champ_valider_statut"]))
44
    {
45
	$i=&Statut::nextId();
46
	$s=new Statut($i);
47
	$s->setLibelleStatut($_POST["champ_nom_statut"]);
48
	$s->enregistrerStatut();
49
 
50
    }
51
   $_POST["champ_valider_statut"]='dejaValider';
52
   $_POST["champ_nom_statut"]='';
53
}
54
 
55
 
56
/**
57
*fonction traitant la supression de statut
58
*/
59
 
60
function traiterSupprimerStatut()
61
{
62
if (isset($_POST["btn_supprimer_statut"]))
63
  {
64
    $identifiant=$_POST["champ_statut_supprimer"];
65
    $verif=&Statut::statutUtilise($identifiant);
66
 
67
    if($verif!=1)
68
    {
69
	$j=&Statut::supprimerStatut($identifiant);
70
    }else $j=0;
71
    if ($j==0)
72
    {
73
	echo "echec supression";
74
    }
75
  }
76
  $_POST["btn_supprimer_statut"]='dejaValider';
77
  $_POST["champ_statut_supprimer"]='';
78
}
79
 
80
 
81
/**
82
*fonction verifiant si statut peut etre supprime
83
*/
84
function verifStatutUtilise()
85
{
86
    $identifiant=$_POST["champ_statut_supprimer"];
87
    $verif=&Statut::statutUtilise($identifiant);
88
    if ($verif==1)return false;
89
    else return true;
90
 
91
 
92
}
93
/**
94
*fonction traitant toutes les actions du menu admin statut
95
*/
96
function traiterAdminStatut()
97
{
98
  $text=creerEntetePage(GESTION_ADMIN_STATUT_L);
99
  //cas ajout utilisateur
100
  $form=afficherMenuAjouterStatut();
101
  if (isset($_POST["champ_valider_statut"]) and $_POST["champ_valider_statut"]!='dejaValider' and $form->validate())
102
   {
103
       $form->process('traiterAjouterStatut');
104
       $m=afficherMenuAjouterStatut();
105
       $text.=$m->ToHTml();
106
   }else
107
   {
108
    $text.=$form->ToHtml();
109
   }
110
   //cas supression
111
   $forms=afficherMenuSupressionstatut();
112
   if (isset($_POST["btn_supprimer_statut"]) and $_POST["btn_supprimer_statut"]!='dejaValider' and  $forms->validate())
113
   {
114
      $forms->process('traiterSupprimerStatut');
115
      $m=afficherMenuSupressionStatut();
116
      $text.=$m->ToHtml();
117
   }else{
118
       $text.=$forms->ToHtml();
119
   }
120
   //affichage des options d'administration
121
 
122
    $formp=creerFormulaireOptionAdmin();
123
    $text.=$formp->ToHtml();
124
   //affichage des options disponibles pour l'utilisateur courant
125
    $text.=afficherOptionAplication($GLOBALS['idCurrentUser']);
126
 
127
   return $text;
128
}
129
?>