Merge pull request #4216 from frederic34/patch-8
FIX option MAIN_DISABLE_FULL_SCANLIST was not working for stock movements
This commit is contained in:
commit
77e9ab763b
@ -203,6 +203,14 @@ if (! empty($search_product)) $sql.= " AND p.label LIKE '%".$db->escape($s
|
|||||||
if (! empty($search_warehouse)) $sql.= " AND e.label LIKE '%".$db->escape($search_warehouse)."%'";
|
if (! empty($search_warehouse)) $sql.= " AND e.label LIKE '%".$db->escape($search_warehouse)."%'";
|
||||||
if (! empty($search_user)) $sql.= " AND u.login LIKE '%".$db->escape($search_user)."%'";
|
if (! empty($search_user)) $sql.= " AND u.login LIKE '%".$db->escape($search_user)."%'";
|
||||||
if (! empty($search_batch)) $sql.= " AND m.batch LIKE '%".$db->escape($search_batch)."%'";
|
if (! empty($search_batch)) $sql.= " AND m.batch LIKE '%".$db->escape($search_batch)."%'";
|
||||||
|
|
||||||
|
$nbtotalofrecords = 0;
|
||||||
|
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
|
||||||
|
{
|
||||||
|
$result = $db->query($sql);
|
||||||
|
$nbtotalofrecords = $db->num_rows($result);
|
||||||
|
}
|
||||||
|
|
||||||
$sql.= $db->order($sortfield,$sortorder);
|
$sql.= $db->order($sortfield,$sortorder);
|
||||||
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
$sql.= $db->plimit($conf->liste_limit+1, $offset);
|
||||||
|
|
||||||
@ -248,7 +256,7 @@ if ($resql)
|
|||||||
|
|
||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php">'.$langs->trans("BackToList").'</a>';
|
$linkback = '<a href="'.DOL_URL_ROOT.'/product/stock/list.php">'.$langs->trans("BackToList").'</a>';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
|
||||||
@ -470,8 +478,8 @@ if ($resql)
|
|||||||
if (!empty($snom)) $param.='&snom='.urlencode($snom); // FIXME $snom is not defined
|
if (!empty($snom)) $param.='&snom='.urlencode($snom); // FIXME $snom is not defined
|
||||||
if ($search_user) $param.='&search_user='.urlencode($search_user);
|
if ($search_user) $param.='&search_user='.urlencode($search_user);
|
||||||
if ($idproduct > 0) $param.='&idproduct='.$idproduct;
|
if ($idproduct > 0) $param.='&idproduct='.$idproduct;
|
||||||
if ($id) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num,0,'');
|
if ($id) print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords,'');
|
||||||
else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
|
else print_barre_liste($texte, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num, $nbtotalofrecords);
|
||||||
|
|
||||||
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
if ($id) print '<input type="hidden" name="id" value="'.$id.'">';
|
if ($id) print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user