When there is no contact, no need to show filters
This commit is contained in:
parent
cfc70c7f92
commit
2fc11a289e
@ -632,6 +632,23 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
|
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.civility, p.poste, p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.email, p.skype, p.statut ";
|
||||||
|
$sql .= ", p.civility as civility_id, p.address, p.zip, p.town";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
||||||
|
$sql .= " WHERE p.fk_soc = ".$object->id;
|
||||||
|
if ($search_status!='' && $search_status != '-1') $sql .= " AND p.statut = ".$db->escape($search_status);
|
||||||
|
if ($search_name) $sql .= " AND (p.lastname LIKE '%".$db->escape($search_name)."%' OR p.firstname LIKE '%".$db->escape($search_name)."%')";
|
||||||
|
$sql.= " ORDER BY $sortfield $sortorder";
|
||||||
|
|
||||||
|
dol_syslog('core/lib/company.lib.php :: show_contacts', LOG_DEBUG);
|
||||||
|
$result = $db->query($sql);
|
||||||
|
if (! $result) dol_print_error($db);
|
||||||
|
|
||||||
|
$num = $db->num_rows($result);
|
||||||
|
|
||||||
|
$var=true;
|
||||||
|
if ($num)
|
||||||
|
{
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
// Name - Position
|
// Name - Position
|
||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
@ -665,24 +682,6 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
|
|||||||
|
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.lastname, p.firstname, p.fk_pays as country_id, p.civility, p.poste, p.phone as phone_pro, p.phone_mobile, p.phone_perso, p.fax, p.email, p.skype, p.statut ";
|
|
||||||
$sql .= ", p.civility as civility_id, p.address, p.zip, p.town";
|
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
|
|
||||||
$sql .= " WHERE p.fk_soc = ".$object->id;
|
|
||||||
if ($search_status!='' && $search_status != '-1') $sql .= " AND p.statut = ".$db->escape($search_status);
|
|
||||||
if ($search_name) $sql .= " AND (p.lastname LIKE '%".$db->escape($search_name)."%' OR p.firstname LIKE '%".$db->escape($search_name)."%')";
|
|
||||||
$sql.= " ORDER BY $sortfield $sortorder";
|
|
||||||
|
|
||||||
dol_syslog('core/lib/company.lib.php :: show_contacts', LOG_DEBUG);
|
|
||||||
$result = $db->query($sql);
|
|
||||||
if (! $result) dol_print_error($db);
|
|
||||||
|
|
||||||
$num = $db->num_rows($result);
|
|
||||||
|
|
||||||
$var=true;
|
|
||||||
if ($num)
|
|
||||||
{
|
|
||||||
$i=0;
|
$i=0;
|
||||||
|
|
||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user