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 '
entity) && $debug)?'?debug=1':'').'" method="POST">'; +print ''; +print ''; + print ''; print ''; print ''; @@ -189,15 +194,12 @@ print "\n"; // Line to add new record $var=false; print "\n"; -print ''; -print ''; -print ''; -print ''."\n"; +print ''."\n"; print ''; // Limit to superadmin if (! empty($conf->multicompany->enabled) && !$user->entity) @@ -205,22 +207,17 @@ if (! empty($conf->multicompany->enabled) && !$user->entity) print ''; + print '\n"; print ''; -print ''; -print "\n"; - -print 'entity) && $debug)?'?debug=1':'').'" method="POST">'; -print ''; -print ''; // Show constants $sql = "SELECT"; @@ -250,21 +247,20 @@ if ($result) $var=!$var; print "\n"; - print ''; - print ''; - print ''; print ''."\n"; // Value print ''; // Note - print ''; + print ''; // Entity limit to superadmin @@ -273,13 +269,14 @@ if ($result) print ''; + print '
'.$langs->trans("Name").'
'; -print ''; +print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; } else { + print ''; print ''; } -print ''; -print ''; +print ''; print "
'.$obj->name.''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; } else { + print ''; print ''; } - print ''; if ($conf->use_javascript_ajax) { print '';