diff --git a/app/ring_groups/app_config.php b/app/ring_groups/app_config.php index dce411f3ec..95628aa05a 100644 --- a/app/ring_groups/app_config.php +++ b/app/ring_groups/app_config.php @@ -177,6 +177,38 @@ $apps[$x]['default_settings'][$y]['default_setting_value'] = "3"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "false"; $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "79aec8c7-c9ae-48d6-b343-4359f4f867c9"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "dashboard"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "ring_group_forward_chart_color_forwarding"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "#ea4c46"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "3b23cd36-b1c1-45fd-a533-8d9604dcb46a"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "dashboard"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "ring_group_forward_chart_color_active"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "#d4d4d4"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "abc10faf-7277-40cd-a7b3-0df4ea6c6c2b"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "dashboard"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "ring_group_forward_chart_border_color"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "rgba(0,0,0,0)"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; + $y++; + $apps[$x]['default_settings'][$y]['default_setting_uuid'] = "506d4482-dee8-4047-9e1c-4375c9a521bb"; + $apps[$x]['default_settings'][$y]['default_setting_category'] = "dashboard"; + $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "ring_group_forward_chart_border_width"; + $apps[$x]['default_settings'][$y]['default_setting_name'] = "text"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "0"; + $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; + $apps[$x]['default_settings'][$y]['default_setting_description'] = ""; //schema details $y=0; diff --git a/app/ring_groups/app_languages.php b/app/ring_groups/app_languages.php index cf45aacf96..9fc88a0eae 100644 --- a/app/ring_groups/app_languages.php +++ b/app/ring_groups/app_languages.php @@ -841,6 +841,48 @@ $text['label-distinctive_ring']['ru-ru'] = "Отличительный вызо $text['label-distinctive_ring']['sv-se'] = "Distinkt Ringning"; $text['label-distinctive_ring']['uk-ua'] = ""; +$text['label-active']['en-us'] = "Active"; +$text['label-active']['en-gb'] = "Active"; +$text['label-active']['ar-eg'] = ""; +$text['label-active']['de-at'] = "Aktiv"; //copied from de-de +$text['label-active']['de-ch'] = "Aktiv"; //copied from de-de +$text['label-active']['de-de'] = "Aktiv"; +$text['label-active']['es-cl'] = ""; +$text['label-active']['es-mx'] = ""; +$text['label-active']['fr-ca'] = "Actif"; +$text['label-active']['fr-fr'] = "Actif"; +$text['label-active']['he-il'] = ""; +$text['label-active']['it-it'] = "Attivo"; +$text['label-active']['nl-nl'] = ""; +$text['label-active']['pl-pl'] = ""; +$text['label-active']['pt-br'] = ""; +$text['label-active']['pt-pt'] = ""; +$text['label-active']['ro-ro'] = ""; +$text['label-active']['ru-ru'] = "Активные"; +$text['label-active']['sv-se'] = "Aktiv"; +$text['label-active']['uk-ua'] = ""; + +$text['label-destination']['en-us'] = "Destination"; +$text['label-destination']['en-gb'] = "Destination"; +$text['label-destination']['ar-eg'] = "جهات الأتصال"; +$text['label-destination']['de-at'] = "Ziele"; //copied from de-de +$text['label-destination']['de-ch'] = "Ziele"; //copied from de-de +$text['label-destination']['de-de'] = "Ziele"; +$text['label-destination']['es-cl'] = "Destino"; +$text['label-destination']['es-mx'] = "Destino"; //copied from es-cl +$text['label-destination']['fr-ca'] = "Destination"; //copied from fr-fr +$text['label-destination']['fr-fr'] = "Destination"; +$text['label-destination']['he-il'] = "יעדים"; +$text['label-destination']['it-it'] = "Destinazioni"; +$text['label-destination']['nl-nl'] = "Bestemmingen"; +$text['label-destination']['pl-pl'] = "Destynacje"; +$text['label-destination']['pt-br'] = "Destino"; //copied from pt-pt +$text['label-destination']['pt-pt'] = "Destino"; +$text['label-destination']['ro-ro'] = "Destinații"; +$text['label-destination']['ru-ru'] = "Направления"; +$text['label-destination']['sv-se'] = "Destinationer"; +$text['label-destination']['uk-ua'] = "Номери"; + $text['label-destinations']['en-us'] = "Destinations"; $text['label-destinations']['en-gb'] = "Destinations"; $text['label-destinations']['ar-eg'] = ""; diff --git a/app/ring_groups/resources/dashboard/ring_group_forward.php b/app/ring_groups/resources/dashboard/ring_group_forward.php index f8b1a24659..7f0962ce33 100644 --- a/app/ring_groups/resources/dashboard/ring_group_forward.php +++ b/app/ring_groups/resources/dashboard/ring_group_forward.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2013-2022 + Portions created by the Initial Developer are Copyright (C) 2013-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -31,8 +31,6 @@ //includes files require_once "resources/require.php"; - require_once "resources/check_auth.php"; - require_once "resources/paging.php"; //add multi-lingual support $language = new text; @@ -47,10 +45,6 @@ $domain_uuid = $_SESSION['user']['domain_uuid']; } -//get variables used to control the order - $order_by = $_GET["order_by"]; - $order = $_GET["order"]; - //connect to the database if (!isset($database)) { $database = new database; @@ -113,35 +107,6 @@ } } -//prepare to page the results - if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) { - //show all ring groups - $sql = "select count(*) from v_ring_groups "; - $sql .= "where domain_uuid = :domain_uuid "; - $parameters['domain_uuid'] = $domain_uuid; - } - else { - //show only assigned ring groups - $sql = "select count(*) from v_ring_groups as r, v_ring_group_users as u "; - $sql .= "where r.ring_group_uuid = u.ring_group_uuid "; - $sql .= "and r.domain_uuid = :domain_uuid "; - $sql .= "and u.user_uuid = :user_uuid "; - $parameters['domain_uuid'] = $domain_uuid; - $parameters['user_uuid'] = $_SESSION['user']['user_uuid']; - } - $num_rows = $database->select($sql, $parameters, 'column'); - unset($parameters); - -//prepare to page the results - $rows_per_page = $is_included ? 10 : (is_numeric($_SESSION['domain']['paging']['numeric']) ? $_SESSION['domain']['paging']['numeric'] : 50); - $param = ""; - if (isset($_GET['page'])) { - $page = $_GET['page']; - if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } - list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page); - $offset = $rows_per_page * $page; - } - //get the list if (permission_exists('ring_group_add') || permission_exists('ring_group_edit')) { //show all ring groups @@ -159,77 +124,148 @@ $parameters['domain_uuid'] = $_SESSION['user']['domain_uuid']; $parameters['user_uuid'] = $_SESSION['user']['user_uuid']; } - $sql .= order_by($order_by, $order, 'ring_group_extension', 'asc'); - $sql .= limit_offset($rows_per_page, $offset); + $sql .= "order by ring_group_extension asc "; $result = $database->select($sql, $parameters, 'all'); unset($sql, $parameters); +//determine keys and stats + unset($stats); + if (is_array($result) && @sizeof($result) != 0) { + foreach ($result as $row) { + $stats['forwarding'] += $row['ring_group_forward_enabled'] == 'true' && $row['ring_group_forward_destination'] ? 1 : 0; + } + $stats['active'] = @sizeof($result) - $stats['forwarding']; + } + +//set defaults + if ($stats['forwarding'] == null) { $stats['forwarding'] = 0; } + if ($stats['active'] == null) { $stats['active'] = 0; } + +//set the row style + $c = 0; + $row_style["0"] = "row_style0"; + $row_style["1"] = "row_style1"; + //create token $object = new token; $token = $object->create('/app/ring_groups/ring_group_forward.php'); -//include header - require_once "resources/header.php"; +//ring group forward + echo "
\n"; -//show content - echo "
\n"; - echo "
".$text['header-ring-group-forward']."
\n"; - echo "
\n"; - if ($is_included && $num_rows > 10) { - echo button::create(['type'=>'button','label'=>$text['button-view_all'],'icon'=>'share-square','collapse'=>'hide-xs','link'=>PROJECT_PATH.'/app/ring_groups/ring_group_forward.php']); - } - echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'collapse'=>false,'onclick'=>"list_form_submit('form_list_ring_group_forward');"]); - echo "
\n"; - echo "
\n"; +//doughnut chart + echo "
\n"; + echo "
\n"; echo "
\n"; - if (!$is_included) { - echo $text['description-ring-group-forward']."\n"; - echo "

