diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php
index 94c660c9a3f..7588bdf5241 100644
--- a/htdocs/admin/const.php
+++ b/htdocs/admin/const.php
@@ -42,9 +42,6 @@ $consts=GETPOST('const');
$constname=GETPOST('constname','alpha');
$constvalue=GETPOST('constvalue');
$constnote=GETPOST('constnote','alpha');
-$consttype=(GETPOST('consttype','alpha')?GETPOST('consttype','alpha'):'chaine');
-
-$typeconst=array('yesno' => 'yesno', 'texte' => 'texte', 'chaine' => 'chaine');
@@ -52,7 +49,7 @@ $typeconst=array('yesno' => 'yesno', 'texte' => 'texte', 'chaine' => 'chaine');
* Actions
*/
-if ($action == 'add')
+if ($action == 'add' || GETPOST('add'))
{
$error=0;
@@ -69,9 +66,13 @@ if ($action == 'add')
if (! $error)
{
- if (dolibarr_set_const($db, $constname, $constvalue, $typeconst[$consttype], 1, $constnote, $entity) >= 0)
+ if (dolibarr_set_const($db, $constname, $constvalue, 'chaine', 1, $constnote, $entity) >= 0)
{
setEventMessage($langs->trans("RecordSaved"));
+ $action="";
+ $constname="";
+ $constvalue="";
+ $constnote="";
}
else
{
@@ -176,6 +177,10 @@ print_fiche_titre($langs->trans("OtherSetup"),'','setup');
print $langs->trans("ConstDesc")."
\n";
print "
\n";
+print '