diff --git a/htdocs/admin/defaultvalues.php b/htdocs/admin/defaultvalues.php index ec4c5fd46052058406caaefb981bb2f3d8836884..dd37e4987e5399e34f3a06f855bcb749c7287fc9 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")."<br>\n"; print "<br>\n"; +print $langs->trans("EnableDefaultValues").' '; +if (empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES)) +{ + // Button off, click to enable + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=1">'; + print img_picto($langs->trans("Disabled"),'switch_off'); + print '</a>'; +} +else +{ + // Button on, click to disable + print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setMAIN_ENABLE_DEFAULT_VALUES&value=0">'; + print img_picto($langs->trans("Activated"),'switch_on'); + print '</a>'; +} +print "<br><br>\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 c47586b2b2aa2c8e4b5474e6a6ed882e24ed58f2..88944ee589a63f80d692b24891c627d3563aff45 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -640,7 +640,8 @@ if ($mode == 'common') { $disableSetup = 0; - print '<td class="center valignmiddle" width="80px">'; + // Link enable/disabme + print '<td class="center valignmiddle" width="60px">'; if (! empty($arrayofwarnings[$modName])) { print '<!-- This module has a warning to show when we activate it (note: your country is '.$mysoc->country_code.') -->'."\n"; @@ -662,12 +663,12 @@ if ($mode == 'common') } print '</td>'."\n"; - // Config link + // Link config if (! empty($objMod->config_page_url) && !$disableSetup) { if (is_array($objMod->config_page_url)) { - print '<td class="tdsetuppicto right" width="40px"">'; + print '<td class="tdsetuppicto right" width="60px">'; $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 '<td class="tdsetuppicto right valignmiddle" width="80px"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>'; + print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.dol_buildpath('/'.$regs[2].'/admin/'.$regs[1],1).'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>'; } else { - print '<td class="tdsetuppicto right valignmiddle" width="80px"><a href="'.$objMod->config_page_url.'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>'; + print '<td class="tdsetuppicto right valignmiddle" width="60px"><a href="'.$objMod->config_page_url.'" title="'.$langs->trans("Setup").'">'.img_picto($langs->trans("Setup"),"setup",'style="padding-right: 6px"').'</a></td>'; } } else { - print '<td class="tdsetuppicto right valignmiddle" width="80px">'.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').'</td>'; + print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').'</td>'; } } else // Module not yet activated { - print '<td class="center valignmiddle" width="80px">'; + // Link enable/disable + print '<td class="center valignmiddle" width="60px">'; if (! empty($objMod->always_enabled)) { // Should never happened @@ -754,7 +756,9 @@ if ($mode == 'common') print "</a>\n"; } print "</td>\n"; - print '<td class="tdsetuppicto right valignmiddle" width="80px">'.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').'</td>'; + + // Link config + print '<td class="tdsetuppicto right valignmiddle" width="60px">'.img_picto($langs->trans("NothingToSetup"),"setup",'class="opacitytransp" style="padding-right: 6px"').'</td>'; } print "</tr>\n"; diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index c8204f213c250c1e98b49a91886a334e53423e44..72ff0f17a1b19a8483bc1503975ebf330359229a 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 '<br>'; //} // Title rule for stock decrease diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 262204b9f7277f322f726597fa77c9fb65308263..e3c6cb7d5cd0718d32d28cee5d295f68eb39be8e 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 14131bddd2c199f2775062c84e293790e452262a..8425aa2c4c6ad7aac3d4f24cc0ee21047826d502 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=<br>For form to create a new thirdparty, it is <strong>%s</strong> PageUrlForDefaultValuesList=<br>For page that list thirdparties, it is <strong>%s</strong> +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 b5f4b8b34ae02514f11ce2b6ac396326f5ca6c11..03f7e1c54acd31c052930ac480d5f6b6087dd42a 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 '<div class="underbanner clearboth"></div>'; - if (! empty($object->multilangs)) { foreach ($object->multilangs as $key => $value) { $s=picto_from_langcode($key); - //print '<tr><td>'; print ($s?$s.' ':'')." <b>".$langs->trans('Language_'.$key).":</b> ".'<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&langtodelete='.$key.'">'.img_delete('', 'class="valigntextbottom"').'</a>'; - //print '</td><td></td></tr>'; + + print '<div class="fichecenter">'; print '<div class="underbanner clearboth"></div>'; print '<table class="border" width="100%">'; print '<tr><td class="titlefieldcreate">'.$langs->trans('Label').'</td><td>'.$object->multilangs[$key]["label"].'</td></tr>'; @@ -296,6 +294,7 @@ else if ($action != 'add') print '<tr><td>'.$langs->trans('Other').' ('.$langs->trans("NotUsed").')</td><td>'.$object->multilangs[$key]["other"].'</td></tr>'; } print '</table>'; + print '</div>'; } } if (! $cnt_trans && $action != 'add') print '<div class="opacitymedium">'. $langs->trans('NoTranslation').'</div>';