From 46b2f00826863d41c3fedd14ed9945907a75bbde Mon Sep 17 00:00:00 2001 From: fusionate Date: Fri, 4 Dec 2020 12:53:51 -0700 Subject: [PATCH] Dialplan Manager: Adjust toggle method to support multiple domains if used on show all. --- app/dialplans/resources/classes/dialplan.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/dialplans/resources/classes/dialplan.php b/app/dialplans/resources/classes/dialplan.php index 68cd8cd311..6839ad12cd 100644 --- a/app/dialplans/resources/classes/dialplan.php +++ b/app/dialplans/resources/classes/dialplan.php @@ -1218,9 +1218,11 @@ } if (is_array($uuids) && @sizeof($uuids) != 0) { $sql = "select ".$this->uuid_prefix."uuid as uuid, ".$this->toggle_field." as toggle, dialplan_context from v_".$this->table." "; - $sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) "; - $sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") "; - $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + $sql .= "where ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") "; + if (!permission_exists('dialplan_all')) { + $sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) "; + $parameters['domain_uuid'] = $_SESSION['domain_uuid']; + } $database = new database; $rows = $database->select($sql, $parameters, 'all'); if (is_array($rows) && @sizeof($rows) != 0) {