--- /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 '
'; -print ''; -print ''; +dol_fiche_head(array(), 'general', $tab, 0, 'product'); +print ''; print ''; - print ''; -print ''."\n"; -print ''."\n"; -print ''."\n"; - +print ''."\n"; print ''; - print ''; if (isset($conf->global->PRODUIT_ATTRIBUTES_SEPARATOR)) { - $separator = $conf->global->PRODUIT_ATTRIBUTES_SEPARATOR; + $separator = $conf->global->PRODUIT_ATTRIBUTES_SEPARATOR; } else { - $separator = "_"; + $separator = "_"; } print ''; - print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("Parameters").''."\n"; +print ''.$langs->trans("Value").''."\n"; +print ' 
'.$langs->trans('HideProductCombinations').''; print $form->selectyesno("PRODUIT_ATTRIBUTES_HIDECHILD", $conf->global->PRODUIT_ATTRIBUTES_HIDECHILD, 1).'
'.$langs->trans('CombinationsSeparator').'
'; - -print '
'; - +print '
'; print '
'; // End of page