diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php index 324f5d8d447..34766f92778 100644 --- a/htdocs/accountancy/admin/account.php +++ b/htdocs/accountancy/admin/account.php @@ -95,7 +95,7 @@ $arrayfields = array( 'aa.import_key'=>array('label'=>"ImportId", 'checked'=>-1) ); -if ($conf->global->MAIN_FEATURES_LEVEL < 2) { +if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { unset($arrayfields['categories']); unset($arrayfields['aa.reconcilable']); } @@ -146,7 +146,7 @@ if (empty($reshook)) { $search_array_options = array(); } if ((GETPOST('valid_change_chart', 'alpha') && GETPOST('chartofaccounts', 'int') > 0) // explicit click on button 'Change and load' with js on - || (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != $conf->global->CHARTOFACCOUNTS)) { // a submit of form is done and chartofaccounts combo has been modified + || (GETPOST('chartofaccounts', 'int') > 0 && GETPOST('chartofaccounts', 'int') != getDolGlobalInt('CHARTOFACCOUNTS'))) { // a submit of form is done and chartofaccounts combo has been modified if ($chartofaccounts > 0 && $permissiontoadd) { // Get language code for this $chartofaccounts $sql = 'SELECT code FROM '.MAIN_DB_PREFIX.'c_country as c, '.MAIN_DB_PREFIX.'accounting_system as a'; @@ -228,7 +228,7 @@ if ($action == 'delete') { print $formconfirm; } -$pcgver = $conf->global->CHARTOFACCOUNTS; +$pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); $sql = "SELECT aa.rowid, aa.fk_pcg_version, aa.pcg_type, aa.account_number, aa.account_parent, aa.label, aa.labelshort, aa.fk_accounting_category,"; $sql .= " aa.reconcilable, aa.active, aa.import_key,"; @@ -240,8 +240,8 @@ $sql .= " WHERE asy.rowid = ".((int) $pcgver); //print $sql; if (strlen(trim($search_account))) { $lengthpaddingaccount = 0; - if ($conf->global->ACCOUNTING_LENGTH_GACCOUNT || $conf->global->ACCOUNTING_LENGTH_AACCOUNT) { - $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_GACCOUNT, $conf->global->ACCOUNTING_LENGTH_AACCOUNT); + if (getDolGlobalInt('ACCOUNTING_LENGTH_GACCOUNT') || getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) { + $lengthpaddingaccount = max(getDolGlobalInt('ACCOUNTING_LENGTH_GACCOUNT'), getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')); } $search_account_tmp = $search_account; $weremovedsomezero = 0; @@ -289,7 +289,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/admin/card.php b/htdocs/accountancy/admin/card.php index 126b7ac9c07..26287a5bbb8 100644 --- a/htdocs/accountancy/admin/card.php +++ b/htdocs/accountancy/admin/card.php @@ -76,7 +76,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors'); $action = 'create'; } else { - $sql = "SELECT pcg_version FROM " . MAIN_DB_PREFIX . "accounting_system WHERE rowid = ".((int) $conf->global->CHARTOFACCOUNTS); + $sql = "SELECT pcg_version FROM " . MAIN_DB_PREFIX . "accounting_system WHERE rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')); dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); $result = $db->query($sql); @@ -139,7 +139,7 @@ if ($action == 'add' && $user->hasRight('accounting', 'chartofaccount')) { } else { $result = $object->fetch($id); - $sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid=".((int) $conf->global->CHARTOFACCOUNTS); + $sql = "SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid=".((int) getDolGlobalInt('CHARTOFACCOUNTS')); dol_syslog('accountancy/admin/card.php:: $sql=' . $sql); $result2 = $db->query($sql); @@ -211,7 +211,7 @@ $form = new Form($db); $formaccounting = new FormAccounting($db); $accountsystem = new AccountancySystem($db); -$accountsystem->fetch($conf->global->CHARTOFACCOUNTS); +$accountsystem->fetch(getDolGlobalInt('CHARTOFACCOUNTS')); $title = $langs->trans('AccountAccounting')." - ".$langs->trans('Card'); diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php index 82cf7d282f1..d0be20bb918 100644 --- a/htdocs/accountancy/admin/fiscalyear.php +++ b/htdocs/accountancy/admin/fiscalyear.php @@ -104,7 +104,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index 174d8fdf13e..fe83a04afd0 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -361,7 +361,7 @@ print ''; foreach ($list as $key) { print ''; - if (!empty($conf->global->ACCOUNTING_MANAGE_ZERO) && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) { + if (getDolGlobalInt('ACCOUNTING_MANAGE_ZERO') && ($key == 'ACCOUNTING_LENGTH_GACCOUNT' || $key == 'ACCOUNTING_LENGTH_AACCOUNT')) { continue; } diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index 01bfa1da942..45ce2c7c763 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -394,7 +394,7 @@ if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/admin/subaccount.php b/htdocs/accountancy/admin/subaccount.php index 31b99be39a3..86df8d69416 100644 --- a/htdocs/accountancy/admin/subaccount.php +++ b/htdocs/accountancy/admin/subaccount.php @@ -78,7 +78,7 @@ $arrayfields = array( 'reconcilable'=>array('label'=>$langs->trans("Reconcilable"), 'checked'=>1) ); -if ($conf->global->MAIN_FEATURES_LEVEL < 2) { +if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { unset($arrayfields['reconcilable']); } @@ -137,8 +137,8 @@ $sql .= " AND sa.code_compta <> ''"; //print $sql; if (strlen(trim($search_subaccount))) { $lengthpaddingaccount = 0; - if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) { - $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT); + if (getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) { + $lengthpaddingaccount = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT'); } $search_subaccount_tmp = $search_subaccount; $weremovedsomezero = 0; @@ -184,8 +184,8 @@ $sql .= " AND sa.code_compta_fournisseur <> ''"; //print $sql; if (strlen(trim($search_subaccount))) { $lengthpaddingaccount = 0; - if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) { - $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT); + if (getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) { + $lengthpaddingaccount = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT'); } $search_subaccount_tmp = $search_subaccount; $weremovedsomezero = 0; @@ -231,8 +231,8 @@ $sql .= " AND u.accountancy_code <> ''"; //print $sql; if (strlen(trim($search_subaccount))) { $lengthpaddingaccount = 0; - if ($conf->global->ACCOUNTING_LENGTH_AACCOUNT) { - $lengthpaddingaccount = max($conf->global->ACCOUNTING_LENGTH_AACCOUNT); + if (getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT')) { + $lengthpaddingaccount = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT'); } $search_subaccount_tmp = $search_subaccount; $weremovedsomezero = 0; @@ -274,7 +274,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php index c45a1202419..976c2f33cc6 100644 --- a/htdocs/accountancy/bookkeeping/balance.php +++ b/htdocs/accountancy/bookkeeping/balance.php @@ -254,7 +254,7 @@ llxHeader('', $title_page); if ($action != 'export_csv') { // List $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { if ($type == 'sub') { $nbtotalofrecords = $object->fetchAllBalance($sortorder, $sortfield, 0, 0, $filter, 'AND', 1); } else { diff --git a/htdocs/accountancy/bookkeeping/export.php b/htdocs/accountancy/bookkeeping/export.php index 591068e5e67..bc99974ccd8 100644 --- a/htdocs/accountancy/bookkeeping/export.php +++ b/htdocs/accountancy/bookkeeping/export.php @@ -670,7 +670,7 @@ $title_page = $langs->trans("Operations").' - '.$langs->trans("ExportAccountancy // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php index d84c9212659..585d5b664cb 100644 --- a/htdocs/accountancy/bookkeeping/list.php +++ b/htdocs/accountancy/bookkeeping/list.php @@ -665,7 +665,7 @@ $title_page = $langs->trans("Operations").' - '.$langs->trans("Journals"); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 599e2360147..9031c73624b 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -559,7 +559,7 @@ llxHeader('', $title_page); // List $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { // TODO Perf Replace this by a count if ($type == 'sub') { $nbtotalofrecords = $object->fetchAllByAccount($sortorder, $sortfield, 0, 0, $filter, 'AND', 1, 1); diff --git a/htdocs/accountancy/class/accountancycategory.class.php b/htdocs/accountancy/class/accountancycategory.class.php index 5c13c2efba8..80b74c41fdf 100644 --- a/htdocs/accountancy/class/accountancycategory.class.php +++ b/htdocs/accountancy/class/accountancycategory.class.php @@ -466,7 +466,7 @@ class AccountancyCategory // extends CommonObject $sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; $sql .= " WHERE (aa.fk_accounting_category <> ".((int) $id)." OR aa.fk_accounting_category IS NULL)"; - $sql .= " AND asy.rowid = ".((int) $conf->global->CHARTOFACCOUNTS); + $sql .= " AND asy.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')); $sql .= " AND aa.active = 1"; $sql .= " AND aa.entity = ".$conf->entity; $sql .= " GROUP BY aa.account_number, aa.label"; @@ -512,7 +512,7 @@ class AccountancyCategory // extends CommonObject $sql = "SELECT aa.rowid, aa.account_number"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa"; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; - $sql .= " AND asy.rowid = ".((int) $conf->global->CHARTOFACCOUNTS); + $sql .= " AND asy.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')); $sql .= " AND aa.active = 1"; $sql .= " AND aa.entity = ".$conf->entity; $sql .= " ORDER BY LENGTH(aa.account_number) DESC;"; // LENGTH is ok with mysql and postgresql @@ -839,7 +839,7 @@ class AccountancyCategory // extends CommonObject exit(); } - $pcgverid = $conf->global->CHARTOFACCOUNTS; + $pcgverid = getDolGlobalInt('CHARTOFACCOUNTS'); $pcgvercode = dol_getIdFromCode($this->db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version'); if (empty($pcgvercode)) { $pcgvercode = $pcgverid; diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 0fd2fb2e61d..8643724030c 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -169,7 +169,7 @@ class AccountingAccount extends CommonObject global $conf; $this->db = $db; - $this->next_prev_filter = "fk_pcg_version IN (SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid = ".((int) $conf->global->CHARTOFACCOUNTS).")"; // Used to add a filter in Form::showrefnav method + $this->next_prev_filter = "fk_pcg_version IN (SELECT pcg_version FROM ".MAIN_DB_PREFIX."accounting_system WHERE rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')).")"; // Used to add a filter in Form::showrefnav method } /** @@ -198,7 +198,7 @@ class AccountingAccount extends CommonObject $sql .= " AND a.entity = ".$conf->entity; } if (!empty($limittocurrentchart)) { - $sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) $conf->global->CHARTOFACCOUNTS).')'; + $sql .= ' AND a.fk_pcg_version IN (SELECT pcg_version FROM '.MAIN_DB_PREFIX.'accounting_system WHERE rowid = '.((int) getDolGlobalInt('CHARTOFACCOUNTS')).')'; } if (!empty($limittoachartaccount)) { $sql .= " AND a.fk_pcg_version = '".$this->db->escape($limittoachartaccount)."'"; diff --git a/htdocs/accountancy/class/bookkeeping.class.php b/htdocs/accountancy/class/bookkeeping.class.php index 7e2cdc56543..49bda65ba2b 100644 --- a/htdocs/accountancy/class/bookkeeping.class.php +++ b/htdocs/accountancy/class/bookkeeping.class.php @@ -2031,7 +2031,7 @@ class BookKeeping extends CommonObject require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php'; - $pcgver = $conf->global->CHARTOFACCOUNTS; + $pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); $sql = "SELECT DISTINCT ab.numero_compte as account_number, aa.label as label, aa.rowid as rowid, aa.fk_pcg_version"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab"; @@ -2093,7 +2093,7 @@ class BookKeeping extends CommonObject public function getRootAccount($account = null) { global $conf; - $pcgver = $conf->global->CHARTOFACCOUNTS; + $pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); $sql = "SELECT root.rowid, root.account_number, root.label as label,"; $sql .= " parent.rowid as parent_rowid, parent.account_number as parent_account_number, parent.label as parent_label"; @@ -2135,7 +2135,7 @@ class BookKeeping extends CommonObject // phpcs:enable global $conf; - $pcgver = $conf->global->CHARTOFACCOUNTS; + $pcgver = getDolGlobalInt('CHARTOFACCOUNTS'); $sql = "SELECT aa.account_number, aa.label, aa.rowid, aa.fk_pcg_version, cat.label as category"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_account as aa "; $sql .= " INNER JOIN ".MAIN_DB_PREFIX."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 17ac1d211ae..e93bb4eccc4 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -75,7 +75,7 @@ $year_current = $year_start; // Validate History $action = GETPOST('action', 'aZ09'); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -102,9 +102,9 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('acc $sql1 .= ' (SELECT accnt.rowid '; $sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt'; $sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst'; - $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity).')'; - $sql1 .= ' AND fd.fk_facture IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture WHERE entity = '.((int) $conf->entity).')'; - $sql1 .= ' AND fk_code_ventilation <> 0'; + $sql1 .= " ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS'))." AND accnt.entity = ".((int) $conf->entity).")"; + $sql1 .= " AND fd.fk_facture IN (SELECT rowid FROM ".MAIN_DB_PREFIX."facture WHERE entity = ".((int) $conf->entity).")"; + $sql1 .= " AND fk_code_ventilation <> 0"; dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); $resql1 = $db->query($sql1); diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php index 0e5ecd25563..2079e28c15f 100644 --- a/htdocs/accountancy/customer/lines.php +++ b/htdocs/accountancy/customer/lines.php @@ -303,7 +303,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 509e131f766..987d35512a5 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -102,7 +102,7 @@ $hookmanager->initHooks(array('accountancycustomerlist')); $formaccounting = new FormAccounting($db); $accountingAccount = new AccountingAccount($db); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -359,7 +359,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php index f11ccbf512e..c9ce105103c 100644 --- a/htdocs/accountancy/expensereport/index.php +++ b/htdocs/accountancy/expensereport/index.php @@ -58,7 +58,7 @@ $year_current = $year_start; // Validate History $action = GETPOST('action', 'aZ09'); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -85,7 +85,7 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->hasRight('acc $sql1 .= ' (SELECT accnt.rowid '; $sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt'; $sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst'; - $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) $conf->global->CHARTOFACCOUNTS).' AND accnt.entity = '.((int) $conf->entity).')'; + $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.((int) getDolGlobalInt('CHARTOFACCOUNTS')).' AND accnt.entity = '.((int) $conf->entity).')'; $sql1 .= ' AND erd.fk_expensereport IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'expensereport WHERE entity = '.((int) $conf->entity).')'; $sql1 .= ' AND fk_code_ventilation <> 0'; dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php index fbb92ebb18e..ba98ebcaaa7 100644 --- a/htdocs/accountancy/expensereport/lines.php +++ b/htdocs/accountancy/expensereport/lines.php @@ -234,7 +234,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php index e8822f2f669..253879eb462 100644 --- a/htdocs/accountancy/expensereport/list.php +++ b/htdocs/accountancy/expensereport/list.php @@ -95,7 +95,7 @@ $hookmanager->initHooks(array('accountancyexpensereportlist')); $formaccounting = new FormAccounting($db); $accounting = new AccountingAccount($db); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -283,7 +283,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index 87e67bbfcb6..63bd08a8066 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -73,7 +73,7 @@ $year_current = $year_start; // Validate History $action = GETPOST('action', 'aZ09'); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -100,9 +100,9 @@ if (($action == 'clean' || $action == 'validatehistory') && $user->rights->accou $sql1 .= ' (SELECT accnt.rowid '; $sql1 .= ' FROM '.MAIN_DB_PREFIX.'accounting_account as accnt'; $sql1 .= ' INNER JOIN '.MAIN_DB_PREFIX.'accounting_system as syst'; - $sql1 .= ' ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid='.$conf->global->CHARTOFACCOUNTS.' AND accnt.entity = '.$conf->entity.')'; - $sql1 .= ' AND fd.fk_facture_fourn IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_fourn WHERE entity = '.$conf->entity.')'; - $sql1 .= ' AND fk_code_ventilation <> 0'; + $sql1 .= " ON accnt.fk_pcg_version = syst.pcg_version AND syst.rowid = ".getDolGlobalInt('CHARTOFACCOUNTS')." AND accnt.entity = ".((int) $conf->entity).")"; + $sql1 .= " AND fd.fk_facture_fourn IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'facture_fourn WHERE entity = ".((int) $conf->entity).")"; + $sql1 .= " AND fk_code_ventilation <> 0"; dol_syslog("htdocs/accountancy/customer/index.php fixaccountancycode", LOG_DEBUG); $resql1 = $db->query($sql1); diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php index 11c4bf290fd..2c4fece83f0 100644 --- a/htdocs/accountancy/supplier/lines.php +++ b/htdocs/accountancy/supplier/lines.php @@ -308,7 +308,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php index 9c9ee109383..2b8fea60e51 100644 --- a/htdocs/accountancy/supplier/list.php +++ b/htdocs/accountancy/supplier/list.php @@ -104,7 +104,7 @@ $hookmanager->initHooks(array('accountancysupplierlist')); $formaccounting = new FormAccounting($db); $accountingAccount = new AccountingAccount($db); -$chartaccountcode = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); +$chartaccountcode = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); // Security check if (!isModEnabled('accounting')) { @@ -363,7 +363,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index 37261676e98..0013db9ffa9 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -500,7 +500,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php index 10b711e943f..c843992ed3b 100644 --- a/htdocs/adherents/subscription/list.php +++ b/htdocs/adherents/subscription/list.php @@ -241,7 +241,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 622accdd5b1..bd2b63f6f7d 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -634,7 +634,7 @@ if ($rowid > 0) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index 20d9ddf4ac9..f7cb09e50be 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -275,7 +275,7 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 280a3b06247..1a8f9ff90d5 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -298,7 +298,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 05b76c9d6d5..94d33d6059c 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -127,10 +127,10 @@ foreach ($modulesdir as $dir) { // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); - if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) { + if ($objMod->version == 'development' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) { $modulequalified = 0; } - if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) { + if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) { $modulequalified = 0; } if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) { diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index f5ec91027f8..c6ba25be465 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -396,10 +396,10 @@ foreach ($modulesdir as $dir) { // We discard modules according to features level (PS: if module is activated we always show it) $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i', '', get_class($objMod))); - if ($objMod->version == 'development' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 2))) { + if ($objMod->version == 'development' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2))) { $modulequalified = 0; } - if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL < 1))) { + if ($objMod->version == 'experimental' && (empty($conf->global->$const_name) && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1))) { $modulequalified = 0; } if (preg_match('/deprecated/', $objMod->version) && (empty($conf->global->$const_name) && ($conf->global->MAIN_FEATURES_LEVEL >= 0))) { @@ -598,7 +598,7 @@ if ($mode == 'common' || $mode == 'commonkanban') { if (getDolGlobalInt('MAIN_FEATURES_LEVEL')) { $array_version = array('stable'=>$langs->transnoentitiesnoconv("Stable")); - if ($conf->global->MAIN_FEATURES_LEVEL < 0) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 0) { $array_version['deprecated'] = $langs->trans("Deprecated"); } if ($conf->global->MAIN_FEATURES_LEVEL > 0) { diff --git a/htdocs/asset/admin/setup.php b/htdocs/asset/admin/setup.php index 1b107746319..c8edc9c5d8f 100644 --- a/htdocs/asset/admin/setup.php +++ b/htdocs/asset/admin/setup.php @@ -544,7 +544,7 @@ if ($action == 'edit') { print ''; require_once DOL_DOCUMENT_ROOT . '/accountancy/class/accountancysystem.class.php'; $accountsystem = new AccountancySystem($db); - $accountsystem->fetch($conf->global->CHARTOFACCOUNTS); + $accountsystem->fetch(getDolGlobalInt('CHARTOFACCOUNTS')); $sql = 'SELECT DISTINCT pcg_type FROM ' . MAIN_DB_PREFIX . 'accounting_account'; $sql .= " WHERE fk_pcg_version = '" . $db->escape($accountsystem->ref) . "'"; $sql .= ' AND entity in ('.getEntity('accounting_account', 0).')'; // Always limit to current entity. No sharing in accountancy. diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index 8f8c551d66b..5ff5f6d0382 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -299,7 +299,7 @@ $sql .= !empty($hookmanager->resPrint) ? (" HAVING 1=1 " . $hookmanager->resPrin // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 8ccf50a8ab1..d87a9ea55c8 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -301,7 +301,7 @@ $sql .= !empty($hookmanager->resPrint) ? (" HAVING 1=1 " . $hookmanager->resPrin // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* This old and fast method to get and count full list returns all record so use a high amount of memory. $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 0819c4f1cd1..043d64ecedf 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -385,7 +385,7 @@ $sql=preg_replace('/,\s*$/','', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index 732ddf20a93..8fe736c4b29 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -311,7 +311,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* This old and fast method to get and count full list returns all record so use a high amount of memory. $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php index e416dd498ed..1c074acf7a9 100644 --- a/htdocs/bookcal/booking_list.php +++ b/htdocs/bookcal/booking_list.php @@ -311,7 +311,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* This old and fast method to get and count full list returns all record so use a high amount of memory. $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); diff --git a/htdocs/bookmarks/list.php b/htdocs/bookmarks/list.php index 2bd7109c80b..88904357ab3 100644 --- a/htdocs/bookmarks/list.php +++ b/htdocs/bookmarks/list.php @@ -172,7 +172,7 @@ if (!$user->admin) { // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index 557e05fc53d..0a9ea52acd1 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -983,7 +983,7 @@ class Categorie extends CommonObject $offset = 0; $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $this->db->query($sql); $nbtotalofrecords = $this->db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 12303f87ed8..342d0ba1a25 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -570,7 +570,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index 2cc3f6a7a9d..987551422e4 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -101,7 +101,7 @@ $sql .= " GROUP BY year, month, df"; $sql .= " ORDER BY year DESC, month DESC, df DESC"; $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 7aa41457cae..f0fb4a9bf7d 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -593,7 +593,7 @@ if ($object->fetch($id) >= 0) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/comm/mailing/list.php b/htdocs/comm/mailing/list.php index 3fea5458a2d..fe87b1fee65 100644 --- a/htdocs/comm/mailing/list.php +++ b/htdocs/comm/mailing/list.php @@ -208,7 +208,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 1b159c9a113..da95eb1425b 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -809,7 +809,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php index a6eb116f17d..4638677fe1c 100644 --- a/htdocs/commande/customer.php +++ b/htdocs/commande/customer.php @@ -111,7 +111,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index df648c9766f..8fff0f25e86 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1060,7 +1060,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 1d5addd76a8..166afaeb5b3 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -602,7 +602,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php index 5740c58c86c..96dd247d24b 100644 --- a/htdocs/compta/bank/bankentries_list.php +++ b/htdocs/compta/bank/bankentries_list.php @@ -701,7 +701,7 @@ $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; $nbtotalofpages = 0; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); $nbtotalofpages = ceil($nbtotalofrecords / $limit); diff --git a/htdocs/compta/bank/list.php b/htdocs/compta/bank/list.php index 85c9e72af5a..e65cff2ae2c 100644 --- a/htdocs/compta/bank/list.php +++ b/htdocs/compta/bank/list.php @@ -258,7 +258,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php index f7ac2576c2c..113bbe2b7cb 100644 --- a/htdocs/compta/bank/releve.php +++ b/htdocs/compta/bank/releve.php @@ -252,7 +252,7 @@ if (empty($numref)) { // Count total nb of records $totalnboflines = 0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalnboflines = $db->num_rows($result); } diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php index ec703f3fea4..df96a920f18 100644 --- a/htdocs/compta/bank/various_payment/list.php +++ b/htdocs/compta/bank/various_payment/list.php @@ -296,7 +296,7 @@ if ($search_all) { // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/compta/cashcontrol/cashcontrol_list.php b/htdocs/compta/cashcontrol/cashcontrol_list.php index 4451707bdff..1e79b09cc37 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_list.php +++ b/htdocs/compta/cashcontrol/cashcontrol_list.php @@ -290,7 +290,7 @@ $sql=preg_replace('/,\s*$/','', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php index e0d45a5e38f..8625be6438e 100644 --- a/htdocs/compta/facture/invoicetemplate_list.php +++ b/htdocs/compta/facture/invoicetemplate_list.php @@ -386,7 +386,7 @@ if ($search_date_when_end) { // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 859584361b7..abc43c402ba 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -935,7 +935,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php index 11748c5c870..08c6096706a 100644 --- a/htdocs/compta/paiement/cheque/list.php +++ b/htdocs/compta/paiement/cheque/list.php @@ -130,7 +130,7 @@ $sql .= dolSqlDateFilter('bc.date_bordereau', 0, $month, $year); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index 5e39e05c818..12036bd07bc 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -261,7 +261,7 @@ if (GETPOST("orphelins", "alpha")) { // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php index 6d780c6471f..0839d51987e 100644 --- a/htdocs/compta/paiement/tovalidate.php +++ b/htdocs/compta/paiement/tovalidate.php @@ -87,7 +87,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php index 8752e63517a..fe43bb50c05 100644 --- a/htdocs/compta/prelevement/card.php +++ b/htdocs/compta/prelevement/card.php @@ -392,7 +392,7 @@ if ($id > 0 || $ref) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php index fc4e4e5f83b..361b52998ec 100644 --- a/htdocs/compta/prelevement/create.php +++ b/htdocs/compta/prelevement/create.php @@ -366,7 +366,7 @@ if ($socid > 0) { } $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php index 905c8f36415..38c02fdc24b 100644 --- a/htdocs/compta/prelevement/demandes.php +++ b/htdocs/compta/prelevement/demandes.php @@ -175,7 +175,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php index 949ebed87c5..9488380ad31 100644 --- a/htdocs/compta/prelevement/factures.php +++ b/htdocs/compta/prelevement/factures.php @@ -218,7 +218,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php index 7e80874745c..67a7cf46c33 100644 --- a/htdocs/compta/prelevement/fiche-rejet.php +++ b/htdocs/compta/prelevement/fiche-rejet.php @@ -199,7 +199,7 @@ $sql .= " ORDER BY pl.amount DESC"; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php index 96c365997b0..e258fbe1e09 100644 --- a/htdocs/compta/prelevement/list.php +++ b/htdocs/compta/prelevement/list.php @@ -158,7 +158,7 @@ if ($search_company) { // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/compta/prelevement/orders_list.php b/htdocs/compta/prelevement/orders_list.php index 974ed47deff..3b5325d2b30 100644 --- a/htdocs/compta/prelevement/orders_list.php +++ b/htdocs/compta/prelevement/orders_list.php @@ -118,7 +118,7 @@ if ($search_amount) { // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index beda62520d9..5d4a3eea67f 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -282,8 +282,8 @@ if ($modecompta == 'BOOKKEEPING') { $predefinedgroupwhere .= " (pcg_type = 'INCOME')"; $predefinedgroupwhere .= ")"; - $charofaccountstring = $conf->global->CHARTOFACCOUNTS; - $charofaccountstring = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); + $charofaccountstring = getDolGlobalInt('CHARTOFACCOUNTS'); + $charofaccountstring = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); $sql = "SELECT -1 as socid, aa.pcg_type, SUM(f.credit - f.debit) as amount"; if ($showaccountdetail == 'no') { diff --git a/htdocs/compta/resultat/index.php b/htdocs/compta/resultat/index.php index 686f5ff42f7..8a5c2855fac 100644 --- a/htdocs/compta/resultat/index.php +++ b/htdocs/compta/resultat/index.php @@ -917,8 +917,8 @@ if (isModEnabled('accounting') && ($modecompta == 'BOOKKEEPING')) { $predefinedgroupwhere .= " (aa.pcg_type = 'INCOME')"; $predefinedgroupwhere .= ")"; - $charofaccountstring = $conf->global->CHARTOFACCOUNTS; - $charofaccountstring = dol_getIdFromCode($db, $conf->global->CHARTOFACCOUNTS, 'accounting_system', 'rowid', 'pcg_version'); + $charofaccountstring = getDolGlobalInt('CHARTOFACCOUNTS'); + $charofaccountstring = dol_getIdFromCode($db, getDolGlobalInt('CHARTOFACCOUNTS'), 'accounting_system', 'rowid', 'pcg_version'); $sql = "SELECT b.doc_ref, b.numero_compte, b.subledger_account, b.subledger_label, aa.pcg_type, date_format(b.doc_date,'%Y-%m') as dm, sum(b.debit) as debit, sum(b.credit) as credit, sum(b.montant) as amount"; $sql .= " FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as b, ".MAIN_DB_PREFIX."accounting_account as aa"; diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index 6ea46c3ea4e..ad552adacc3 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -270,7 +270,7 @@ if (isModEnabled('project')) { // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 8c575ad4b6a..ee23d52ae99 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -182,7 +182,7 @@ if (preg_match('/^cs\./', $sortfield) // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/compta/stats/index.php b/htdocs/compta/stats/index.php index f578e6a2ec9..4a23f772baf 100644 --- a/htdocs/compta/stats/index.php +++ b/htdocs/compta/stats/index.php @@ -241,7 +241,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql .= " AND f.fk_soc = ".((int) $socid); } } elseif ($modecompta == "BOOKKEEPING") { - $pcgverid = $conf->global->CHARTOFACCOUNTS; + $pcgverid = getDolGlobalInt('CHARTOFACCOUNTS'); $pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version'); if (empty($pcgvercode)) { $pcgvercode = $pcgverid; diff --git a/htdocs/compta/stats/supplier_turnover.php b/htdocs/compta/stats/supplier_turnover.php index db6cec39cab..825ba61e531 100644 --- a/htdocs/compta/stats/supplier_turnover.php +++ b/htdocs/compta/stats/supplier_turnover.php @@ -226,7 +226,7 @@ if ($modecompta == 'CREANCES-DETTES') { $sql .= " AND f.fk_soc = ".((int) $socid); } } elseif ($modecompta == "BOOKKEEPING") { - $pcgverid = $conf->global->CHARTOFACCOUNTS; + $pcgverid = getDolGlobalInt('CHARTOFACCOUNTS'); $pcgvercode = dol_getIdFromCode($db, $pcgverid, 'accounting_system', 'rowid', 'pcg_version'); if (empty($pcgvercode)) { $pcgvercode = $pcgverid; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 5d5e0e0b8ff..bf0c7bbc6e3 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -219,7 +219,7 @@ $sql .= " GROUP BY t.rowid, t.amount, t.label, t.datev, t.datep, t.paye, t.fk_ty // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 533d2a8a42e..426eb756ec7 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -686,7 +686,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index c51a4398cf1..e8a259b2989 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -462,7 +462,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { //$result = $db->query($sql); //$nbtotalofrecords = $db->num_rows($result); diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php index 47818081448..de5f08a3693 100644 --- a/htdocs/contrat/services_list.php +++ b/htdocs/contrat/services_list.php @@ -368,7 +368,7 @@ $sql .= $db->order($sortfield, $sortorder); //print $sql; $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/core/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php index f071871d0d4..c59f3973c3a 100644 --- a/htdocs/core/boxes/box_validated_projects.php +++ b/htdocs/core/boxes/box_validated_projects.php @@ -69,7 +69,7 @@ class box_validated_projects extends ModeleBoxes $this->hidden = empty($user->rights->projet->lire); - if ($conf->global->MAIN_FEATURES_LEVEL < 2) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { $this->enabled = 0; } } diff --git a/htdocs/core/class/html.formaccounting.class.php b/htdocs/core/class/html.formaccounting.class.php index 47dab9f6fda..3437d4fa050 100644 --- a/htdocs/core/class/html.formaccounting.class.php +++ b/htdocs/core/class/html.formaccounting.class.php @@ -370,7 +370,7 @@ class FormAccounting extends Form $sql = "SELECT DISTINCT aa.account_number, aa.label, aa.labelshort, aa.rowid, aa.fk_pcg_version"; $sql .= " FROM ".$this->db->prefix()."accounting_account as aa"; $sql .= " INNER JOIN ".$this->db->prefix()."accounting_system as asy ON aa.fk_pcg_version = asy.pcg_version"; - $sql .= " AND asy.rowid = ".((int) $conf->global->CHARTOFACCOUNTS); + $sql .= " AND asy.rowid = ".((int) getDolGlobalInt('CHARTOFACCOUNTS')); if ($active === '1') { $sql .= " AND aa.active = 1"; } elseif ($active === '0') { @@ -390,7 +390,7 @@ class FormAccounting extends Form $num_rows = $this->db->num_rows($resql); - if ($num_rows == 0 && (empty($conf->global->CHARTOFACCOUNTS) || $conf->global->CHARTOFACCOUNTS < 0)) { + if ($num_rows == 0 && (empty(getDolGlobalInt('CHARTOFACCOUNTS')) || getDolGlobalInt('CHARTOFACCOUNTS') < 0)) { $langs->load("errors"); $showempty = $langs->trans("ErrorYouMustFirstSetupYourChartOfAccount"); } else { diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php index e2c87ff15e8..e5c9e4eca6a 100644 --- a/htdocs/core/class/html.formadmin.class.php +++ b/htdocs/core/class/html.formadmin.class.php @@ -243,10 +243,10 @@ class FormAdmin foreach ($menuarray as $key => $val) { $tab = explode('_', $key); $newprefix = $tab[0]; - if ($newprefix == '1' && ($conf->global->MAIN_FEATURES_LEVEL < 1)) { + if ($newprefix == '1' && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1)) { continue; } - if ($newprefix == '2' && ($conf->global->MAIN_FEATURES_LEVEL < 2)) { + if ($newprefix == '2' && (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2)) { continue; } if ($newprefix != $oldprefix) { // Add separators diff --git a/htdocs/core/lib/doleditor.lib.php b/htdocs/core/lib/doleditor.lib.php index c2e1955d8de..43e59c01e65 100644 --- a/htdocs/core/lib/doleditor.lib.php +++ b/htdocs/core/lib/doleditor.lib.php @@ -90,10 +90,10 @@ function show_skin($fuser, $edit = 0) if (is_dir($dirskin."/".$subdir) && substr($subdir, 0, 1) <> '.' && substr($subdir, 0, 3) <> 'CVS' && !preg_match('/common|phones/i', $subdir)) { // Disable not stable themes (dir ends with _exp or _dev) - if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && preg_match('/_dev$/i', $subdir)) { continue; } - if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i', $subdir)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && preg_match('/_exp$/i', $subdir)) { continue; } diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php index 64747c1bbf6..8058deb387b 100644 --- a/htdocs/core/lib/usergroups.lib.php +++ b/htdocs/core/lib/usergroups.lib.php @@ -409,10 +409,10 @@ function showSkins($fuser, $edit = 0, $foruserprofile = false) if (is_dir($dirtheme."/".$subdir) && substr($subdir, 0, 1) <> '.' && substr($subdir, 0, 3) <> 'CVS' && !preg_match('/common|phones/i', $subdir)) { // Disable not stable themes (dir ends with _exp or _dev) - if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && preg_match('/_dev$/i', $subdir)) { continue; } - if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i', $subdir)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && preg_match('/_exp$/i', $subdir)) { continue; } diff --git a/htdocs/core/lib/website2.lib.php b/htdocs/core/lib/website2.lib.php index 25c099a0fee..87a964c9419 100644 --- a/htdocs/core/lib/website2.lib.php +++ b/htdocs/core/lib/website2.lib.php @@ -581,10 +581,10 @@ function showWebsiteTemplates(Website $website) $subdirwithoutzip = preg_replace('/\.zip$/i', '', $subdir); // Disable not stable themes (dir ends with _exp or _dev) - if ($conf->global->MAIN_FEATURES_LEVEL < 2 && preg_match('/_dev$/i', $subdir)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2 && preg_match('/_dev$/i', $subdir)) { continue; } - if ($conf->global->MAIN_FEATURES_LEVEL < 1 && preg_match('/_exp$/i', $subdir)) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1 && preg_match('/_exp$/i', $subdir)) { continue; } diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 1c62db7db57..affeb8ee827 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -450,9 +450,9 @@ class ImportCsv extends ModeleImports //var_dump($arrayrecord[0]['val']); /*include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancysystem.class.php'; $tmpchartofaccount = new AccountancySystem($this->db); - $tmpchartofaccount->fetch($conf->global->CHARTOFACCOUNTS); + $tmpchartofaccount->fetch(getDolGlobalInt('CHARTOFACCOUNTS')); //var_dump($tmpchartofaccount->ref.' - '.$arrayrecord[0]['val']); - if ((! ($conf->global->CHARTOFACCOUNTS > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val']) + if ((! (getDolGlobalInt('CHARTOFACCOUNTS') > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val']) { $this->errors[$error]['lib']=$langs->trans('ErrorImportOfChartLimitedToCurrentChart', $tmpchartofaccount->ref); $this->errors[$error]['type']='RESTRICTONCURRENCTCHART'; diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index 4ced5a7dff4..f9b41f185f1 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -493,9 +493,9 @@ class ImportXlsx extends ModeleImports //var_dump($arrayrecord[0]['val']); /*include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancysystem.class.php'; $tmpchartofaccount = new AccountancySystem($this->db); - $tmpchartofaccount->fetch($conf->global->CHARTOFACCOUNTS); + $tmpchartofaccount->fetch(getDolGlobalInt('CHARTOFACCOUNTS')); //var_dump($tmpchartofaccount->ref.' - '.$arrayrecord[0]['val']); - if ((! ($conf->global->CHARTOFACCOUNTS > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val']) + if ((! (getDolGlobalInt('CHARTOFACCOUNTS') > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val']) { $this->errors[$error]['lib']=$langs->trans('ErrorImportOfChartLimitedToCurrentChart', $tmpchartofaccount->ref); $this->errors[$error]['type']='RESTRICTONCURRENCTCHART'; diff --git a/htdocs/core/modules/movement/doc/pdf_standard.modules.php b/htdocs/core/modules/movement/doc/pdf_standard.modules.php index a1c4ff54654..2d7a7e8f9fc 100644 --- a/htdocs/core/modules/movement/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/movement/doc/pdf_standard.modules.php @@ -337,7 +337,7 @@ class pdf_standard extends ModelePDFMovement $sql .= $this->db->order($sortfield, $sortorder); $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $this->db->query($sql); $nbtotalofrecords = $this->db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php index 021e33dd20a..8ef23101ac4 100644 --- a/htdocs/cron/list.php +++ b/htdocs/cron/list.php @@ -302,7 +302,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/don/list.php b/htdocs/don/list.php index b8412c58707..a2f81fe093e 100644 --- a/htdocs/don/list.php +++ b/htdocs/don/list.php @@ -139,7 +139,7 @@ if ($search_amount) { $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index f78654a94f4..b65b11639ab 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -590,7 +590,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 5fd8425c259..9a66fdb3a61 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -338,7 +338,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index ac17743092e..2bd8e44522f 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -451,7 +451,7 @@ $reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $obje $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint; $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php index 0f7145418aa..96437f3c855 100644 --- a/htdocs/expensereport/list.php +++ b/htdocs/expensereport/list.php @@ -346,7 +346,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/expensereport/payment/list.php b/htdocs/expensereport/payment/list.php index 675696473f5..a0e45c65e8b 100644 --- a/htdocs/expensereport/payment/list.php +++ b/htdocs/expensereport/payment/list.php @@ -232,7 +232,7 @@ $sql .= ' ba.rowid, ba.ref, ba.label, ba.number, ba.account_number, ba.iban_pref $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index e06b138ab76..22ee0a1a1c5 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -328,7 +328,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index adf75194fde..0f981d464e4 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -970,7 +970,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/fourn/facture/list-rec.php b/htdocs/fourn/facture/list-rec.php index 65c35a1ed67..e3c4ed0fcea 100644 --- a/htdocs/fourn/facture/list-rec.php +++ b/htdocs/fourn/facture/list-rec.php @@ -358,7 +358,7 @@ if ($tmpsortfield == 'recurring') { $sql .= $db->order($tmpsortfield, $sortorder); $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 25045b154e0..97c1b4c7b37 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -705,7 +705,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index 1b7db48a063..61b6ae23df4 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -244,7 +244,7 @@ if (empty($user->rights->societe->client->voir)) { $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php index 10c3c0bae78..029f1bd2308 100644 --- a/htdocs/fourn/product/list.php +++ b/htdocs/fourn/product/list.php @@ -199,7 +199,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index ddcb4b55bd6..6a810880501 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -368,7 +368,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/holiday/view_log.php b/htdocs/holiday/view_log.php index d868cdd9cbc..a67fc63bf5e 100644 --- a/htdocs/holiday/view_log.php +++ b/htdocs/holiday/view_log.php @@ -222,7 +222,7 @@ $log_holiday = $object->fetchLog($sqlorder, $sqlwhere); // Load $object->logs // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { //TODO: $result = $db->query($sql); //TODO: $nbtotalofrecords = $db->num_rows($result); $nbtotalofrecords = is_array($object->logs) ? count($object->logs) : 0; diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php index 59192bc5ca5..f933a152250 100644 --- a/htdocs/hrm/admin/admin_establishment.php +++ b/htdocs/hrm/admin/admin_establishment.php @@ -98,7 +98,7 @@ $sql .= " WHERE e.entity IN (".getEntity('establishment').')'; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index 3b77d199388..9e911f7bc19 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -313,7 +313,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index ae215e50556..da67eb18729 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -301,7 +301,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index e7033e88b86..92f3efd6fe9 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -424,7 +424,7 @@ if ($job->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create' // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 @@ -985,7 +985,7 @@ function DisplayPositionList() // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index c2ce65032bc..7892bbd5952 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -312,7 +312,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 3ec1e393ace..28685480acb 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -314,7 +314,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index f25dc9536c4..c8c6ddfef36 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -276,7 +276,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index 8450484160e..75abceb309b 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -348,7 +348,7 @@ $sql=preg_replace('/,\s*$/','', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index 70a91ecfe3a..44329cc7daa 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -130,7 +130,7 @@ $sql .= " GROUP BY l.rowid, l.label, l.capital, l.paid, l.datestart, l.dateend"; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/'.preg_quote($linktopl, '/').'/', '', $sqlforcount); diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php index 0ef626c507f..50b911ae036 100644 --- a/htdocs/margin/checkMargins.php +++ b/htdocs/margin/checkMargins.php @@ -230,7 +230,7 @@ $sql .= " AND d.buy_price_ht IS NOT NULL"; $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { dol_syslog(__FILE__, LOG_DEBUG); $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php index e16fe9647ea..02c5a1b33bb 100644 --- a/htdocs/modulebuilder/template/myobject_list.php +++ b/htdocs/modulebuilder/template/myobject_list.php @@ -376,7 +376,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index c49b5903046..aadb4a3a7b1 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -321,7 +321,7 @@ $sql=preg_replace('/,\s*$/','', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/mrp/mo_movements.php b/htdocs/mrp/mo_movements.php index ae3ed6d9e34..5b30237b1b7 100644 --- a/htdocs/mrp/mo_movements.php +++ b/htdocs/mrp/mo_movements.php @@ -492,7 +492,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/multicurrency/multicurrency_rate.php b/htdocs/multicurrency/multicurrency_rate.php index b518a0d378c..e20476776e2 100644 --- a/htdocs/multicurrency/multicurrency_rate.php +++ b/htdocs/multicurrency/multicurrency_rate.php @@ -328,7 +328,7 @@ $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); if ($result) { diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php index d845ef337d4..78c20146414 100644 --- a/htdocs/opensurvey/list.php +++ b/htdocs/opensurvey/list.php @@ -199,7 +199,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index 33b940748bd..a57211cff06 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -421,7 +421,7 @@ $sql=preg_replace('/,\s*$/','', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/product/admin/product_lot.php b/htdocs/product/admin/product_lot.php index d7eb1b5fe50..364ff691b53 100644 --- a/htdocs/product/admin/product_lot.php +++ b/htdocs/product/admin/product_lot.php @@ -170,7 +170,7 @@ $head = product_lot_admin_prepare_head(); print dol_get_fiche_head($head, 'settings', $langs->trans("Batch"), -1, 'lot'); -if ($conf->global->MAIN_FEATURES_LEVEL < 2) { +if (getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) { // The feature to define the numbering module of lot or serial is no enabled bcause it is not used anywhere in Dolibarr code: You can set it // but the numbering module is not used. // TODO Use it on lot creation page, when you create a lot and when the lot number is kept empty to define the lot according diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index d1d5f542b0d..217d6b76141 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -329,7 +329,7 @@ $sql=preg_replace('/,\s*$/','', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 4d654bd5187..338b1420842 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -627,7 +627,7 @@ $sql .= $hookmanager->resPrint; //if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/'.preg_quote($linktopfp, '/').'/', '', $sqlforcount); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 172ca4a5e54..c573a2a26c6 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -2100,7 +2100,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $nbtotalofrecords = $prodcustprice->fetch_all_log($sortorder, $sortfield, $conf->liste_limit, $offset, $filter); } @@ -2227,7 +2227,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $nbtotalofrecords = $prodcustprice->fetchAll($sortorder, $sortfield, 0, 0, $filter); } diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index 6cb7c455759..a80afac833f 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -290,7 +290,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index da2c45c6766..3d72610736e 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -411,7 +411,7 @@ if (!empty($sql_having)) { // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php index d417fc8af73..851bf118823 100644 --- a/htdocs/product/stats/bom.php +++ b/htdocs/product/stats/bom.php @@ -144,7 +144,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); if ($result) { $totalofrecords = $db->num_rows($result); @@ -205,7 +205,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); if ($result) { $totalofrecords = $db->num_rows($result); diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index a8606e49a8f..cc77d5ea9da 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -174,7 +174,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index dddd911224c..4322680499e 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -174,7 +174,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 21737badb16..9ce0a12fc71 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -159,7 +159,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index f17d56faeb9..2bdb1ad6d4a 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -190,7 +190,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 06a63cb4c6e..349b41584d4 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -173,7 +173,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stats/facturerec.php b/htdocs/product/stats/facturerec.php index ddc7e1a0e3d..149a6aacf41 100644 --- a/htdocs/product/stats/facturerec.php +++ b/htdocs/product/stats/facturerec.php @@ -191,7 +191,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index 8a4fc03b530..a6ba39cdad9 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -169,7 +169,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 99f3e42e921..f93c5022fd2 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -175,7 +175,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 841c0e29004..f2957ffaeb1 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -174,7 +174,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index f731c6e855f..5c113eeca45 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -336,7 +336,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/product/stock/movement_card.php b/htdocs/product/stock/movement_card.php index 5babcfc4c7c..571ff25a753 100644 --- a/htdocs/product/stock/movement_card.php +++ b/htdocs/product/stock/movement_card.php @@ -510,7 +510,7 @@ $sql .= $hookmanager->resPrint; $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index 72f36220185..25c16ba7394 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -708,7 +708,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index d77075bdd8b..43eb7c1fd1f 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -300,7 +300,7 @@ $sql=preg_replace('/,\s*$/','', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* This old and fast method to get and count full list returns all record so use a high amount of memory. $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 63d44bbc284..039c6ff9e4a 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -533,7 +533,7 @@ if ($includeproductswithoutdesiredqty == 'on') { } $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { diff --git a/htdocs/product/stock/stats/commande_fournisseur.php b/htdocs/product/stock/stats/commande_fournisseur.php index 34f0a75109e..e2b8b7a306f 100644 --- a/htdocs/product/stock/stats/commande_fournisseur.php +++ b/htdocs/product/stock/stats/commande_fournisseur.php @@ -249,7 +249,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stock/stats/expedition.php b/htdocs/product/stock/stats/expedition.php index d4672fb31c5..29dd7a5b6d9 100644 --- a/htdocs/product/stock/stats/expedition.php +++ b/htdocs/product/stock/stats/expedition.php @@ -248,7 +248,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stock/stats/mo.php b/htdocs/product/stock/stats/mo.php index 95fbb7d9e9a..7609cdaf346 100644 --- a/htdocs/product/stock/stats/mo.php +++ b/htdocs/product/stock/stats/mo.php @@ -190,7 +190,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stock/stats/reception.php b/htdocs/product/stock/stats/reception.php index 444629cd3ff..f423e7a1f5a 100644 --- a/htdocs/product/stock/stats/reception.php +++ b/htdocs/product/stock/stats/reception.php @@ -247,7 +247,7 @@ if ($id > 0 || !empty($ref)) { // Count total nb of records $totalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $totalofrecords = $db->num_rows($result); } diff --git a/htdocs/product/stock/stockatdate.php b/htdocs/product/stock/stockatdate.php index 76d4958da34..901e512d23e 100644 --- a/htdocs/product/stock/stockatdate.php +++ b/htdocs/product/stock/stockatdate.php @@ -306,7 +306,7 @@ $sql .= $db->order($sortfield, $sortorder); $nbtotalofrecords = 0; if ($date && $dateIsValid) { // We avoid a heavy sql if mandatory parameter date not yet defined - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index 47904825ca7..4cb5e195f4a 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -233,7 +233,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php index b55305c92e6..64cc1bf6327 100644 --- a/htdocs/projet/list.php +++ b/htdocs/projet/list.php @@ -685,7 +685,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php index fdbe705b928..e54d35bdf96 100644 --- a/htdocs/projet/tasks/list.php +++ b/htdocs/projet/tasks/list.php @@ -548,7 +548,7 @@ if (!empty($arrayfields['t.tobill']['checked']) || !empty($arrayfields['t.billed // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php index 0da51607eb8..0005a9fd881 100644 --- a/htdocs/projet/tasks/time.php +++ b/htdocs/projet/tasks/time.php @@ -1664,7 +1664,7 @@ if (($id > 0 || !empty($ref)) || $projectidforalltimes > 0 || $allprojectforuser // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index d348252efeb..7b28d571bc5 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -708,7 +708,7 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // No $sql .= $hookmanager->resPrint; $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index deca6c40548..8e564c23ee3 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -312,7 +312,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index 82bad29b8ea..5757e0d9c67 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -289,7 +289,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* This old and fast method to get and count full list returns all record so use a high amount of memory. */ $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index b9050d190d2..8045b2857cb 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -542,7 +542,7 @@ class Dolresource extends CommonObject } $sql .= $this->db->order($sortfield, $sortorder); $this->num_all = 0; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $this->db->query($sql); $this->num_all = $this->db->num_rows($result); } diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 8ad57e0d93b..2395b6bf1b3 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -200,7 +200,7 @@ print ''; print ''; print ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $ret = $object->fetchAll('', '', 0, 0, $filter); if ($ret == -1) { dol_print_error($db, $object->error); diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 70c69761559..3dbdb75e803 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -303,7 +303,7 @@ $sql .= " pst.code"; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index adee2a2ebf1..d1acd5849d3 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -286,7 +286,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0 diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index 2f6159633fb..c143dd6cbfb 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -740,7 +740,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records with no order and no limits $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index e4ce8015381..e7dabe47154 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -410,7 +410,7 @@ if ($result > 0) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index dafe53a19d8..dae56b10c53 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -456,7 +456,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { if ($result < 0) { setEventMessages($prodcustprice->error, $prodcustprice->errors, 'errors'); } else { - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $nbtotalofrecords = $result; } } @@ -536,7 +536,7 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $nbtotalofrecords = $prodcustprice->fetchAll('', '', 0, 0, $filter); } diff --git a/htdocs/societe/website.php b/htdocs/societe/website.php index 4af74bdb2ce..8c467882a01 100644 --- a/htdocs/societe/website.php +++ b/htdocs/societe/website.php @@ -323,7 +323,7 @@ $sql .= $db->order($sortfield, $sortorder); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index d6b15e0baa5..9498674956f 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -472,7 +472,7 @@ $sql .= ', sp.ref DESC'; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index fa009bfec76..cfaf0d6ff51 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -460,7 +460,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/user/list.php b/htdocs/user/list.php index c935221404a..39b72c958a1 100644 --- a/htdocs/user/list.php +++ b/htdocs/user/list.php @@ -495,7 +495,7 @@ $sql .= $hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 0088b30cbf8..8d2769a497b 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -429,7 +429,7 @@ if ($result > 0) { // Count total nb of records $nbtotalofrecords = ''; - if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { + if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { $result = $db->query($sql); $nbtotalofrecords = $db->num_rows($result); if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 87925eda11a..a9ec17b65a4 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -333,7 +333,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " ".$hookmanager->resPrint; // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* This old and fast method to get and count full list returns all record so use a high amount of memory. $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index fac35b03190..a6b590b55d5 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -315,7 +315,7 @@ $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPri // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* This old and fast method to get and count full list returns all record so use a high amount of memory. $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql); diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index e1ca77e7101..186f3772e40 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -321,7 +321,7 @@ $sql = preg_replace('/,\s*$/', '', $sql); // Count total nb of records $nbtotalofrecords = ''; -if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) { +if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* This old and fast method to get and count full list returns all record so use a high amount of memory. */ $resql = $db->query($sql); $nbtotalofrecords = $db->num_rows($resql);