#1681 Clear sort filter works partially in customers list
This commit is contained in:
parent
05059da9e8
commit
a82953ef70
@ -48,13 +48,12 @@ $pagenext = $page + 1;
|
||||
if (! $sortorder) $sortorder="ASC";
|
||||
if (! $sortfield) $sortfield="s.nom";
|
||||
|
||||
$search_nom=GETPOST("search_nom");
|
||||
$search_company=GETPOST("search_company");
|
||||
$search_zipcode=GETPOST("search_zipcode");
|
||||
$search_town=GETPOST("search_town");
|
||||
$search_code=GETPOST("search_code");
|
||||
$search_compta=GETPOST("search_compta");
|
||||
$search_status = GETPOST("search_status",'int');
|
||||
if ($search_status=='') $search_status=1; // always display activ customer first
|
||||
|
||||
// Load sale and categ filters
|
||||
$search_sale = GETPOST("search_sale");
|
||||
@ -78,21 +77,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
|
||||
// Do we click on purge search criteria ?
|
||||
if (GETPOST("button_removefilter_x"))
|
||||
{
|
||||
$search_categ='';
|
||||
$catid='';
|
||||
$search_sale='';
|
||||
$socname="";
|
||||
$search_nom="";
|
||||
$search_sale="";
|
||||
$search_categ="";
|
||||
$catid="";
|
||||
$search_company="";
|
||||
$search_zipcode="";
|
||||
$search_town="";
|
||||
$search_idprof1='';
|
||||
$search_idprof2='';
|
||||
$search_idprof3='';
|
||||
$search_idprof4='';
|
||||
$seach_status=1;
|
||||
$search_code='';
|
||||
$search_compta='';
|
||||
$search_status='';
|
||||
}
|
||||
|
||||
|
||||
if ($search_status=='') $search_status=1; // always display activ customer first
|
||||
|
||||
/*
|
||||
* view
|
||||
@ -122,8 +118,8 @@ if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
|
||||
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
|
||||
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
|
||||
if ($search_nom) {
|
||||
$sql .= natural_search('s.nom', $search_nom);
|
||||
if ($search_company) {
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
|
||||
if ($search_town) {
|
||||
@ -156,7 +152,7 @@ if ($result)
|
||||
{
|
||||
$num = $db->num_rows($result);
|
||||
|
||||
$param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town;
|
||||
$param = "&search_company=".$search_company."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town;
|
||||
if ($search_categ != '') $param.='&search_categ='.$search_categ;
|
||||
if ($search_sale != '') $param.='&search_sale='.$search_sale;
|
||||
if ($search_status != '') $param.='&search_status='.$search_status;
|
||||
@ -207,7 +203,7 @@ if ($result)
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
print '<input type="text" class="flat" name="search_nom" value="'.$search_nom.'" size="10">';
|
||||
print '<input type="text" class="flat" name="search_company" value="'.$search_company.'" size="10">';
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre">';
|
||||
@ -235,7 +231,6 @@ if ($result)
|
||||
print '</td>';
|
||||
|
||||
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
|
||||
print ' ';
|
||||
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
|
||||
print '</td>';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user