Subversion Repositories Applications.gtt

Compare Revisions

Ignore whitespace Rev 8 → Rev 9

/trunk/controleur/gtt_controleur_editer_preferences.php
34,7 → 34,6
// | INCLUSION DE FICHIERS |
// +------------------------------------------------------------------------------------------------------+
//inclusion des paquets de la librairie pear
include_once CHEMIN_FN_GENERIQUE_AFFICHAGE;
include_once CHEMIN_MENU.'gtt_menu_editer_preferences.php';
include_once CHEMIN_CLASSES_METIER.'gtt_preference.class.php';
/**
/trunk/controleur/gtt_controleur_travail.php
33,7 → 33,6
*@copyright Copyright (C) 2003 Tela-Botanica
*/
// +------------------------------------------------------------------------------------------------------+
include_once CHEMIN_FN_GENERIQUE_AFFICHAGE;
include_once CHEMIN_MENU.'gtt_menu_travail.php';
include_once CHEMIN_CLASSES_METIER.'gtt_travail.class.php';
include_once CHEMIN_CLASSES_METIER.'gtt_taches.class.php';
/trunk/index.php
42,7 → 42,7
include_once 'gtt_config.inc.php';
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';
include_once CHEMIN_CLASSES.'gtt_authentification.php';
include_once CHEMIN_FN_GENERIQUE_AFFICHAGE;
include_once CHEMIN_PRESENTATION.'gtt_fonctions_generique_affichage.php';
 
// Création du dsn
// Connexion a la base de donnees
50,7 → 50,7
 
if (DB::isError($GLOBALS['db'])) {
$GLOBALS['db']->getMessage();
echo "echec connexion a la base de donnees";
echo "Echec connexion a la base de donnees";
}
 
