Skip to content

Commit

Permalink
#1681 Clear sort filter works partially in customers list
Browse files Browse the repository at this point in the history
  • Loading branch information
aspangaro committed Nov 17, 2014
1 parent 05059da commit a82953e
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions htdocs/comm/list.php
Expand Up @@ -48,13 +48,12 @@
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");
Expand All @@ -78,21 +77,18 @@
// 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
Expand Down Expand Up @@ -122,8 +118,8 @@
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) {
Expand Down Expand Up @@ -156,7 +152,7 @@
{
$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;
Expand Down Expand Up @@ -207,7 +203,7 @@
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">';
Expand Down Expand Up @@ -235,7 +231,6 @@
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 '&nbsp; ';
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>';

Expand Down

0 comments on commit a82953e

Please sign in to comment.