Revert "Make new method for fast scanlist optional (for the moment)."

This reverts commit c034c1bb33.
This commit is contained in:
Francis Appels 2022-11-18 16:02:11 +01:00
parent c3b28bec85
commit d7cd88e9c3

View File

@ -594,12 +594,11 @@ $sql .= $hookmanager->resPrint;
//if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet //if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
$nbtotalofrecords = ''; $nbtotalofrecords = '';
if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
if (!getDolGlobalInt('MAIN_ENABLE_FAST_SCANLIST')) { /* $result = $db->query($sql);
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result); $nbtotalofrecords = $db->num_rows($result);
} else { */
/* Experimental: The fast and low memory method to get and count full list converts the sql into a sql count */ /* The fast and low memory method to get and count full list converts the sql into a sql count */
$sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql); $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
$sqlforcount = preg_replace('/'.preg_quote($linktopfp, '/').'/', '', $sqlforcount); $sqlforcount = preg_replace('/'.preg_quote($linktopfp, '/').'/', '', $sqlforcount);
$sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
@ -610,7 +609,6 @@ if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
} else { } else {
dol_print_error($db); dol_print_error($db);
} }
}
if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
$page = 0; $page = 0;