From 02c176cf1b6bfb197c2c8c8e3ffedadafe2966c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 21 Dec 2009 00:06:04 +0000 Subject: [PATCH] Fix: if javascript disabled, no way to edit constants. --- htdocs/admin/const.php | 54 ++++++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index a85d105c127..a0e3fc509c6 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -36,9 +36,11 @@ accessforbidden(); $typeconst=array('yesno','texte','chaine'); + /* * Actions */ + if ($_POST["action"] == 'add') { if (dolibarr_set_const($db, $_POST["constname"],$_POST["constvalue"],$typeconst[$_POST["consttype"]],1,isset($_POST["constnote"])?$_POST["constnote"]:'',$_POST["entity"]) < 0) @@ -61,6 +63,7 @@ if (($_POST["const"] && isset($_POST["update"]) && $_POST["update"] == $langs->t } } +// Delete several lines at once if ($_POST["const"] && $_POST["delete"] && $_POST["delete"] == $langs->trans("Delete")) { foreach($_POST["const"] as $const) @@ -75,6 +78,15 @@ if ($_POST["const"] && $_POST["delete"] && $_POST["delete"] == $langs->trans("De } } +// Delete line from delete picto +if ($_GET["action"] == 'delete') +{ + if (dolibarr_del_const($db, $_GET["rowid"],$_GET["entity"]) < 0) + { + print $db->error(); + } +} + /* * View @@ -103,6 +115,7 @@ $form = new Form($db); # Affiche ligne d'ajout $var=false; +print "\n"; print '
'; print ''; print ''; @@ -125,15 +138,12 @@ else print ''; } print ''; -print '
'; +print ''; print "\n"; print ''; -print ''; -$colspan = 4; -if ($conf->multicompany->enabled && !$user->entity) $colspan++; -print ' '; print '
'; +print "\n"; print '
'; print ''; @@ -173,11 +183,15 @@ if ($result) // Value print ''; - print ''; + print 'use_javascript_ajax) print ' onKeyPress="displayElement(\'updateconst\'); checkBox(\'check_'.$i.'\');"'; + print '>'; print ''; // Note - print ''; + print 'use_javascript_ajax) print ' onKeyPress="displayElement(\'updateconst\'); checkBox(\'check_'.$i.'\');"'; + print '>'; print ''; // Entity limit to superadmin @@ -193,7 +207,13 @@ if ($result) } print ''; - print ''; + if ($conf->use_javascript_ajax) + { + print ''; + print '   '; + } + print ''.img_delete().''; + print "\n"; print "\n"; @@ -204,13 +224,17 @@ if ($result) print ''; -print '
'; -print ''; -print ''; +if ($conf->use_javascript_ajax) +{ + print '
'; + print ''; + print ''; +} + print "
\n";