$params = array("dsn"=>$GLOBALS['dsn'],
73,88 → 73,113
$GLOBALS['idCurrentUser'] = $utilisateur;
// Récuperation de l'identifiant de la personne
// Test des choix de menu a afficher
if (empty($action)) {
$action = 1 ;
}
switch ($action) {
// Cas affichage menu travail 1
case GESTION_TRAVAIL :
include_once CHEMIN_MENU.'gtt_menu_travail.php';
include_once CHEMIN_CONTROLEUR.'gtt_controleur_travail.php';
if (!isset($semaine)) {
$semaine = date('W',mktime(0, 0, 0, date('m'), date('d') ,date('Y')));
}
if (!isset($annee)) {
$annee = date('Y');
}
$text = traiterAdminTravail($_SERVER['PHP_SELF'], $semaine, $annee, $utilisateur);
break;
// Cas affichage du menu ajout autilisateurss 13
case GESTION_ADMIN_UTILISATEUR :
include_once CHEMIN_MENU.'gtt_menu_admin_utilisateur.php';
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_utilisateur.php';
$text = traiterAdminUtilisateur('',0);
break;
// Cas editer des utilisateurs 14
case GESTION_EDITER_UTILISATEUR :
include_once CHEMIN_MENU.'gtt_menu_admin_utilisateur.php';
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_utilisateur.php';
$text = traiterAdminUtilisateur(renvoyerDonneesUser(),1);
break;
// Cas afficher menu administration projet 15
case GESTION_ADMIN_PROJET :
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_projet.php';
$text = traiterAdminProjet();
break;
// Cas afficher menu administration categorie 16
case GESTION_ADMIN_CATEGORIE :
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_categorie.php';
$text = traiterAdminCategorie();
break;
// Cas afficher menu admin motif absence 17
case GESTION_ADMIN_MOTIF_ABSENCE :
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_motif_absence.php';
$text = traiterAdminMotif();
break;
// Cas afficher menu admin statut 18
case GESTION_ADMIN_STATUT :
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_statut.php';
$text = traiterAdminStatut();
break;
// Cas afficher admin editer frais 19
case GESTION_ADMIN_FRAIS :
$text = '';
break;
// Cas afficher admin editer taches 20
case GESTION_ADMIN_TACHE :
$text = '';
break;
// Cas editer preferences d'un utilisateur 21
case GESTION_EDITER_PREFERENCES :
include_once CHEMIN_MENU.'gtt_menu_editer_preferences.php';
include_once CHEMIN_CONTROLEUR.'gtt_controleur_editer_preferences.php';
$text = traiterEditerPreferences($GLOBALS['idCurrentUser']);
break;
// Cas deconnexion 22
case GESTION_DECONNEXION :
$a->logout();
$text = afficherMenuConnexion();
//$GLOBALS['db']->disconnect();
break;
$action = 1;
if (!empty($_GET['action'])) {
$action = $_GET['action'];
}
$text .= fermerBalisesFin();
echo $text;
if (!preg_match('/^\d+$/', $action)) {
// Utilisation du mécanisme MVC avec Squelette PHP et objet
require_once GTT_CHEMIN_CLASSE.'Controlleur.class.php';
require_once GTT_CHEMIN_CLASSE.'aAction.class.php';
require_once GTT_CHEMIN_CLASSE.'Resultat.class.php';
$module = 'Preference';
if (isset($_GET['module']) && !empty($_GET['module'])) {
$module = $_GET['module'];
}
$nom_module = 'GttControlleur'.$module;
$fichier_module = GTT_CHEMIN_MODULE.$nom_module.'.class.php';
$nom_module_general = 'Controlleur';
$fichier_module_general = GTT_CHEMIN_CLASSE.$nom_module_general.'.class.php';
if (file_exists($fichier_module)) {
require_once $fichier_module;
$Controlleur = new $nom_module;
} else if (file_exists($fichier_module_general)) {
require_once $fichier_module_general;
$Controlleur = new $nom_module_general;
}
echo $Controlleur->executer($action);
} else {
// Utilisation de l'ancien mécanisme
switch ($action) {
// Cas affichage menu travail 1
case GESTION_TRAVAIL :
include_once CHEMIN_MENU.'gtt_menu_travail.php';
include_once CHEMIN_CONTROLEUR.'gtt_controleur_travail.php';
if (!isset($semaine)) {
$semaine = date('W',mktime(0, 0, 0, date('m'), date('d') ,date('Y')));
}
if (!isset($annee)) {
$annee = date('Y');
}
$text = traiterAdminTravail($_SERVER['PHP_SELF'], $semaine, $annee, $utilisateur);
break;
// Cas affichage du menu ajout autilisateurss 13
case GESTION_ADMIN_UTILISATEUR :
include_once CHEMIN_MENU.'gtt_menu_admin_utilisateur.php';
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_utilisateur.php';
$text = traiterAdminUtilisateur('',0);
break;
// Cas editer des utilisateurs 14
case GESTION_EDITER_UTILISATEUR :
include_once CHEMIN_MENU.'gtt_menu_admin_utilisateur.php';
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_utilisateur.php';
$text = traiterAdminUtilisateur(renvoyerDonneesUser(),1);
break;
// Cas afficher menu administration projet 15
case GESTION_ADMIN_PROJET :
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_projet.php';
$text = traiterAdminProjet();
break;
// Cas afficher menu administration categorie 16
case GESTION_ADMIN_CATEGORIE :
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_categorie.php';
$text = traiterAdminCategorie();
break;
// Cas afficher menu admin motif absence 17
case GESTION_ADMIN_MOTIF_ABSENCE :
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_motif_absence.php';
$text = traiterAdminMotif();
break;
// Cas afficher menu admin statut 18
case GESTION_ADMIN_STATUT :
include_once CHEMIN_CONTROLEUR.'gtt_controleur_admin_statut.php';
$text = traiterAdminStatut();
break;
// Cas afficher admin editer frais 19
case GESTION_ADMIN_FRAIS :
$text = '';
break;
// Cas afficher admin editer taches 20
case GESTION_ADMIN_TACHE :
$text = '';
break;
// Cas editer preferences d'un utilisateur 21
case GESTION_EDITER_PREFERENCES :
include_once CHEMIN_MENU.'gtt_menu_editer_preferences.php';
include_once CHEMIN_CONTROLEUR.'gtt_controleur_editer_preferences.php';
$text = traiterEditerPreferences($GLOBALS['idCurrentUser']);
break;
// Cas deconnexion 22
case GESTION_DECONNEXION :
$a->logout();
$text = afficherMenuConnexion();
//$GLOBALS['db']->disconnect();
break;
}
$text .= fermerBalisesFin();
echo $text;
}
} else {
echo afficherMenuConnexion();
}
/trunk/langues/gtt_langue_fr.inc.php
48,10 → 48,12
// +----------------------------------------------------------------------------+
// GENERAL
//Abréviation : G
$G =& $GLOBALS['_GTT_']['i18n']['general'];
define ( 'GTT_L_G_NOM_APPLICATION' , 'Gestion du Temps de Travail' );
define ( 'GTT_L_G_OUI' , 'Oui' );//GESTION_OUI_L
define ( 'GTT_L_G_NON' , 'Non' );//GESTION_NON_L
define ( 'GTT_L_G_OK' , 'OK' );
$G['valider'] = 'Valider';
define ( 'GTT_L_G_VALIDER', 'Valider');
define ( 'GTT_L_G_MODIFIER', 'Modifier');
define ( 'GTT_L_G_SUPPRIMER', 'Supprimer');
61,7 → 63,6
define ( 'GTT_L_G_JOUR_SINGULIER' , 'jour' );
define ( 'GTT_L_G_JOURS_PLURIEL' , 'jours' );
 
 
// +----------------------------------------------------------------------------+
 
// +----------------------------------------------------------------------------+
/trunk/gtt_config.inc.php
3,18 → 3,22
/*fichier de definition */
error_reporting(E_ALL);
 
// Les constantes d'action
define ('GTT_ACTION_PREFERENCE', 'preferences');
define ('GTT_ACTION_PREFERENCE_VALIDER', 'preferences_valider');
 
// Définition des constantes
define ('GESTION_TRAVAIL',1);
define ('GESTION_TRAVAIL', 1);
define ('GESTION_ADMIN_UTILISATEUR', 13);
define ('GESTION_EDITER_UTILISATEUR',14);
define ('GESTION_ADMIN_PROJET',15);
define ('GESTION_ADMIN_CATEGORIE',16);
define ('GESTION_ADMIN_MOTIF_ABSENCE',17);
define ('GESTION_ADMIN_STATUT',18);
define ('GESTION_ADMIN_FRAIS',19);
define ('GESTION_ADMIN_TACHE',20);
define ('GESTION_EDITER_PREFERENCES',21);
define ('GESTION_DECONNEXION',22);
define ('GESTION_EDITER_UTILISATEUR', 14);
define ('GESTION_ADMIN_PROJET', 15);
define ('GESTION_ADMIN_CATEGORIE', 16);
define ('GESTION_ADMIN_MOTIF_ABSENCE', 17);
define ('GESTION_ADMIN_STATUT', 18);
define ('GESTION_ADMIN_FRAIS', 19);
define ('GESTION_ADMIN_TACHE', 20);
define ('GESTION_EDITER_PREFERENCES', 21);
define ('GESTION_DECONNEXION', 22);
 
//==================================== CHEMINS ==================================
/* definition des chemins d'acces
21,8 → 25,8
//==================================================================================
*/
define ("CHEMIN",'');
define("CHEMIN_CALENDRIER",CHEMIN.'presentation/');
define("CHEMIN_FN_GENERIQUE_AFFICHAGE",CHEMIN.'presentation/gtt_fonctions_generique_affichage.php');
define("CHEMIN_PRESENTATION",CHEMIN.'presentation/');
define("CHEMIN_CALENDRIER",CHEMIN_PRESENTATION);
define("CHEMIN_CSS",CHEMIN.'presentation/');
define("CHEMIN_CLASSES_METIER",CHEMIN.'classes_metier/');
define("CHEMIN_CLASSES",CHEMIN.'classes/');
30,6 → 34,14
define("CHEMIN_MENU",CHEMIN.'menu/');
define("CHEMIN_CONTROLEUR",CHEMIN.'controleur/');
 
define ('GTT_CHEMIN_APPLI', '');
define ('GTT_CHEMIN_CLASSE', GTT_CHEMIN_APPLI.'classes/');
define ('GTT_CHEMIN_METIER', GTT_CHEMIN_CLASSE.'metiers/');
define ('GTT_CHEMIN_MODULE', GTT_CHEMIN_APPLI.'modules/');
define ('GTT_CHEMIN_ACTION', GTT_CHEMIN_APPLI.'actions/');
define ('GTT_CHEMIN_PRESENTATION', GTT_CHEMIN_APPLI.'presentation/');
define ('GTT_CHEMIN_VUE', GTT_CHEMIN_APPLI.'vues/');
 
/**
//==================================== CONSTANTES ==================================
/* definition des constantes de plusieurs tests et divers
/trunk/classes_metier/gtt_projet.class.php
281,34 → 281,29
}
}
/**fonction recuperant la liste de projets
*/
function recupererTableauProjet()
{
$requete="SELECT ".GEST_CHAMPS_ID_PROJET." , ".GEST_CHAMPS_NOM_PROJET.",C.".GEST_CHAMPS_ID_CATEGORIE.",C.".GEST_CHAMPS_LIBELLE_CATEGORIE.
" FROM ".GEST_PROJET." P ,".GEST_CATEGORIE." C ".
" WHERE P.".GEST_CHAMPS_ID_CATEGORIE." = C.".GEST_CHAMPS_ID_CATEGORIE.
" ORDER BY C.".GEST_CHAMPS_ID_CATEGORIE;
$tab= array();
$resultat=$GLOBALS['db']->query($requete);
(DB::isError($resultat)) ?
die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
$j=$resultat->numRows();
if ($j!=0)
{
while($ligne=$resultat->fetchRow(DB_FETCHMODE_ASSOC))
{
$case=array(GEST_CHAMPS_ID_PROJET =>$ligne[GEST_CHAMPS_ID_PROJET],
GEST_CHAMPS_NOM_PROJET =>$ligne[GEST_CHAMPS_NOM_PROJET],
GEST_CHAMPS_LIBELLE_CATEGORIE =>$ligne[GEST_CHAMPS_LIBELLE_CATEGORIE]);
array_push($tab,$case);
}
}
return $tab;
}
/** Méthode recuperant la liste de projets */
function recupererTableauProjet()
{
$requete = 'SELECT '.GEST_CHAMPS_ID_PROJET." , ".GEST_CHAMPS_NOM_PROJET.",C.".GEST_CHAMPS_ID_CATEGORIE.",C.".GEST_CHAMPS_LIBELLE_CATEGORIE.
" FROM ".GEST_PROJET." P ,".GEST_CATEGORIE." C ".
" WHERE P.".GEST_CHAMPS_ID_CATEGORIE." = C.".GEST_CHAMPS_ID_CATEGORIE.
" ORDER BY C.".GEST_CHAMPS_ID_CATEGORIE;
$tab = array();
$resultat = $GLOBALS['db']->query($requete);
(DB::isError($resultat)) ? die (BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete)) : '' ;
 
$j = $resultat->numRows();
if ($j != 0) {
while($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
$case = array( GEST_CHAMPS_ID_PROJET => $ligne[GEST_CHAMPS_ID_PROJET],
GEST_CHAMPS_NOM_PROJET => $ligne[GEST_CHAMPS_NOM_PROJET],
GEST_CHAMPS_LIBELLE_CATEGORIE => $ligne[GEST_CHAMPS_LIBELLE_CATEGORIE]);
array_push($tab, $case);
}
}
return $tab;
}
 
/**
*fonction recuperant la tache par defaut d'un projet
*tache par defaut : tache s'appelant general
/trunk/menu/gtt_menu_editer_preferences.php
31,7 → 31,7
*/
// +------------------------------------------------------------------------------------------------------+
// +------------------------------------------------------------------------------------------------------+
// | INCLUSION DE FICHIERS |
// | INCLUSION DE FICHIERS |
// +------------------------------------------------------------------------------------------------------+
// Fichier langues
include_once CHEMIN_LANGUES.'gtt_langue_fr.inc.php';