Add context field to conference and call center queue (#6836)

* Update conference_edit.php

* Update app_config.php

* Update app_config.php

* Update call_center_queue_edit.php

* Update call_center_queue_edit.php
This commit is contained in:
Alex 2023-11-29 13:26:48 -07:00 committed by GitHub
parent b0d87807b8
commit fa607d4bba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 71 additions and 3 deletions

View File

@ -42,6 +42,7 @@
$apps[$x]['destinations'][$y]['field']['destination'] = "queue_extension";
$apps[$x]['destinations'][$y]['field']['extension'] = "queue_extension";
$apps[$x]['destinations'][$y]['field']['description'] = "queue_description";
$apps[$x]['destinations'][$y]['field']['context'] = "queue_context";
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${name} \${description}";
@ -66,6 +67,9 @@
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_queue_context";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "call_center_all";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
@ -205,7 +209,7 @@
$apps[$x]['default_settings'][$y]['default_setting_value'] = "hold_music";
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Pass through hold_music variable.";
//cache details
$apps[$x]['cache']['key'] = "dialplan.\${domain_name}";
@ -480,6 +484,10 @@
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_context";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "queue_description";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';

View File

@ -116,6 +116,14 @@
$queue_email_address = $_POST["queue_email_address"] ?? null;
$queue_description = $_POST["queue_description"];
//set the context for users that do not have the permission
if (permission_exists('call_center_queue_context')) {
$queue_context = $_POST["queue_context"];
}
else if ($action == 'add') {
$queue_context = $_SESSION['domain_name'];
}
//remove invalid characters
$queue_cid_prefix = str_replace(":", "-", $queue_cid_prefix);
$queue_cid_prefix = str_replace("\"", "", $queue_cid_prefix);
@ -316,6 +324,7 @@
if (permission_exists('call_center_email_address')) {
$array['call_center_queues'][0]['queue_email_address'] = $queue_email_address;
}
$array['call_center_queues'][0]['queue_context'] = $queue_context;
$array['call_center_queues'][0]['queue_description'] = $queue_description;
$array['call_center_queues'][0]['call_center_queue_uuid'] = $call_center_queue_uuid;
$array['call_center_queues'][0]['dialplan_uuid'] = $dialplan_uuid;
@ -397,7 +406,9 @@
$array['dialplans'][0]["dialplan_uuid"] = $dialplan_uuid;
$array['dialplans'][0]["dialplan_name"] = $queue_name;
$array['dialplans'][0]["dialplan_number"] = $queue_extension;
$array['dialplans'][0]["dialplan_context"] = $_SESSION['domain_name'];
if (isset($queue_context)) {
$array['dialplans'][0]["dialplan_context"] = $queue_context;
}
$array['dialplans'][0]["dialplan_continue"] = "false";
$array['dialplans'][0]["dialplan_xml"] = $dialplan_xml;
$array['dialplans'][0]["dialplan_order"] = "230";
@ -544,6 +555,7 @@
$queue_announce_frequency = $row["queue_announce_frequency"];
$queue_cc_exit_keys = $row["queue_cc_exit_keys"];
$queue_email_address = $row["queue_email_address"];
$queue_context = $row["queue_context"];
$queue_description = $row["queue_description"];
}
}
@ -617,6 +629,7 @@
if (empty($queue_tier_rule_no_agent_no_wait)) { $queue_tier_rule_no_agent_no_wait = "true"; }
if (empty($queue_discard_abandoned_after)) { $queue_discard_abandoned_after = "900"; }
if (empty($queue_abandoned_resume_allowed)) { $queue_abandoned_resume_allowed = "false"; }
if (empty($queue_context)) { $queue_context = $_SESSION['domain_name']; }
//create token
$object = new token;
@ -1370,6 +1383,19 @@
echo "</tr>\n";
}
if (permission_exists('call_center_queue_context')) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-context']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='queue_context' maxlength='255' value=\"".escape($queue_context)."\" required='required'>\n";
echo "<br />\n";
echo $text['description-enter-context']."\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
echo " ".$text['label-description']."\n";

