Permalink
Browse files

Agent Sorting

Account for agents' name format setting when sorting agents.
  • Loading branch information...
protich committed Oct 24, 2016
1 parent 4f68aeb commit 5c548c7a7de37390694b84c75a0e4625e3cb52fd
Showing with 6 additions and 6 deletions.
  1. +6 −6 include/staff/staffmembers.inc.php
@@ -16,12 +16,6 @@
$orderWays = array('DESC'=>'DESC', 'ASC'=>'ASC');
$sort = ($_REQUEST['sort'] && $sortOptions[strtolower($_REQUEST['sort'])]) ? strtolower($_REQUEST['sort']) : 'name';
if ($sort && $sortOptions[$sort]) {
$order_column = $sortOptions[$sort];
}
$order_column = $order_column ? $order_column : array('firstname', 'lastname');
switch ($cfg->getAgentNameFormat()) {
case 'last':
case 'lastfirst':
@@ -31,6 +25,12 @@
// Otherwise leave unchanged
}
if ($sort && $sortOptions[$sort]) {
$order_column = $sortOptions[$sort];
}
$order_column = $order_column ?: array('firstname', 'lastname');
if ($_REQUEST['order'] && isset($orderWays[strtoupper($_REQUEST['order'])])) {
$order = $orderWays[strtoupper($_REQUEST['order'])];
} else {

0 comments on commit 5c548c7

Please sign in to comment.