From 581c9191325ae915277636b60fd5bc6d96b536df Mon Sep 17 00:00:00 2001 From: K-Flagman <105959875+k-flagman@users.noreply.github.com> Date: Fri, 20 Jan 2023 17:25:13 -0800 Subject: [PATCH] Add iphone style toggle to enable/disable ring groups destinations #6394 (#6395) * Add iphone style toggle for destinations in ring groups * Add iphone style toggle for destinations in ring groups * only select enabled destination when make ring group calls * add destination_enable filed in table v_ring_group_destinations schema * Change destination_enabled value on to true. * Update app_config.php * Change destination_enabled from on to true * Change destination_enabled to boolean * Delete fix.css * Will style this * Update template.php Co-authored-by: flagman Co-authored-by: FusionPBX Co-authored-by: K-flagman <43560934+kapetrosyan@users.noreply.github.com> --- app/ring_groups/app_config.php | 5 +++++ app/ring_groups/ring_group_edit.php | 19 ++++++++++++++++++- .../scripts/app/ring_groups/index.lua | 1 + themes/default/template.php | 1 - 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/ring_groups/app_config.php b/app/ring_groups/app_config.php index b1a62588b6..13711f40e5 100644 --- a/app/ring_groups/app_config.php +++ b/app/ring_groups/app_config.php @@ -372,6 +372,11 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "numeric"; //confirm,announce $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "destination_enabled"; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "boolean"; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "text"; + $z++; $apps[$x]['db'][$y]['fields'][$z]['name'] = "insert_date"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'timestamptz'; $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'date'; diff --git a/app/ring_groups/ring_group_edit.php b/app/ring_groups/ring_group_edit.php index 7d94e14c88..44913131e6 100644 --- a/app/ring_groups/ring_group_edit.php +++ b/app/ring_groups/ring_group_edit.php @@ -378,6 +378,7 @@ $array['ring_groups'][0]["ring_group_destinations"][$y]["destination_delay"] = $row['destination_delay']; $array['ring_groups'][0]["ring_group_destinations"][$y]["destination_timeout"] = $row['destination_timeout']; $array['ring_groups'][0]["ring_group_destinations"][$y]["destination_prompt"] = $row['destination_prompt']; + $array['ring_groups'][0]["ring_group_destinations"][$y]["destination_enabled"] = $row['destination_enabled']; $array['ring_groups'][0]["ring_group_destinations"][$y]["domain_uuid"] = $domain_uuid; } $y++; @@ -754,6 +755,7 @@ if (permission_exists('ring_group_prompt')) { echo " ".$text['label-destination_prompt']."\n"; } + echo " "."Enable"."\n"; if ($show_destination_delete && permission_exists('ring_group_destination_delete')) { echo " \n"; echo " ".$text['label-delete']."\n"; @@ -768,7 +770,9 @@ if (strlen($row['ring_group_destination_uuid']) > 0) { echo " \n"; - } + } else { + $row['destination_enabled'] = 'true'; + } echo " \n"; echo " \n"; @@ -813,6 +817,19 @@ echo " \n"; echo " \n"; } + echo " \n"; + ###iphone + + echo "