From 5bf03de3fbd000cc33d72387169359ce21d5459d Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Wed, 19 Oct 2016 22:24:04 +0200 Subject: [PATCH] Fix setup page --- htdocs/admin/resource.php | 44 +++++++++++++++----------------- htdocs/core/lib/resource.lib.php | 2 +- 2 files changed, 21 insertions(+), 25 deletions(-) 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 '
'; print ''; -print ''; +print ''; $var=true; print ''; print ''; print ''."\n"; print ''."\n"; +print ''; // Utilisation formulaire Ajax sur choix produit $var=!$var; print ''; -print ''; +print ''; if (empty($conf->use_javascript_ajax)) { print ''; + print ''; } print ''; @@ -119,10 +114,10 @@ print ''; $var=!$var; print ''; print ''; -print ''; print ''; +print ''; print ''; $var=!$var; @@ -131,6 +126,7 @@ print ''; print ''; +print ''; print ''; print '
'.$langs->trans("Parameters").''.$langs->trans("Value").'
'.$langs->trans("UseSearchToSelectResource").''.$langs->trans("UseSearchToSelectResource").''; @@ -111,7 +103,10 @@ else '2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",2).')', '3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",3).')', ); - print $form->selectarray("activate_usesearchtoselectproduct",$arrval,$conf->global->RESOURCE_USE_SEARCH_TO_SELECT); + print $form->selectarray("activate_RESOURCE_USE_SEARCH_TO_SELECT",$arrval,$conf->global->RESOURCE_USE_SEARCH_TO_SELECT); + print ''; + print ''; print '
'.$langs->trans('DisabledResourceLinkUser').''; echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_USER'); print '
'.$langs->trans('DisabledResourceLinkContact').''; echo ajax_constantonoff('RESOURCE_HIDE_ADD_CONTACT_THIPARTY'); print '
'; diff --git a/htdocs/core/lib/resource.lib.php b/htdocs/core/lib/resource.lib.php index 687ccacc15a..a6c63dc51e4 100644 --- a/htdocs/core/lib/resource.lib.php +++ b/htdocs/core/lib/resource.lib.php @@ -95,7 +95,7 @@ function resource_admin_prepare_head() { $head = array(); $head[$h][0] = DOL_URL_ROOT.'/admin/resource.php'; - $head[$h][1] = $langs->trans("Miscellaneous"); + $head[$h][1] = $langs->trans("ResourceSetup"); $head[$h][2] = 'general'; $h++;