Mise à jour des vues et de la navigation dans les pages
This commit is contained in:
parent
0ead8a2e24
commit
3d18bf433b
@ -47,7 +47,14 @@ if ($page < 0) { $page = 0 ; }
|
|||||||
$limit = $conf->liste_limit;
|
$limit = $conf->liste_limit;
|
||||||
$offset = $limit * $page ;
|
$offset = $limit * $page ;
|
||||||
|
|
||||||
print_barre_liste("Liste des contacts",$page, $PHP_SELF, '', $sortfield, $sortorder);
|
if ($_GET["view"] == 'phone')
|
||||||
|
{
|
||||||
|
$titre = "Liste des contacts (Vue téléphone)";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$titre = "Liste des contacts";
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
@ -56,7 +63,7 @@ print_barre_liste("Liste des contacts",$page, $PHP_SELF, '', $sortfield, $sortor
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$sql = "SELECT s.idp, s.nom, p.idp as cidp, p.name, p.firstname, p.email, p.phone ";
|
$sql = "SELECT s.idp, s.nom, p.idp as cidp, p.name, p.firstname, p.email, p.phone, p.phone_mobile, p.fax ";
|
||||||
$sql .= "FROM llx_socpeople as p";
|
$sql .= "FROM llx_socpeople as p";
|
||||||
$sql .= " LEFT JOIN llx_societe as s ON (s.idp = p.fk_soc)";
|
$sql .= " LEFT JOIN llx_societe as s ON (s.idp = p.fk_soc)";
|
||||||
|
|
||||||
@ -85,11 +92,11 @@ if ($socid)
|
|||||||
|
|
||||||
if($_GET["view"] == "recent")
|
if($_GET["view"] == "recent")
|
||||||
{
|
{
|
||||||
$sql .= " ORDER BY p.datec DESC " . $db->plimit( $limit, $offset);
|
$sql .= " ORDER BY p.datec DESC " . $db->plimit( $limit + 1, $offset);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset);
|
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit + 1, $offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -99,6 +106,8 @@ if ($result)
|
|||||||
$num = $db->num_rows();
|
$num = $db->num_rows();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
|
print_barre_liste($titre ,$page, $PHP_SELF, '&view='.$_GET["view"].'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num);
|
||||||
|
|
||||||
if ($sortorder == "DESC")
|
if ($sortorder == "DESC")
|
||||||
{
|
{
|
||||||
$sortorder="ASC";
|
$sortorder="ASC";
|
||||||
@ -107,7 +116,7 @@ if ($result)
|
|||||||
{
|
{
|
||||||
$sortorder="DESC";
|
$sortorder="DESC";
|
||||||
}
|
}
|
||||||
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
print "<p><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
|
||||||
print "<TR class=\"liste_titre\">";
|
print "<TR class=\"liste_titre\">";
|
||||||
print "<TD>";
|
print "<TD>";
|
||||||
print_liste_field_titre("Nom",$PHP_SELF,"lower(p.name)", $begin);
|
print_liste_field_titre("Nom",$PHP_SELF,"lower(p.name)", $begin);
|
||||||
@ -115,11 +124,24 @@ if ($result)
|
|||||||
print_liste_field_titre("Prénom",$PHP_SELF,"lower(p.firstname)", $begin);
|
print_liste_field_titre("Prénom",$PHP_SELF,"lower(p.firstname)", $begin);
|
||||||
print "</td><td>";
|
print "</td><td>";
|
||||||
print_liste_field_titre("Société",$PHP_SELF,"lower(s.nom)", $begin);
|
print_liste_field_titre("Société",$PHP_SELF,"lower(s.nom)", $begin);
|
||||||
print "</td><TD>email</TD>";
|
print '</td>';
|
||||||
print '<TD>Téléphone</TD>';
|
|
||||||
|
print '<td>Téléphone</td>';
|
||||||
|
|
||||||
|
|
||||||
|
if ($_GET["view"] == 'phone')
|
||||||
|
{
|
||||||
|
print '<td>Portable</td>';
|
||||||
|
print '<td>Fax</td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td>email</td>';
|
||||||
|
}
|
||||||
|
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
$var=True;
|
$var=True;
|
||||||
while ($i < $num)
|
while ($i < min($num,$limit))
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object( $i);
|
$obj = $db->fetch_object( $i);
|
||||||
|
|
||||||
@ -140,9 +162,21 @@ if ($result)
|
|||||||
}
|
}
|
||||||
print "<a href=\"".DOL_URL_ROOT."/comm/fiche.php?socid=$obj->idp\">$obj->nom</A></td>\n";
|
print "<a href=\"".DOL_URL_ROOT."/comm/fiche.php?socid=$obj->idp\">$obj->nom</A></td>\n";
|
||||||
|
|
||||||
print '<td><a href="action/fiche.php?action=create&actionid=4&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->email.'</a> </td>';
|
|
||||||
|
|
||||||
print '<td><a href="action/fiche.php?action=create&actionid=1&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->phone.'</a> </td>';
|
print '<td><a href="action/fiche.php?action=create&actionid=1&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->phone.'</a> </td>';
|
||||||
|
|
||||||
|
if ($_GET["view"] == 'phone')
|
||||||
|
{
|
||||||
|
|
||||||
|
print '<td>'.$obj->phone_mobile.' </td>';
|
||||||
|
|
||||||
|
print '<td>'.$obj->fax.' </td>';
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td><a href="action/fiche.php?action=create&actionid=4&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->email.'</a> </td>';
|
||||||
|
}
|
||||||
|
|
||||||
print "</TR>\n";
|
print "</TR>\n";
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user