Revize 540d2579
Přidáno uživatelem Ondřej Fibich před asi 9 roky(ů)
application/controllers/messages.php | ||
---|---|---|
|
||
$allowed_order_type = array
|
||
(
|
||
'id', 'from', 'to', 'extension', 'opening_balance', 'closing_balance'
|
||
'id', 'message'
|
||
);
|
||
|
||
if (!in_array(strtolower($order_by), $allowed_order_type))
|
||
... | ... | |
'order_by' => $order_by,
|
||
'order_by_direction' => $order_by_direction,
|
||
'limit_results' => $limit_results,
|
||
'url_array_ofset' => 1,
|
||
'filter' => $filter_form
|
||
));
|
||
|
application/models/message.php | ||
---|---|---|
// order by check
|
||
if (!$this->has_column($order_by))
|
||
{
|
||
$order_by = 'id';
|
||
if ($order_by == 'message')
|
||
{
|
||
$order_by = 'name';
|
||
}
|
||
else
|
||
{
|
||
$order_by = 'id';
|
||
}
|
||
}
|
||
// order by direction check
|
||
if (strtolower($order_by_direction) != 'desc')
|
Také k dispozici: Unified diff
refs #1015: fix ordering in messages grid