View File

@ -42,6 +42,7 @@
$apps[$x]['destinations'][$y]['field']['destination'] = "conference_extension";
$apps[$x]['destinations'][$y]['field']['extension'] = "conference_extension";
$apps[$x]['destinations'][$y]['field']['description'] = "conference_description";
$apps[$x]['destinations'][$y]['field']['context'] = "conference_context";
$apps[$x]['destinations'][$y]['select_value']['dialplan'] = "transfer:\${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_value']['ivr'] = "menu-exec-app:transfer \${destination} XML \${context}";
$apps[$x]['destinations'][$y]['select_label'] = "\${destination} \${name} \${description}";
@ -86,6 +87,9 @@
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "conference_context";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "conference_email_address";
$y++;
$apps[$x]['permissions'][$y]['name'] = "conference_account_code";
@ -169,6 +173,10 @@
$apps[$x]['db'][$y]['fields'][$z]['search'] = 'true';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description.";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "conference_context";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "";
$z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = "conference_enabled";
$apps[$x]['db'][$y]['fields'][$z]['type'] = "text";
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Select whether to enable or disable the conference.";

View File

@ -72,6 +72,14 @@
$conference_description = $_POST["conference_description"];
$conference_enabled = $_POST["conference_enabled"] ?? 'false';
//set the context for users that do not have the permission
if (permission_exists('conference_context')) {
$conference_context = $_POST["conference_context"];
}
else if ($action == 'add') {
$conference_context = $_SESSION['domain_name'];
}
//sanitize the conference name
$conference_name = preg_replace("/[^A-Za-z0-9\- ]/", "", $conference_name);
//$conference_name = str_replace(" ", "-", $conference_name);
@ -199,6 +207,7 @@
}
$array['conferences'][0]['conference_order'] = $conference_order;
$array['conferences'][0]['conference_description'] = $conference_description;
$array['conferences'][0]['conference_context'] = $conference_context;
$array['conferences'][0]['conference_enabled'] = $conference_enabled;
//conference pin number
@ -220,11 +229,13 @@
$array['dialplans'][0]['domain_uuid'] = $_SESSION['domain_uuid'];
$array['dialplans'][0]['dialplan_name'] = $conference_name;
$array['dialplans'][0]['dialplan_number'] = $conference_extension;
if (isset($conference_context)) {
$array['dialplans'][0]["dialplan_context"] = $conference_context;
}
$array['dialplans'][0]['app_uuid'] = 'b81412e8-7253-91f4-e48e-42fc2c9a38d9';
$array['dialplans'][0]['dialplan_xml'] = $dialplan_xml;
$array['dialplans'][0]['dialplan_continue'] = 'false';
$array['dialplans'][0]['dialplan_order'] = '333';
$array['dialplans'][0]['dialplan_context'] = $_SESSION['domain_name'];
$array['dialplans'][0]['dialplan_enabled'] = $conference_enabled;
$array['dialplans'][0]['dialplan_description'] = $conference_description;
@ -295,6 +306,7 @@
$conference_account_code = $row["conference_account_code"];
$conference_order = $row["conference_order"];
$conference_description = $row["conference_description"];
$conference_context = $row["conference_context"];
$conference_enabled = $row["conference_enabled"];
$conference_name = str_replace("-", " ", $conference_name);
}
@ -302,6 +314,7 @@
}
//set the defaults
if (empty($conference_context)) { $conference_context = $_SESSION['domain_name']; }
if (empty($conference_enabled)) { $conference_enabled = 'true'; }
//get the conference profiles
@ -524,6 +537,19 @@
echo "</td>\n";
echo "</tr>\n";
if (permission_exists('conference_context')) {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-context']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='conference_context' maxlength='255' value=\"".escape($conference_context)."\" required='required'>\n";
echo "<br />\n";
echo $text['description-enter-context']."\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['table-enabled']."\n";