';
if (empty($mode))
{
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 3532125ed8e..f5dbd8186cd 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -327,6 +327,7 @@ if ($resql)
print '
';
print '
';
print '
';
+ print '';
print "
\n";
if ($num > 0)
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 2e2bf34a75d..17e9467fb81 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -2252,6 +2252,47 @@ function img_phone($titlealt = 'default', $option = 0)
return img_picto($titlealt, $img);
}
+/**
+ * Show search logo
+ *
+ * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
+ * @param string $other Add more attributes on img
+ * @return string Retourne tag img
+ */
+function img_search($titlealt = 'default', $other = '')
+{
+ global $conf, $langs;
+
+ if ($titlealt == 'default') $titlealt = $langs->trans('Search');
+
+ $img = img_picto($titlealt, 'search.png', $other, false, 1);
+
+ $input = '';
+
+ return $input;
+}
+
+/**
+ * Show search logo
+ *
+ * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title.
+ * @param string $other Add more attributes on img
+ * @return string Retourne tag img
+ */
+function img_searchclear($titlealt = 'default', $other = '')
+{
+ global $conf, $langs;
+
+ if ($titlealt == 'default') $titlealt = $langs->trans('Search');
+
+ $img = img_picto($titlealt, 'searchclear.png', $other, false, 1);
+
+ $input = '';
+
+ return $input;
+}
/**
* Show information for admin users
diff --git a/htdocs/expedition/liste.php b/htdocs/expedition/liste.php
index 29ab105ee91..91eb7056b2c 100644
--- a/htdocs/expedition/liste.php
+++ b/htdocs/expedition/liste.php
@@ -34,6 +34,10 @@ $expeditionid = GETPOST('id','int');
if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'expedition',$expeditionid,'');
+$search_ref_exp = GETPOST("search_ref_exp");
+$search_ref_liv = GETPOST('search_ref_liv');
+$search_societe = GETPOST("search_societe");
+
$sortfield = GETPOST('sortfield','alpha');
$sortorder = GETPOST('sortorder','alpha');
$page = GETPOST('page','int');
@@ -47,6 +51,13 @@ if (! $sortfield) $sortfield="e.ref";
if (! $sortorder) $sortorder="DESC";
$limit = $conf->liste_limit;
+// Do we click on purge search criteria ?
+if (GETPOST("button_removefilter_x"))
+{
+ $search_ref_exp='';
+ $search_ref_liv='';
+ $search_societe='';
+}
/*
* View
@@ -79,10 +90,9 @@ if ($socid)
{
$sql.= " AND e.fk_soc = ".$socid;
}
-if (GETPOST('sf_ref','alpha'))
-{
- $sql.= " AND e.ref like '%".$db->escape(GETPOST('sf_ref','alpha'))."%'";
-}
+if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
+if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv);
+if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1,$offset);
@@ -94,7 +104,10 @@ if ($resql)
$expedition = new Expedition($db);
- $param="&socid=$socid";
+ $param="";
+ if ($search_ref_exp) $param.= "&search_ref_exp=".$search_ref_exp;
+ if ($search_ref_liv) $param.= "&search_ref_liv=".$search_ref_liv;
+ if ($search_societe) $param.= "&search_societe=".$search_societe;
print_barre_liste($langs->trans('ListOfSendings'), $page, "liste.php",$param,$sortfield,$sortorder,'',$num);
@@ -103,14 +116,44 @@ if ($resql)
print '