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 <flagman@flagman.com>
Co-authored-by: FusionPBX <markjcrane@gmail.com>
Co-authored-by: K-flagman <43560934+kapetrosyan@users.noreply.github.com>
This commit is contained in:
K-Flagman
2023-01-20 17:25:13 -08:00
committed by GitHub
parent 7d22b514a4
commit 581c919132
4 changed files with 24 additions and 2 deletions

View File

@@ -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';

View File

@@ -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 " <td class='vtable'>".$text['label-destination_prompt']."</td>\n";
}
echo " <td class='vtable'>"."Enable"."</td>\n";
if ($show_destination_delete && permission_exists('ring_group_destination_delete')) {
echo " <td class='vtable edit_delete_checkbox_all' onmouseover=\"swap_display('delete_label_destinations', 'delete_toggle_destinations');\" onmouseout=\"swap_display('delete_label_destinations', 'delete_toggle_destinations');\">\n";
echo " <span id='delete_label_destinations'>".$text['label-delete']."</span>\n";
@@ -768,7 +770,9 @@
if (strlen($row['ring_group_destination_uuid']) > 0) {
echo " <input name='ring_group_destinations[".$x."][ring_group_destination_uuid]' type='hidden' value=\"".escape($row['ring_group_destination_uuid'])."\">\n";
}
} else {
$row['destination_enabled'] = 'true';
}
echo " <tr>\n";
echo " <td class='formfld'>\n";
@@ -813,6 +817,19 @@
echo " </select>\n";
echo " </td>\n";
}
echo " <td valign='top' class='".$row_style[$c]." switch-c'>\n";
###iphone
echo " <label class='switch'>\n";
$checked = ($row['destination_enabled'] == 'true' ? 'checked=checked' : '');
echo " <input type ='checkbox' id='ring_group_destinations[".$x."][destination_enabled]' name='ring_group_destinations[".$x."][destination_enabled]' $checked>\n";
echo " <div class ='slider round'></div>\n";
echo " </div>\n";
#iphone button
echo "</td>";
if ($show_destination_delete && permission_exists('ring_group_destination_delete')) {
if (is_uuid($row['ring_group_destination_uuid'])) {
echo " <td class='vtable' style='text-align: center; padding-bottom: 3px;'>";

View File

@@ -489,6 +489,7 @@
AND d.ring_group_uuid = :ring_group_uuid
AND r.domain_uuid = :domain_uuid
AND r.ring_group_enabled = 'true'
AND d.destination_enabled = 'true'
ORDER BY
]]..sql_order..[[
]];

View File

@@ -20,7 +20,6 @@
<link rel='stylesheet' type='text/css' href='{$project_path}/resources/bootstrap/css/bootstrap-colorpicker.min.css.php'>
<link rel='stylesheet' type='text/css' href='{$project_path}/resources/fontawesome/css/all.min.css.php'>
<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php'>
{*//link to custom css file *}
{if $settings.theme.custom_css}
<link rel='stylesheet' type='text/css' href='{$settings.theme.custom_css}'>