mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 09:03:49 +00:00
Moved Tier management to Queue Edit page, remove Tier view and delete files. Hide Voicemail Forward Destination field until development complete.
This commit is contained in:
@@ -35,16 +35,6 @@
|
||||
$text['title-call_center_agent_status']['pt-pt'] = "Estado do Agente do Call Center";
|
||||
$text['title-call_center_agent_status']['fr-fr'] = "Etat de l'agent";
|
||||
|
||||
$text['title-call_center_tiers']['en-us'] = "Call Center Tiers";
|
||||
$text['title-call_center_tiers']['es-cl'] = "Niveles de Centro de Llamados";
|
||||
$text['title-call_center_tiers']['pt-pt'] = "Níveis do Call Center";
|
||||
$text['title-call_center_tiers']['fr-fr'] = "Tiers";
|
||||
|
||||
$text['title-call_center_tier_add']['en-us'] = "Call Center Tier Add";
|
||||
$text['title-call_center_tier_add']['es-cl'] = "Agregar Nivel de Centro de Llamados";
|
||||
$text['title-call_center_tier_add']['pt-pt'] = "Adicionar Nível ao Call Center";
|
||||
$text['title-call_center_tier_add']['fr-fr'] = "Ajouter un Tier";
|
||||
|
||||
$text['title-call_center_tier_edit']['en-us'] = "Call Center Tier Edit";
|
||||
$text['title-call_center_tier_edit']['es-cl'] = "Editar Nivel de Centro de Llamados";
|
||||
$text['title-call_center_tier_edit']['pt-pt'] = "Editar Nível do Call Center";
|
||||
@@ -85,16 +75,6 @@
|
||||
$text['header-call_center_agent_status']['pt-pt'] = "Estado do Agente do Call Center";
|
||||
$text['header-call_center_agent_status']['fr-fr'] = "Etat de l'agent";
|
||||
|
||||
$text['header-call_center_tiers']['en-us'] = "Call Center Tiers";
|
||||
$text['header-call_center_tiers']['es-cl'] = "Niveles de Centro de Llamados";
|
||||
$text['header-call_center_tiers']['pt-pt'] = "Níveis do Call Center";
|
||||
$text['header-call_center_tiers']['fr-fr'] = "Tiers";
|
||||
|
||||
$text['header-call_center_tier_add']['en-us'] = "Call Center Tier Add";
|
||||
$text['header-call_center_tier_add']['es-cl'] = "Agregar Nivel de Centro de Llamados";
|
||||
$text['header-call_center_tier_add']['pt-pt'] = "Adicionar Nível ao Call Center";
|
||||
$text['header-call_center_tier_add']['fr-fr'] = "Ajouter un Tier";
|
||||
|
||||
$text['header-call_center_tier_edit']['en-us'] = "Call Center Tier Edit";
|
||||
$text['header-call_center_tier_edit']['es-cl'] = "Editar Nivel de Centro de Llamados";
|
||||
$text['header-call_center_tier_edit']['pt-pt'] = "Editar Nível do Call Center";
|
||||
@@ -115,11 +95,6 @@
|
||||
$text['description-call_center_agent_status']['pt-pt'] = "Lista todas as chamadas do Call Center com a opção de alterar o estado de um ou mais agentes.";
|
||||
$text['description-call_center_agent_status']['fr-fr'] = "Liste tous les agents du centre d'appel avec la possibilité de modifier l'état d'un ou plusieur agent.";
|
||||
|
||||
$text['description-call_center_tiers']['en-us'] = "List all tiers. Tiers assign agents to queues.";
|
||||
$text['description-call_center_tiers']['es-cl'] = "Lista todos los niveles. Los niveles asignan agentes a las colas.";
|
||||
$text['description-call_center_tiers']['pt-pt'] = "Lista todos os níveis. Os níveis atribuem agentes às filas.";
|
||||
$text['description-call_center_tiers']['fr-fr'] = "Liste tous les Tiers. Les Tiers permettent d'affecter les agents aux queues.";
|
||||
|
||||
$text['label-queue_name']['en-us'] = "Queue Name";
|
||||
$text['label-queue_name']['es-cl'] = "Nombre de Cola";
|
||||
$text['label-queue_name']['pt-pt'] = "Nome da Fila";
|
||||
@@ -169,6 +144,11 @@
|
||||
$text['label-record_template']['pt-pt'] = "Gravar Template";
|
||||
$text['label-record_template']['fr-fr'] = "Modèle d'enregistrement";
|
||||
|
||||
$text['label-tiers']['en-us'] = "Tiers";
|
||||
$text['label-tiers']['es-cl'] = "Niveles de Centro de Llamados";
|
||||
$text['label-tiers']['pt-pt'] = "Níveis do Call Center";
|
||||
$text['label-tiers']['fr-fr'] = "Tiers";
|
||||
|
||||
$text['label-time_base_score']['en-us'] = "Time Base Score";
|
||||
$text['label-time_base_score']['es-cl'] = "Puntuación basada en tiempo";
|
||||
$text['label-time_base_score']['pt-pt'] = "Pontuação baseada no tempo";
|
||||
@@ -335,6 +315,11 @@
|
||||
$text['description-record_template']['pt-pt'] = "Introduza um template de gravação. \$\${base_dir}/recordings/archive/\${strftime(%Y)}/\${strftime(%b)}/\${strftime(%d)}/\${uuid}.wav";
|
||||
$text['description-record_template']['fr-fr'] = "Entrer un modèle d\'enregistrement. \$\${base_dir}/recordings/archive/\${strftime(%Y)}/\${strftime(%b)}/\${strftime(%d)}/\${uuid}.wav";
|
||||
|
||||
$text['description-tiers']['en-us'] = "Tiers assign agents to queues.";
|
||||
$text['description-tiers']['es-cl'] = "Lista todos los niveles. Los niveles asignan agentes a las colas.";
|
||||
$text['description-tiers']['pt-pt'] = "Lista todos os níveis. Os níveis atribuem agentes às filas.";
|
||||
$text['description-tiers']['fr-fr'] = "Liste tous les Tiers. Les Tiers permettent d'affecter les agents aux queues.";
|
||||
|
||||
$text['description-time_base_score']['en-us'] = "Select the time base score.";
|
||||
$text['description-time_base_score']['es-cl'] = "Seleccione el tiempo base";
|
||||
$text['description-time_base_score']['pt-pt'] = "Seleccione o tempo base ";
|
||||
@@ -400,7 +385,7 @@
|
||||
$text['description-description']['pt-pt'] = "Introduza uma descrição, se desejar.";
|
||||
$text['description-description']['fr-fr'] = "";
|
||||
|
||||
$text['description-agent_name']['en-us'] = "Select the agents name.";
|
||||
$text['description-agent_name']['en-us'] = "Select the agent name.";
|
||||
$text['description-agent_name']['es-cl'] = "Seleccione el nombre del agente.";
|
||||
$text['description-agent_name']['pt-pt'] = "Seleccione o nome dos agentes.";
|
||||
$text['description-agent_name']['fr-fr'] = "";
|
||||
|
||||
@@ -83,6 +83,51 @@ else {
|
||||
$queue_cid_prefix = str_replace("/", "", $queue_cid_prefix);
|
||||
}
|
||||
|
||||
//delete the tier (agent from the queue)
|
||||
if ($_REQUEST["delete_type"] == "tier" && strlen($_REQUEST["delete_uuid"]) > 0 && permission_exists("call_center_tier_delete")) {
|
||||
//set the variables
|
||||
$call_center_queue_uuid = check_str($_REQUEST["id"]);
|
||||
$tier_uuid = check_str($_REQUEST["delete_uuid"]);
|
||||
//get the agent details
|
||||
$sql = "
|
||||
select
|
||||
agent_name,
|
||||
queue_name
|
||||
from
|
||||
v_call_center_tiers
|
||||
where
|
||||
domain_uuid = '".$domain_uuid."' and
|
||||
call_center_tier_uuid = '".$tier_uuid."'
|
||||
";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$agent_name = $row["agent_name"];
|
||||
$queue_name = $row["queue_name"];
|
||||
break; //limit to 1 row
|
||||
}
|
||||
unset ($prep_statement);
|
||||
//delete the agent from freeswitch
|
||||
//get the domain using the $domain_uuid
|
||||
$tmp_domain = $_SESSION['domains'][$domain_uuid]['domain_name'];
|
||||
//setup the event socket connection
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
//delete the agent over event socket
|
||||
if ($fp) {
|
||||
//callcenter_config tier del [queue_name] [agent_name]
|
||||
$cmd = "api callcenter_config tier del ".$queue_name."@".$tmp_domain." ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name'];
|
||||
$response = event_socket_request($fp, $cmd);
|
||||
}
|
||||
//delete the tier from the database
|
||||
if (strlen($tier_uuid)>0) {
|
||||
$sql = "delete from v_call_center_tiers where domain_uuid = '".$domain_uuid."' and call_center_tier_uuid = '".$tier_uuid."'";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
unset($sql);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
@@ -188,8 +233,6 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
}
|
||||
|
||||
$_SESSION["message"] = $text['message-add'];
|
||||
header("Location: call_center_queues.php");
|
||||
return;
|
||||
} //if ($action == "add")
|
||||
|
||||
if ($action == "update") {
|
||||
@@ -229,9 +272,72 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
}
|
||||
|
||||
$_SESSION["message"] = $text['message-update'];
|
||||
header("Location: call_center_queues.php");
|
||||
return;
|
||||
} //if ($action == "update")
|
||||
|
||||
//add agent/tier to queue
|
||||
$agent_name = check_str($_POST["agent_name"]);
|
||||
$tier_level = check_str($_POST["tier_level"]);
|
||||
$tier_position = check_str($_POST["tier_position"]);
|
||||
|
||||
if ($agent_name != '') {
|
||||
//add the agent
|
||||
//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
|
||||
if ($fp) {
|
||||
//get the domain using the $domain_uuid
|
||||
$tmp_domain = $_SESSION['domains'][$domain_uuid]['domain_name'];
|
||||
/* syntax:
|
||||
callcenter_config tier add [queue_name] [agent_name] [level] [position]
|
||||
callcenter_config tier set state [queue_name] [agent_name] [state]
|
||||
callcenter_config tier set level [queue_name] [agent_name] [level]
|
||||
callcenter_config tier set position [queue_name] [agent_name] [position]
|
||||
*/
|
||||
//add the agent
|
||||
$cmd = "api callcenter_config tier add ".$queue_name."@".$tmp_domain." ".$agent_name."@".$tmp_domain." ".$tier_level." ".$tier_position;
|
||||
$response = event_socket_request($fp, $cmd);
|
||||
usleep(200);
|
||||
//agent set level
|
||||
$cmd = "api callcenter_config tier set level ".$queue_name."@".$tmp_domain." ".$agent_name."@".$tmp_domain." ".$tier_level;
|
||||
$response = event_socket_request($fp, $cmd);
|
||||
usleep(200);
|
||||
//agent set position
|
||||
$cmd = "api callcenter_config tier set position ".$queue_name."@".$tmp_domain." ".$agent_name."@".$tmp_domain." ".$tier_position;
|
||||
$response = event_socket_request($fp, $cmd);
|
||||
usleep(200);
|
||||
}
|
||||
|
||||
//add tier to database
|
||||
$call_center_tier_uuid = uuid();
|
||||
$sql = "insert into v_call_center_tiers ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "call_center_tier_uuid, ";
|
||||
$sql .= "agent_name, ";
|
||||
$sql .= "queue_name, ";
|
||||
$sql .= "tier_level, ";
|
||||
$sql .= "tier_position ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$domain_uuid', ";
|
||||
$sql .= "'$call_center_tier_uuid', ";
|
||||
$sql .= "'$agent_name', ";
|
||||
$sql .= "'$queue_name', ";
|
||||
$sql .= "'$tier_level', ";
|
||||
$sql .= "'$tier_position' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//syncrhonize configuration
|
||||
save_call_center_xml();
|
||||
}
|
||||
|
||||
//redirect
|
||||
header("Location: call_center_queue_edit.php?id=".$call_center_queue_uuid);
|
||||
return;
|
||||
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
|
||||
@@ -318,7 +424,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " <input type='button' class='btn' value='".$text['button-unload']."' onclick=\"document.location.href='cmd.php?cmd=api+callcenter_config+queue+unload+$queue_name@".$_SESSION['domain_name']."';\" />\n";
|
||||
echo " <input type='button' class='btn' value='".$text['button-reload']."' onclick=\"document.location.href='cmd.php?cmd=api+callcenter_config+queue+reload+$queue_name@".$_SESSION['domain_name']."';\" />\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
@@ -417,6 +523,100 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
if (permission_exists('call_center_tier_view')) {
|
||||
|
||||
echo "<tr>";
|
||||
echo " <td class='vncell' valign='top'>".$text['label-tiers'].":</td>";
|
||||
echo " <td class='vtable' align='left'>";
|
||||
echo " <table width='45%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vtable'>".$text['label-agent_name']."</td>\n";
|
||||
echo " <td class='vtable' style='text-align: center;'>".$text['label-tier_level']."</td>\n";
|
||||
echo " <td class='vtable' style='text-align: center;'>".$text['label-tier_position']."</td>\n";
|
||||
echo " <td></td>\n";
|
||||
echo " </tr>\n";
|
||||
|
||||
if ($call_center_queue_uuid != '') {
|
||||
|
||||
$sql = "select * from v_call_center_tiers where queue_name = '".$queue_name."' and domain_uuid = '".$domain_uuid."' order by tier_level asc, tier_position asc, agent_name asc";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count = count($result);
|
||||
foreach($result as $field) {
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vtable'>".$field['agent_name']."</td>\n";
|
||||
echo " <td class='vtable' style='text-align: center;'>".$field['tier_level']." </td>\n";
|
||||
echo " <td class='vtable' style='text-align: center;'>".$field['tier_position']." </td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('call_center_tier_edit')) {
|
||||
echo "<a href='call_center_tier_edit.php?id=".$field['call_center_tier_uuid']."' alt='".$text['button-edit']."'>".$v_link_label_edit."</a>";
|
||||
}
|
||||
if (permission_exists('call_center_tier_delete')) {
|
||||
echo "<a href='#' onclick=\"if (confirm('".$text['confirm-delete']."')) { document.getElementById('delete_type').value = 'tier'; document.getElementById('delete_uuid').value = '".$field['call_center_tier_uuid']."'; document.forms.frm.submit(); }\" alt='".$text['button-delete']."'>".$v_link_label_delete."</a>";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
$assigned_agents[] = $field['agent_name'];
|
||||
}
|
||||
unset ($prep_statement, $sql, $result);
|
||||
|
||||
}
|
||||
|
||||
if (permission_exists('call_center_tier_add')) {
|
||||
|
||||
//get agents
|
||||
$sql = "select agent_name from v_call_center_agents where domain_uuid = '".$domain_uuid."' ";
|
||||
foreach($assigned_agents as $assigned_agent) {
|
||||
$sql .= "and agent_name <> '".$assigned_agent."' ";
|
||||
}
|
||||
$sql .= "order by agent_name asc";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
|
||||
if (sizeof($result)>0) {
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vtable'>\n";
|
||||
echo " <select id='agent_name' name='agent_name' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
foreach($result as $field) {
|
||||
echo " <option value='".$field['agent_name']."'>".$field['agent_name']."</option>\n";
|
||||
}
|
||||
unset($sql, $result);
|
||||
echo " </select>";
|
||||
echo " </td>\n";
|
||||
echo " <td class='vtable' style='text-align: center;'>\n";
|
||||
echo " <select class='formfld' name='tier_level'>\n";
|
||||
for ($t = 1; $t <= 9; $t++) {
|
||||
echo " <option value='".$t."'>".$t."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
echo " <td class='vtable' style='text-align: center;'>\n";
|
||||
echo " <select class='formfld' name='tier_position'>\n";
|
||||
for ($t = 1; $t <= 9; $t++) {
|
||||
echo " <option value='".$t."'>".$t."</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo " </td>\n";
|
||||
echo " <td>";
|
||||
echo " <input type=\"submit\" class='btn' value=\"".$text['button-add']."\">\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo " </table>\n";
|
||||
echo " <br>\n";
|
||||
echo " ".$text['description-tiers']."\n";
|
||||
echo " <br />\n";
|
||||
echo " </td>";
|
||||
echo "</tr>";
|
||||
|
||||
}
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
|
||||
echo " ".$text['label-music_on_hold'].":\n";
|
||||
@@ -693,9 +893,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
if ($action == "update") {
|
||||
echo " <input type='hidden' name='call_center_queue_uuid' value='$call_center_queue_uuid'>\n";
|
||||
echo " <input type='hidden' name='call_center_queue_uuid' value='".$call_center_queue_uuid."'>\n";
|
||||
echo " <input type='hidden' name='id' id='id' value='".$call_center_queue_uuid."'>";
|
||||
echo " <input type='hidden' name='delete_type' id='delete_type' value=''>";
|
||||
echo " <input type='hidden' name='delete_uuid' id='delete_uuid' value=''>";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo " <input type='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('call_center_tier_delete')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
require_once "app_languages.php";
|
||||
foreach($text as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
//get the id
|
||||
if (count($_GET)>0) {
|
||||
$id = check_str($_GET["id"]);
|
||||
}
|
||||
|
||||
//get the agent details
|
||||
$sql = "select * from v_call_center_tiers ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and call_center_tier_uuid = '$id' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$agent_name = $row["agent_name"];
|
||||
$queue_name = $row["queue_name"];
|
||||
break; //limit to 1 row
|
||||
}
|
||||
unset ($prep_statement);
|
||||
|
||||
//delete the agent from the freeswitch
|
||||
//get the domain using the $domain_uuid
|
||||
$tmp_domain = $_SESSION['domains'][$domain_uuid]['domain_name'];
|
||||
//setup the event socket connection
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
//delete the agent over event socket
|
||||
if ($fp) {
|
||||
//callcenter_config tier del [queue_name] [agent_name]
|
||||
$cmd = "api callcenter_config tier del ".$queue_name."@".$tmp_domain." ".$agent_name."@".$_SESSION['domains'][$domain_uuid]['domain_name'];
|
||||
$response = event_socket_request($fp, $cmd);
|
||||
}
|
||||
|
||||
//delete the tier from the database
|
||||
if (strlen($id)>0) {
|
||||
$sql = "delete from v_call_center_tiers ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and call_center_tier_uuid = '$id' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
|
||||
$_SESSION["message"] = $text['message-delete'];
|
||||
header("Location: call_center_tiers.php");
|
||||
return;
|
||||
?>
|
||||
@@ -40,14 +40,8 @@ else {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
//action add or update
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
$call_center_tier_uuid = check_str($_REQUEST["id"]);
|
||||
}
|
||||
else {
|
||||
$action = "add";
|
||||
}
|
||||
//set tier uuid
|
||||
$call_center_tier_uuid = check_str($_REQUEST["id"]);
|
||||
|
||||
//get http post variables and set them to php variables
|
||||
if (count($_POST)>0) {
|
||||
@@ -60,9 +54,7 @@ else {
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
if ($action == "update") {
|
||||
$call_center_tier_uuid = check_str($_POST["call_center_tier_uuid"]);
|
||||
}
|
||||
$call_center_tier_uuid = check_str($_POST["call_center_tier_uuid"]);
|
||||
|
||||
//check for all required data
|
||||
//if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid<br>\n"; }
|
||||
@@ -109,63 +101,39 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
usleep(200);
|
||||
}
|
||||
|
||||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
if ($action == "add") {
|
||||
$call_center_tier_uuid = uuid();
|
||||
$sql = "insert into v_call_center_tiers ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "call_center_tier_uuid, ";
|
||||
$sql .= "agent_name, ";
|
||||
$sql .= "queue_name, ";
|
||||
$sql .= "tier_level, ";
|
||||
$sql .= "tier_position ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$domain_uuid', ";
|
||||
$sql .= "'$call_center_tier_uuid', ";
|
||||
$sql .= "'$agent_name', ";
|
||||
$sql .= "'$queue_name', ";
|
||||
$sql .= "'$tier_level', ";
|
||||
$sql .= "'$tier_position' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
//update the database
|
||||
$sql = "update v_call_center_tiers set ";
|
||||
$sql .= "domain_uuid = '$domain_uuid', ";
|
||||
$sql .= "agent_name = '$agent_name', ";
|
||||
$sql .= "queue_name = '$queue_name', ";
|
||||
$sql .= "tier_level = '$tier_level', ";
|
||||
$sql .= "tier_position = '$tier_position' ";
|
||||
$sql .= "where call_center_tier_uuid = '$call_center_tier_uuid'";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//syncrhonize configuration
|
||||
save_call_center_xml();
|
||||
//syncrhonize configuration
|
||||
save_call_center_xml();
|
||||
|
||||
$_SESSION["message"] = $text['message-add'];
|
||||
header("Location: call_center_tiers.php");
|
||||
return;
|
||||
} //if ($action == "add")
|
||||
//look up queue uuid by queue name (ugh)
|
||||
$sql = "select call_center_queue_uuid from v_call_center_queues where queue_name = '".$queue_name."'";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$queue_uuid = $row["call_center_queue_uuid"];
|
||||
break;
|
||||
}
|
||||
unset($prep_statement);
|
||||
|
||||
if ($action == "update") {
|
||||
$sql = "update v_call_center_tiers set ";
|
||||
$sql .= "domain_uuid = '$domain_uuid', ";
|
||||
$sql .= "agent_name = '$agent_name', ";
|
||||
$sql .= "queue_name = '$queue_name', ";
|
||||
$sql .= "tier_level = '$tier_level', ";
|
||||
$sql .= "tier_position = '$tier_position' ";
|
||||
$sql .= "where call_center_tier_uuid = '$call_center_tier_uuid'";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
$_SESSION["message"] = $text['message-update'];
|
||||
header("Location: call_center_queue_edit.php?id=".$queue_uuid);
|
||||
return;
|
||||
|
||||
//syncrhonize configuration
|
||||
save_call_center_xml();
|
||||
|
||||
$_SESSION["message"] = $text['message-update'];
|
||||
header("Location: call_center_tiers.php");
|
||||
return;
|
||||
} //if ($action == "update")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
|
||||
//pre-populate the form
|
||||
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
|
||||
$call_center_tier_uuid = $_GET["id"];
|
||||
$sql = "select * from v_call_center_tiers ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and call_center_tier_uuid = '$call_center_tier_uuid' ";
|
||||
@@ -185,12 +153,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//show the header
|
||||
require_once "resources/header.php";
|
||||
if ($action == "add") {
|
||||
$page["title"] = $text['title-call_center_tier_add'];
|
||||
}
|
||||
if ($action == "update") {
|
||||
$page["title"] = $text['title-call_center_tier_edit'];
|
||||
}
|
||||
$page["title"] = $text['title-call_center_tier_edit'];
|
||||
|
||||
//show the content
|
||||
echo "<div align='center'>";
|
||||
@@ -204,14 +167,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
if ($action == "add") {
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['header-call_center_tier_add']."</b></td>\n";
|
||||
}
|
||||
if ($action == "update") {
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['header-call_center_tier_edit']."</b></td>\n";
|
||||
}
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['header-call_center_tier_edit']."</b></td>\n";
|
||||
echo "<td width='70%' align='right'>";
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='call_center_tiers.php'\" value='".$text['button-back']."'>";
|
||||
echo " <input type='button' class='btn' alt='".$text['button-back']."' onclick='history.back();' value='".$text['button-back']."'>";
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
@@ -423,14 +381,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo $text['description-tier_position']."\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
if ($action == "update") {
|
||||
echo " <input type='hidden' name='call_center_tier_uuid' value='$call_center_tier_uuid'>\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "<tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
echo " <input type='hidden' name='call_center_tier_uuid' value='$call_center_tier_uuid'>\n";
|
||||
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
|
||||
|
||||
@@ -1,182 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('call_center_tier_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
require_once "app_languages.php";
|
||||
foreach($text as $key => $value) {
|
||||
$text[$key] = $value[$_SESSION['domain']['language']['code']];
|
||||
}
|
||||
|
||||
require_once "resources/header.php";
|
||||
$page["title"] = $text['title-call_center_tiers'];
|
||||
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//get http variables and set as php variables
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//show the content
|
||||
echo "<div align='center'>";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
|
||||
echo "<tr class='border'>\n";
|
||||
echo " <td align=\"center\">\n";
|
||||
echo " <br>";
|
||||
|
||||
echo "<table width='100%' border='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td width='50%' align='left' nowrap='nowrap'><b>".$text['header-call_center_tiers']."</b></td>\n";
|
||||
echo "<td width='50%' align='right'>\n";
|
||||
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='call_center_queues.php'\" value='".$text['button-back']."'>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' colspan='2'>\n";
|
||||
echo $text['description-call_center_tiers']."<br /><br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</tr></table>\n";
|
||||
|
||||
$sql = "select * from v_call_center_tiers ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
if (strlen($order_by) == 0) {
|
||||
$order_by = 'queue_name';
|
||||
$order = 'asc';
|
||||
}
|
||||
else {
|
||||
$sql .= "order by $order_by $order ";
|
||||
}
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$num_rows = count($result);
|
||||
unset ($prep_statement, $result, $sql);
|
||||
$rows_per_page = 100;
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
$sql = "select * from v_call_center_tiers ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
if (strlen($order_by) == 0) {
|
||||
$order_by = 'queue_name';
|
||||
$order = 'asc';
|
||||
}
|
||||
else {
|
||||
$sql .= "order by $order_by $order ";
|
||||
}
|
||||
$sql .= " limit $rows_per_page offset $offset ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count = count($result);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('agent_name', $text['label-agent_name'], $order_by, $order);
|
||||
echo th_order_by('queue_name', $text['label-queue_name'], $order_by, $order);
|
||||
echo th_order_by('tier_level', $text['label-tier_level'], $order_by, $order);
|
||||
echo th_order_by('tier_position', $text['label-tier_position'], $order_by, $order);
|
||||
echo "<td class='list_control_icons'>";
|
||||
if (permission_exists('call_center_tier_add')) {
|
||||
echo "<a href='call_center_tier_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "<tr>\n";
|
||||
|
||||
if ($result_count == 0) { //no results
|
||||
}
|
||||
else { //received results
|
||||
foreach($result as $row) {
|
||||
echo "<tr >\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_name]." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row[queue_name]." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row[tier_level]." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row[tier_position]." </td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('call_center_tier_edit')) {
|
||||
echo "<a href='call_center_tier_edit.php?id=".$row[call_center_tier_uuid]."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||
}
|
||||
if (permission_exists('call_center_tier_delete')) {
|
||||
echo "<a href='call_center_tier_delete.php?id=".$row[call_center_tier_uuid]."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
} //end foreach
|
||||
unset($sql, $result, $row_count);
|
||||
} //end if results
|
||||
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='6' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('call_center_tier_add')) {
|
||||
echo "<a href='call_center_tier_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<br><br>";
|
||||
echo "<br><br>";
|
||||
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<br><br>";
|
||||
|
||||
//show the footer
|
||||
require_once "resources/footer.php";
|
||||
?>
|
||||
@@ -358,6 +358,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
/*
|
||||
//still in development
|
||||
|
||||
if ($action == "update") {
|
||||
echo " <tr>";
|
||||
echo " <td class='vncell' valign='top'>".$text['label-forward_destinations'].":</td>";
|
||||
@@ -429,6 +432,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
}
|
||||
*/
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
|
||||
Reference in New Issue
Block a user