diff --git a/htdocs/admin/resource.php b/htdocs/admin/resource.php index fd3fe4829c1..d8fdddd2bb5 100644 --- a/htdocs/admin/resource.php +++ b/htdocs/admin/resource.php @@ -44,26 +44,17 @@ $action = GETPOST('action', 'alpha'); * Actions */ -if ($action == 'update') +if ($action == 'updateoptions') { - $error = 0; - - foreach ($list as $constname) { - $constvalue = GETPOST($constname, 'alpha'); - - if (!dolibarr_set_const($db, $constname, $constvalue, 'chaine', 0, '', $conf->entity)) { - $error++; - } - } - - if (! $error) - { - setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); - } - else - { - setEventMessages($langs->trans("Error"), null, 'errors'); - } + if (GETPOST('activate_RESOURCE_USE_SEARCH_TO_SELECT')) + { + if (dolibarr_set_const($db, "RESOURCE_USE_SEARCH_TO_SELECT", GETPOST('activate_RESOURCE_USE_SEARCH_TO_SELECT'), 'chaine', 0, '', $conf->entity)) + { + setEventMessages($langs->trans("SetupSaved"), null, 'mesgs'); + } else { + setEventMessages($langs->trans("Error"), null, 'errors'); + } + } } /* @@ -79,23 +70,24 @@ print load_fiche_titre($langs->trans('ResourceSetup'),$linkback,'title_setup'); $head=resource_admin_prepare_head(); -dol_fiche_head($head, 'attributes', $langs->trans("ResourceSingular"), 0, 'action'); +dol_fiche_head($head, 'general', $langs->trans("ResourceSingular"), 0, 'action'); print '