diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index ec4c5fd4605..dd37e4987e5 100644 --- a/htdocs/admin/defaultvalues.php +++ b/htdocs/admin/defaultvalues.php @@ -84,6 +84,11 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP $search_array_options=array(); } +if ($action == 'setMAIN_ENABLE_DEFAULT_VALUES') +{ + if (GETPOST('value')) dolibarr_set_const($db, 'MAIN_ENABLE_DEFAULT_VALUES', 1, 'chaine', 0, '', $conf->entity); + else dolibarr_set_const($db, 'MAIN_ENABLE_DEFAULT_VALUES', 0, 'chaine', 0, '', $conf->entity); +} if (($action == 'add' || (GETPOST('add') && $action != 'update')) || GETPOST('actionmodify')) { @@ -185,6 +190,23 @@ print load_fiche_titre($langs->trans("DefaultValues"),'','title_setup'); print $langs->trans("DefaultValuesDesc")."
\n"; print "
\n"; +print $langs->trans("EnableDefaultValues").' '; +if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) +{ + // Button off, click to enable + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print ''; +} +else +{ + // Button on, click to disable + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); + print ''; +} +print "

\n"; + $param='&mode='.$mode; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index c47586b2b2a..88944ee589a 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -640,7 +640,8 @@ if ($mode == 'common') { $disableSetup = 0; - print ''; + // Link enable/disabme + print ''; if (! empty($arrayofwarnings[$modName])) { print ''."\n"; @@ -662,12 +663,12 @@ if ($mode == 'common') } print ''."\n"; - // Config link + // Link config if (! empty($objMod->config_page_url) && !$disableSetup) { if (is_array($objMod->config_page_url)) { - print ''; + print ''; $i=0; foreach ($objMod->config_page_url as $page) { @@ -693,22 +694,23 @@ if ($mode == 'common') } else if (preg_match('/^([^@]+)@([^@]+)$/i',$objMod->config_page_url,$regs)) { - print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; + print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } else { - print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; + print ''.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').''; } } else { - print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''; + print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''; } } else // Module not yet activated { - print ''; + // Link enable/disable + print ''; if (! empty($objMod->always_enabled)) { // Should never happened @@ -754,7 +756,9 @@ if ($mode == 'common') print "\n"; } print "\n"; - print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''; + + // Link config + print ''.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').''; } print "\n"; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index c8204f213c2..72ff0f17a1b 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -149,6 +149,7 @@ if (! empty($conf->productbatch->enabled)) //if (! empty($conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER) || ! empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT)) //{ print info_admin($langs->trans("IfYouUsePointOfSaleCheckModule")); +print '
'; //} // Title rule for stock decrease diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 262204b9f72..e3c6cb7d5cd 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -260,7 +260,7 @@ function GETPOST($paramname, $check='', $method=0, $filter=NULL, $options=NULL) global $conf; // Management of default values - if (! isset($_GET['sortfield']) && empty($conf->global->MAIN_DISABLE_DEFAULT_VALUES)) // If we did a click on a field to sort, we do no apply default values. Same if option MAIN_DISABLE_DEFAULT_VALUES is on + if (! isset($_GET['sortfield']) && ! empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) // If we did a click on a field to sort, we do no apply default values. Same if option MAIN_DISABLE_DEFAULT_VALUES is on { if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! empty($paramname) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname])) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 14131bddd2c..8425aa2c4c6 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -431,6 +431,7 @@ TheKeyIsTheNameOfHtmlField=This is the name of the HTML field. This need to have PageUrlForDefaultValues=You must enter here the relative url of the page. If you include parameters in URL, the default values will be effective if all parameters are set to same value. Examples: PageUrlForDefaultValuesCreate=
For form to create a new thirdparty, it is %s PageUrlForDefaultValuesList=
For page that list thirdparties, it is %s +EnableDefaultValues=Enable usage of personalized default values GoIntoTranslationMenuToChangeThis=A translation has been found for the key with this code, so to change this value, you must edit it fom Home-Setup-translation. WarningSettingSortOrder=Warning, setting a default sort order may result in a technical error when going on the list page if field is an unknown field. If you experience such an error, come back to this page to remove the default sort order and restore default behavior. Field=Field diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php index b5f4b8b34ae..03f7e1c54ac 100644 --- a/htdocs/product/traduction.php +++ b/htdocs/product/traduction.php @@ -277,16 +277,14 @@ if ($action == 'edit') } else if ($action != 'add') { - //if ($cnt_trans) print '
'; - if (! empty($object->multilangs)) { foreach ($object->multilangs as $key => $value) { $s=picto_from_langcode($key); - //print ''; print ($s?$s.' ':'')." ".$langs->trans('Language_'.$key).": ".''.img_delete('', 'class="valigntextbottom"').''; - //print ''; + + print '
'; print '
'; print ''; print ''; @@ -296,6 +294,7 @@ else if ($action != 'add') print ''; } print '
'.$langs->trans('Label').''.$object->multilangs[$key]["label"].'
'.$langs->trans('Other').' ('.$langs->trans("NotUsed").')'.$object->multilangs[$key]["other"].'
'; + print '
'; } } if (! $cnt_trans && $action != 'add') print '
'. $langs->trans('NoTranslation').'
';