Skip to content

Commit

Permalink
FIX : page must always be 0 when we search (to avoid case : when we'r…
Browse files Browse the repository at this point in the history
…e on page 3 and we're looking for a precise thirdparty, we stay on page 3 and nothing's displaied)
  • Loading branch information
atm-gauthier committed Jul 11, 2018
1 parent 2f668cc commit 103c7e6
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
4 changes: 3 additions & 1 deletion htdocs/comm/propal/list.php
Expand Up @@ -83,12 +83,14 @@
$search_day=GETPOST("search_day","int");
$search_month=GETPOST("search_month","int");
$search_year=GETPOST("search_year","int");
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');

$limit = GETPOST('limit')?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 || !empty($search_btn) || !empty($search_remove_btn)) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
Expand Down
4 changes: 3 additions & 1 deletion htdocs/commande/list.php
Expand Up @@ -74,6 +74,8 @@
$optioncss = GETPOST('optioncss','alpha');
$billed = GETPOST('billed','int');
$viewstatut=GETPOST('viewstatut');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');

// Security check
$id = (GETPOST('orderid')?GETPOST('orderid','int'):GETPOST('id','int'));
Expand All @@ -86,7 +88,7 @@
$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 || !empty($search_btn) || !empty($search_remove_btn)) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
Expand Down
4 changes: 3 additions & 1 deletion htdocs/compta/facture/list.php
Expand Up @@ -93,6 +93,8 @@
$day_lim = GETPOST('day_lim','int');
$month_lim = GETPOST('month_lim','int');
$year_lim = GETPOST('year_lim','int');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');

$option = GETPOST('option');
if ($option == 'late') {
Expand All @@ -104,7 +106,7 @@
$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 || !empty($search_btn) || !empty($search_remove_btn)) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
if (! $sortorder && ! empty($conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER) && $search_status == 1) $sortorder=$conf->global->INVOICE_DEFAULT_UNPAYED_SORT_ORDER;
if (! $sortorder) $sortorder='DESC';
Expand Down
4 changes: 3 additions & 1 deletion htdocs/fourn/commande/list.php
Expand Up @@ -85,6 +85,8 @@
$optioncss = GETPOST('optioncss','alpha');
$billed = GETPOST('billed','int');
$search_project_ref=GETPOST('search_project_ref','alpha');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');

$page = GETPOST('page','int');
$sortorder = GETPOST('sortorder','alpha');
Expand All @@ -105,7 +107,7 @@
$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 || !empty($search_btn) || !empty($search_remove_btn)) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
Expand Down
4 changes: 3 additions & 1 deletion htdocs/fourn/facture/list.php
Expand Up @@ -99,6 +99,8 @@
$month_lim = GETPOST('month_lim','int');
$year_lim = GETPOST('year_lim','int');
$toselect = GETPOST('toselect', 'array');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');

$option = GETPOST('option');
if ($option == 'late') {
Expand All @@ -110,7 +112,7 @@
$sortfield = GETPOST("sortfield",'alpha');
$sortorder = GETPOST("sortorder",'alpha');
$page=GETPOST("page",'int');
if ($page == -1 || $page == null) { $page = 0 ; }
if ($page == -1 || $page == null || !empty($search_btn) || !empty($search_remove_btn)) { $page = 0 ; }
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
Expand Down
4 changes: 3 additions & 1 deletion htdocs/societe/list.php
Expand Up @@ -82,6 +82,8 @@
$search_level_from = GETPOST("search_level_from","alpha");
$search_level_to = GETPOST("search_level_to","alpha");
$search_stcomm=GETPOST('search_stcomm','int');
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');

$type=GETPOST('type');
$optioncss=GETPOST('optioncss','alpha');
Expand All @@ -95,7 +97,7 @@
$page=GETPOST("page",'int');
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="s.nom";
if (empty($page) || $page == -1) { $page = 0; }
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn)) { $page = 0; }
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
Expand Down
4 changes: 3 additions & 1 deletion htdocs/supplier_proposal/list.php
Expand Up @@ -73,6 +73,8 @@
$search_montant_ttc=GETPOST('search_montant_ttc','alpha');
$search_status=GETPOST('viewstatut','alpha')?GETPOST('viewstatut','alpha'):GETPOST('search_status','int');
$object_statut=$db->escape(GETPOST('supplier_proposal_statut'));
$search_btn=GETPOST('button_search','alpha');
$search_remove_btn=GETPOST('button_removefilter','alpha');

$sall=GETPOST('sall', 'alphanohtml');
$mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
Expand All @@ -85,7 +87,7 @@
$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 || !empty($search_btn) || !empty($search_remove_btn)) { $page = 0; } // If $page is not defined, or '' or -1
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
Expand Down

0 comments on commit 103c7e6

Please sign in to comment.