La recherche raccourci sur les propals regarde aussi dans la description des lignes

This commit is contained in:
Laurent Destailleur 2005-08-24 22:38:00 +00:00
parent dd113c6cef
commit b3abf0da5b
2 changed files with 103 additions and 95 deletions

View File

@ -96,9 +96,13 @@ if ($conf->propal->enabled && $user->rights->propale->lire) {
print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal.php">'; print '<form method="post" action="'.DOL_URL_ROOT.'/comm/propal.php">';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAProposal").'</td></tr>'; print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAProposal").'</td></tr>';
print '<tr '.$bc[$var].'><td nowrap>'; print '<tr '.$bc[$var].'>';
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="sf_ref" size="18"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>'; print '<td nowrap>'.$langs->trans("Ref").':</td><td><input type="text" class="flat" name="sf_ref" size="18"></td>';
print "</table></form><br>\n"; print '<td rowspan="2"><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
print '<tr '.$bc[$var].'><td nowrap>'.$langs->trans("Other").':</td><td><input type="text" class="flat" name="sall" size="18"></td>';
print '</tr>';
print "</table></form>\n";
print "<br>";
} }
/* /*

View File

@ -46,6 +46,7 @@ require_once('../propal.class.php');
require_once('../actioncomm.class.php'); require_once('../actioncomm.class.php');
require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php'); require_once(DOL_DOCUMENT_ROOT.'/lib/CMailFile.class.php');
$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"];
if (isset($_GET["msg"])) { $msg=urldecode($_GET["msg"]); } if (isset($_GET["msg"])) { $msg=urldecode($_GET["msg"]); }
$year=isset($_GET["year"])?$_GET["year"]:""; $year=isset($_GET["year"])?$_GET["year"]:"";
$month=isset($_GET["month"])?$_GET["month"]:""; $month=isset($_GET["month"])?$_GET["month"]:"";
@ -64,6 +65,7 @@ $NBLINES=4;
$form=new Form($db); $form=new Form($db);
/******************************************************************************/ /******************************************************************************/
/* Actions */ /* Actions */
/******************************************************************************/ /******************************************************************************/
@ -1044,6 +1046,7 @@ else
$sql = 'SELECT s.nom, s.idp, s.client, p.rowid as propalid, p.price, p.ref, p.fk_statut, '.$db->pdate('p.datep').' as dp,'.$db->pdate('p.fin_validite').' as dfv'; $sql = 'SELECT s.nom, s.idp, s.client, p.rowid as propalid, p.price, p.ref, p.fk_statut, '.$db->pdate('p.datep').' as dp,'.$db->pdate('p.fin_validite').' as dfv';
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p'; $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'propal as p';
if ($sall) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal';
$sql.= ' WHERE p.fk_soc = s.idp'; $sql.= ' WHERE p.fk_soc = s.idp';
if (!empty($_GET['search_ref'])) if (!empty($_GET['search_ref']))
@ -1058,6 +1061,7 @@ else
{ {
$sql .= " AND p.price='".$_GET['search_montant_ht']."'"; $sql .= " AND p.price='".$_GET['search_montant_ht']."'";
} }
if ($sall) $sql.= " AND (s.nom like '%".$sall."%' OR p.note like '%".$sall."%' OR pd.description like '%".$sall."%')";
if ($_GET['socidp']) if ($_GET['socidp'])
{ {
$sql .= ' AND s.idp = '.$_GET['socidp']; $sql .= ' AND s.idp = '.$_GET['socidp'];