diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 2ac4fa76682..00eebf78f10 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -585,6 +585,10 @@ complete_dictionary_with_modules($taborder, $tabname, $tablib, $tabsql, $tabsqls $i = 0; foreach ($tabcomplete as $key => $value) { $i++; + // When a dictionnary is commented + if (!isset($tabcond[$i])) { + continue; + } $tabcomplete[$key]['id'] = $i; $tabcomplete[$key]['cond'] = $tabcond[$i]; $tabcomplete[$key]['rowid'] = $tabrowid[$i]; @@ -607,7 +611,7 @@ if (empty($sortfield)) { $tmp1 = explode(',', empty($tabcomplete[$keytable]['sqlsort']) ? '' : $tabcomplete[$keytable]['sqlsort']); $tmp2 = explode(' ', $tmp1[0]); $sortfield = preg_replace('/^.*\./', '', $tmp2[0]); - $sortorder = $tmp2[1]; + $sortorder = (!empty($tmp2[1]) ? $tmp2[1] : ''); //var_dump($sortfield);var_dump($sortorder); } diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index d59505e5fb7..103ef815e48 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -236,7 +236,7 @@ $arrayfields = array( 'p.multicurrency_total_invoiced'=>array('label'=>'MulticurrencyAmountInvoicedTTC', 'checked'=>0, 'enabled'=>!empty($conf->multicurrency->enabled) && !empty($conf->global->PROPOSAL_SHOW_INVOICED_AMOUNT)), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10), 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>-1), - 'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), + 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 5d4dce6872d..cdabf9f2a5a 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -190,7 +190,7 @@ $arrayfields = array( 'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110), 'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>115), 'sale_representative'=>array('label'=>"SaleRepresentativesOfThirdParty", 'checked'=>0, 'position'=>116), - 'total_pa' => array('label' => ($conf->global->MARGIN_TYPE == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), + 'total_pa' => array('label' => (getDolGlobalString('MARGIN_TYPE') == '1' ? 'BuyingPrice' : 'CostPrice'), 'checked' => 0, 'position' => 300, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), 'total_margin' => array('label' => 'Margin', 'checked' => 0, 'position' => 301, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous ? 0 : 1)), 'total_margin_rate' => array('label' => 'MarginRate', 'checked' => 0, 'position' => 302, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARGIN_RATES) ? 0 : 1)), 'total_mark_rate' => array('label' => 'MarkRate', 'checked' => 0, 'position' => 303, 'enabled' => (empty($conf->margin->enabled) || !$user->rights->margins->liretous || empty($conf->global->DISPLAY_MARK_RATES) ? 0 : 1)), diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 889599e2fa9..55876016680 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -340,7 +340,7 @@ if ($result) { $obj = $db->fetch_object($result); // If line is for a module that does not exist anymore (absent of includes/module), we ignore it - if (empty($modules[$obj->module])) { + if (!isset($obj->module) || empty($modules[$obj->module])) { $i++; continue; }