diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index d98eed5decb..d837a6c6421 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -42,6 +42,7 @@ $massaction=GETPOST('massaction','alpha');
$show_files=GETPOST('show_files','int');
$confirm=GETPOST('confirm','alpha');
$toselect = GETPOST('toselect', 'array');
+$contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'contactlist';
// Security check
$id = GETPOST('id','int');
@@ -81,8 +82,8 @@ if ($search_status=='') $search_status=1; // always display activ customer first
$optioncss = GETPOST('optioncss','alpha');
-$type=GETPOST("type");
-$view=GETPOST("view");
+$type=GETPOST("type",'aZ');
+$view=GETPOST("view",'alpha');
$limit = GETPOST('limit','int')?GETPOST('limit','int'):$conf->liste_limit;
$sortfield = GETPOST('sortfield', 'alpha');
@@ -95,29 +96,28 @@ if (! $sortfield) $sortfield="p.lastname";
if (empty($page) || $page < 0) { $page = 0; }
$offset = $limit * $page;
-$contextpage='contactlist';
$titre = (! empty($conf->global->SOCIETE_ADDRESSES_MANAGEMENT) ? $langs->trans("ListOfContacts") : $langs->trans("ListOfContactsAddresses"));
if ($type == "p")
{
- $contextpage='contactprospectlist';
+ if (empty($contextpage) || $contextpage == 'contactlist') $contextpage='contactprospectlist';
$titre.=' ('.$langs->trans("ThirdPartyProspects").')';
$urlfiche="card.php";
}
if ($type == "c")
{
- $contextpage='contactcustomerlist';
+ if (empty($contextpage) || $contextpage == 'contactlist') $contextpage='contactcustomerlist';
$titre.=' ('.$langs->trans("ThirdPartyCustomers").')';
$urlfiche="card.php";
}
else if ($type == "f")
{
- $contextpage='contactsupplierlist';
+ if (empty($contextpage) || $contextpage == 'contactlist') $contextpage='contactsupplierlist';
$titre.=' ('.$langs->trans("ThirdPartySuppliers").')';
$urlfiche="card.php";
}
else if ($type == "o")
{
- $contextpage='contactotherlist';
+ if (empty($contextpage) || $contextpage == 'contactlist') $contextpage='contactotherlist';
$titre.=' ('.$langs->trans("OthersNotLinkedToThirdParty").')';
$urlfiche="";
}
@@ -435,6 +435,7 @@ print '';
print '';
print '';
+print '';
print '';
print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_companies.png', 0, $newcardbutton, '', $limit);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 9201083035e..a4a874e792b 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4072,10 +4072,6 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
$options=preg_replace('/&+/i','&',$options);
if (! preg_match('/^&/',$options)) $options='&'.$options;
- //print " ";
- //$sortimg.= '
';
- //$sortimg.= '';
-
if (! $sortorder || $field1 != $sortfield1)
{
//$out.= ''.img_down("A-Z",0).'';
@@ -4094,8 +4090,6 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
$sortimg.= ''.img_down("A-Z",0).'';
}
}
-
- //$sortimg.= '';
}
$out.=$sortimg;
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index d25ffcba2e2..ac08d1251e2 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -108,9 +108,9 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
-if ($type == 'c' && (empty($contextpage) || $contextpage == 'thirdpartylist')) { $contextpage='customerlist'; if ($search_type=='') $search_type='1,3'; }
-if ($type == 'p' && (empty($contextpage) || $contextpage == 'thirdpartylist')) { $contextpage='prospectlist'; if ($search_type=='') $search_type='2,3'; }
-if ($type == 'f' && (empty($contextpage) || $contextpage == 'thirdpartylist')) { $contextpage='supplierlist'; if ($search_type=='') $search_type='4'; }
+if ($type == 'c') { if (empty($contextpage) || $contextpage == 'thirdpartylist') $contextpage='customerlist'; if ($search_type=='') $search_type='1,3'; }
+if ($type == 'p') { if (empty($contextpage) || $contextpage == 'thirdpartylist') $contextpage='prospectlist'; if ($search_type=='') $search_type='2,3'; }
+if ($type == 'f') { if (empty($contextpage) || $contextpage == 'thirdpartylist') $contextpage='supplierlist'; if ($search_type=='') $search_type='4'; }
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new Societe($db);