mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-22 10:56:31 +00:00
call center php 8.1 changes (#6720)
* Update call_center_agents.php * Update call_center_queues.php * Update call_center_queue_edit.php * Update call_center_agent_edit.php * Update call_center_agents.php
This commit is contained in:
@@ -47,14 +47,14 @@
|
||||
$text = $language->get();
|
||||
|
||||
//check for duplicates
|
||||
if ($_GET["check"] == 'duplicate') {
|
||||
if (!empty($_GET["check"]) == 'duplicate') {
|
||||
//agent id
|
||||
if ($_GET["agent_id"] != '') {
|
||||
if (!empty($_GET["agent_id"])) {
|
||||
$sql = "select agent_name ";
|
||||
$sql .= "from v_call_center_agents ";
|
||||
$sql .= "where agent_id = :agent_id ";
|
||||
$sql .= "and domain_uuid = :domain_uuid ";
|
||||
if (is_uuid($_GET["agent_uuid"])) {
|
||||
if (!empty($_GET["agent_uuid"]) && is_uuid($_GET["agent_uuid"])) {
|
||||
$sql .= " and call_center_agent_uuid <> :call_center_agent_uuid ";
|
||||
$parameters['call_center_agent_uuid'] = $_GET["agent_uuid"];
|
||||
}
|
||||
@@ -62,7 +62,7 @@
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row) && sizeof($row) != 0 && $row['agent_name'] != '') {
|
||||
if (!empty($row) && !empty($row['agent_name'])) {
|
||||
echo $text['message-duplicate_agent_id'].(if_group("superadmin") ? ": ".$row["agent_name"] : null);
|
||||
}
|
||||
unset($sql, $parameters);
|
||||
@@ -72,7 +72,7 @@
|
||||
}
|
||||
|
||||
//action add or update
|
||||
if (is_uuid($_REQUEST["id"])) {
|
||||
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
$call_center_agent_uuid = $_REQUEST["id"];
|
||||
}
|
||||
@@ -81,7 +81,7 @@
|
||||
}
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (is_array($_POST)) {
|
||||
if (!empty($_POST)) {
|
||||
$call_center_agent_uuid = $_POST["call_center_agent_uuid"];
|
||||
$user_uuid = $_POST["user_uuid"];
|
||||
$agent_name = $_POST["agent_name"];
|
||||
@@ -101,7 +101,7 @@
|
||||
}
|
||||
|
||||
//process the user data and save it to the database
|
||||
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
|
||||
if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
||||
|
||||
//validate the token
|
||||
$token = new token;
|
||||
@@ -287,7 +287,7 @@
|
||||
$destination = new destinations;
|
||||
|
||||
//pre-populate the form
|
||||
if (is_uuid($_GET["id"]) && $_POST["persistformvar"] != "true") {
|
||||
if (!empty($_GET["id"]) && is_uuid($_GET["id"]) && empty($_POST["persistformvar"])) {
|
||||
$call_center_agent_uuid = $_GET["id"];
|
||||
$sql = "select * from v_call_center_agents ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
@@ -296,7 +296,7 @@
|
||||
$parameters['call_center_agent_uuid'] = $call_center_agent_uuid;
|
||||
$database = new database;
|
||||
$row = $database->select($sql, $parameters, 'row');
|
||||
if (is_array($row) && @sizeof($row) != 0) {
|
||||
if (!empty($row)) {
|
||||
$call_center_agent_uuid = $row["call_center_agent_uuid"];
|
||||
$user_uuid = $row["user_uuid"];
|
||||
$agent_name = $row["agent_name"];
|
||||
@@ -401,7 +401,7 @@
|
||||
echo " ".$text['label-agent_name']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td width='70%' class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='agent_name' maxlength='255' value=\"".escape($agent_name)."\" />\n";
|
||||
echo " <input class='formfld' type='text' name='agent_name' maxlength='255' value=\"".escape($agent_name ?? '')."\" />\n";
|
||||
/*
|
||||
echo "<select id=\"agent_name\" name=\"agent_name\" class='formfld'>\n";
|
||||
echo "<option value=\"\"></option>\n";
|
||||
@@ -460,7 +460,7 @@
|
||||
echo " </select>";
|
||||
unset($users);
|
||||
echo " <br>\n";
|
||||
echo " ".$text['description-users']."\n";
|
||||
echo " ".!empty($text['description-users'])."\n";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
|
||||
@@ -469,7 +469,7 @@
|
||||
echo " ".$text['label-agent_id']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='number' name='agent_id' id='agent_id' maxlength='255' min='1' step='1' value='".escape($agent_id)."'>\n";
|
||||
echo " <input class='formfld' type='number' name='agent_id' id='agent_id' maxlength='255' min='1' step='1' value='".escape($agent_id ?? '')."'>\n";
|
||||
echo " <div style='display: none;' id='duplicate_agent_id_response'></div>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-agent_id']."\n";
|
||||
@@ -481,7 +481,7 @@
|
||||
echo " ".$text['label-agent_password']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='password' name='agent_password' autocomplete='off' onmouseover=\"this.type='text';\" onfocus=\"this.type='text';\" onmouseout=\"if (!\$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" maxlength='255' min='1' step='1' value='".escape($agent_password)."'>\n";
|
||||
echo " <input class='formfld' type='password' name='agent_password' autocomplete='off' onmouseover=\"this.type='text';\" onfocus=\"this.type='text';\" onmouseout=\"if (!\$(this).is(':focus')) { this.type='password'; }\" onblur=\"this.type='password';\" maxlength='255' min='1' step='1' value='".escape($agent_password ?? '')."'>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-agent_password']."\n";
|
||||
echo "</td>\n";
|
||||
@@ -492,7 +492,7 @@
|
||||
echo " ".$text['label-contact']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo $destination->select('user_contact', 'agent_contact', $agent_contact);
|
||||
echo $destination->select('user_contact', 'agent_contact', !empty($agent_contact));
|
||||
echo "<br />\n";
|
||||
echo $text['description-contact']."\n";
|
||||
echo "</td>\n";
|
||||
|
||||
@@ -46,15 +46,18 @@
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
|
||||
//get posted data
|
||||
if (is_array($_POST['call_center_agents'])) {
|
||||
if (!empty($_POST['call_center_agents'])) {
|
||||
$action = $_POST['action'];
|
||||
$search = $_POST['search'];
|
||||
$call_center_agents = $_POST['call_center_agents'];
|
||||
}
|
||||
|
||||
//process the http post data by action
|
||||
if ($action != '' && is_array($call_center_agents) && @sizeof($call_center_agents) != 0) {
|
||||
if (!empty($action) && !empty($call_center_agents)) {
|
||||
switch ($action) {
|
||||
case 'delete':
|
||||
if (permission_exists('call_center_agent_delete')) {
|
||||
@@ -69,11 +72,11 @@
|
||||
}
|
||||
|
||||
//get http variables and set them to php variables
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
$order_by = $_GET["order_by"] ?? '';
|
||||
$order = $_GET["order"] ?? '';
|
||||
|
||||
//add the search term
|
||||
$search = strtolower($_GET["search"]);
|
||||
$search = strtolower($_GET["search"] ?? '');
|
||||
if (!empty($search)) {
|
||||
$sql_search = " (";
|
||||
$sql_search .= "lower(agent_name) like :search ";
|
||||
@@ -85,23 +88,23 @@
|
||||
//get total call center agent count from the database
|
||||
$sql = "select count(*) from v_call_center_agents ";
|
||||
$sql .= "where true ";
|
||||
if ($_GET['show'] != "all" || !permission_exists('call_center_all')) {
|
||||
if (!empty($_GET['show']) != "all" || !permission_exists('call_center_all')) {
|
||||
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
}
|
||||
if (isset($sql_search)) {
|
||||
if (!empty($sql_search)) {
|
||||
$sql .= "and ".$sql_search;
|
||||
}
|
||||
$database = new database;
|
||||
$num_rows = $database->select($sql, $parameters, 'column');
|
||||
$num_rows = $database->select($sql, $parameters ?? null, 'column');
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$rows_per_page = (!empty($_SESSION['domain']['paging']['numeric'])) ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$param = "&search=".urlencode($search);
|
||||
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
|
||||
if (!empty($_GET['show']) == "all" && permission_exists('call_center_all')) {
|
||||
$param .= "&show=all";
|
||||
}
|
||||
$page = $_GET['page'];
|
||||
$page = $_GET['page'] ?? '';
|
||||
if (empty($page)) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
|
||||
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
|
||||
@@ -112,7 +115,7 @@
|
||||
$sql .= order_by($order_by, $order, 'agent_name', 'asc');
|
||||
$sql .= limit_offset($rows_per_page, $offset);
|
||||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
$result = $database->select($sql, $parameters ?? null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//create token
|
||||
@@ -142,7 +145,7 @@
|
||||
}
|
||||
echo "<form id='form_search' class='inline' method='get'>";
|
||||
if (permission_exists('call_center_all')) {
|
||||
if ($_GET['show'] == 'all') {
|
||||
if (!empty($_GET['show']) == 'all') {
|
||||
echo " <input type='hidden' name='show' value='all'>";
|
||||
}
|
||||
else {
|
||||
@@ -175,10 +178,10 @@
|
||||
echo "<tr class='list-header'>\n";
|
||||
if (permission_exists('call_center_agent_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($result ?: "style='visibility: hidden;'").">\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".(!empty($result) ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
|
||||
if (!empty($_GET['show']) == "all" && permission_exists('call_center_all')) {
|
||||
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
|
||||
}
|
||||
//echo th_order_by('domain_uuid', 'domain_uuid', $order_by, $order);
|
||||
@@ -192,12 +195,12 @@
|
||||
//echo th_order_by('agent_wrap_up_time', $text['label-wrap_up_time'], $order_by, $order);
|
||||
//echo th_order_by('agent_reject_delay_time', $text['label-reject_delay_time'], $order_by, $order);
|
||||
//echo th_order_by('agent_busy_delay_time', $text['label-busy_delay_time'], $order_by, $order);
|
||||
if (permission_exists('call_center_agent_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
if (permission_exists('call_center_agent_edit') && $list_row_edit_button == 'true') {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
|
||||
if (is_array($result)) {
|
||||
if (!empty($result)) {
|
||||
$x = 0;
|
||||
foreach($result as $row) {
|
||||
if (permission_exists('call_center_agent_edit')) {
|
||||
@@ -210,7 +213,7 @@
|
||||
echo " <input type='hidden' name='call_center_agents[$x][uuid]' value='".escape($row['call_center_agent_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
|
||||
if (!empty($_GET['show']) == "all" && permission_exists('call_center_all')) {
|
||||
if (!empty($_SESSION['domains'][$row['domain_uuid']]['domain_name'])) {
|
||||
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
|
||||
}
|
||||
@@ -239,7 +242,7 @@
|
||||
$sql .= "where gateway_uuid = :gateway_uuid ";
|
||||
$parameters['gateway_uuid'] = $bridge_statement[2];
|
||||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
$result = $database->select($sql, $parameters ?? null, 'all');
|
||||
if (count($result) > 0) {
|
||||
$gateway_name = $result[0]['gateway'];
|
||||
$agent_contact = str_replace($bridge_statement[2], $gateway_name, $agent_contact);
|
||||
@@ -252,7 +255,7 @@
|
||||
//echo " <td>".$row[agent_wrap_up_time]."</td>\n";
|
||||
//echo " <td>".$row[agent_reject_delay_time]."</td>\n";
|
||||
//echo " <td>".$row[agent_busy_delay_time]."</td>\n";
|
||||
if (permission_exists('call_center_agent_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
if (permission_exists('call_center_agent_edit') && $list_row_edit_button == 'true') {
|
||||
echo " <td class='action-button'>";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
$text = $language->get();
|
||||
|
||||
//action add or update
|
||||
if (is_uuid($_REQUEST["id"])) {
|
||||
if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
$call_center_queue_uuid = $_REQUEST["id"];
|
||||
}
|
||||
@@ -60,12 +60,12 @@
|
||||
|
||||
//get total call center queues count from the database, check limit, if defined
|
||||
if ($action == 'add') {
|
||||
if ($_SESSION['limit']['call_center_queues']['numeric'] != '') {
|
||||
if (!empty($_SESSION['limit']['call_center_queues']['numeric'])) {
|
||||
$sql = "select count(*) from v_call_center_queues ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$total_call_center_queues = $database->select($sql, $parameters, 'column');
|
||||
$total_call_center_queues = $database->select($sql, $parameters ?? null, 'column');
|
||||
unset($sql, $parameters);
|
||||
|
||||
if ($total_call_center_queues >= $_SESSION['limit']['call_center_queues']['numeric']) {
|
||||
@@ -77,7 +77,7 @@
|
||||
}
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (is_array($_POST)) {
|
||||
if (!empty($_POST)) {
|
||||
//get the post variables a run a security chack on them
|
||||
//$domain_uuid = $_POST["domain_uuid"];
|
||||
$dialplan_uuid = $_POST["dialplan_uuid"];
|
||||
@@ -119,7 +119,7 @@
|
||||
}
|
||||
|
||||
//delete the tier (agent from the queue)
|
||||
if ($_REQUEST["a"] == "delete" && is_uuid($_REQUEST["id"]) && permission_exists("call_center_tier_delete")) {
|
||||
if (!empty($_REQUEST["a"]) && $_REQUEST["a"] == "delete" && is_uuid($_REQUEST["id"]) && permission_exists("call_center_tier_delete")) {
|
||||
//set the variables
|
||||
$call_center_queue_uuid = $_REQUEST["id"];
|
||||
$call_center_tier_uuid = $_REQUEST["call_center_tier_uuid"];
|
||||
@@ -133,10 +133,10 @@
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$parameters['call_center_tier_uuid'] = $call_center_tier_uuid;
|
||||
$database = new database;
|
||||
$tiers = $database->select($sql, $parameters, 'all');
|
||||
$tiers = $database->select($sql, $parameters ?? null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
if (is_array($tiers) && sizeof($tiers) != 0) {
|
||||
if (!empty($tiers)) {
|
||||
foreach ($tiers as &$row) {
|
||||
$call_center_agent_uuid = $row["call_center_agent_uuid"];
|
||||
$call_center_queue_uuid = $row["call_center_queue_uuid"];
|
||||
@@ -175,7 +175,7 @@
|
||||
}
|
||||
|
||||
//process the user data and save it to the database
|
||||
if (count($_POST) > 0 && empty($_POST["persistformvar"])) {
|
||||
if (!empty($_POST) && empty($_POST["persistformvar"])) {
|
||||
|
||||
//get the uuid from the POST
|
||||
if ($action == "update") {
|
||||
@@ -242,7 +242,7 @@
|
||||
|
||||
//update the call centier tiers array
|
||||
$x = 0;
|
||||
if (is_array($_POST["call_center_tiers"]) && @sizeof($_POST["call_center_tiers"]) != 0) {
|
||||
if (!empty($_POST["call_center_tiers"])) {
|
||||
foreach ($_POST["call_center_tiers"] as $row) {
|
||||
//add the domain_uuid
|
||||
if (empty($row["domain_uuid"])) {
|
||||
@@ -264,7 +264,7 @@
|
||||
$queue_timeout_data = implode($action_array);
|
||||
|
||||
//add the recording path if needed
|
||||
if ($queue_greeting != '') {
|
||||
if (!empty($queue_greeting)) {
|
||||
if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$queue_greeting)) {
|
||||
$queue_greeting_path = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$queue_greeting;
|
||||
}
|
||||
@@ -316,7 +316,7 @@
|
||||
$array['call_center_queues'][0]['domain_uuid'] = $domain_uuid;
|
||||
|
||||
$y = 0;
|
||||
if (is_array($_POST["call_center_tiers"]) && @sizeof($_POST["call_center_tiers"]) != 0) {
|
||||
if (!empty($_POST["call_center_tiers"])) {
|
||||
foreach ($_POST["call_center_tiers"] as $row) {
|
||||
if (is_uuid($row['call_center_tier_uuid'])) {
|
||||
$call_center_tier_uuid = $row['call_center_tier_uuid'];
|
||||
@@ -418,12 +418,12 @@
|
||||
$cache->delete("dialplan:".$_SESSION["domain_name"]);
|
||||
|
||||
//clear the destinations session array
|
||||
if (isset($_SESSION['destinations']['array'])) {
|
||||
if (!empty($_SESSION['destinations']['array'])) {
|
||||
unset($_SESSION['destinations']['array']);
|
||||
}
|
||||
|
||||
//redirect the user
|
||||
if (isset($action)) {
|
||||
if (!empty($action)) {
|
||||
if ($action == "add") {
|
||||
message::add($text['message-add']);
|
||||
}
|
||||
@@ -441,7 +441,7 @@
|
||||
$tier_level = $_POST["tier_level"];
|
||||
$tier_position = $_POST["tier_position"];
|
||||
|
||||
if ($agent_name != '') {
|
||||
if (!empty($agent_name)) {
|
||||
//setup the event socket connection
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
//add the agent using event socket
|
||||
@@ -489,7 +489,7 @@
|
||||
} //(count($_POST)>0 && empty($_POST["persistformvar"]))
|
||||
|
||||
//pre-populate the form
|
||||
if (is_array($_GET) && is_uuid($_GET["id"]) && $_POST["persistformvar"] != "true") {
|
||||
if (!empty($_GET) && is_uuid($_GET["id"]) && empty($_POST["persistformvar"])) {
|
||||
$call_center_queue_uuid = $_GET["id"];
|
||||
$sql = "select * from v_call_center_queues ";
|
||||
$sql .= "where domain_uuid = :domain_uuid ";
|
||||
@@ -497,10 +497,10 @@
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$parameters['call_center_queue_uuid'] = $call_center_queue_uuid;
|
||||
$database = new database;
|
||||
$call_center_queues = $database->select($sql, $parameters, 'all');
|
||||
$call_center_queues = $database->select($sql, $parameters ?? null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
if (is_array($call_center_queues)) {
|
||||
if (!empty($call_center_queues)) {
|
||||
foreach ($call_center_queues as &$row) {
|
||||
$queue_name = $row["queue_name"];
|
||||
$dialplan_uuid = $row["dialplan_uuid"];
|
||||
@@ -543,9 +543,9 @@
|
||||
$sql .= "and t.domain_uuid = :domain_uuid ";
|
||||
$sql .= "order by tier_level asc, tier_position asc, a.agent_name asc";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$parameters['call_center_queue_uuid'] = $call_center_queue_uuid;
|
||||
$parameters['call_center_queue_uuid'] = $call_center_queue_uuid ?? null;
|
||||
$database = new database;
|
||||
$tiers = $database->select($sql, $parameters, 'all');
|
||||
$tiers = $database->select($sql, $parameters ?? null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//add an empty row to the tiers array
|
||||
@@ -560,7 +560,7 @@
|
||||
for ($x = 0; $x < $rows; $x++) {
|
||||
$tiers[$id]['call_center_tier_uuid'] = uuid();
|
||||
$tiers[$id]['call_center_agent_uuid'] = '';
|
||||
$tiers[$id]['call_center_queue_uuid'] = $call_center_queue_uuid;
|
||||
$tiers[$id]['call_center_queue_uuid'] = $call_center_queue_uuid ?? null;
|
||||
$tiers[$id]['tier_level'] = '';
|
||||
$tiers[$id]['tier_position'] = '';
|
||||
$tiers[$id]['agent_name'] = '';
|
||||
@@ -573,7 +573,7 @@
|
||||
$sql .= "order by agent_name asc";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$agents = $database->select($sql, $parameters, 'all');
|
||||
$agents = $database->select($sql, $parameters ?? null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//get the sounds
|
||||
@@ -605,7 +605,7 @@
|
||||
$sql .= "order by recording_name asc ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
$database = new database;
|
||||
$recordings = $database->select($sql, $parameters, 'all');
|
||||
$recordings = $database->select($sql, $parameters ?? null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//get the phrases
|
||||
@@ -613,7 +613,7 @@
|
||||
$sql .= "where (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$parameters['domain_uuid'] = $domain_uuid;
|
||||
$database = new database;
|
||||
$phrases = $database->select($sql, $parameters, 'all');
|
||||
$phrases = $database->select($sql, $parameters ?? null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//show the header
|
||||
@@ -626,7 +626,7 @@
|
||||
require_once "resources/header.php";
|
||||
|
||||
//only allow a uuid
|
||||
if (!is_uuid($call_center_queue_uuid)) {
|
||||
if (!empty($call_center_queue_uuid) && !is_uuid($call_center_queue_uuid)) {
|
||||
$call_center_queue_uuid = null;
|
||||
}
|
||||
|
||||
@@ -698,7 +698,7 @@
|
||||
echo " ".$text['label-queue_name']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td width='70%' class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='queue_name' maxlength='255' value=\"".escape($queue_name)."\" required='required'>\n";
|
||||
echo " <input class='formfld' type='text' name='queue_name' maxlength='255' value=\"".escape($queue_name ?? '')."\" required='required'>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-queue_name']."\n";
|
||||
echo "</td>\n";
|
||||
@@ -709,7 +709,7 @@
|
||||
echo " ".$text['label-extension']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='number' name='queue_extension' maxlength='255' min='0' step='1' value=\"".escape($queue_extension)."\" required='required'>\n";
|
||||
echo " <input class='formfld' type='number' name='queue_extension' maxlength='255' min='0' step='1' value=\"".escape($queue_extension ?? '')."\" required='required'>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-extension']."\n";
|
||||
echo "</td>\n";
|
||||
@@ -809,7 +809,7 @@
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
if (permission_exists('call_center_tier_view') && is_array($agents) && count($agents) > 0) {
|
||||
if (permission_exists('call_center_tier_view') && !empty($agents)) {
|
||||
echo "<tr>";
|
||||
echo " <td class='vncell' valign='top'>".$text['label-agents']."</td>";
|
||||
echo " <td class='vtable' align='left'>";
|
||||
@@ -821,7 +821,7 @@
|
||||
echo " <td></td>\n";
|
||||
echo " </tr>\n";
|
||||
$x = 0;
|
||||
if (is_array($tiers)) {
|
||||
if (!empty($tiers)) {
|
||||
foreach($tiers as $field) {
|
||||
echo " <tr>\n";
|
||||
echo " <td class=''>";
|
||||
@@ -948,7 +948,7 @@
|
||||
echo " ".$text['label-time_base_score_sec']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='number' name='queue_time_base_score_sec' maxlength='255' min='0' step='1' value='".escape($queue_time_base_score_sec)."'>\n";
|
||||
echo " <input class='formfld' type='number' name='queue_time_base_score_sec' maxlength='255' min='0' step='1' value='".escape($queue_time_base_score_sec ?? '')."'>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-time_base_score_sec']."\n";
|
||||
echo "</td>\n";
|
||||
@@ -992,7 +992,7 @@
|
||||
echo " ".$text['label-timeout_action']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo $destination->select('dialplan', 'queue_timeout_action', $queue_timeout_action);
|
||||
echo $destination->select('dialplan', 'queue_timeout_action', !empty($queue_timeout_action));
|
||||
echo "<br />\n";
|
||||
echo $text['description-timeout_action']."\n";
|
||||
echo "</td>\n";
|
||||
@@ -1121,7 +1121,7 @@
|
||||
echo " ".$text['label-caller_id_name_prefix']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='queue_cid_prefix' maxlength='255' value='".escape($queue_cid_prefix)."'>\n";
|
||||
echo " <input class='formfld' type='text' name='queue_cid_prefix' maxlength='255' value='".escape($queue_cid_prefix ?? '')."'>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-caller_id_name_prefix']."\n";
|
||||
echo "</td>\n";
|
||||
@@ -1196,8 +1196,8 @@
|
||||
$script .= " tb.name=obj.name;\n";
|
||||
$script .= " tb.className='formfld';\n";
|
||||
$script .= " tb.setAttribute('id', '".$destination_id."');\n";
|
||||
$script .= " tb.setAttribute('style', '".$select_style."');\n";
|
||||
if ($on_change != '') {
|
||||
$script .= " tb.setAttribute('style', '".!empty($select_style)."');\n";
|
||||
if (!empty($on_change)) {
|
||||
$script .= " tb.setAttribute('onchange', \"".$on_change."\");\n";
|
||||
$script .= " tb.setAttribute('onkeyup', \"".$on_change."\");\n";
|
||||
}
|
||||
@@ -1221,7 +1221,7 @@
|
||||
$script .= " obj[0].parentNode.removeChild(obj[1]);\n";
|
||||
$script .= " obj[0].parentNode.removeChild(obj[2]);\n";
|
||||
$script .= " document.getElementById('btn_select_to_input_".$destination_id."').style.visibility = 'visible';\n";
|
||||
if ($on_change != '') {
|
||||
if (!empty($on_change)) {
|
||||
$script .= " ".$on_change.";\n";
|
||||
}
|
||||
$script .= "}\n";
|
||||
@@ -1234,7 +1234,7 @@
|
||||
|
||||
//recordings
|
||||
$tmp_selected = false;
|
||||
if (is_array($recordings)) {
|
||||
if (!empty($recordings)) {
|
||||
echo "<optgroup label='Recordings'>\n";
|
||||
foreach ($recordings as &$row) {
|
||||
$recording_name = $row["recording_name"];
|
||||
@@ -1287,7 +1287,7 @@
|
||||
echo " ".$text['label-caller_announce_frequency']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='number' name='queue_announce_frequency' maxlength='255' min='0' step='1' value='".escape($queue_announce_frequency)."'>\n";
|
||||
echo " <input class='formfld' type='number' name='queue_announce_frequency' maxlength='255' min='0' step='1' value='".escape($queue_announce_frequency ?? '')."'>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-caller_announce_frequency']."\n";
|
||||
echo "</td>\n";
|
||||
@@ -1299,7 +1299,7 @@
|
||||
echo " ".$text['label-exit_keys']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='queue_cc_exit_keys' value='".escape($queue_cc_exit_keys)."'>\n";
|
||||
echo " <input class='formfld' type='text' name='queue_cc_exit_keys' value='".escape($queue_cc_exit_keys ?? '')."'>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-exit_keys']."\n";
|
||||
echo "</td>\n";
|
||||
@@ -1323,7 +1323,7 @@
|
||||
echo " ".$text['label-description']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='queue_description' maxlength='255' value=\"".escape($queue_description)."\">\n";
|
||||
echo " <input class='formfld' type='text' name='queue_description' maxlength='255' value=\"".escape($queue_description ?? '')."\">\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-description']."\n";
|
||||
echo "</td>\n";
|
||||
|
||||
@@ -46,15 +46,18 @@
|
||||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//set from session variables
|
||||
$list_row_edit_button = !empty($_SESSION['theme']['list_row_edit_button']['boolean']) ? $_SESSION['theme']['list_row_edit_button']['boolean'] : 'false';
|
||||
|
||||
//get posted data
|
||||
if (is_array($_POST['call_center_queues'])) {
|
||||
if (!empty($_POST['call_center_queues'])) {
|
||||
$action = $_POST['action'];
|
||||
$search = $_POST['search'];
|
||||
$call_center_queues = $_POST['call_center_queues'];
|
||||
}
|
||||
|
||||
//process the http post data by action
|
||||
if ($action != '' && is_array($call_center_queues) && @sizeof($call_center_queues) != 0) {
|
||||
if (!empty($action) && !empty($call_center_queues)) {
|
||||
switch ($action) {
|
||||
case 'copy':
|
||||
if (permission_exists('call_center_queue_add')) {
|
||||
@@ -75,11 +78,11 @@
|
||||
}
|
||||
|
||||
//get http variables and set as php variables
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
$order_by = $_GET["order_by"] ?? '';
|
||||
$order = $_GET["order"] ?? '';
|
||||
|
||||
//add the search term
|
||||
$search = strtolower($_GET["search"]);
|
||||
$search = strtolower($_GET["search"] ?? '');
|
||||
if (!empty($search)) {
|
||||
$sql_search = " (";
|
||||
$sql_search .= "lower(queue_name) like :search ";
|
||||
@@ -91,23 +94,23 @@
|
||||
//get total call center queues count from the database
|
||||
$sql = "select count(*) from v_call_center_queues ";
|
||||
$sql .= "where true ";
|
||||
if ($_GET['show'] != "all" || !permission_exists('call_center_all')) {
|
||||
if (!empty($_GET['show']) != "all" || !permission_exists('call_center_all')) {
|
||||
$sql .= "and (domain_uuid = :domain_uuid or domain_uuid is null) ";
|
||||
$parameters['domain_uuid'] = $_SESSION['domain_uuid'];
|
||||
}
|
||||
if (isset($sql_search)) {
|
||||
if (!empty($sql_search)) {
|
||||
$sql .= "and ".$sql_search;
|
||||
}
|
||||
$database = new database;
|
||||
$num_rows = $database->select($sql, $parameters, 'column');
|
||||
$num_rows = $database->select($sql, $parameters ?? null, 'column');
|
||||
|
||||
//prepare to page the results
|
||||
$rows_per_page = ($_SESSION['domain']['paging']['numeric'] != '') ? $_SESSION['domain']['paging']['numeric'] : 50;
|
||||
$param = "&search=".urlencode($search);
|
||||
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
|
||||
if (!empty($_GET['show']) == "all" && permission_exists('call_center_all')) {
|
||||
$param .= "&show=all";
|
||||
}
|
||||
$page = $_GET['page'];
|
||||
$page = $_GET['page'] ?? '';
|
||||
if (empty($page)) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page) = paging($num_rows, $param, $rows_per_page);
|
||||
list($paging_controls_mini, $rows_per_page) = paging($num_rows, $param, $rows_per_page, true);
|
||||
@@ -118,7 +121,7 @@
|
||||
$sql .= order_by($order_by, $order, 'queue_name', 'asc');
|
||||
$sql .= limit_offset($rows_per_page, $offset);
|
||||
$database = new database;
|
||||
$result = $database->select($sql, $parameters, 'all');
|
||||
$result = $database->select($sql, $parameters ?? null, 'all');
|
||||
unset($sql, $parameters);
|
||||
|
||||
//create token
|
||||
@@ -143,21 +146,21 @@
|
||||
echo button::create(['type'=>'button','label'=>$text['button-wallboard'],'icon'=>'th','link'=>PROJECT_PATH.'/app/call_center_wallboard/call_center_wallboard.php']);
|
||||
}
|
||||
$margin_left = permission_exists('call_center_agent_view') || permission_exists('call_center_wallboard') ? 'margin-left: 15px;' : null;
|
||||
if (permission_exists('call_center_queue_add') && (!is_numeric($_SESSION['limit']['call_center_queues']['numeric']) || $num_rows <= $_SESSION['limit']['call_center_queues']['numeric'])) {
|
||||
if (permission_exists('call_center_queue_add') && (!is_numeric($_SESSION['limit']['call_center_queues']['numeric'] ?? '') || $num_rows <= $_SESSION['limit']['call_center_queues']['numeric'])) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'id'=>'btn_add','style'=>$margin_left,'link'=>'call_center_queue_edit.php']);
|
||||
unset($margin_left);
|
||||
}
|
||||
if (permission_exists('call_center_queue_add') && $result && (!is_numeric($_SESSION['limit']['call_center_queues']['numeric']) || $num_rows <= $_SESSION['limit']['call_center_queues']['numeric'])) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none; '.$margin_left,'onclick'=>"modal_open('modal-copy','btn_copy');"]);
|
||||
if (permission_exists('call_center_queue_add') && $result && (!is_numeric($_SESSION['limit']['call_center_queues']['numeric'] ?? '') || $num_rows <= $_SESSION['limit']['call_center_queues']['numeric'])) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-copy'],'icon'=>$_SESSION['theme']['button_icon_copy'],'id'=>'btn_copy','name'=>'btn_copy','style'=>'display: none; '.!empty($margin_left),'onclick'=>"modal_open('modal-copy','btn_copy');"]);
|
||||
unset($margin_left);
|
||||
}
|
||||
if (permission_exists('call_center_queue_delete') && $result) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; '.$margin_left,'onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'id'=>'btn_delete','name'=>'btn_delete','style'=>'display: none; '.!empty($margin_left),'onclick'=>"modal_open('modal-delete','btn_delete');"]);
|
||||
unset($margin_left);
|
||||
}
|
||||
echo "<form id='form_search' class='inline' method='get'>\n";
|
||||
if (permission_exists('call_center_all')) {
|
||||
if ($_GET['show'] == 'all') {
|
||||
if (!empty($_GET['show']) == 'all') {
|
||||
echo " <input type='hidden' name='show' value='all'>";
|
||||
}
|
||||
else {
|
||||
@@ -175,7 +178,7 @@
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
if (permission_exists('call_center_queue_add') && $result && (!is_numeric($_SESSION['limit']['call_center_queues']['numeric']) || $num_rows <= $_SESSION['limit']['call_center_queues']['numeric'])) {
|
||||
if (permission_exists('call_center_queue_add') && $result && (!is_numeric($_SESSION['limit']['call_center_queues']['numeric'] ?? '') || $num_rows <= $_SESSION['limit']['call_center_queues']['numeric'])) {
|
||||
echo modal::create(['id'=>'modal-copy','type'=>'copy','actions'=>button::create(['type'=>'button','label'=>$text['button-continue'],'icon'=>'check','id'=>'btn_copy','style'=>'float: right; margin-left: 15px;','collapse'=>'never','onclick'=>"modal_close(); list_action_set('copy'); list_form_submit('form_list');"])]);
|
||||
}
|
||||
if (permission_exists('call_center_queue_delete') && $result) {
|
||||
@@ -193,10 +196,10 @@
|
||||
echo "<tr class='list-header'>\n";
|
||||
if (permission_exists('call_center_queue_add') || permission_exists('call_center_queue_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".($result ?: "style='visibility: hidden;'").">\n";
|
||||
echo " <input type='checkbox' id='checkbox_all' name='checkbox_all' onclick='list_all_toggle(); checkbox_on_change(this);' ".(!empty($result) ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
|
||||
if (!empty($_GET['show']) == "all" && permission_exists('call_center_all')) {
|
||||
echo th_order_by('domain_name', $text['label-domain'], $order_by, $order, $param, "class='shrink'");
|
||||
}
|
||||
echo th_order_by('queue_name', $text['label-queue_name'], $order_by, $order);
|
||||
@@ -215,12 +218,12 @@
|
||||
//echo th_order_by('queue_abandoned_resume_allowed', $text['label-abandoned_resume_allowed'], $order_by, $order);
|
||||
//echo th_order_by('queue_tier_rule_wait_multiply_level', $text['label-tier_rule_wait_multiply_level'], $order_by, $order);
|
||||
echo th_order_by('queue_description', $text['label-description'], $order_by, $order, null, "class='hide-sm-dn'");
|
||||
if (permission_exists('call_center_queue_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
if (permission_exists('call_center_queue_edit') && $list_row_edit_button == 'true') {
|
||||
echo " <td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
|
||||
if (is_array($result)) {
|
||||
if (!empty($result)) {
|
||||
$x = 0;
|
||||
foreach($result as $row) {
|
||||
if (permission_exists('call_center_queue_edit')) {
|
||||
@@ -233,7 +236,7 @@
|
||||
echo " <input type='hidden' name='call_center_queues[$x][uuid]' value='".escape($row['call_center_queue_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
if ($_GET['show'] == "all" && permission_exists('call_center_all')) {
|
||||
if (!empty($_GET['show']) == "all" && permission_exists('call_center_all')) {
|
||||
if (!empty($_SESSION['domains'][$row['domain_uuid']]['domain_name'])) {
|
||||
$domain = $_SESSION['domains'][$row['domain_uuid']]['domain_name'];
|
||||
}
|
||||
@@ -265,7 +268,7 @@
|
||||
//echo " <td>".escape($row[queue_abandoned_resume_allowed])." </td>\n";
|
||||
//echo " <td>".escape($row[queue_tier_rule_wait_multiply_level])." </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row['queue_description'])."</td>\n";
|
||||
if (permission_exists('call_center_queue_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
if (permission_exists('call_center_queue_edit') && $list_row_edit_button == 'true') {
|
||||
echo " <td class='action-button'>";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
|
||||
Reference in New Issue
Block a user