Merge pull request #2047 from frederic34/patch-6

#1685-1686 Clear sort filter works partially in supplier invoices
This commit is contained in:
Laurent Destailleur 2014-11-22 15:50:16 +01:00
parent 830d470c33
commit e4804f99ff

View File

@ -74,7 +74,7 @@ $month = GETPOST("month","int");
$year = GETPOST("year","int"); $year = GETPOST("year","int");
$filter = GETPOST("filtre"); $filter = GETPOST("filtre");
if (GETPOST("button_removefilter_x")) if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
{ {
$search_ref=""; $search_ref="";
$search_ref_supplier=""; $search_ref_supplier="";
@ -138,7 +138,7 @@ if ($socid)
{ {
$sql .= " AND s.rowid = ".$socid; $sql .= " AND s.rowid = ".$socid;
} }
if ($filter) && $filter != -1) // GETPOST('filtre') may be a string if ($filter && $filter != -1) // GETPOST('filtre') may be a string
{ {
$filtrearr = explode(",", $filter); $filtrearr = explode(",", $filter);
foreach ($filtrearr as $fil) foreach ($filtrearr as $fil)
@ -219,7 +219,7 @@ if ($resql)
if ($search_company) $param.='&search_company='.urlencode($search_company); if ($search_company) $param.='&search_company='.urlencode($search_company);
if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax);
if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax);
if ($filter) && $filter != -1) $param.='&filtre='.urlencode($filter); if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter);
print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$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"].'">';
@ -272,7 +272,7 @@ if ($resql)
print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">'; print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
print '</td><td class="liste_titre" align="right">'; print '</td><td class="liste_titre" align="right">';
$liststatus=array('paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid")); $liststatus=array('paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid"));
print $form->selectarray('filtre', $liststatus, $filter), 1); print $form->selectarray('filtre', $liststatus, $filter, 1);
print '</td><td class="liste_titre" align="right">'; print '</td><td class="liste_titre" align="right">';
print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">'; print '<input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
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 '<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")).'">';
@ -331,7 +331,7 @@ if ($resql)
//print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$objp->am); //print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$objp->am);
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5); print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5);
print '</td>'; print '</td>';
print '<td align="center">&nbsp;</td>'; print '<td align="center">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";