Subversion Repositories Applications.papyrus

Compare Revisions

Ignore whitespace Rev 1270 → Rev 1271

/branches/livraison_menes/papyrus/applications/admin_application/admin_application.php
19,7 → 19,7
// | License along with this library; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
// +------------------------------------------------------------------------------------------------------+
// CVS : $Id: admin_application.php,v 1.7 2006-12-01 10:39:14 alexandre_tb Exp $
// CVS : $Id: admin_application.php,v 1.7.2.1 2007-03-20 14:19:09 alexandre_tb Exp $
/**
* Application gérant les applications de Papyrus
*
31,7 → 31,7
//Auteur original :
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
*@copyright Tela-Botanica 2000-2004
*@version $Revision: 1.7 $
*@version $Revision: 1.7.2.1 $
// +------------------------------------------------------------------------------------------------------+
*/
 
92,7 → 92,7
$db = &$GLOBALS['_GEN_commun']['pear_db'] ;
$url = $GLOBALS['_GEN_commun']['url'] ;
$auth = &$GLOBALS['_GEN_commun']['pear_auth'] ;
isset ($GLOBALS['action']) ? '' : $GLOBALS['action'] = '' ; // On déclare action si elle n'existe pas
$res='';
if (!$auth->getAuth()) {
$res .= '<p class="zone_alert">'.ADAP_IDENTIFIEZ_VOUS.'</p>'."\n" ;
113,30 → 113,30
// Le lien pour une nouvelle entrée
$res .= '<a href="'.$url->getURL().'&amp;action=nouveau">'.ADAP_AJOUTER.'</a>'."\n<br />" ;
// traitement de la suppression
if (isset ($GLOBALS['action']) && $GLOBALS['action'] == 'supprimer') adap_supprimer_application($GLOBALS['id_appl'], $db) ;
if (isset ($_REQUEST['action']) && $_REQUEST['action'] == 'supprimer') adap_supprimer_application($_REQUEST['id_appl'], $db) ;
// traitement de l'ajout
if (isset ($GLOBALS['action']) || isset ($GLOBALS['id_appl'])) {
if (isset ($_REQUEST['action']) || isset ($_REQUEST['id_appl'])) {
$formulaire = new HTML_formulaireAppl('formulaire_appl', '', str_replace ('&amp;', '&', $url->getURL())) ;
$formulaire->construitFormulaire($url) ;
// On ajoute un champs caché avec action=nouveau_v
if ($GLOBALS['action'] == 'nouveau') {
if (isset ($_REQUEST['action']) && $_REQUEST['action'] == 'nouveau') {
$formulaire->addElement ('hidden', 'action', 'nouveau_v') ;
return $formulaire->toHTML() ;
}
if (isset ($GLOBALS['id_appl']) && $GLOBALS['action'] != 'modifier_v' && $GLOBALS['action'] != 'supprimer') {
if (isset ($_REQUEST['id_appl']) && !isset ($_REQUEST['action'])) {
$formulaire->addElement ('hidden', 'action', 'modifier_v') ;
$formulaire->addElement ('hidden', 'id_appl', $GLOBALS['id_appl']) ;
$formulaire->setDefaults(adap_valeurs_par_defaut($GLOBALS['id_appl'], $db)) ;
$formulaire->addElement ('hidden', 'id_appl', $_REQUEST['id_appl']) ;
$formulaire->setDefaults(adap_valeurs_par_defaut($_REQUEST['id_appl'], $db)) ;
return $formulaire->toHTML() ;
}
if ($GLOBALS['action'] == 'modifier_v') {
if ($_REQUEST['action'] == 'modifier_v') {
if ($formulaire->validate()) {
mise_a_jour ($formulaire->getSubmitValues(), $db) ;
}
}
if ($GLOBALS['action'] == 'nouveau_v') {
if ($_REQUEST['action'] == 'nouveau_v') {
if ($formulaire->validate()) {
insertion ($formulaire->getSubmitValues(), $db) ;
}
177,6 → 177,12
/* +--Fin du code ----------------------------------------------------------------------------------------+
*
* $Log: not supported by cvs2svn $
* Revision 1.8 2007/03/20 14:17:36 alexandre_tb
* remplacement des varaibles $GLOBALS par $_REQUEST, pour que l appli fonctionne avec les register_globals à Off
*
* Revision 1.7 2006/12/01 10:39:14 alexandre_tb
* Suppression des références aux applettes
*
* Revision 1.6 2006/10/06 10:40:51 florian
* harmonisation des messages d'erreur de l'authentification
*