From dd113c6cef932149ee25ccf22f30b26a0aacdef7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 24 Aug 2005 22:27:23 +0000 Subject: [PATCH] La recherche raccourci sur les contrats regarde aussi dans la description des lignes --- htdocs/comm/index.php | 14 +++++++++----- htdocs/contrat/index.php | 18 +++++++++--------- htdocs/contrat/liste.php | 2 ++ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 0a18ca33f43..ce83e5943bf 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -105,14 +104,19 @@ if ($conf->propal->enabled && $user->rights->propale->lire) { /* * Recherche Contrat */ -if ($conf->contrat->enabled) { +if ($conf->contrat->enabled) +{ $var=false; print '
'; print ''; print ''; - print ''; - print "
'.$langs->trans("SearchAContract").'
'; - print $langs->trans("Ref").':

\n"; + print ''; + print ''.$langs->trans("Ref").':'; + print ''; + print ''.$langs->trans("Other").':'; + print ''; + print "\n"; + print "
"; } /* diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 5aff0dcbeac..8513dbe5ca1 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -45,9 +44,7 @@ $statut=isset($_GET["statut"])?$_GET["statut"]:1; $socid=$_GET["socid"]; -/* - * Sécurité accés client - */ +// Sécurité accés client if ($user->societe_id > 0) { $action = ''; @@ -64,18 +61,21 @@ print ''; /* * Recherche Contrat */ -if ($conf->contrat->enabled) { +if ($conf->contrat->enabled) +{ $var=false; print '
'; print ''; print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + print ''; print "
'.$langs->trans("SearchAContract").'
'; - print $langs->trans("Ref").':
'.$langs->trans("Ref").':
'.$langs->trans("Other").':
\n"; + print "
"; } -print '
'; - // Légende $var=false; print ''; diff --git a/htdocs/contrat/liste.php b/htdocs/contrat/liste.php index 1ebd46ecd91..f936d4f4b01 100644 --- a/htdocs/contrat/liste.php +++ b/htdocs/contrat/liste.php @@ -46,6 +46,7 @@ $offset = $limit * $page ; $search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"]; $search_contract=isset($_GET["search_contract"])?$_GET["search_contract"]:$_POST["search_contract"]; +$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"]; $statut=isset($_GET["statut"])?$_GET["statut"]:1; $socid=$_GET["socid"]; @@ -72,6 +73,7 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat $sql.= " WHERE c.fk_soc = s.idp "; if ($search_nom) $sql.= " AND s.nom like '%".$search_nom."%'"; if ($search_contract) $sql.= " AND c.rowid = '".$search_contract."'"; +if ($sall) $sql.= " AND (s.nom like '%".$sall."%' OR cd.label like '%".$sall."%' OR cd.description like '%".$sall."%')"; if ($socid > 0) $sql.= " AND s.idp = $socid"; $sql.= " GROUP BY c.rowid, c.datec, c.statut, s.nom, s.idp"; $sql.= " ORDER BY $sortfield $sortorder";