Fix limit on margin pages
This commit is contained in:
parent
460179a01c
commit
ce8a024d44
@ -44,8 +44,15 @@ if ($user->rights->margins->read->all) {
|
|||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
// Load variable for pagination
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
|
$sortfield = GETPOST('sortfield','alpha');
|
||||||
|
$sortorder = GETPOST('sortorder','alpha');
|
||||||
|
$page = GETPOST('page','int');
|
||||||
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
|
$offset = $limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortorder) $sortorder="ASC";
|
||||||
if (! $sortfield)
|
if (! $sortfield)
|
||||||
{
|
{
|
||||||
@ -54,11 +61,6 @@ if (! $sortfield)
|
|||||||
else
|
else
|
||||||
$sortfield="u.lastname";
|
$sortfield="u.lastname";
|
||||||
}
|
}
|
||||||
$page = GETPOST("page",'int');
|
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
|
||||||
$offset = $conf->liste_limit * $page;
|
|
||||||
$pageprev = $page - 1;
|
|
||||||
$pagenext = $page + 1;
|
|
||||||
|
|
||||||
$startdate=$enddate='';
|
$startdate=$enddate='';
|
||||||
|
|
||||||
@ -170,7 +172,7 @@ if ($result)
|
|||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,$num,'');
|
print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1);
|
||||||
|
|
||||||
if ($conf->global->MARGIN_TYPE == "1")
|
if ($conf->global->MARGIN_TYPE == "1")
|
||||||
$labelcostprice=$langs->trans('BuyingPrice');
|
$labelcostprice=$langs->trans('BuyingPrice');
|
||||||
|
|||||||
@ -41,11 +41,17 @@ $result = restrictedArea($user, 'societe','','');
|
|||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
$page = GETPOST("page",'int');
|
// Load variable for pagination
|
||||||
|
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
|
$sortfield = GETPOST('sortfield','alpha');
|
||||||
|
$sortorder = GETPOST('sortorder','alpha');
|
||||||
|
$page = GETPOST('page','int');
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
$offset = $conf->liste_limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
|
if (! $sortfield) $sortfield="s.nom"; // Set here default search field
|
||||||
|
if (! $sortorder) $sortorder="ASC";
|
||||||
|
|
||||||
$startdate=$enddate='';
|
$startdate=$enddate='';
|
||||||
|
|
||||||
@ -206,7 +212,7 @@ if ($result)
|
|||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num,$num,'');
|
print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1);
|
||||||
|
|
||||||
if ($conf->global->MARGIN_TYPE == "1")
|
if ($conf->global->MARGIN_TYPE == "1")
|
||||||
$labelcostprice=$langs->trans('BuyingPrice');
|
$labelcostprice=$langs->trans('BuyingPrice');
|
||||||
|
|||||||
@ -46,9 +46,15 @@ $result=restrictedArea($user,'produit|service',$fieldvalue,'product&product','',
|
|||||||
|
|
||||||
$mesg = '';
|
$mesg = '';
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield",'alpha');
|
// Load variable for pagination
|
||||||
$sortorder = GETPOST("sortorder",'alpha');
|
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
|
||||||
if (! $sortorder) $sortorder="ASC";
|
$sortfield = GETPOST('sortfield','alpha');
|
||||||
|
$sortorder = GETPOST('sortorder','alpha');
|
||||||
|
$page = GETPOST('page','int');
|
||||||
|
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
||||||
|
$offset = $limit * $page;
|
||||||
|
$pageprev = $page - 1;
|
||||||
|
$pagenext = $page + 1;
|
||||||
if (! $sortfield)
|
if (! $sortfield)
|
||||||
{
|
{
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
@ -63,12 +69,6 @@ if (! $sortfield)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$page = GETPOST("page",'int');
|
|
||||||
if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
|
|
||||||
$offset = $conf->liste_limit * $page;
|
|
||||||
$pageprev = $page - 1;
|
|
||||||
$pagenext = $page + 1;
|
|
||||||
|
|
||||||
$startdate=$enddate='';
|
$startdate=$enddate='';
|
||||||
|
|
||||||
if (!empty($_POST['startdatemonth']))
|
if (!empty($_POST['startdatemonth']))
|
||||||
@ -202,7 +202,7 @@ if ($result)
|
|||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print_barre_liste($langs->trans("MarginDetails"),$page,$_SERVER["PHP_SELF"],"&id=".$id,$sortfield,$sortorder,'',$num,$num,'');
|
print_barre_liste($langs->trans("MarginDetails"), $page, $_SERVER["PHP_SELF"], "&id=".$id, $sortfield, $sortorder, '', $num, $num, '', 0, '', '', 0, 1);
|
||||||
|
|
||||||
//var_dump($conf->global->MARGIN_TYPE);
|
//var_dump($conf->global->MARGIN_TYPE);
|
||||||
if ($conf->global->MARGIN_TYPE == "1")
|
if ($conf->global->MARGIN_TYPE == "1")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user