\n"; - } + echo "\n"; +//details echo "
\n"; - echo "\n"; - echo "\n"; - echo th_order_by('ring_group_name', $text['label-name'], $order_by, $order); - echo th_order_by('ring_group_extension', $text['label-extension'], $order_by, $order); - echo ""; - if (!$is_included) { - echo th_order_by('ring_group_description', $text['label-description'], $order_by, $order, null, "class='hide-sm-dn'"); - } + echo "
"; + + echo button::create(['type'=>'button','label'=>$text['button-save'],'icon'=>$_SESSION['theme']['button_icon_save'],'collapse'=>false,'style'=>"position: absolute; margin-top: -35px; margin-left: -72px;",'onclick'=>"list_form_submit('form_list_ring_group_forward');"]); + + echo "
".$text['label-forwarding']."
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; +//data if (is_array($result) && @sizeof($result) != 0) { $x = 0; foreach ($result as $row) { - $onclick = "onclick=\"document.getElementById('".escape($row['ring_group_uuid'])."').selectedIndex = (document.getElementById('".escape($row['ring_group_uuid'])."').selectedIndex) ? 0 : 1; if (document.getElementById('".escape($row['ring_group_uuid'])."').selectedIndex) { document.getElementById('destination').focus(); }\""; - echo "\n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; - if (!$is_included) { - echo " \n"; + // switch + if (substr($_SESSION['theme']['input_toggle_style']['text'], 0, 6) == 'switch') { + echo " \n"; } + // select + else { + echo " \n"; + } + echo " \n"; + echo " \n"; echo "\n"; $x++; + $c = ($c) ? 0 : 1; } + unset($result); } - unset($result); echo "
".$text['label-name']."".$text['label-extension']."".$text['label-forwarding']."".$text['label-destination']."
".escape($row['ring_group_name'])." ".escape($row['ring_group_extension'])." "; + $tr_link = PROJECT_PATH."/app/ring_groups/ring_group_edit.php?id=".$row['ring_group_uuid']; + echo "
".escape($row['ring_group_name'])."".escape($row['ring_group_extension'])."".escape($row['ring_group_description'])." 
\n"; - echo "
\n"; - if (!$is_included) { - echo "
".$paging_controls."
\n"; - } + echo "
"; + $n++; + echo "\n"; echo "\n"; -?> + echo ""; + echo "
\n"; + +?> \ No newline at end of file diff --git a/themes/default/css.php b/themes/default/css.php index d00c25c165..ea5671749d 100644 --- a/themes/default/css.php +++ b/themes/default/css.php @@ -2492,6 +2492,13 @@ header('Expires: '.gmdate('D, d M Y H:i:s',time()+3600).' GMT'); vertical-align: middle; } + td.hud_text.input { + margin: 0; + padding-top: 0; + padding-bottom: 0; + white-space: nowrap; + } + span.hud_expander { display: block; clear: both;