diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 820738630f65e5f170b9b8844816bed636697b0c..33414e558c3239a871738a7b171ff34a3f16af52 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -19,10 +19,10 @@ */ /** - \file htdocs/admin/const.php - \ingroup setup - \brief Page d'administration/configuration des constantes autres - \version $Id$ + * \file htdocs/admin/const.php + * \ingroup setup + * \brief Admin page to defined miscellaneous constants + * \version $Id$ */ require("./pre.inc.php"); @@ -36,6 +36,10 @@ accessforbidden(); $typeconst=array('yesno','texte','chaine'); +/* + * Actions + */ + if ($_POST["action"] == 'update' || $_POST["action"] == 'add') { if (! dolibarr_set_const($db, $_POST["constname"],$_POST["constvalue"],$typeconst[$_POST["consttype"]],1,isset($_POST["constnote"])?$_POST["constnote"]:'',$_POST["entity"])); @@ -53,6 +57,10 @@ if ($_GET["action"] == 'delete') } +/* + * View + */ + llxHeader(); print_fiche_titre($langs->trans("OtherSetup"),'','setup'); @@ -113,7 +121,7 @@ $sql.= ", note"; $sql.= ", entity"; $sql.= " FROM ".MAIN_DB_PREFIX."const"; $sql.= " WHERE entity IN (0,".$conf->entity.")"; -if (!isset($all)) $sql.= " AND visible = 1"; +if (!empty($all)) $sql.= " AND visible = 1"; $sql.= " ORDER BY name ASC"; dol_syslog("Const::listConstant sql=".$sql);