diff --git a/app/call_block/resources/dashboard/config.php b/app/call_block/resources/dashboard/config.php index d220ccc517..96bd82114e 100644 --- a/app/call_block/resources/dashboard/config.php +++ b/app/call_block/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = 'e75f04ff-6d1b-4b39-af0f-e1d1860327c $array['dashboard'][$x]['dashboard_name'] = 'Call Block'; $array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-ban'; +$array['dashboard'][$x]['dashboard_icon_color'] = '#EA4C46'; $array['dashboard'][$x]['dashboard_url'] = '/app/call_block/call_block.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -17,9 +18,9 @@ $array['dashboard'][$x]['dashboard_heading_text_color'] = ''; $array['dashboard'][$x]['dashboard_heading_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_heading_background_color'] = ''; $array['dashboard'][$x]['dashboard_heading_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; -$array['dashboard'][$x]['dashboard_number_text_color'] = '#EA4C46'; +$array['dashboard'][$x]['dashboard_number_text_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; @@ -44,3 +45,4 @@ $array['dashboard'][$x]['dashboard_groups'][$y]['group_name'] = 'user'; $y++; ?> + diff --git a/app/call_forward/resources/dashboard/config.php b/app/call_forward/resources/dashboard/config.php index 29f7122a91..edc3f0c0a7 100644 --- a/app/call_forward/resources/dashboard/config.php +++ b/app/call_forward/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = 'ba60799a-1c40-44a8-80ef-c2be4f4692f $array['dashboard'][$x]['dashboard_name'] = 'Call Forward'; $array['dashboard'][$x]['dashboard_path'] = 'call_forward/call_forward'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-forward'; +$array['dashboard'][$x]['dashboard_icon_color'] = ''; $array['dashboard'][$x]['dashboard_url'] = '/app/call_forward/call_forward.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -18,9 +19,9 @@ $array['dashboard'][$x]['dashboard_label_text_color'] = ''; $array['dashboard'][$x]['dashboard_label_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_label_background_color'] = ''; $array['dashboard'][$x]['dashboard_label_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; diff --git a/app/cisco/app_config.php b/app/cisco/app_config.php index 34017ad789..442aa4ca55 100644 --- a/app/cisco/app_config.php +++ b/app/cisco/app_config.php @@ -176,5 +176,13 @@ $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "SPA PC VLAN ID. Options 0 to 4094."; $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "78637de4-ec12-4d41-8c65-39afe50d2b02"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "provision"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "spa_router_mode"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = "Options: 0:Bridge, 1:NAT."; + $y++; ?> diff --git a/app/conference_centers/resources/dashboard/config.php b/app/conference_centers/resources/dashboard/config.php index f9fd79b610..273b533abc 100644 --- a/app/conference_centers/resources/dashboard/config.php +++ b/app/conference_centers/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = 'd1b26c96-6cfd-45ea-824f-0b5e16a9aab $array['dashboard'][$x]['dashboard_name'] = 'Conference Centers'; $array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-hotel'; +$array['dashboard'][$x]['dashboard_icon_color'] = '#5D5CE3'; $array['dashboard'][$x]['dashboard_url'] = '/app/conference_centers/conference_rooms.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -18,9 +19,9 @@ $array['dashboard'][$x]['dashboard_label_text_color'] = ''; $array['dashboard'][$x]['dashboard_label_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_label_background_color'] = ''; $array['dashboard'][$x]['dashboard_label_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; -$array['dashboard'][$x]['dashboard_number_text_color'] = '#5d5ce3'; +$array['dashboard'][$x]['dashboard_number_text_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; diff --git a/app/conferences/resources/dashboard/config.php b/app/conferences/resources/dashboard/config.php index cb9d3cbaf7..d9cd3e9a37 100644 --- a/app/conferences/resources/dashboard/config.php +++ b/app/conferences/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = 'c3c37d29-b654-4024-8ee4-d752b3e4db4 $array['dashboard'][$x]['dashboard_name'] = 'Conferences'; $array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-comments'; +$array['dashboard'][$x]['dashboard_icon_color'] = '#0292ff'; $array['dashboard'][$x]['dashboard_url'] = '/app/conferences/conferences.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -18,9 +19,9 @@ $array['dashboard'][$x]['dashboard_label_text_color'] = ''; $array['dashboard'][$x]['dashboard_label_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_label_background_color'] = ''; $array['dashboard'][$x]['dashboard_label_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; -$array['dashboard'][$x]['dashboard_number_text_color'] = '#0292FF'; +$array['dashboard'][$x]['dashboard_number_text_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; diff --git a/app/destinations/resources/dashboard/config.php b/app/destinations/resources/dashboard/config.php index dcb4590bd7..6eb1d00670 100644 --- a/app/destinations/resources/dashboard/config.php +++ b/app/destinations/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = 'a294b771-a125-4d36-b51a-973540346fa $array['dashboard'][$x]['dashboard_name'] = 'Destinations'; $array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-solid fa-right-to-bracket'; +$array['dashboard'][$x]['dashboard_icon_color'] = '#0292ff'; $array['dashboard'][$x]['dashboard_url'] = '/app/destinations/destinations.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -18,9 +19,9 @@ $array['dashboard'][$x]['dashboard_label_text_color'] = ''; $array['dashboard'][$x]['dashboard_label_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_label_background_color'] = ''; $array['dashboard'][$x]['dashboard_label_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; -$array['dashboard'][$x]['dashboard_number_text_color'] = '#0292ff'; +$array['dashboard'][$x]['dashboard_number_text_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; diff --git a/app/devices/devices.php b/app/devices/devices.php index 0cdcd0ee61..af2fb3015b 100644 --- a/app/devices/devices.php +++ b/app/devices/devices.php @@ -48,18 +48,6 @@ $database = database::new(); $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid, 'user_uuid' => $user_uuid]); -//set all permissions - $has_device_import = permission_exists('device_import'); - $has_device_edit = permission_exists('device_edit'); - $has_device_all = permission_exists('device_all'); - $has_device_delete = permission_exists('device_delete'); - $has_device_domain_all = permission_exists('device_domain_all'); - $has_device_export = permission_exists('device_export'); - $has_device_vendor_view = permission_exists('device_vendor_view'); - $has_device_profile_view = permission_exists('device_profile_view'); - $has_device_add = permission_exists('device_add'); - $has_show_all = &$has_device_domain_all; - //add multi-lingual support $language = new text; $text = $language->get(); @@ -78,13 +66,13 @@ if (!empty($action) && !empty($devices) && is_array($devices) && @sizeof($devices) != 0) { switch ($action) { case 'toggle': - if ($has_device_edit) { + if (permission_exists('device_edit')) { $obj = new device; $obj->toggle($devices); } break; case 'delete': - if ($has_device_delete) { + if (permission_exists('device_delete')) { $obj = new device; $obj->delete($devices); } @@ -105,7 +93,7 @@ //get total devices count from the database $sql = "select count(*) from v_devices "; $sql .= "where domain_uuid = :domain_uuid "; - if (!$has_device_all && !$has_device_domain_all) { + if (!permission_exists('device_all') && !permission_exists('device_domain_all')) { $sql .= "and device_user_uuid = :user_uuid "; $parameters['user_uuid'] = $user_uuid; } @@ -113,12 +101,6 @@ $total_devices = $database->select($sql, $parameters, 'column'); unset($sql, $parameters); -//update the has_device_add permission if the total device count is greater then set limit - $device_limit = $settings->get('limit', 'devices', null); - if ($has_device_add && $device_limit !== null) { - $has_device_add = $total_devices > $device_limit; - } - //get the domains if user has permission for show all $domains = []; if ($has_device_domain_all) { @@ -142,7 +124,7 @@ //prepare to page the results $sql = "select count(*) from v_devices as d "; - if (isset($_GET['show']) && $_GET['show'] == "all" && $has_device_all) { + if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) { if (!empty($search)) { $sql .= "where "; } @@ -150,7 +132,7 @@ else { $sql .= "where ("; $sql .= " d.domain_uuid = :domain_uuid "; - if ($has_device_all) { + if (permission_exists('device_all')) { $sql .= " or d.domain_uuid is null "; } $sql .= ") "; @@ -205,7 +187,7 @@ $param = "&search=".$search; $param .= "&fields=".$fields; } - if (!empty($_GET['show']) && $_GET['show'] == "all" && $has_device_all) { + if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) { $param .= "&show=all"; } $page = $_GET['page'] ?? 0; @@ -218,7 +200,7 @@ $sql .= "to_char(timezone(:time_zone, d.device_provisioned_date), 'DD Mon YYYY') as provisioned_date_formatted, \n"; $sql .= "to_char(timezone(:time_zone, d.device_provisioned_date), 'HH12:MI:SS am') as provisioned_time_formatted \n"; $sql .= "from v_devices as d, v_devices as d2 "; - if (isset($_GET['show']) && $_GET['show'] == "all" && $has_device_all) { + if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) { $sql .= ", v_domains as d3 "; } $sql .= "where ( "; @@ -228,19 +210,19 @@ $sql .= " d.device_uuid = d2.device_uuid "; $sql .= " ) "; $sql .= ") "; - if (isset($_GET['show']) && $_GET['show'] == "all" && $has_device_all) { + if (isset($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) { $sql .= " and d.domain_uuid = d3.domain_uuid "; } else { $sql .= "and ("; $sql .= " d.domain_uuid = :domain_uuid "; - if ($has_device_all) { + if (permission_exists('device_all')) { $sql .= " or d.domain_uuid is null "; } $sql .= ") "; $parameters['domain_uuid'] = $domain_uuid; } - if (!$has_device_all && !$has_device_domain_all) { + if (!permission_exists('device_all') && !permission_exists('device_domain_all')) { $sql .= "and d.device_user_uuid = :user_uuid "; $parameters['user_uuid'] = $user_uuid; } @@ -314,33 +296,33 @@ echo "
\n"; echo "
".$text['header-devices']."
".number_format($num_rows)."
\n"; echo "
\n"; - if ($has_device_import) { + if (permission_exists('device_import')) { echo button::create(['type'=>'button','label'=>$text['button-import'],'icon'=>$settings->get('theme', 'button_icon_import'),'link'=>'device_imports.php']); } - if ($has_device_export) { + if (permission_exists('device_export')) { echo button::create(['type'=>'button','label'=>$text['button-export'],'icon'=>$settings->get('theme', 'button_icon_export'),'link'=>'device_download.php']); } - if ($has_device_vendor_view) { + if (permission_exists('device_vendor_view')) { echo button::create(['type'=>'button','label'=>$text['button-vendors'],'icon'=>'fax','link'=>'device_vendors.php']); } - if ($has_device_profile_view) { + if (permission_exists('device_profile_view')) { echo button::create(['type'=>'button','label'=>$text['button-profiles'],'icon'=>'clone','link'=>'device_profiles.php']); } - $margin_left = $has_device_import || $has_device_export || $has_device_vendor_view || $has_device_profile_view ? "margin-left: 15px;" : null; - if ($has_device_add) { + $margin_left = permission_exists('device_import') || permission_exists('device_export') || permission_exists('device_vendor_view') || permission_exists('device_profile_view') ? "margin-left: 15px;" : null; + if (permission_exists('device_add') && (empty($_SESSION['limit']['devices']['numeric']) || ($total_devices < $_SESSION['limit']['devices']['numeric']))) { echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$settings->get('theme', 'button_icon_add'),'id'=>'btn_add','style'=>$margin_left,'link'=>'device_edit.php']); unset($margin_left); } - if ($has_device_edit && $devices) { + if (permission_exists('device_edit') && $devices) { echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$settings->get('theme', 'button_icon_toggle'),'id'=>'btn_toggle','name'=>'btn_toggle','style'=>'display: none; '.($margin_left ?? null),'onclick'=>"modal_open('modal-toggle','btn_toggle');"]); unset($margin_left); } - if ($has_device_delete && $devices) { + if (permission_exists('device_delete') && $devices) { echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$settings->get('theme', 'button_icon_delete'),'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; '.($margin_left ?? null),'onclick'=>"modal_open('modal-delete','btn_delete');"]); unset($margin_left); } echo "
\n"; - if ($has_device_edit && $devices) { + if (permission_exists('device_edit') && $devices) { echo modal::create(['id'=>'modal-toggle','type'=>'toggle','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_toggle','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('toggle'); list_form_submit('form_list');"])]); } - if ($has_device_delete && $devices) { + if (permission_exists('device_delete') && $devices) { echo modal::create(['id'=>'modal-delete','type'=>'delete','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_delete','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('delete'); list_form_submit('form_list');"])]); } @@ -387,12 +369,12 @@ echo "
\n"; echo "\n"; echo "\n"; - if ($has_device_edit || $has_device_delete) { + if (permission_exists('device_edit') || permission_exists('device_delete')) { echo " \n"; } - if (!empty($_GET['show']) && $_GET['show'] == "all" && $has_device_all) { + if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) { echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, null, null, $param); } echo th_order_by('device_address', $text['label-device_address'], $order_by, $order, null, null, $param ?? null); @@ -406,7 +388,7 @@ echo th_order_by('device_enabled', $text['label-device_enabled'], $order_by, $order, null, "class='center'", $param ?? null); echo th_order_by('device_provisioned_date', $text['label-device_status'], $order_by, $order, null, null, $param ?? null); echo th_order_by('device_description', $text['label-device_description'], $order_by, $order, null, "class='hide-sm-dn'", $param ?? null); - if ($has_device_edit && $settings->get('theme', 'list_row_edit_button', 'false') === 'true') { + if (permission_exists('device_edit') && $settings->get('theme', 'list_row_edit_button', false)) { echo " \n"; } echo "\n"; @@ -422,7 +404,7 @@ } } - if ($has_device_edit) { + if (permission_exists('device_edit')) { $list_row_url = "device_edit.php?id=".urlencode($row['device_uuid']); } @@ -437,17 +419,17 @@ } echo "\n"; - if ($has_device_edit || $has_device_delete) { + if (permission_exists('device_edit') || permission_exists('device_delete')) { echo " \n"; } - if (!empty($_GET['show']) && $_GET['show'] == "all" && $has_device_all) { + if (!empty($_GET['show']) && $_GET['show'] == "all" && permission_exists('device_all')) { echo " \n"; } echo " \n"; echo " \n"; if ($device_alternate) { @@ -463,7 +445,7 @@ echo " \n"; echo " \n"; echo " \n"; - if ($has_device_edit) { + if (permission_exists('device_edit')) { echo " \n"; echo " \n"; echo " \n"; - if ($has_device_edit && $settings->get('theme', 'list_row_edit_button', false)) { + if (permission_exists('device_edit') && $settings->get('theme', 'list_row_edit_button', false)) { echo " \n"; diff --git a/app/emergency/app_languages.php b/app/emergency/app_languages.php index 843c22e9ae..455852ef7d 100644 --- a/app/emergency/app_languages.php +++ b/app/emergency/app_languages.php @@ -27,8 +27,8 @@ $text['title-emergency_logs']['zh-cn'] = "紧急日志"; $text['title-emergency_logs']['ja-jp'] = "緊急ログ"; $text['title-emergency_logs']['ko-kr'] = "비상 기록"; -$text['title_description-emergency_logs']['en-us'] = "Track emergency calls includinng details of the time, date, and originating extension."; -$text['title_description-emergency_logs']['en-gb'] = "Track emergency calls includinng details of the time, date, and originating extension."; +$text['title_description-emergency_logs']['en-us'] = "Track emergency calls including details of the time, date, and originating extension."; +$text['title_description-emergency_logs']['en-gb'] = "Track emergency calls including details of the time, date, and originating extension."; $text['title_description-emergency_logs']['ar-eg'] = "تتبع مكالمات الطوارئ بما في ذلك تفاصيل الوقت والتاريخ والامتداد الأصلي."; $text['title_description-emergency_logs']['de-at'] = "Verfolgen Sie Notrufe mit Angaben zu Uhrzeit, Datum und Nebenstelle des Anrufers."; $text['title_description-emergency_logs']['de-ch'] = "Verfolgen Sie Notrufe mit Angaben zu Uhrzeit, Datum und Nebenstelle des Anrufers."; diff --git a/app/event_guard/resources/dashboard/config.php b/app/event_guard/resources/dashboard/config.php index 6e5ec741fd..49d060ee1d 100644 --- a/app/event_guard/resources/dashboard/config.php +++ b/app/event_guard/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = 'e95f0221-d956-4baf-90c5-e38e16a20a4 $array['dashboard'][$x]['dashboard_name'] = 'Event Guard'; $array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-solid fa-person-military-pointing'; +$array['dashboard'][$x]['dashboard_icon_color'] = '#5D5CE3'; $array['dashboard'][$x]['dashboard_url'] = '/app/event_guard/event_guard_logs.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -17,9 +18,9 @@ $array['dashboard'][$x]['dashboard_heading_text_color'] = ''; $array['dashboard'][$x]['dashboard_heading_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_heading_background_color'] = ''; $array['dashboard'][$x]['dashboard_heading_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; -$array['dashboard'][$x]['dashboard_number_text_color'] = '#5D5CE3'; +$array['dashboard'][$x]['dashboard_number_text_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; diff --git a/app/extensions/resources/dashboard/config.php b/app/extensions/resources/dashboard/config.php index fbd82ae049..ed8eff5fb1 100644 --- a/app/extensions/resources/dashboard/config.php +++ b/app/extensions/resources/dashboard/config.php @@ -26,6 +26,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = '4b7b6652-7e5f-48d3-987e-971053f093a $array['dashboard'][$x]['dashboard_name'] = 'Extensions'; $array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-suitcase'; +$array['dashboard'][$x]['dashboard_icon_color'] = '#0292ff'; $array['dashboard'][$x]['dashboard_url'] = '/app/extensions/extensions.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -39,9 +40,9 @@ $array['dashboard'][$x]['dashboard_label_text_color'] = ''; $array['dashboard'][$x]['dashboard_label_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_label_background_color'] = ''; $array['dashboard'][$x]['dashboard_label_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; -$array['dashboard'][$x]['dashboard_number_text_color'] = '#0292ff'; +$array['dashboard'][$x]['dashboard_number_text_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; diff --git a/app/fax/resources/dashboard/config.php b/app/fax/resources/dashboard/config.php index 11888f256a..f769641f90 100644 --- a/app/fax/resources/dashboard/config.php +++ b/app/fax/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = 'ea3f5a8a-fc93-47d7-a632-a733522affc $array['dashboard'][$x]['dashboard_name'] = 'Fax Server'; $array['dashboard'][$x]['dashboard_path'] = 'core/dashboard/resources/dashboard/icon.php'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-print'; +$array['dashboard'][$x]['dashboard_icon_color'] = '#5D5CE3'; $array['dashboard'][$x]['dashboard_url'] = '/app/fax/fax.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -18,9 +19,9 @@ $array['dashboard'][$x]['dashboard_label_text_color'] = ''; $array['dashboard'][$x]['dashboard_label_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_label_background_color'] = ''; $array['dashboard'][$x]['dashboard_label_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; -$array['dashboard'][$x]['dashboard_number_text_color'] = '#5d5ce3'; +$array['dashboard'][$x]['dashboard_number_text_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; diff --git a/app/ivr_menus/resources/dashboard/config.php b/app/ivr_menus/resources/dashboard/config.php index feae19b377..f3ea72026d 100644 --- a/app/ivr_menus/resources/dashboard/config.php +++ b/app/ivr_menus/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = '3af7af65-7861-4d05-a0bc-36d704458fa $array['dashboard'][$x]['dashboard_name'] = 'IVR Menus'; $array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-solid fa-diagram-project'; +$array['dashboard'][$x]['dashboard_icon_color'] = '#0292ff'; $array['dashboard'][$x]['dashboard_url'] = '/app/ivr_menus/ivr_menus.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -18,9 +19,9 @@ $array['dashboard'][$x]['dashboard_label_text_color'] = ''; $array['dashboard'][$x]['dashboard_label_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_label_background_color'] = ''; $array['dashboard'][$x]['dashboard_label_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; -$array['dashboard'][$x]['dashboard_number_text_color'] = '#0292ff'; +$array['dashboard'][$x]['dashboard_number_text_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; diff --git a/app/recordings/resources/dashboard/config.php b/app/recordings/resources/dashboard/config.php index 9c2779bda0..c0ea2d1d68 100644 --- a/app/recordings/resources/dashboard/config.php +++ b/app/recordings/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = '3d8efe65-49c3-4783-844e-4ebc1c97db6 $array['dashboard'][$x]['dashboard_name'] = 'Recordings'; $array['dashboard'][$x]['dashboard_path'] = 'dashboard/icon'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-microphone'; +$array['dashboard'][$x]['dashboard_icon_color'] = '#0292ff'; $array['dashboard'][$x]['dashboard_url'] = '/app/recordings/recordings.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -18,9 +19,9 @@ $array['dashboard'][$x]['dashboard_label_text_color'] = ''; $array['dashboard'][$x]['dashboard_label_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_label_background_color'] = ''; $array['dashboard'][$x]['dashboard_label_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; -$array['dashboard'][$x]['dashboard_number_text_color'] = '#0292ff'; +$array['dashboard'][$x]['dashboard_number_text_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; diff --git a/app/registrations/resources/dashboard/config.php b/app/registrations/resources/dashboard/config.php index 700512b15e..c7a08b6a94 100644 --- a/app/registrations/resources/dashboard/config.php +++ b/app/registrations/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = 'ce343ebe-3b54-4aad-b7e0-66de02171e7 $array['dashboard'][$x]['dashboard_name'] = 'Registrations'; $array['dashboard'][$x]['dashboard_path'] = 'registrations/registrations.php'; $array['dashboard'][$x]['dashboard_icon'] = 'fa-list-check'; +$array['dashboard'][$x]['dashboard_icon_color'] = '#bfbfbf'; $array['dashboard'][$x]['dashboard_url'] = '/app/registrations/registrations.php'; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -18,9 +19,9 @@ $array['dashboard'][$x]['dashboard_label_text_color'] = ''; $array['dashboard'][$x]['dashboard_label_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_label_background_color'] = ''; $array['dashboard'][$x]['dashboard_label_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; -$array['dashboard'][$x]['dashboard_number_text_color'] = '#bfbfbf'; +$array['dashboard'][$x]['dashboard_number_text_color'] = '#ffffff'; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = '#5d5ce3'; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; diff --git a/app/registrations/resources/dashboard/registrations.php b/app/registrations/resources/dashboard/registrations.php index 401ee88b11..6883af3d3d 100644 --- a/app/registrations/resources/dashboard/registrations.php +++ b/app/registrations/resources/dashboard/registrations.php @@ -59,7 +59,7 @@ echo " ".escape($dashboard_label).""; echo "
\n"; echo " \n"; - echo " ".$active_registrations." / ".($active_registrations + $inactive_registrations)."\n"; + echo " ".$active_registrations." / ".($active_registrations + $inactive_registrations)."\n"; echo "
\n"; echo " \n"; if (empty($dashboard_details_state) || $dashboard_details_state != "disabled") { diff --git a/app/ring_groups/resources/dashboard/config.php b/app/ring_groups/resources/dashboard/config.php index 790d472815..264a39606c 100644 --- a/app/ring_groups/resources/dashboard/config.php +++ b/app/ring_groups/resources/dashboard/config.php @@ -5,6 +5,7 @@ $array['dashboard'][$x]['dashboard_uuid'] = 'b5da1d72-2cc7-422e-b05c-f07659aed41 $array['dashboard'][$x]['dashboard_name'] = 'Ring Group Forward'; $array['dashboard'][$x]['dashboard_path'] = 'ring_groups/ring_group_forward'; $array['dashboard'][$x]['dashboard_icon'] = ''; +$array['dashboard'][$x]['dashboard_icon_color'] = '0292ff'; $array['dashboard'][$x]['dashboard_url'] = ''; $array['dashboard'][$x]['dashboard_target'] = 'self'; $array['dashboard'][$x]['dashboard_width'] = ''; @@ -18,9 +19,9 @@ $array['dashboard'][$x]['dashboard_label_text_color'] = ''; $array['dashboard'][$x]['dashboard_label_text_color_hover'] = ''; $array['dashboard'][$x]['dashboard_label_background_color'] = ''; $array['dashboard'][$x]['dashboard_label_background_color_hover'] = ''; -$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color'] = ''; $array['dashboard'][$x]['dashboard_number_text_color_hover'] = ''; +$array['dashboard'][$x]['dashboard_number_background_color'] = ''; $array['dashboard'][$x]['dashboard_background_color'] =''; $array['dashboard'][$x]['dashboard_background_color_hover'] = ''; $array['dashboard'][$x]['dashboard_detail_background_color'] = ''; diff --git a/app/ring_groups/ring_group_edit.php b/app/ring_groups/ring_group_edit.php index 8f85007173..4da6c44602 100644 --- a/app/ring_groups/ring_group_edit.php +++ b/app/ring_groups/ring_group_edit.php @@ -74,6 +74,10 @@ $total_ring_groups = $database->select($sql, $parameters ?? null, 'column'); unset($sql, $parameters); +//get the domain_uuid + $domain_uuid = $_SESSION['domain_uuid']; + $domain_name = $_SESSION['domain_name']; + //action add or update if (!empty($_REQUEST["id"]) || !empty($_REQUEST["ring_group_uuid"])) { $action = "update"; @@ -86,19 +90,19 @@ //get the domain_uuid if (is_uuid($ring_group_uuid) && permission_exists('ring_group_all')) { - $sql = "select domain_uuid from v_ring_groups "; + $sql = "select r.domain_uuid, d.domain_name "; + $sql .= "from v_ring_groups as r, v_domains as d "; $sql .= "where ring_group_uuid = :ring_group_uuid "; + $sql .= "and r.domain_uuid = d.domain_uuid "; $parameters['ring_group_uuid'] = $ring_group_uuid; - $domain_uuid = $database->select($sql, $parameters, 'column'); + $row = $database->select($sql, $parameters, 'row'); + $domain_uuid = $row['domain_uuid']; + $domain_name = $row['domain_name']; unset($sql, $parameters); } - else { - $domain_uuid = $_SESSION['domain_uuid']; - } } else { $action = "add"; - $domain_uuid = $_SESSION['domain_uuid']; } //delete the user from the ring group @@ -135,15 +139,15 @@ } //get total ring group count from the database, check limit, if defined - if ($action == 'add' && $_SESSION['limit']['ring_groups']['numeric'] ?? '') { + if ($action == 'add' && $settings->get('limit', 'ring_groups', '') ?? '') { $sql = "select count(*) from v_ring_groups "; $sql .= "where domain_uuid = :domain_uuid "; $parameters['domain_uuid'] = $domain_uuid; $total_ring_groups = $database->select($sql, $parameters, 'column'); unset($sql, $parameters); - if (is_numeric($_SESSION['limit']['ring_groups']['numeric']) && $total_ring_groups >= $_SESSION['limit']['ring_groups']['numeric']) { - message::add($text['message-maximum_ring_groups'].' '.$_SESSION['limit']['ring_groups']['numeric'], 'negative'); + if (is_numeric($settings->get('limit', 'ring_groups', '')) && $total_ring_groups >= $settings->get('limit', 'ring_groups', '')) { + message::add($text['message-maximum_ring_groups'].' '.$settings->get('limit', 'ring_groups', ''), 'negative'); header('Location: ring_groups.php'); exit; } @@ -217,7 +221,7 @@ $ring_group_context = $_POST["ring_group_context"]; } else if ($action == 'add') { - $ring_group_context = $_SESSION['domain_name']; + $ring_group_context = $domain_name; } //if the user doesn't have the correct permission then @@ -413,7 +417,7 @@ else { $ring_group_destination_uuid = uuid(); } - if (!empty($row['destination_number']) && $_SESSION['ring_group']['destination_range_enabled']['boolean']) { + if (!empty($row['destination_number']) && $settings->get('ring_group', 'destination_range_enabled', false)) { // check the range $output_array = array(); preg_match('/[0-9]{1,}-[0-9]{1,}/', $row['destination_number'], $output_array); @@ -586,8 +590,8 @@ } //set the defaults - $destination_delay_max = $_SESSION['ring_group']['destination_delay_max']['numeric']; - $destination_timeout_max = $_SESSION['ring_group']['destination_timeout_max']['numeric']; + $destination_delay_max = $settings->get('ring_group', 'destination_delay_max', ''); + $destination_timeout_max = $settings->get('ring_group', 'destination_timeout_max', '');; if (empty($ring_group_call_timeout)) { $ring_group_call_timeout = '30'; } @@ -611,12 +615,12 @@ //add an empty row to the options array if (!isset($ring_group_destinations) || count($ring_group_destinations) == 0) { - $rows = $_SESSION['ring_group']['destination_add_rows']['numeric']; + $rows = $settings->get('ring_group', 'destination_add_rows', 5); $id = 0; $show_destination_delete = false; } if (isset($ring_group_destinations) && count($ring_group_destinations) > 0) { - $rows = $_SESSION['ring_group']['destination_edit_rows']['numeric']; + $rows = $settings->get('ring_group', 'destination_edit_rows', 1); $id = count($ring_group_destinations)+1; $show_destination_delete = true; } @@ -657,7 +661,7 @@ //set the default ring group context if (empty($ring_group_context)) { - $ring_group_context = $_SESSION['domain_name']; + $ring_group_context = $domain_name; } //get the ring backs @@ -752,7 +756,7 @@ echo button::create(['type'=>'button','label'=>$text['button-back'],'icon'=>$_SESSION['theme']['button_icon_back'],'id'=>'btn_back','link'=>'ring_groups.php']); if ($action == 'update') { $button_margin = 'margin-left: 15px;'; - if (permission_exists('ring_group_add') && (!isset($_SESSION['limit']['ring_groups']['numeric']) || ($total_ring_groups < $_SESSION['limit']['ring_groups']['numeric']))) { + if (permission_exists('ring_group_add') && (empty($settings->get('limit', 'ring_groups', '')) || ($total_ring_groups < $settings->get('limit', 'ring_groups', '')))) { echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'name'=>'btn_copy','style'=>$button_margin,'onclick'=>"modal_open('modal-copy','btn_copy');"]); unset($button_margin); } @@ -767,7 +771,7 @@ echo "\n"; if ($action == "update") { - if (permission_exists('ring_group_add') && (!isset($_SESSION['limit']['ring_groups']['numeric']) || ($total_ring_groups < $_SESSION['limit']['ring_groups']['numeric']))) { + if (permission_exists('ring_group_add') && (empty($settings->get('limit', 'ring_groups', '')) || ($total_ring_groups < $settings->get('limit', 'ring_groups', '')))) { echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'submit','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','name'=>'action','value'=>'copy','onclick'=>"modal_close();"])]); } if (permission_exists('ring_group_delete') || permission_exists('ring_group_destination_delete')) { @@ -797,7 +801,7 @@ echo " ".$text['label-extension']."\n"; echo "\n"; echo "\n"; @@ -824,8 +828,8 @@ if ($key == 'recordings') { if ( !empty($instance_value) && - ($instance_value == $row["value"] || $instance_value == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].'/'.$row["value"]) && - file_exists($_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name'].'/'.pathinfo($row["value"], PATHINFO_BASENAME)) + ($instance_value == $row["value"] || $instance_value == $settings->get('switch', 'recordings', '')."/".$domain_name.'/'.$row["value"]) && + file_exists($settings->get('switch', 'recordings', '')."/".$domain_name.'/'.pathinfo($row["value"], PATHINFO_BASENAME)) ) { $selected = "selected='selected'"; $playable = '../recordings/recordings.php?action=download&type=rec&filename='.pathinfo($row["value"], PATHINFO_BASENAME); @@ -930,7 +934,7 @@ echo " \n"; echo " \n"; echo " \n"; echo "
\n"; echo " \n"; echo "  
\n"; echo " \n"; echo " \n"; echo " ".escape($domains[$row['domain_uuid']]).""; - echo $has_device_edit ? "".escape(format_device_address($row['device_address']))."" : escape(format_device_address($row['device_address'])); + echo permission_exists('device_edit') ? "".escape(format_device_address($row['device_address']))."" : escape(format_device_address($row['device_address'])); echo " ".escape($row['device_label'])." ".escape($row['device_vendor'])." ".escape($row['device_template'])." ".escape($device_profile_name)." ".escape($row['device_description'])." "; echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$settings->get('theme','button_icon_edit'),'link'=>$list_row_url]); echo " \n"; - echo " \n"; + echo " get('ring_group', 'extension_range', '') ?? '')."\">\n"; echo "
\n"; echo $text['description-extension']."\n"; echo "
\n"; if (!isset($row['ring_group_destination_uuid'])) { // new record - if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { + if (substr($settings->get('theme', 'input_toggle_style', ''), 0, 6) == 'switch') { $onkeyup = "onkeyup=\"document.getElementById('ring_group_destinations_".$x."_destination_enabled').checked = (this.value != '' ? true : false);\""; // switch } else { @@ -982,7 +986,7 @@ echo " \n"; // switch - if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { + if (substr($settings->get('theme', 'input_toggle_style', ''), 0, 6) == 'switch') { echo " \n"; - if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { + if (substr($settings->get('theme', 'input_toggle_style', ''), 0, 6) == 'switch') { echo "