FIX Filter on status of thirdparty list and bad encoding of url
This commit is contained in:
parent
d54650905b
commit
0df42bc5ea
@ -468,6 +468,7 @@ if ($resql)
|
||||
$reshook=$hookmanager->executeHooks('printFieldListSearch',$parameters); // Note that $action and $object may have been modified by hook
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Status
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status);
|
||||
print '</td>';
|
||||
|
||||
@ -55,6 +55,7 @@ $search_categ=trim(GETPOST("search_categ"));
|
||||
$mode=GETPOST("mode");
|
||||
$modesearch=GETPOST("mode_search");
|
||||
$search_type=trim(GETPOST('search_type'));
|
||||
$search_status=GETPOST("search_status",'int');
|
||||
|
||||
$sortfield=GETPOST("sortfield",'alpha');
|
||||
$sortorder=GETPOST("sortorder",'alpha');
|
||||
@ -172,8 +173,11 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
|
||||
$search_idprof3='';
|
||||
$search_idprof4='';
|
||||
$search_type='';
|
||||
$search_status='';
|
||||
}
|
||||
|
||||
if ($search_status=='') $search_status=1; // always display active thirdparty first
|
||||
|
||||
if ($socname)
|
||||
{
|
||||
$search_nom=$socname;
|
||||
@ -234,6 +238,7 @@ if ($search_idprof6) $sql .= " AND s.idprof6 LIKE '%".$db->escape($search_idpro
|
||||
if ($search_type > 0 && in_array($search_type,array('1,3','2,3'))) $sql .= " AND s.client IN (".$db->escape($search_type).")";
|
||||
if ($search_type > 0 && in_array($search_type,array('4'))) $sql .= " AND s.fournisseur = 1";
|
||||
if ($search_type == '0') $sql .= " AND s.client = 0 AND s.fournisseur = 0";
|
||||
if ($search_status!='') $sql .= " AND s.status = ".$db->escape($search_status);
|
||||
if (!empty($conf->barcode->enabled) && $sbarcode) $sql.= " AND s.barcode LIKE '%".$db->escape($sbarcode)."%'";
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
@ -257,13 +262,14 @@ if ($resql)
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
|
||||
$params = "&socname=".htmlspecialchars($socname)."&search_nom=".htmlspecialchars($search_nom)."&search_town=".htmlspecialchars($search_town);
|
||||
$params.= ($sbarcode?"&sbarcode=".htmlspecialchars($sbarcode):"");
|
||||
$params.= '&search_idprof1='.htmlspecialchars($search_idprof1);
|
||||
$params.= '&search_idprof2='.htmlspecialchars($search_idprof2);
|
||||
$params.= '&search_idprof3='.htmlspecialchars($search_idprof3);
|
||||
$params.= '&search_idprof4='.htmlspecialchars($search_idprof4);
|
||||
|
||||
$params = "&socname=".urlencode($socname)."&search_nom=".urlencode($search_nom)."&search_town=".urlencode($search_town);
|
||||
$params.= ($sbarcode?"&sbarcode=".urlencode($sbarcode):"");
|
||||
$params.= '&search_idprof1='.urlencode($search_idprof1);
|
||||
$params.= '&search_idprof2='.urlencode($search_idprof2);
|
||||
$params.= '&search_idprof3='.urlencode($search_idprof3);
|
||||
$params.= '&search_idprof4='.urlencode($search_idprof4);
|
||||
if ($search_status != '') $params.='&search_status='.urlencode($search_status);
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"],$params,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'title_companies');
|
||||
|
||||
// Show delete result message
|
||||
@ -391,7 +397,9 @@ if ($resql)
|
||||
print $hookmanager->resPrint;
|
||||
|
||||
// Status
|
||||
print '<td></td>';
|
||||
print '<td class="liste_titre" align="right">';
|
||||
print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$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")).'">';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user