Enhance [master] add column descriptions to xml_cdr (#2571)

update th_order_by to accept optional description parameter that will
populate the title field and append the , sort(order)
This commit is contained in:
Mafoo
2017-05-13 21:14:03 +01:00
committed by FusionPBX
parent f44aee3bf8
commit 4963119692
3 changed files with 106 additions and 26 deletions
+9 -9
View File
@@ -460,20 +460,20 @@
if (!function_exists('th_order_by')) {
//html table header order by
function th_order_by($field_name, $columntitle, $order_by, $order, $app_uuid = '', $css = '', $additional_get_params='') {
function th_order_by($field_name, $columntitle, $order_by, $order, $app_uuid = '', $css = '', $additional_get_params='', $description='') {
if (strlen($app_uuid) > 0) { $app_uuid = "&app_uuid=".$app_uuid; } // accomodate need to pass app_uuid where necessary (inbound/outbound routes lists)
if (strlen($additional_get_params) > 0) {$additional_get_params = '&'.$additional_get_params; } // you may need to pass other parameters
$html = "<th ".$css." nowrap>";
if (strlen($order_by)==0) {
$html .= "<a href='?order_by=$field_name&order=desc".$app_uuid."$additional_get_params' title='ascending'>$columntitle</a>";
$description = (strlen($description) > 0) ? $description . ', ': '';
if (strlen($order_by) == 0)
$order = 'asc';
if ($order == "asc") {
$description .= 'sort(ascending)';
$html .= "<a href='?order_by=$field_name&order=desc".$app_uuid."$additional_get_params' title='$description'>$columntitle</a>";
}
else {
if ($order=="asc") {
$html .= "<a href='?order_by=$field_name&order=desc".$app_uuid."$additional_get_params' title='ascending'>$columntitle</a>";
}
else {
$html .= "<a href='?order_by=$field_name&order=asc".$app_uuid."$additional_get_params' title='descending'>$columntitle</a>";
}
$description .= 'sort(descending)';
$html .= "<a href='?order_by=$field_name&order=asc".$app_uuid."$additional_get_params' title='$description'>$columntitle</a>";
}
$html .= "</th>";
return $html;