From e8dbf586f557656a46649ddec48bbf8de919c383 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Wed, 18 Dec 2013 08:54:03 +0000 Subject: [PATCH] Fix the table header order links so they maintain the app_uuid in the link. Remove the tag as it should be handled with the title CSS class. --- app/dialplan/dialplans.php | 49 ++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/app/dialplan/dialplans.php b/app/dialplan/dialplans.php index 068b99b8ca..4a3cb10d56 100644 --- a/app/dialplan/dialplans.php +++ b/app/dialplan/dialplans.php @@ -41,10 +41,29 @@ else { } //set the http values as php variables - $order_by = $_GET["order_by"]; - $order = $_GET["order"]; - $dialplan_context = $_GET["dialplan_context"]; - $app_uuid = $_GET["app_uuid"]; + $order_by = check_str($_GET["order_by"]); + $order = check_str($_GET["order"]); + $dialplan_context = check_str($_GET["dialplan_context"]); + $app_uuid = check_str($_GET["app_uuid"]); + +//custom table header order by to accomodate the app_uuid + function th_order_by($field_name, $columntitle, $order_by, $order, $app_uuid) { + if (strlen($app_uuid) > 0) { $app_uuid = "app_uuid=".$app_uuid; } + $html = "    "; + if (strlen($order_by)==0) { + $html .= "$columntitle"; + } + else { + if ($order=="asc") { + $html .= "$columntitle"; + } + else { + $html .= "$columntitle"; + } + } + $html .= "    "; + return $html; + } //includes require_once "resources/header.php"; @@ -77,19 +96,19 @@ else { echo " \n"; echo " \n"; if ($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4") { - echo " ".$text['header-inbound_routes']."\n"; + echo " ".$text['header-inbound_routes']."\n"; } elseif ($app_uuid == "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3") { - echo " ".$text['header-outbound_routes']."\n"; + echo " ".$text['header-outbound_routes']."\n"; } elseif ($app_uuid == "16589224-c876-aeb3-f59f-523a1c0801f7") { - echo " ".$text['header-queues']."\n"; + echo " ".$text['header-queues']."\n"; } elseif ($app_uuid == "4b821450-926b-175a-af93-a03c441818b1") { - echo " ".$text['header-time_conditions']."\n"; + echo " ".$text['header-time_conditions']."\n"; } else { - echo " ".$text['header-dialplan_manager']."\n"; + echo " ".$text['header-dialplan_manager']."\n"; } echo " \n"; echo " \n"; @@ -191,12 +210,12 @@ else { echo "
\n"; echo "\n"; echo "\n"; - echo th_order_by('dialplan_name', $text['label-name'], $order_by, $order); - echo th_order_by('dialplan_number', $text['label-number'], $order_by, $order); - echo th_order_by('dialplan_context', $text['label-context'], $order_by, $order); - echo th_order_by('dialplan_order', $text['label-order'], $order_by, $order); - echo th_order_by('dialplan_enabled', $text['label-enabled'], $order_by, $order); - echo th_order_by('dialplan_description', $text['label-description'], $order_by, $order); + echo th_order_by('dialplan_name', $text['label-name'], $order_by, $order, $app_uuid); + echo th_order_by('dialplan_number', $text['label-number'], $order_by, $order, $app_uuid); + echo th_order_by('dialplan_context', $text['label-context'], $order_by, $order, $app_uuid); + echo th_order_by('dialplan_order', $text['label-order'], $order_by, $order, $app_uuid); + echo th_order_by('dialplan_enabled', $text['label-enabled'], $order_by, $order, $app_uuid); + echo th_order_by('dialplan_description', $text['label-description'], $order_by, $order, $app_uuid); echo "
\n"; if ($app_uuid == "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4") { if (permission_exists('inbound_route_add')) {