Improve search into supplier command list
This commit is contained in:
parent
4c95cab35f
commit
b60f834d8d
@ -39,12 +39,12 @@ $langs->load("sendings");
|
||||
|
||||
$search_ref=GETPOST('search_ref');
|
||||
$search_refsupp=GETPOST('search_refsupp');
|
||||
$search_nom=GETPOST('search_nom');
|
||||
$search_company=GETPOST('search_company');
|
||||
$search_user=GETPOST('search_user');
|
||||
$search_ttc=GETPOST('search_ttc');
|
||||
$sall=GETPOST('search_all');
|
||||
$search_status=GETPOST('search_status','int');
|
||||
if ($search_status == '') $search_status=-1;
|
||||
|
||||
|
||||
$page = GETPOST('page','int');
|
||||
$socid = GETPOST('socid','int');
|
||||
@ -58,6 +58,18 @@ $orderid = GETPOST('orderid');
|
||||
if ($user->societe_id) $socid=$user->societe_id;
|
||||
$result = restrictedArea($user, 'fournisseur', $orderid, '', 'commande');
|
||||
|
||||
// Purge search criteria
|
||||
if (GETPOST("button_removefilter"))
|
||||
{
|
||||
$search_ref='';
|
||||
$search_refsupp='';
|
||||
$search_company='';
|
||||
$search_user='';
|
||||
$search_ttc='';
|
||||
$search_status='';
|
||||
}
|
||||
|
||||
if ($search_status == '') $search_status=-1;
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -102,9 +114,9 @@ if ($search_ref)
|
||||
{
|
||||
$sql .= natural_search('cf.ref', $search_ref);
|
||||
}
|
||||
if ($search_nom)
|
||||
if ($search_company)
|
||||
{
|
||||
$sql .= natural_search('s.nom', $search_nom);
|
||||
$sql .= natural_search('s.nom', $search_company);
|
||||
}
|
||||
if ($search_user)
|
||||
{
|
||||
@ -154,13 +166,14 @@ if ($resql)
|
||||
$i = 0;
|
||||
|
||||
$param="";
|
||||
if ($search_ref) $param.="&search_ref=".$search_ref;
|
||||
if ($search_nom) $param.="&search_nom=".$search_nom;
|
||||
if ($search_user) $param.="&search_user=".$search_user;
|
||||
if ($search_ttc) $param.="&search_ttc=".$search_ttc;
|
||||
if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp;
|
||||
if ($socid) $param.="&socid=".$socid;
|
||||
if ($search_status >= 0) $param.="&search_status=".$search_status;
|
||||
if ($search_ref) $param.="&search_ref=".$search_ref;
|
||||
if ($search_company) $param.="&search_company=".$search_company;
|
||||
if ($search_user) $param.="&search_user=".$search_user;
|
||||
if ($search_ttc) $param.="&search_ttc=".$search_ttc;
|
||||
if ($search_refsupp) $param.="&search_refsupp=".$search_refsupp;
|
||||
if ($socid) $param.="&socid=".$socid;
|
||||
if ($search_status >= 0) $param.="&search_status=".$search_status;
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
@ -180,7 +193,7 @@ if ($resql)
|
||||
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_ref" value="'.$search_ref.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_refsupp" value="'.$search_refsupp.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_nom" value="'.$search_nom.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'.$search_company.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_user" value="'.$search_user.'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat" name="search_ttc" value="'.$search_ttc.'"></td>';
|
||||
print '<td class="liste_titre"> </td>';
|
||||
@ -188,10 +201,9 @@ if ($resql)
|
||||
print '<td class="liste_titre" align="right">';
|
||||
$formorder->selectSupplierOrderStatus($search_status,1,'search_status');
|
||||
print '</td>';
|
||||
print '<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 '</td>';
|
||||
print '</tr>';
|
||||
print '<td class="liste_titre" align="right"><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 "</td></tr>\n";
|
||||
|
||||
$var=true;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user