diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php index 404e0afb5f4..504eea0ae1d 100755 --- a/htdocs/compta/deplacement/list.php +++ b/htdocs/compta/deplacement/list.php @@ -22,7 +22,7 @@ /** * \file htdocs/compta/deplacement/list.php * \brief Page list of expenses - * \version $Id: list.php,v 1.1 2011/06/29 17:55:33 eldy Exp $ + * \version $Id: list.php,v 1.2 2011/06/30 21:53:02 eldy Exp $ */ require("../../main.inc.php"); @@ -49,6 +49,8 @@ if (! $sortorder) $sortorder="DESC"; if (! $sortfield) $sortfield="d.dated"; $limit = $conf->liste_limit; +$search_ref=GETPOST('search_ref'); + /* * View @@ -59,7 +61,7 @@ $tripandexpense_static=new Deplacement($db); llxHeader(); $sql = "SELECT s.nom, s.rowid as socid,"; // Ou -$sql.= " d.rowid, d.type, d.dated as dd, d.km, "; // Comment +$sql.= " d.rowid, d.type, d.dated as dd, d.km,"; // Comment $sql.= " u.name, u.firstname"; // Qui $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= ", ".MAIN_DB_PREFIX."deplacement as d"; @@ -69,6 +71,10 @@ $sql.= " WHERE d.fk_user = u.rowid"; $sql.= " AND d.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND sc.fk_user = " .$user->id; if ($socid) $sql.= " AND s.rowid = ".$socid; +if (trim($search_ref) != '') +{ + $sql.= ' AND d.rowid LIKE \'%'.$db->escape(trim($search_ref)) . '%\''; +} $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1 ,$offset); @@ -81,6 +87,7 @@ if ($resql) print_barre_liste($langs->trans("ListOfFees"), $page, $_SERVER["PHP_SELF"],"&socid=$socid",$sortfield,$sortorder,'',$num); $i = 0; + print '
\n"; $db->free($resql); } else @@ -125,5 +156,5 @@ else } $db->close(); -llxFooter('$Date: 2011/06/29 17:55:33 $ - $Revision: 1.1 $'); +llxFooter('$Date: 2011/06/30 21:53:02 $ - $Revision: 1.2 $'); ?> diff --git a/htdocs/compta/dons/liste.php b/htdocs/compta/dons/liste.php index 3f5240adbe3..61f1c321947 100644 --- a/htdocs/compta/dons/liste.php +++ b/htdocs/compta/dons/liste.php @@ -21,7 +21,7 @@ * \file htdocs/compta/dons/liste.php * \ingroup don * \brief Page de liste des dons - * \version $Id$ + * \version $Id: liste.php,v 1.34 2011/06/30 21:53:02 eldy Exp $ */ require("../../main.inc.php"); @@ -43,6 +43,9 @@ if (! $sortfield) $sortfield="d.datedon"; $limit = $conf->liste_limit; $statut=isset($_GET["statut"])?$_GET["statut"]:"-1"; +$search_ref=GETPOST('search_ref'); +$search_company=GETPOST('search_company'); +$search_name=GETPOST('search_name'); @@ -66,6 +69,18 @@ if ($statut >= 0) { $sql .= " AND d.fk_statut = ".$statut; } +if (trim($search_ref) != '') +{ + $sql.= ' AND d.rowid LIKE \'%'.$db->escape(trim($search_ref)) . '%\''; +} +if (trim($search_company) != '') +{ + $sql.= ' AND d.societe LIKE \'%'.$db->escape(trim($search_company)) . '%\''; +} +if (trim($search_name) != '') +{ + $sql.= ' AND d.nom LIKE \'%'.$db->escape(trim($search_name)) . '%\' OR d.prenom LIKE \'%'.$db->escape(trim($search_name)) . '%\''; +} $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -89,6 +104,7 @@ if ($result) } + print '\n"; + $db->free($resql); } else { @@ -149,5 +193,5 @@ else $db->close(); -llxFooter('$Date$ - $Revision$'); +llxFooter('$Date: 2011/06/30 21:53:02 $ - $Revision: 1.34 $'); ?> diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 38d3851f5cf..9171c8edc8c 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -26,7 +26,7 @@ * \file htdocs/compta/facture.php * \ingroup facture * \brief Page to create/see an invoice - * \version $Id: facture.php,v 1.841 2011/06/30 13:27:21 hregis Exp $ + * \version $Id: facture.php,v 1.842 2011/06/30 21:53:02 eldy Exp $ */ require('../main.inc.php'); @@ -61,6 +61,7 @@ $action=GETPOST('action'); $confirm=GETPOST('confirm'); $lineid=GETPOST('lineid'); $userid=GETPOST('userid'); +$search_ref=GETPOST('sf_ref')?GETPOST('sf_ref'):GETPOST('search_ref'); // Security check $fieldid = isset($_GET["ref"])?'facnumber':'rowid'; @@ -248,8 +249,8 @@ if ($action == 'valid') if ($action == 'set_thirdparty') { - $object->updateObjectField('facture',$id,'fk_soc',$socid); - + $object->updateObjectField('facture',$id,'fk_soc',$socid); + Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); exit; } @@ -3052,9 +3053,9 @@ else { $sql.= " AND f.datef BETWEEN '".$db->idate(dol_get_first_day($year,1,false))."' AND '".$db->idate(dol_get_last_day($year,12,false))."'"; } - if ($_POST['sf_ref']) + if (trim($search_ref) != '') { - $sql.= ' AND f.facnumber LIKE \'%'.$db->escape(trim($_POST['sf_ref'])) . '%\''; + $sql.= ' AND f.facnumber LIKE \'%'.$db->escape(trim($search_ref)) . '%\''; } if ($sall) { @@ -3106,17 +3107,17 @@ else //print '