Call Center Agents: If selected as Contact, show Gateway name instead of UUID.

Call Center Agent Edit: Set width on Contact select box.
This commit is contained in:
Nate Jones 2015-04-14 00:25:59 +00:00
parent 9437791df4
commit bbe24cc75f
2 changed files with 30 additions and 13 deletions

View File

@ -389,7 +389,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
//switch_select_destination(select_type, select_label, select_name, select_value, select_style, action); //switch_select_destination(select_type, select_label, select_name, select_value, select_style, action);
switch_select_destination("call_center_contact", "", "agent_contact", $agent_contact, "", ""); switch_select_destination("call_center_contact", "", "agent_contact", $agent_contact, "width: 350px;", "");
echo "<br />\n"; echo "<br />\n";
echo $text['description-contact']."\n"; echo $text['description-contact']."\n";

View File

@ -119,7 +119,7 @@ else {
//echo th_order_by('agent_busy_delay_time', $text['label-busy_delay_time'], $order_by, $order); //echo th_order_by('agent_busy_delay_time', $text['label-busy_delay_time'], $order_by, $order);
echo "<td class='list_control_icons'>"; echo "<td class='list_control_icons'>";
if (permission_exists('call_center_agent_add')) { if (permission_exists('call_center_agent_add')) {
echo "<a href='call_center_agent_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>"; echo "<a href='call_center_agent_edit.php' alt='".$text['button-add']."'>".$v_link_label_add."</a>";
} }
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@ -128,31 +128,48 @@ else {
} }
else { //received results else { //received results
foreach($result as $row) { foreach($result as $row) {
$tr_link = (permission_exists('call_center_agent_edit')) ? "href='call_center_agent_edit.php?id=".$row[call_center_agent_uuid]."'" : null; $tr_link = (permission_exists('call_center_agent_edit')) ? "href='call_center_agent_edit.php?id=".$row['call_center_agent_uuid']."'" : null;
echo "<tr ".$tr_link.">\n"; echo "<tr ".$tr_link.">\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[domain_uuid]."</td>\n"; //echo " <td valign='top' class='".$row_style[$c]."'>".$row[domain_uuid]."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>"; echo " <td valign='top' class='".$row_style[$c]."'>";
if (permission_exists('call_center_agent_edit')) { if (permission_exists('call_center_agent_edit')) {
echo "<a href='call_center_agent_edit.php?id=".$row[call_center_agent_uuid]."'>".$row[agent_name]."</a>"; echo "<a href='call_center_agent_edit.php?id=".$row['call_center_agent_uuid']."'>".$row['agent_name']."</a>";
} }
else { else {
echo $row[agent_name]; echo $row['agent_name'];
} }
echo " </td>\n"; echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_type]."&nbsp;</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".$row['agent_type']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_call_timeout]."&nbsp;</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".$row['agent_call_timeout']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_contact]."&nbsp;</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_max_no_answer]."&nbsp;</td>\n"; // parse out gateway uuid
echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_status]."&nbsp;</td>\n"; $bridge_statement = explode('/', $row['agent_contact']);
if ($bridge_statement[0] == 'sofia' && $bridge_statement[1] == 'gateway') {
$gateway_uuid = $bridge_statement[2];
// retrieve gateway name from db
$sql = "select gateway from v_gateways where gateway_uuid = '".$gateway_uuid."' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
if (count($result) > 0) { $gateway_name = $result[0]['gateway']; }
unset ($prep_statement, $sql);
echo str_replace($gateway_uuid, $gateway_name, $row['agent_contact']);
}
else {
echo $row['agent_contact'];
}
echo " &nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['agent_max_no_answer']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['agent_status']."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_wrap_up_time]."&nbsp;</td>\n"; //echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_wrap_up_time]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_reject_delay_time]."&nbsp;</td>\n"; //echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_reject_delay_time]."&nbsp;</td>\n";
//echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_busy_delay_time]."&nbsp;</td>\n"; //echo " <td valign='top' class='".$row_style[$c]."'>".$row[agent_busy_delay_time]."&nbsp;</td>\n";
echo " <td class='list_control_icons'>\n"; echo " <td class='list_control_icons'>\n";
if (permission_exists('call_center_agent_edit')) { if (permission_exists('call_center_agent_edit')) {
echo "<a href='call_center_agent_edit.php?id=".$row[call_center_agent_uuid]."' alt='".$text['button-edit']."'>$v_link_label_edit</a>"; echo "<a href='call_center_agent_edit.php?id=".$row['call_center_agent_uuid']."' alt='".$text['button-edit']."'>".$v_link_label_edit."</a>";
} }
if (permission_exists('call_center_agent_delete')) { if (permission_exists('call_center_agent_delete')) {
echo "<a href='call_center_agent_delete.php?id=".$row[call_center_agent_uuid]."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>"; echo "<a href='call_center_agent_delete.php?id=".$row['call_center_agent_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">".$v_link_label_delete."</a>";
} }
//echo " <input type='button' class='btn' name='' alt='edit' onclick=\"window.location='call_center_agent_edit.php?id=".$row[call_center_agent_uuid]."'\" value='e'>\n"; //echo " <input type='button' class='btn' name='' alt='edit' onclick=\"window.location='call_center_agent_edit.php?id=".$row[call_center_agent_uuid]."'\" value='e'>\n";
//echo " <input type='button' class='btn' name='' alt='delete' onclick=\"if (confirm('Are you sure you want to delete this?')) { window.location='call_center_agent_delete.php?id=".$row[call_center_agent_uuid]."' }\" value='x'>\n"; //echo " <input type='button' class='btn' name='' alt='delete' onclick=\"if (confirm('Are you sure you want to delete this?')) { window.location='call_center_agent_delete.php?id=".$row[call_center_agent_uuid]."' }\" value='x'>\n";
@ -171,7 +188,7 @@ else {
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n"; echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td class='list_control_icons'>"; echo " <td class='list_control_icons'>";
if (permission_exists('call_center_agent_add')) { if (permission_exists('call_center_agent_add')) {
echo "<a href='call_center_agent_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>"; echo "<a href='call_center_agent_edit.php' alt='".$text['button-add']."'>".$v_link_label_add."</a>";
} }
echo " </td>\n"; echo " </td>\n";
echo " </tr>\n"; echo " </tr>\n";