Fix filter on prospect status

This commit is contained in:
Laurent Destailleur 2015-08-24 14:59:46 +02:00
parent 80fc4743c9
commit 1a55159e35
2 changed files with 7 additions and 7 deletions

View File

@ -150,7 +150,7 @@ $search_categ = GETPOST('search_categ','int');
// If the internal user must only see his prospect, force searching by him // If the internal user must only see his prospect, force searching by him
if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id; if (!$user->rights->societe->client->voir && !$socid) $search_sale = $user->id;
// List of avaible states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state) // List of available states; we'll need that for each lines (quick changing prospect states) and for search bar (filter by prospect state)
$sts = array(-1,0,1,2,3); $sts = array(-1,0,1,2,3);
@ -235,7 +235,7 @@ $sql.= " AND s.client IN (2, 3)";
$sql.= ' AND s.entity IN ('.getEntity('societe', 1).')'; $sql.= ' AND s.entity IN ('.getEntity('societe', 1).')';
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc"; if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc";
if ($socid) $sql.= " AND s.rowid = " .$socid; if ($socid) $sql.= " AND s.rowid = " .$socid;
if ($search_stcomm != '') $sql.= natural_search("s.fk_stcomm",$search_stcomm,2); if ($search_stcomm != '' && $search_stcomm != -2) $sql.= natural_search("s.fk_stcomm",$search_stcomm,2);
if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
@ -376,13 +376,13 @@ if ($resql)
print '<input type="text" class="flat" name="search_nom" size="10" value="'.$search_nom.'">'; print '<input type="text" class="flat" name="search_nom" size="10" value="'.$search_nom.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_zipcode" size="10" value="'.$search_zipcode.'">'; print '<input type="text" class="flat" name="search_zipcode" size="6" value="'.$search_zipcode.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_town" size="10" value="'.$search_town.'">'; print '<input type="text" class="flat" name="search_town" size="8" value="'.$search_town.'">';
print '</td>'; print '</td>';
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';
print '<input type="text" class="flat" name="search_state" size="10" value="'.$search_state.'">'; print '<input type="text" class="flat" name="search_state" size="8" value="'.$search_state.'">';
print '</td>'; print '</td>';
print '<td align="center" class="liste_titre">'; print '<td align="center" class="liste_titre">';
print '<input class="flat" type="text" size="10" name="search_datec" value="'.$search_datec.'">'; print '<input class="flat" type="text" size="10" name="search_datec" value="'.$search_datec.'">';
@ -490,7 +490,7 @@ if ($resql)
print $prospectstatic->LibProspCommStatut($obj->stcomm_id,2,$prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label']); print $prospectstatic->LibProspCommStatut($obj->stcomm_id,2,$prospectstatic->cacheprospectstatus[$obj->stcomm_id]['label']);
print "</td>"; print "</td>";
print '<td align="right" class="nowrap">'; print '<td align="center" class="nowrap">';
foreach($prospectstatic->cacheprospectstatus as $key => $val) foreach($prospectstatic->cacheprospectstatus as $key => $val)
{ {
$titlealt='default'; $titlealt='default';

View File

@ -4455,7 +4455,7 @@ class Form
{ {
$textforempty=' '; $textforempty=' ';
if (! empty($conf->use_javascript_ajax)) $textforempty='&nbsp;'; // If we use ajaxcombo, we need &nbsp; here to avoid to have an empty element that is too small. if (! empty($conf->use_javascript_ajax)) $textforempty='&nbsp;'; // If we use ajaxcombo, we need &nbsp; here to avoid to have an empty element that is too small.
$out.='<option value="-1"'.($id==-1?' selected':'').'>'.$textforempty.'</option>'."\n"; $out.='<option value="-2"'.($id==-2?' selected':'').'>'.$textforempty.'</option>'."\n"; // id is -2 because -1 is already "do not contact"
} }
if (is_array($array)) if (is_array($array))