diff --git a/app/dialplans/dialplans.php b/app/dialplans/dialplans.php
index c6fbdecd46..1d236e5394 100644
--- a/app/dialplans/dialplans.php
+++ b/app/dialplans/dialplans.php
@@ -101,7 +101,12 @@
//get the number of rows in the dialplan
$sql = "select count(*) as num_rows from v_dialplans ";
- $sql .= "where (domain_uuid = '$domain_uuid' or domain_uuid is null) ";
+ if ($_GET['show'] == "all" && permission_exists('dialplan_all')) {
+ $sql .= "where 1 = 1 ";
+ }
+ else {
+ $sql .= "where (domain_uuid = '$domain_uuid' or domain_uuid is null) ";
+ }
if (strlen($app_uuid) == 0) {
//hide inbound routes
$sql .= "and app_uuid <> 'c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4' ";
@@ -139,7 +144,10 @@
unset($prep_statement, $result);
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
- $param = "";
+ $param = "&search=".escape($search);
+ if ($_GET['show'] == "all" && permission_exists('destination_all')) {
+ $param .= "&show=all";
+ }
if (strlen($app_uuid) > 0 && is_uuid($app_uuid)) { $param = "&app_uuid=".$app_uuid; }
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
@@ -148,7 +156,12 @@
//get the list of dialplans
$sql = "select * from v_dialplans ";
- $sql .= "where (domain_uuid = '$domain_uuid' or domain_uuid is null) ";
+ if ($_GET['show'] == "all" && permission_exists('dialplan_all')) {
+ $sql .= "where 1 = 1 ";
+ }
+ else {
+ $sql .= "where (domain_uuid = '$domain_uuid' or domain_uuid is null) ";
+ }
if (strlen($app_uuid) == 0) {
//hide inbound routes
$sql .= "and app_uuid <> 'c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4' ";
@@ -231,14 +244,22 @@
echo "
\n";
echo " \n";
echo "