Subversion Repositories Applications.papyrus

Rev

Rev 473 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 473 Rev 481
1
<?php
1
<?php
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
2
/*vim: set expandtab tabstop=4 shiftwidth=4: */ 
3
// +------------------------------------------------------------------------------------------------------+
3
// +------------------------------------------------------------------------------------------------------+
4
// | PHP version 4.1                                                                                      |
4
// | PHP version 4.1                                                                                      |
5
// +------------------------------------------------------------------------------------------------------+
5
// +------------------------------------------------------------------------------------------------------+
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
6
// | Copyright (C) 2004 Tela Botanica (accueil@tela-botanica.org)                                         |
7
// +------------------------------------------------------------------------------------------------------+
7
// +------------------------------------------------------------------------------------------------------+
8
// | This library is free software; you can redistribute it and/or                                        |
8
// | This library is free software; you can redistribute it and/or                                        |
9
// | modify it under the terms of the GNU General Public                                                  |
9
// | modify it under the terms of the GNU General Public                                                  |
10
// | License as published by the Free Software Foundation; either                                         |
10
// | License as published by the Free Software Foundation; either                                         |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
11
// | version 2.1 of the License, or (at your option) any later version.                                   |
12
// |                                                                                                      |
12
// |                                                                                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
13
// | This library is distributed in the hope that it will be useful,                                      |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
14
// | but WITHOUT ANY WARRANTY; without even the implied warranty of                                       |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
15
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU                                    |
16
// | General Public License for more details.                                                             |
16
// | General Public License for more details.                                                             |
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU General Public                                            |
18
// | You should have received a copy of the GNU General Public                                            |
19
// | License along with this library; if not, write to the Free Software                                  |
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                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: projet.php,v 1.3 2005-09-27 16:31:06 alexandre_tb Exp $
22
// CVS : $Id: projet.php,v 1.4 2005-09-28 16:29:39 ddelon Exp $
23
/**
23
/**
24
* Application projet
24
* Application projet
25
*
25
*
26
* Fichier d'appel pour papyrus
26
* Fichier d'appel pour papyrus
27
*
27
*
28
*@package projet
28
*@package projet
29
//Auteur original :
29
//Auteur original :
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
30
*@author        Alexandre Granier <alexandre@tela-botanica.org>
31
//Autres auteurs :
31
//Autres auteurs :
32
*@author        Aucun
32
*@author        Aucun
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.3 $
34
*@version       $Revision: 1.4 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
39
// |                                            ENTETE du PROGRAMME                                       |
39
// |                                            ENTETE du PROGRAMME                                       |
40
// +------------------------------------------------------------------------------------------------------+
40
// +------------------------------------------------------------------------------------------------------+
41
 
41
 
42
include_once 'configuration/projet.config.inc.php' ;
42
include_once 'configuration/projet.config.inc.php' ;
43
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
43
include_once PROJET_CHEMIN_CLASSES.'projetControleur.class.php' ;
44
 
44
 
45
// Inclusion des styles selon papyrus
45
// Inclusion des styles selon papyrus
46
if (function_exists("GEN_stockerStyleExterne")) {
46
if (function_exists("GEN_stockerStyleExterne")) {
47
    GEN_stockerStyleExterne('projet','client/projet/projet.css') ;
47
    GEN_stockerStyleExterne('projet','client/projet/projet.css') ;
48
    GEN_stockerStyleExterne('projet_arbre','client/projet/arbre.css') ;
48
    GEN_stockerStyleExterne('projet_arbre','client/projet/arbre.css') ;
49
}
49
}
50
 
50
 
51
// +------------------------------------------------------------------------------------------------------+
51
// +------------------------------------------------------------------------------------------------------+
52
// |                                           LISTE des constantes                                       |
52
// |                                           LISTE des constantes                                       |
53
// +------------------------------------------------------------------------------------------------------+
53
// +------------------------------------------------------------------------------------------------------+
54
 
54
 
55
define ("PROJET_DEFAUT", 1) ;
55
define ("PROJET_DEFAUT", 1) ;
56
define ("PROJET_VOIR", 2) ;
56
define ("PROJET_VOIR", 2) ;
57
define ('PROJET_MENU_AFFICHER_CONTENU_CORPS', 1) ;
57
define ('PROJET_MENU_AFFICHER_CONTENU_CORPS', 1) ;
58
// +------------------------------------------------------------------------------------------------------+
58
// +------------------------------------------------------------------------------------------------------+
59
// |                                           LISTE de FONCTIONS                                         |
59
// |                                           LISTE de FONCTIONS                                         |
60
// +------------------------------------------------------------------------------------------------------+
60
// +------------------------------------------------------------------------------------------------------+
61
 
61
 
62
if (isset($_REQUEST[PROJET_VARIABLE_ID_PROJET])) {
62
if (isset($_REQUEST[PROJET_VARIABLE_ID_PROJET])) {
63
    function afficherContenuNavigation () {
63
    function afficherContenuNavigation () {
64
        $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ID_PROJET, $_REQUEST[PROJET_VARIABLE_ID_PROJET]) ;
64
        $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ID_PROJET, $_REQUEST[PROJET_VARIABLE_ID_PROJET]) ;
65
        if (empty($_REQUEST[PROJET_VARIABLE_ACTION])) {
65
        if (empty($_REQUEST[PROJET_VARIABLE_ACTION])) {
66
            $_REQUEST[PROJET_VARIABLE_ACTION] = PROJET_ACTION_VOIR_RESUME ;
66
            $_REQUEST[PROJET_VARIABLE_ACTION] = PROJET_ACTION_VOIR_RESUME ;
67
        }
67
        }
68
        $res = '' ;
68
        $res = '' ;
69
        if (isset($GLOBALS['_GEN_commun']['info_application']->presentation) && $GLOBALS['_GEN_commun']['info_application']->presentation == 'arbre') {
69
        if (isset($GLOBALS['_GEN_commun']['info_application']->presentation) && (($GLOBALS['_GEN_commun']['info_application']->presentation == 'arbre')||($GLOBALS['_GEN_commun']['info_application']->presentation == 'liste'))) {
70
            $res .= '<ul class="onglets">';
70
            $res .= '<ul class="onglets">';
71
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_RESUME);
71
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_RESUME);
72
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_RESUME).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_SYNTHESE.'</a></li>';
72
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_RESUME).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_SYNTHESE.'</a></li>';
73
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DESCRIPTION);
73
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DESCRIPTION);
74
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_DESCRIPTION).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_DESCRIPTION.'</a></li>';
74
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_DESCRIPTION).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_DESCRIPTION.'</a></li>';
75
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_WIKINI);
75
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_WIKINI);
76
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_WIKINI).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_WIKINI.'</a></li>';
76
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_WIKINI).'"><a href="'.$GLOBALS['url']->getURL().'">'.PROJET_WIKINI.'</a></li>';
77
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT) ;
77
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_DOCUMENT) ;
78
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_DOCUMENT).'"><a href="'.$GLOBALS['url']->getURL().'">Documents</a></li>';
78
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_DOCUMENT).'"><a href="'.$GLOBALS['url']->getURL().'">Documents</a></li>';
79
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM) ;
79
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_FORUM) ;
80
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_FORUM).'"><a href="'.$GLOBALS['url']->getURL().'">Forum</a></li>';
80
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_FORUM).'"><a href="'.$GLOBALS['url']->getURL().'">Forum</a></li>';
81
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
81
            $GLOBALS['url']->addQueryString(PROJET_VARIABLE_ACTION, PROJET_ACTION_VOIR_PARTICIPANT) ;
82
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_PARTICIPANT).'"><a href="'.$GLOBALS['url']->getURL().'">Participants</a></li>';
82
            $res .= '<li class="'.cma(PROJET_ACTION_VOIR_PARTICIPANT).'"><a href="'.$GLOBALS['url']->getURL().'">Participants</a></li>';
83
            $res .= '</ul>';
83
            $res .= '</ul>';
84
            $GLOBALS['url']->removeQueryString (PROJET_VARIABLE_ACTION) ;
84
            $GLOBALS['url']->removeQueryString (PROJET_VARIABLE_ACTION) ;
85
        }
85
        }
86
        return $res ;
86
        return $res ;
87
    }
87
    }
88
}
88
}
89
 
89
 
90
function afficherContenuMenu()
90
function afficherContenuMenu()
91
{
91
{
92
    $sortie  = '';
92
    $sortie  = '';
93
    // on fait de même pour id_projet
93
    // on fait de même pour id_projet
94
    $id_projet = isset($_REQUEST[PROJET_VARIABLE_ID_PROJET]) ? $_REQUEST[PROJET_VARIABLE_ID_PROJET] :  '';
94
    $id_projet = isset($_REQUEST[PROJET_VARIABLE_ID_PROJET]) ? $_REQUEST[PROJET_VARIABLE_ID_PROJET] :  '';
95
    
95
    
96
       // On recherche une action dans la variable $action, s'il n'y a pas, on envoie defaut
96
       // On recherche une action dans la variable $action, s'il n'y a pas, on envoie defaut
97
    $action = isset($_REQUEST[PROJET_VARIABLE_ACTION]) ? $_REQUEST[PROJET_VARIABLE_ACTION] : PROJET_DEFAUT;
97
    $action = isset($_REQUEST[PROJET_VARIABLE_ACTION]) ? $_REQUEST[PROJET_VARIABLE_ACTION] : PROJET_DEFAUT;
98
    
98
    
99
    // et pour id_repertoire
99
    // et pour id_repertoire
100
    $id_repertoire = isset($_REQUEST['id_repertoire']) ? $_REQUEST['id_repertoire'] : '';
100
    $id_repertoire = isset($_REQUEST['id_repertoire']) ? $_REQUEST['id_repertoire'] : '';
101
 
101
 
102
    $controleur = new projetControleur($GLOBALS['projet_db'], $GLOBALS['projet_auth'], $GLOBALS['url']) ;
102
    $controleur = new projetControleur($GLOBALS['projet_db'], $GLOBALS['projet_auth'], $GLOBALS['url']) ;
103
    
103
    
104
    if ($id_projet != '' && projet::projetExiste($GLOBALS['projet_db'], $id_projet)) {
104
    if ($id_projet != '' && projet::projetExiste($GLOBALS['projet_db'], $id_projet)) {
105
        $controleur->setIdProjet($id_projet) ;
105
        $controleur->setIdProjet($id_projet) ;
106
    }
106
    }
107
    if ($id_repertoire != "") {
107
    if ($id_repertoire != "") {
108
        $controleur->setIdRepertoire($id_repertoire) ;
108
        $controleur->setIdRepertoire($id_repertoire) ;
109
    }
109
    }
110
    
110
    
111
    // Dans le cas de la présentation par arbre, on met les menus
111
    // Dans le cas de la présentation par arbre, on met les menus
112
    if (isset($GLOBALS['_GEN_commun']['info_application']->presentation) && $GLOBALS['_GEN_commun']['info_application']->presentation == 'arbre') {
112
    if (isset($GLOBALS['_GEN_commun']['info_application']->presentation) && (($GLOBALS['_GEN_commun']['info_application']->presentation == 'arbre') || ($GLOBALS['_GEN_commun']['info_application']->presentation == 'liste'))){
113
        $sortie .= $controleur->menuGeneral() ;
113
        $sortie .= $controleur->menuGeneral() ;
114
    }
114
    }
115
    return $sortie;
115
    return $sortie;
116
}
116
}
117
 
117
 
118
function afficherContenuCorps() {
118
function afficherContenuCorps() {
119
    
119
    
120
 
120
 
121
    // On recherche une action dans la variable $action, s'il n'y a pas, on envoie defaut
121
    // On recherche une action dans la variable $action, s'il n'y a pas, on envoie defaut
122
    $action = isset($_REQUEST[PROJET_VARIABLE_ACTION]) ? $_REQUEST[PROJET_VARIABLE_ACTION] : PROJET_DEFAUT;
122
    $action = isset($_REQUEST[PROJET_VARIABLE_ACTION]) ? $_REQUEST[PROJET_VARIABLE_ACTION] : PROJET_DEFAUT;
123
    
123
    
124
    // on fait de même pour id_projet
124
    // on fait de même pour id_projet
125
    $id_projet = isset($_REQUEST[PROJET_VARIABLE_ID_PROJET]) ? $_REQUEST[PROJET_VARIABLE_ID_PROJET] : '';
125
    $id_projet = isset($_REQUEST[PROJET_VARIABLE_ID_PROJET]) ? $_REQUEST[PROJET_VARIABLE_ID_PROJET] : '';
126
 
126
 
127
    // et pour id_repertoire
127
    // et pour id_repertoire
128
    $id_repertoire = isset($_REQUEST['id_repertoire']) ? $_REQUEST['id_repertoire'] : '';
128
    $id_repertoire = isset($_REQUEST['id_repertoire']) ? $_REQUEST['id_repertoire'] : '';
129
 
129
 
130
    // et pour id_document
130
    // et pour id_document
131
    $id_document = isset($_REQUEST['id_document']) ? $_REQUEST['id_document'] : '';
131
    $id_document = isset($_REQUEST['id_document']) ? $_REQUEST['id_document'] : '';
132
 
132
 
133
    // On construit le controleur en lui passant en paramètre l'identifiant de connexion à la BD
133
    // On construit le controleur en lui passant en paramètre l'identifiant de connexion à la BD
134
    // l'objet d'authentification et l'url de la page
134
    // l'objet d'authentification et l'url de la page
135
    
135
    
136
    $controleur = new projetControleur(&$GLOBALS['projet_db'], &$GLOBALS['projet_auth'], &$GLOBALS['url']) ;
136
    $controleur = new projetControleur(&$GLOBALS['projet_db'], &$GLOBALS['projet_auth'], &$GLOBALS['url']) ;
137
    $controleur->setAction ($action) ;
137
    $controleur->setAction ($action) ;
138
    
138
    
139
    // On indique au controleur sur quel projet on travaille
139
    // On indique au controleur sur quel projet on travaille
140
    
140
    
141
    if ($id_projet != "") {
141
    if ($id_projet != "") {
142
        $controleur->setIdProjet($id_projet) ;
142
        $controleur->setIdProjet($id_projet) ;
143
 
143
 
144
    }
144
    }
145
    if ($id_repertoire != "") {
145
    if ($id_repertoire != "") {
146
        $controleur->setIdRepertoire($id_repertoire) ;
146
        $controleur->setIdRepertoire($id_repertoire) ;
147
    }
147
    }
148
    if ($id_document != "") {
148
    if ($id_document != "") {
149
        $controleur->setIdDocument($id_document) ;
149
        $controleur->setIdDocument($id_document) ;
150
    }
150
    }
151
    
151
    
152
    // récupération des paramètres de l'appli
152
    // récupération des paramètres de l'appli
153
    if (isset($GLOBALS['_GEN_commun']['info_application']->presentation)) {
153
    if (isset($GLOBALS['_GEN_commun']['info_application']->presentation)) {
154
        $controleur->setPresentation($GLOBALS['_GEN_commun']['info_application']->presentation) ;
154
        $controleur->setPresentation($GLOBALS['_GEN_commun']['info_application']->presentation) ;
155
    }
155
    }
156
    if (isset($GLOBALS['_GEN_commun']['info_application']->projet_type)) {
156
    if (isset($GLOBALS['_GEN_commun']['info_application']->projet_type)) {
157
        $controleur->setType($GLOBALS['_GEN_commun']['info_application']->projet_type) ;
157
        $controleur->setType($GLOBALS['_GEN_commun']['info_application']->projet_type) ;
158
    }
158
    }
159
    if (isset ($GLOBALS['_GEN_commun']['info_application']->exclure)) {
159
    if (isset ($GLOBALS['_GEN_commun']['info_application']->exclure)) {
160
        $controleur->exclure($GLOBALS['_GEN_commun']['info_application']->exclure) ;
160
        $controleur->exclure($GLOBALS['_GEN_commun']['info_application']->exclure) ;
161
    }
161
    }
162
    $res = $controleur->run() ;
162
    $res = $controleur->run() ;
163
    $GLOBALS['chrono_flash']['apres_doc'] = microtime() ;
163
    $GLOBALS['chrono_flash']['apres_doc'] = microtime() ;
164
    return $res ;
164
    return $res ;
165
}
165
}
166
 
166
 
167
/** cma() calcule menu actif
167
/** cma() calcule menu actif
168
 *
168
 *
169
 *
169
 *
170
 * @return
170
 * @return
171
 */
171
 */
172
 
172
 
173
function cma ($var) {
173
function cma ($var) {
174
    $class = $_REQUEST[PROJET_VARIABLE_ACTION] == $var ?  'menu_actif' :  'menu_inactif' ;
174
    $class = $_REQUEST[PROJET_VARIABLE_ACTION] == $var ?  'menu_actif' :  'menu_inactif' ;
175
    return $class ;
175
    return $class ;
176
}
176
}
177
/* +--Fin du code ----------------------------------------------------------------------------------------+
177
/* +--Fin du code ----------------------------------------------------------------------------------------+
178
*
178
*
179
* $Log: not supported by cvs2svn $
179
* $Log: not supported by cvs2svn $
-
 
180
* Revision 1.3  2005/09/27 16:31:06  alexandre_tb
-
 
181
* ??
-
 
182
*
180
*
183
*
181
* +-- Fin du code ----------------------------------------------------------------------------------------+
184
* +-- Fin du code ----------------------------------------------------------------------------------------+
182
*/
185
*/
183
 
186
 
184
 
187
 
185
?>
188
?>