From f0951391557298eb6db7dca3b737cc0afad8ab0c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Wed, 20 Aug 2025 18:57:56 -0600 Subject: [PATCH] Use the toggle for voicemail and transcribe --- app/extensions/extension_edit.php | 50 +++++++++++++++++-------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index ee475d41d0..ea47f8e882 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -47,7 +47,7 @@ $language = new text; $text = $language->get(); -//return the first item if data type = array, returns value if data type = text +//return the first item if data type = array, returns value if data type = text function get_first_item($value) { return is_array($value) ? $value[0] : $value; } @@ -714,10 +714,10 @@ } else { //send a message to the user the device is not unique - $message = $text['message-duplicate'].(if_group("superadmin") && $_SESSION["domain_name"] != $device_domain_name ? ": ".$device_domain_name : null); + $message = $text['message-duplicate'].(if_group("superadmin") && $domain_name != $device_domain_name ? ": ".$device_domain_name : null); message::add($message,'negative'); } - + //increment $j++; } @@ -1113,7 +1113,7 @@ $token = $object->create($_SERVER['PHP_SELF']); //set the back button - $_SESSION['call_forward_back'] = $_SERVER['PHP_SELF'] . "?id=$extension_uuid"; + $_SESSION['call_forward_back'] = $_SERVER['PHP_SELF'].(!empty($extension_uuid) ? '?id='.$extension_uuid : null); //begin the page content require_once "resources/header.php"; @@ -1189,7 +1189,9 @@ } } - echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$settings->get('theme', 'button_icon_save'),'id'=>'btn_save','style'=>'margin-left: 15px;','onclick'=>'submit_form();']); + if (permission_exists('extension_add') || permission_exists('extension_edit')) { + echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$settings->get('theme', 'button_icon_save'),'id'=>'btn_save','style'=>'margin-left: 15px;','onclick'=>'submit_form();']); + } echo " \n"; echo "
\n"; echo "\n"; @@ -1795,21 +1797,18 @@ echo " ".$text['label-voicemail_enabled']."\n"; echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; + echo " \n"; } else { - echo " \n"; + echo " \n"; } - if ($voicemail_enabled == false) { - echo " \n"; - } - else { - echo " \n"; - } - echo " \n"; echo "
\n"; echo $text['description-voicemail_enabled']."\n"; echo "\n"; @@ -1832,11 +1831,18 @@ echo " ".$text['label-voicemail_transcription_enabled']."\n"; echo "\n"; echo "\n"; - echo " \n"; + if (substr($settings->get('theme', 'input_toggle_style'), 0, 6) == 'switch') { + echo " \n"; + } + else { + echo " \n"; + } echo "
\n"; echo $text['description-voicemail_transcription_enabled']."\n"; echo "\n";