Subversion Repositories Applications.gtt

Rev

Go to most recent revision | Details | 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_FN_GENERIQUE_AFFICHAGE;
37
include_once CHEMIN_MENU.'gtt_menu_admin_statut.php';
38
/**
39
*fonction traitant l'enregistrement des statuts
40
*/
41
 
42
function traiterAjouterStatut()
43
{
44
  if (isset($_POST["champ_valider_statut"]))
45
    {
46
	$i=&Statut::nextId();
47
	$s=new Statut($i);
48
	$s->setLibelleStatut($_POST["champ_nom_statut"]);
49
	$s->enregistrerStatut();
50
 
51
    }
52
   $_POST["champ_valider_statut"]='dejaValider';
53
   $_POST["champ_nom_statut"]='';
54
}
55
 
56
 
57
/**
58
*fonction traitant la supression de statut
59
*/
60
 
61
function traiterSupprimerStatut()
62
{
63
if (isset($_POST["btn_supprimer_statut"]))
64
  {
65
    $identifiant=$_POST["champ_statut_supprimer"];
66
    $verif=&Statut::statutUtilise($identifiant);
67
 
68
    if($verif!=1)
69
    {
70
	$j=&Statut::supprimerStatut($identifiant);
71
    }else $j=0;
72
    if ($j==0)
73
    {
74
	echo "echec supression";
75
    }
76
  }
77
  $_POST["btn_supprimer_statut"]='dejaValider';
78
  $_POST["champ_statut_supprimer"]='';
79
}
80
 
81
 
82
/**
83
*fonction verifiant si statut peut etre supprime
84
*/
85
function verifStatutUtilise()
86
{
87
    $identifiant=$_POST["champ_statut_supprimer"];
88
    $verif=&Statut::statutUtilise($identifiant);
89
    if ($verif==1)return false;
90
    else return true;
91
 
92
 
93
}
94
/**
95
*fonction traitant toutes les actions du menu admin statut
96
*/
97
function traiterAdminStatut()
98
{
99
  $text=creerEntetePage(GESTION_ADMIN_STATUT_L);
100
  //cas ajout utilisateur
101
  $form=afficherMenuAjouterStatut();
102
  if (isset($_POST["champ_valider_statut"]) and $_POST["champ_valider_statut"]!='dejaValider' and $form->validate())
103
   {
104
       $form->process('traiterAjouterStatut');
105
       $m=afficherMenuAjouterStatut();
106
       $text.=$m->ToHTml();
107
   }else
108
   {
109
    $text.=$form->ToHtml();
110
   }
111
   //cas supression
112
   $forms=afficherMenuSupressionstatut();
113
   if (isset($_POST["btn_supprimer_statut"]) and $_POST["btn_supprimer_statut"]!='dejaValider' and  $forms->validate())
114
   {
115
      $forms->process('traiterSupprimerStatut');
116
      $m=afficherMenuSupressionStatut();
117
      $text.=$m->ToHtml();
118
   }else{
119
       $text.=$forms->ToHtml();
120
   }
121
   //affichage des options d'administration
122
 
123
    $formp=creerFormulaireOptionAdmin();
124
    $text.=$formp->ToHtml();
125
   //affichage des options disponibles pour l'utilisateur courant
126
    $text.=afficherOptionAplication($GLOBALS['idCurrentUser']);
127
 
128
   return $text;
129
}
130
?>