Subversion Repositories Applications.papyrus

Rev

Rev 1087 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1087 Rev 1271
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
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                                  |
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: admin_application.php,v 1.7 2006-12-01 10:39:14 alexandre_tb Exp $
22
// CVS : $Id: admin_application.php,v 1.7.2.1 2007-03-20 14:19:09 alexandre_tb Exp $
23
/**
23
/**
24
* Application gérant les applications de Papyrus
24
* Application gérant les applications de Papyrus
25
*
25
*
26
* Cette application permet de gérer les applications de papyrus
26
* Cette application permet de gérer les applications de papyrus
27
* elle permet de spécifier pour un monde quel annuaire utiliser
27
* elle permet de spécifier pour un monde quel annuaire utiliser
Line 29... Line 29...
29
*
29
*
30
*@package Admin_auth
30
*@package Admin_auth
31
//Auteur original :
31
//Auteur original :
32
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
32
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.7 $
34
*@version       $Revision: 1.7.2.1 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
Line 90... Line 90...
90
function afficherContenuCorps()
90
function afficherContenuCorps()
91
{
91
{
92
    $db = &$GLOBALS['_GEN_commun']['pear_db'] ;
92
    $db = &$GLOBALS['_GEN_commun']['pear_db'] ;
93
    $url = $GLOBALS['_GEN_commun']['url'] ;
93
    $url = $GLOBALS['_GEN_commun']['url'] ;
94
    $auth = &$GLOBALS['_GEN_commun']['pear_auth'] ;
94
    $auth = &$GLOBALS['_GEN_commun']['pear_auth'] ;
95
    isset ($GLOBALS['action']) ? '' : $GLOBALS['action'] = '' ; // On déclare action si elle n'existe pas
-
 
-
 
95
    
96
    $res='';
96
    $res='';
97
    if (!$auth->getAuth()) {
97
    if (!$auth->getAuth()) {
98
    	$res .= '<p class="zone_alert">'.ADAP_IDENTIFIEZ_VOUS.'</p>'."\n" ;
98
    	$res .= '<p class="zone_alert">'.ADAP_IDENTIFIEZ_VOUS.'</p>'."\n" ;
99
		$res .= '<form id="form_connexion" style="clear:both;" class="form_identification" action="' ;
99
		$res .= '<form id="form_connexion" style="clear:both;" class="form_identification" action="' ;
100
		$res .= $url->getURL();
100
		$res .= $url->getURL();
Line 111... Line 111...
111
        return $res ;
111
        return $res ;
112
    } else {
112
    } else {
113
	    // Le lien pour une nouvelle entrée
113
	    // Le lien pour une nouvelle entrée
114
	    $res .= '<a href="'.$url->getURL().'&amp;action=nouveau">'.ADAP_AJOUTER.'</a>'."\n<br />" ;
114
	    $res .= '<a href="'.$url->getURL().'&amp;action=nouveau">'.ADAP_AJOUTER.'</a>'."\n<br />" ;
115
	    // traitement de la suppression
115
	    // traitement de la suppression
116
	    if (isset ($GLOBALS['action']) && $GLOBALS['action'] == 'supprimer') adap_supprimer_application($GLOBALS['id_appl'], $db) ;
116
	    if (isset ($_REQUEST['action']) && $_REQUEST['action'] == 'supprimer') adap_supprimer_application($_REQUEST['id_appl'], $db) ;
Line 117... Line 117...
117
	    
117
	    
118
	    // traitement de l'ajout
118
	    // traitement de l'ajout
119
	    if (isset ($GLOBALS['action']) || isset ($GLOBALS['id_appl'])) {
119
	    if (isset ($_REQUEST['action']) || isset ($_REQUEST['id_appl'])) {
120
	        $formulaire = new HTML_formulaireAppl('formulaire_appl', '', str_replace ('&amp;', '&', $url->getURL())) ;
120
	        $formulaire = new HTML_formulaireAppl('formulaire_appl', '', str_replace ('&amp;', '&', $url->getURL())) ;
Line 121... Line 121...
121
	        $formulaire->construitFormulaire($url) ;
121
	        $formulaire->construitFormulaire($url) ;
122
	        
122
	        
123
	        // On ajoute un champs caché avec action=nouveau_v
123
	        // On ajoute un champs caché avec action=nouveau_v
124
	        if ($GLOBALS['action'] == 'nouveau') {
124
	        if (isset ($_REQUEST['action']) && $_REQUEST['action'] == 'nouveau') {
125
	            $formulaire->addElement ('hidden', 'action', 'nouveau_v') ;
125
	            $formulaire->addElement ('hidden', 'action', 'nouveau_v') ;
126
	            return $formulaire->toHTML() ;
126
	            return $formulaire->toHTML() ;
127
	        }
127
	        }
128
	        if (isset ($GLOBALS['id_appl']) && $GLOBALS['action'] != 'modifier_v' && $GLOBALS['action'] != 'supprimer') {
128
	        if (isset ($_REQUEST['id_appl']) && !isset ($_REQUEST['action'])) {
129
	            $formulaire->addElement ('hidden', 'action', 'modifier_v') ;
129
	            $formulaire->addElement ('hidden', 'action', 'modifier_v') ;
130
	            $formulaire->addElement ('hidden', 'id_appl', $GLOBALS['id_appl']) ;
130
	            $formulaire->addElement ('hidden', 'id_appl', $_REQUEST['id_appl']) ;
131
	            $formulaire->setDefaults(adap_valeurs_par_defaut($GLOBALS['id_appl'], $db)) ;
131
	            $formulaire->setDefaults(adap_valeurs_par_defaut($_REQUEST['id_appl'], $db)) ;
132
	            return $formulaire->toHTML() ;
132
	            return $formulaire->toHTML() ;
133
	        }
133
	        }
134
	        if ($GLOBALS['action'] == 'modifier_v') {
134
	        if ($_REQUEST['action'] == 'modifier_v') {
135
	            if ($formulaire->validate()) {
135
	            if ($formulaire->validate()) {
136
	                mise_a_jour ($formulaire->getSubmitValues(), $db) ;
136
	                mise_a_jour ($formulaire->getSubmitValues(), $db) ;
137
	            }
137
	            }
138
	        }
138
	        }
139
	        if ($GLOBALS['action'] == 'nouveau_v') {
139
	        if ($_REQUEST['action'] == 'nouveau_v') {
140
	            if ($formulaire->validate()) {
140
	            if ($formulaire->validate()) {
141
	                insertion ($formulaire->getSubmitValues(), $db) ;
141
	                insertion ($formulaire->getSubmitValues(), $db) ;
Line 175... Line 175...
175
 
175
 
176
 
176
 
177
/* +--Fin du code ----------------------------------------------------------------------------------------+
177
/* +--Fin du code ----------------------------------------------------------------------------------------+
-
 
178
*
-
 
179
* $Log: not supported by cvs2svn $
-
 
180
* Revision 1.8  2007/03/20 14:17:36  alexandre_tb
-
 
181
* remplacement des varaibles $GLOBALS par $_REQUEST, pour que l appli fonctionne avec les register_globals à Off
-
 
182
*
-
 
183
* Revision 1.7  2006/12/01 10:39:14  alexandre_tb
178
*
184
* Suppression des références aux applettes
179
* $Log: not supported by cvs2svn $
185
*
180
* Revision 1.6  2006/10/06 10:40:51  florian
186
* Revision 1.6  2006/10/06 10:40:51  florian
181
* harmonisation des messages d'erreur de l'authentification
187
* harmonisation des messages d'erreur de l'authentification
182
*
188
*