diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 88fa6ebad27f78d202bc13c4a8eb79bb9846d0b0..4db7935e69cd1b208aa7bed0b12a4ea172addfe1 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -372,6 +372,17 @@ $search_montant_ht = GETPOST("search_montant_ht"); $search_montant_ttc = GETPOST("search_montant_ttc"); $late = GETPOST("late"); +// Do we click on purge search criteria ? +if (GETPOST("button_removefilter_x")) +{ + $search_ref=''; + $search_refcustomer=''; + $search_societe=''; + $search_paymentmode=''; + $search_montant_ht=''; + $search_montant_ttc=''; +} + $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -571,6 +582,7 @@ if ($resql) print '<td class="liste_titre"> </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 '<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>'; if (empty($mode)) { diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 3532125ed8e5147d8afc29449b1a063431a08d91..f5dbd8186cd87e1ef49fcf1c3fc5a4f4b495b828 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -327,6 +327,7 @@ if ($resql) print '<td class="liste_titre" align="right"><input class="flat" type="text" size="10" name="search_montant_ttc" value="'.$search_montant_ttc.'"></td>'; print '<td class="liste_titre" align="right"> </td>'; 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"; if ($num > 0) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2e2bf34a75df933c26a4928d326e9593eb73fe12..17e9467fb81585d5ee21025e39e72d732f9f78ee 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 = '<input type="image" class="liste_titre" name="button_search" src="'.$img.'" '; + $input.= 'value="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'" >'; + + 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 = '<input type="image" class="liste_titre" name="button_removefilter" src="'.$img.'" '; + $input.= 'value="'.dol_escape_htmltag($titlealt).'" title="'.dol_escape_htmltag($titlealt).'" >'; + + return $input; +} /** * Show information for admin users diff --git a/htdocs/expedition/liste.php b/htdocs/expedition/liste.php index 29ab105ee91ff5ed043ea989cdbb97d1ef46e21f..91eb7056b2c905f08c0e18c92c41ff08881af882 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 '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; - print_liste_field_titre($langs->trans("Ref"),"liste.php","e.ref","",$param,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Company"),"liste.php","s.nom", "", $param,'align="left"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("DateDeliveryPlanned"),"liste.php","e.date_delivery","",$param, 'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Ref"),"ship2bill.php","e.ref","",$param,'',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Company"),"ship2bill.php","s.nom", "", $param,'align="left"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateDeliveryPlanned"),"ship2bill.php","e.date_delivery","",$param, 'align="center"',$sortfield,$sortorder); if($conf->livraison_bon->enabled) { - print_liste_field_titre($langs->trans("DateReceived"),"liste.php","e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DeliveryOrder"),"ship2bill.php","e.date_expedition","",$param, '',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("DateReceived"),"ship2bill.php","e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder); + } + print_liste_field_titre($langs->trans("Status"),"ship2bill.php","e.fk_statut","",$param,'align="right"',$sortfield,$sortorder); + print "</tr>\n"; + + // Lignes des champs de filtre + print '<tr class="liste_titre">'; + print '<td class="liste_titre">'; + print '<input class="flat" size="10" type="text" name="search_ref_exp" value="'.$search_ref_exp.'">'; + print '</td>'; + print '<td class="liste_titre" align="left">'; + print '<input class="flat" type="text" size="10" name="search_societe" value="'.dol_escape_htmltag($search_societe).'">'; + print '</td>'; + print '<td class="liste_titre"> </td>'; + if($conf->livraison_bon->enabled) { + print '<td class="liste_titre">'; + print '<input class="flat" size="10" type="text" name="search_ref_liv" value="'.$search_ref_liv.'"'; + print '</td>'; + print '<td class="liste_titre"> </td>'; } - print_liste_field_titre($langs->trans("Status"),"liste.php","e.fk_statut","",$param,'align="right"',$sortfield,$sortorder); + print '<td class="liste_titre" align="right">'; + // Développé dans la 3.7 + //print img_search(); + //print img_searchclear(); + 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 '</td>'; + print '<td class="liste_titre" align="center">'; + print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>'; + print '</td>'; + print "</tr>\n"; + $var=True; while ($i < min($num,$limit))