mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
WIP Max length of list is automatic
This commit is contained in:
parent
196e90cfe8
commit
83fd7f1b3d
|
|
@ -434,7 +434,15 @@ if ($mode == 'other') {
|
|||
print '</tr>';
|
||||
|
||||
// Max size of lists
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeList") . '</td><td><input class="flat width50" name="MAIN_SIZE_LISTE_LIMIT" value="' . getDolGlobalString('MAIN_SIZE_LISTE_LIMIT') . '"></td>';
|
||||
print '<tr class="oddeven"><td>' . $langs->trans("DefaultMaxSizeList") . '</td><td><input class="flat width50" name="MAIN_SIZE_LISTE_LIMIT" value="';
|
||||
if (getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT') > 0) {
|
||||
print getDolGlobalString('MAIN_SIZE_LISTE_LIMIT');
|
||||
}
|
||||
print '">';
|
||||
if (getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT') <= 0) {
|
||||
print ' <span class="opacitymedium">('.$langs->trans("Automatic").')</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Max size of short lists on customer card
|
||||
|
|
|
|||
|
|
@ -123,9 +123,9 @@ if (isModEnabled("product") || isModEnabled("service")) {
|
|||
$statustoshow = -1;
|
||||
if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) {
|
||||
// hide products in closed warehouse, but show products for internal transfer
|
||||
print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOSTINT('combinations'), 1);
|
||||
print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, 'warehouseopen,warehouseinternal', GETPOSTINT('combinations'), 1);
|
||||
} else {
|
||||
print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOSTINT('combinations'), 1);
|
||||
print $form->select_produits(GETPOSTINT('idprod'), (($filtertype == 1) ? 'idprodservice' : 'idprod'), $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500', 0, '', GETPOSTINT('combinations'), 1);
|
||||
}
|
||||
$urltocreateproduct = DOL_URL_ROOT.'/product/card.php?action=create&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
print '<a href="'.$urltocreateproduct.'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddProduct").'"></span></a>';
|
||||
|
|
|
|||
|
|
@ -810,20 +810,20 @@ class Conf extends stdClass
|
|||
$this->global->MAIN_HTML_TITLE = 'thirdpartynameonly,contactnameonly,projectnameonly';
|
||||
}
|
||||
|
||||
// conf->liste_limit = constante de taille maximale des listes
|
||||
if (empty($this->global->MAIN_SIZE_LISTE_LIMIT)) {
|
||||
$this->global->MAIN_SIZE_LISTE_LIMIT = 15;
|
||||
// conf->liste_limit = constant to limit size of lists
|
||||
$this->liste_limit = getDolGlobalInt('MAIN_SIZE_LISTE_LIMIT', 15);
|
||||
if ((int) $this->liste_limit <= 0) {
|
||||
// Mode automatic. TODO Define a value according to height
|
||||
$this->liste_limit = 15;
|
||||
}
|
||||
$this->liste_limit = $this->global->MAIN_SIZE_LISTE_LIMIT;
|
||||
|
||||
// conf->product->limit_size = constante de taille maximale des select de produit
|
||||
// Set PRODUIT_LIMIT_SIZE if never defined
|
||||
if (!isset($this->global->PRODUIT_LIMIT_SIZE)) {
|
||||
$this->global->PRODUIT_LIMIT_SIZE = 1000;
|
||||
}
|
||||
$this->product->limit_size = $this->global->PRODUIT_LIMIT_SIZE;
|
||||
|
||||
// Set PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE, may be modified later according to browser
|
||||
$this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = (isset($this->global->PRODUIT_DESC_IN_FORM) ? $this->global->PRODUIT_DESC_IN_FORM : 0);
|
||||
$this->global->PRODUIT_DESC_IN_FORM_ACCORDING_TO_DEVICE = getDolGlobalInt('PRODUIT_DESC_IN_FORM');
|
||||
|
||||
// conf->theme et $this->css
|
||||
if (empty($this->global->MAIN_THEME)) {
|
||||
|
|
|
|||
|
|
@ -259,9 +259,9 @@ if ($nolinesbefore) {
|
|||
}
|
||||
if (getDolGlobalString('ENTREPOT_EXTRA_STATUS')) {
|
||||
// hide products in closed warehouse, but show products for internal transfer
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, $statuswarehouse, GETPOST('combinations', 'array'));
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, $statuswarehouse, GETPOST('combinations', 'array'));
|
||||
} else {
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, $conf->product->limit_size, $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', GETPOST('combinations', 'array'));
|
||||
$form->select_produits(GETPOST('idprod'), 'idprod', $filtertype, getDolGlobalInt('PRODUIT_LIMIT_SIZE'), $buyer->price_level, $statustoshow, 2, '', 1, array(), $buyer->id, '1', 0, 'maxwidth500 widthcentpercentminusx', 0, '', GETPOST('combinations', 'array'));
|
||||
}
|
||||
if (getDolGlobalString('MAIN_AUTO_OPEN_SELECT2_ON_FOCUS_FOR_CUSTOMER_PRODUCTS')) {
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1342,17 +1342,18 @@ if (!defined('NOLOGIN')) {
|
|||
* Overwrite some configs globals (try to avoid this and have code to use instead $user->conf->xxx)
|
||||
*/
|
||||
|
||||
// Set liste_limit
|
||||
if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT)) {
|
||||
$conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT; // Can be 0
|
||||
// Set liste_limit from user setup
|
||||
if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT)) { // If a user setup exists
|
||||
$conf->liste_limit = getDolUserInt('MAIN_SIZE_LISTE_LIMIT'); // Can be 0
|
||||
}
|
||||
if (isset($user->conf->PRODUIT_LIMIT_SIZE)) {
|
||||
$conf->product->limit_size = $user->conf->PRODUIT_LIMIT_SIZE; // Can be 0
|
||||
if ((int) $conf->liste_limit <= 0) {
|
||||
// Mode automatic. TODO Define a value according to height
|
||||
$conf->liste_limit = 15;
|
||||
}
|
||||
|
||||
// Replace conf->css by personalized value if theme not forced
|
||||
if (!getDolGlobalString('MAIN_FORCETHEME') && !empty($user->conf->MAIN_THEME)) {
|
||||
$conf->theme = $user->conf->MAIN_THEME;
|
||||
if (!getDolGlobalString('MAIN_FORCETHEME') && getDolUserString('MAIN_THEME')) {
|
||||
$conf->theme = getDolUserString('MAIN_THEME');
|
||||
$conf->css = "/theme/".$conf->theme."/style.css.php";
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1373,14 +1374,14 @@ if (GETPOST('theme', 'aZ09')) {
|
|||
if (GETPOSTINT('nojs')) { // If javascript was not disabled on URL
|
||||
$conf->use_javascript_ajax = 0;
|
||||
} else {
|
||||
if (!empty($user->conf->MAIN_DISABLE_JAVASCRIPT)) {
|
||||
$conf->use_javascript_ajax = !$user->conf->MAIN_DISABLE_JAVASCRIPT;
|
||||
if (getDolUserString('MAIN_DISABLE_JAVASCRIPT')) {
|
||||
$conf->use_javascript_ajax = !getDolUserString('MAIN_DISABLE_JAVASCRIPT');
|
||||
}
|
||||
}
|
||||
|
||||
// Set MAIN_OPTIMIZEFORTEXTBROWSER for user (must be after login part)
|
||||
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') && !empty($user->conf->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = $user->conf->MAIN_OPTIMIZEFORTEXTBROWSER;
|
||||
if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') && getDolUserString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
|
||||
$conf->global->MAIN_OPTIMIZEFORTEXTBROWSER = getDolUserString('MAIN_OPTIMIZEFORTEXTBROWSER');
|
||||
if (getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') == 1) {
|
||||
$conf->global->THEME_TOPMENU_DISABLE_IMAGE = 1;
|
||||
}
|
||||
|
|
@ -1389,7 +1390,7 @@ if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER') && !empty($user->conf->MA
|
|||
//var_dump($user->conf->THEME_TOPMENU_DISABLE_IMAGE);
|
||||
|
||||
// set MAIN_OPTIMIZEFORCOLORBLIND for user
|
||||
$conf->global->MAIN_OPTIMIZEFORCOLORBLIND = empty($user->conf->MAIN_OPTIMIZEFORCOLORBLIND) ? '' : $user->conf->MAIN_OPTIMIZEFORCOLORBLIND;
|
||||
$conf->global->MAIN_OPTIMIZEFORCOLORBLIND = getDolUserString('MAIN_OPTIMIZEFORCOLORBLIND');
|
||||
|
||||
// Set terminal output option according to conf->browser.
|
||||
if (GETPOSTINT('dol_hide_leftmenu') || !empty($_SESSION['dol_hide_leftmenu'])) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user