La recherche raccourci sur les contrats regarde aussi dans la description des lignes
This commit is contained in:
parent
3d9ff70b7c
commit
dd113c6cef
@ -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 '<form method="post" action="'.DOL_URL_ROOT.'/contrat/liste.php">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAContract").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td nowrap>';
|
||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="search_contract" size="18"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||
print "</table></form><br>\n";
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td nowrap>'.$langs->trans("Ref").':</td><td><input type="text" class="flat" name="search_contract" size="18"></td>';
|
||||
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>";
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -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 '<tr><td width="30%" valign="top" class="notopnoleft">';
|
||||
/*
|
||||
* Recherche Contrat
|
||||
*/
|
||||
if ($conf->contrat->enabled) {
|
||||
if ($conf->contrat->enabled)
|
||||
{
|
||||
$var=false;
|
||||
print '<form method="post" action="'.DOL_URL_ROOT.'/contrat/liste.php">';
|
||||
print '<table class="noborder" width="100%">';
|
||||
print '<tr class="liste_titre"><td colspan="3">'.$langs->trans("SearchAContract").'</td></tr>';
|
||||
print '<tr '.$bc[$var].'><td nowrap>';
|
||||
print $langs->trans("Ref").':</td><td><input type="text" class="flat" name="search_contract" size="18"></td><td><input type="submit" value="'.$langs->trans("Search").'" class="button"></td></tr>';
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td nowrap>'.$langs->trans("Ref").':</td><td><input type="text" class="flat" name="search_contract" size="18"></td>';
|
||||
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>";
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
|
||||
// Légende
|
||||
$var=false;
|
||||
print '<table class="noborder" width="100%">';
|
||||
|
||||
@ -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";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user