--- /tmp/dsg/dolibarr/htdocs/variants/admin/github_admin.php +++ /tmp/dsg/dolibarr/htdocs/variants/admin/client_admin.php @@ -22,69 +22,51 @@ $langs->loadLangs(array("admin", "products")); -$action = GETPOST('action', 'alphanohtml'); - // Security check if (!$user->admin || (empty($conf->product->enabled) && empty($conf->service->enabled))) accessforbidden(); -$error = 0; - - -/* - * Actions - */ - -if ($action) { +if ($_POST) { $value = GETPOST('PRODUIT_ATTRIBUTES_HIDECHILD'); - if (!dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_HIDECHILD', $value, 'chaine', 0, '', $conf->entity)) { + if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_HIDECHILD', $value, 'chaine', 0, '', $conf->entity)) { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + } else { setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); - $error++; } - if (!dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_SEPARATOR', GETPOST('PRODUIT_ATTRIBUTES_SEPARATOR'), 'chaine', 0, '', $conf->entity)) { - setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); - $error++; - } - - if (!$error) { - setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); - } + if (dolibarr_set_const($db, 'PRODUIT_ATTRIBUTES_SEPARATOR', GETPOST('PRODUIT_ATTRIBUTES_SEPARATOR'), 'chaine', 0, '', $conf->entity)) { + setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); + } else { + setEventMessages($langs->trans('CoreErrorMessage'), null, 'errors'); + } } -$title = $langs->trans('ModuleSetup').' '.$langs->trans('Module610Name'); +$title = $langs->trans('ModuleSetup').' '.$langs->trans('ProductAttributes'); llxHeader('', $title); $linkback = ''.$langs->trans("BackToModuleList").''; print load_fiche_titre($title, $linkback, 'title_setup'); -print '
'; // End of page