diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php index 43265aefe0e..2233447b3be 100644 --- a/htdocs/comm/contact.php +++ b/htdocs/comm/contact.php @@ -30,15 +30,16 @@ require("./pre.inc.php"); -if (!$user->rights->societe->lire) accessforbidden(); - $langs->load("companies"); -llxHeader('','Contacts'); - $sortfield=isset($_GET["sortfield"])?$_GET["sortfield"]:$_POST["sortfield"]; $sortorder=isset($_GET["sortorder"])?$_GET["sortorder"]:$_POST["sortorder"]; $page=$_GET["page"]; +if (! $sortorder) $sortorder="ASC"; +if (! $sortfield) $sortfield="p.name"; +if ($page < 0) { $page = 0 ; } +$limit = $conf->liste_limit; +$offset = $limit * $page ; $socid=$_GET["socid"]; $type=$_GET["type"]; @@ -52,13 +53,11 @@ if ($user->societe_id > 0) $action = ''; $socid = $user->societe_id; } +if (!$user->rights->societe->lire) accessforbidden(); -if (! $sortorder) $sortorder="ASC"; -if (! $sortfield) $sortfield="p.name"; -if ($page < 0) { $page = 0 ; } -$limit = $conf->liste_limit; -$offset = $limit * $page ; + +llxHeader('','Contacts'); if ($type == "c") @@ -139,18 +138,18 @@ if ($result) { $num = $db->num_rows(); - print_barre_liste($langs->trans("ListOfContacts").($label?" (".$label.")":""),$page, "contact.php", "&type=$type",$sortfield,$sortorder,"",$num); + print_barre_liste($langs->trans("ListOfContacts").($label?" (".$label.")":""),$page, $_SERVER["PHP_SELF"], "&type=$type",$sortfield,$sortorder,"",$num); print '
| '.$langs->trans("Email").' | '; print ''.$langs->trans("Phone").' | '; print "