by pradag » Sat Jul 13, 2013 10:44 am
Our solution, not the better but work.
Asterisk: 1.4.39.2-vici
Version: 2.6b0.5
SVN Version: 1904
DB Schema Version: 1336
astgiuclient: VERSION: 2.6-360c BUILD: 121206-0634
It is working also with newer version.
Edit file /srv/www/htdocs/agc/vicidial.php
Line 1304:
**********************************************************************************************************************************************************************************************************************************
##### grab the statuses that can be used for dispositioning by an agent
$stmt="SELECT status,status_name,scheduled_callback,selectable,category FROM vicidial_statuses WHERE status != 'NEW' order by category,status limit 500;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$VD_statuses_ct = mysql_num_rows($rslt);
$i=0;
while ($i < $VD_statuses_ct)
{
$row=mysql_fetch_row($rslt);
if ($TEST_all_statuses > 0) {$SELstatuses[$i]='Y';}
$statuses[$i] =$row[0];
$status_names[$i] =$row[1];
$CBstatuses[$i] =$row[2];
$SELstatuses[$i] =$row[3];
$category[$i] =$row[4];
$category[$i] = str_pad($category[$i], 8, "- ", STR_PAD_LEFT);
$VARstatuses = "$VARstatuses'$statuses[$i]',";
$VARstatusnames = "$VARstatusnames'$status_names[$i]',";
$VARSELstatuses = "$VARSELstatuses'$SELstatuses[$i]',";
$VARCBstatuses = "$VARCBstatuses'$CBstatuses[$i]',";
$VARcategory = "$VARcategory'$category[$i]',";
if ($CBstatuses[$i] == 'Y')
{$VARCBstatusesLIST .= " $statuses[$i]";}
if ($SELstatuses[$i] == 'Y')
{$VARSELstatuses_ct++;}
$i++;
}
##### grab the campaign-specific statuses that can be used for dispositioning by an agent
$stmt="SELECT status,status_name,scheduled_callback,selectable,category FROM vicidial_campaign_statuses WHERE status != 'NEW' and campaign_id='$VD_campaign' order by category,status limit 500;";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
$VD_statuses_camp = mysql_num_rows($rslt);
$j=0;
while ($j < $VD_statuses_camp)
{
$row=mysql_fetch_row($rslt);
$category[$i] =$row[4];
$category[$i] = str_pad($category[$i], 8, "- ", STR_PAD_LEFT);
$category_title[$i] = "CAT";
$category_sel[$i] = $row[3];
$category_cb[$i] = "N";
if ($category[$i] !== $category_b && $category_sel[$i] == 'Y') {
$VARstatuses = "$VARstatuses'$category_title[$i]',";
$VARstatusnames = "$VARstatusnames'$category[$i]',";
$VARSELstatuses = "$VARSELstatuses'$category_sel[$i]',";
$VARCBstatuses = "$VARCBstatuses'$category_cb[$i]',";
$VARcategory = "$VARcategory'$category[$i]',";
$category_b = $category[$i];
$VARSELstatuses_ct++;
$VD_statuses_camp++;
$i++;
}
$statuses[$i] =$row[0];
$status_names[$i] =$row[1];
$CBstatuses[$i] =$row[2];
$SELstatuses[$i] =$row[3];
$category[$i] =$row[4];
$category[$i] = str_pad($category[$i], 8, "- ", STR_PAD_LEFT);
if ($TEST_all_statuses > 0) {$SELstatuses[$i]='Y';}
$VARstatuses = "$VARstatuses'$statuses[$i]',";
$VARstatusnames = "$VARstatusnames'$status_names[$i]',";
$VARSELstatuses = "$VARSELstatuses'$SELstatuses[$i]',";
$VARCBstatuses = "$VARCBstatuses'$CBstatuses[$i]',";
$VARcategory = "$VARcategory'$category[$i]',";
if ($CBstatuses[$i] == 'Y')
{$VARCBstatusesLIST .= " $statuses[$i]";}
if ($SELstatuses[$i] == 'Y')
{$VARSELstatuses_ct++;}
$i++;
$j++;
}
$VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp);
$VARstatuses = substr("$VARstatuses", 0, -1);
$VARstatusnames = substr("$VARstatusnames", 0, -1);
$VARSELstatuses = substr("$VARSELstatuses", 0, -1);
$VARCBstatuses = substr("$VARCBstatuses", 0, -1);
$VARcategory = substr("$VARcategory", 0, -1);
$VARCBstatusesLIST .= " ";
**********************************************************************************************************************************************************************************************************************************
Edit line 3224:
**********************************************************************************************************************************************************************************************************************************
VARCBstatuses = new Array(<?php echo $VARCBstatuses ?>);
VARcategory = new Array(<?php echo $VARcategory ?>);
var VARCBstatusesLIST = '<?php echo $VARCBstatusesLIST ?>';
**********************************************************************************************************************************************************************************************************************************
Edit line 9206:
**********************************************************************************************************************************************************************************************************************************
// Generate the Call Disposition Chooser panel
function DispoSelectContent_create(taskDSgrp,taskDSstage)
{
if (disable_dispo_screen > 0)
{
document.vicidial_form.DispoSelection.value = disable_dispo_status;
DispoSelect_submit();
}
else
{
if (customer_3way_hangup_dispo_message.length > 1)
{
document.getElementById("Dispo3wayMessage").innerHTML = "<br /><b><font color=\"red\" size=\"3\">" + customer_3way_hangup_dispo_message + "</font></b><br />";
}
if (APIManualDialQueue > 0)
{
document.getElementById("DispoManualQueueMessage").innerHTML = "<br /><b><font color=\"red\" size=\"3\">Manual Dial Queue Calls Waiting: " + APIManualDialQueue + "</font></b><br />";
}
if (per_call_notes == 'ENABLED')
{
var test_notes = document.vicidial_form.call_notes_dispo.value;
if (test_notes.length > 0)
{document.vicidial_form.call_notes.value = document.vicidial_form.call_notes_dispo.value}
document.getElementById("PerCallNotesContent").innerHTML = "<br /><b><font size=\"3\">Call Notes: </font></b><br /><textarea name=\"call_notes_dispo\" id=\"call_notes_dispo\" rows=\"2\" cols=\"100\" class=\"cust_form_text\" value=\"\">" + document.vicidial_form.call_notes.value + "</textarea>";
}
else
{
document.getElementById("PerCallNotesContent").innerHTML = "<input type=\"hidden\" name=\"call_notes_dispo\" id=\"call_notes_dispo\" value=\"\" />";
}
HidEGenDerPulldown();
AgentDispoing = 1;
var CBflag = '';
var CATflag = 0;
var SPANflag = 0;
var LINEnum = 0;
var VD_statuses_ct_half = parseInt(VARSELstatuses_ct / 2);
var dispo_HTML = "<table cellpadding=\"5\" cellspacing=\"5\" width=\"1000px\"><tr><td colspan=\"2\"><b> CALL DISPOSITION</b></td></tr><tr><td bgcolor=\"#F5F6CE\" height=\"500px\" width=\"300px\" valign=\"top\"><font class=\"log_text\"><span id=\"DispoSelectA\">";
var loop_ct = 0;
var print_ct = 0;
if (hide_dispo_list < 1)
{
while (loop_ct < VD_statuses_ct)
{
if (VARSELstatuses[loop_ct] == 'Y')
{
if (VARCBstatuses[loop_ct] == 'Y')
{CBflag = '*';}
else
{CBflag = '';}
if (VARstatuses[loop_ct] == 'CAT')
{
if (CATflag != 1)
{
CATflag = 1;
}
CBflag = '***';
if (VARstatusnames[loop_ct] == taskDSgrp || VARstatusnames[loop_ct] == taskDSstage)
{
dispo_HTML = dispo_HTML + "<font size=\"4\" style=\"BACKGROUND-COLOR: #BBFF00\"><b><a href=\"#\" onclick=\"DispoSelectContent_create('" + VARstatuses[loop_ct] + "','ReSET');return false;\">" + CBflag + " - " + VARstatusnames[loop_ct] + " - " + CBflag + "</a> " + "</b></font><br /><br />";
CATflag = 2;
SPANflag = 1;
}
else
{
dispo_HTML = dispo_HTML + "<font size=\"4\" style=\"BACKGROUND-COLOR: #AAAAAA\"><b><a href=\"#\" onclick=\"DispoSelectContent_create('" + VARstatusnames[loop_ct] + "','ReSET');return false;\">" + CBflag + " - " + VARstatusnames[loop_ct] + " - " + CBflag + "</a> " + "</b></font><br /><br />";
}
}
if (CATflag > 1 && VARstatuses[loop_ct] !== 'CAT')
{
if (taskDSgrp == VARstatuses[loop_ct])
{
dispo_HTML = dispo_HTML + "<font size=\"3\" style=\"BACKGROUND-COLOR: #66BBEE\"><b><a href=\"#\" onclick=\"DispoSelect_submit();return false;\">" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + "</a> " + CBflag + "</b></font><br /><br />";
}
else if (taskDSgrp == "")
{
// dispo_HTML = dispo_HTML + "<font size=\"3\" style=\"BACKGROUND-COLOR: #FFFFCC\"><b><a href=\"#\" onclick=\"DispoSelect_submit();return false;\">" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + "</a> " + CBflag + "</b></font><br /><br />";
}
else
{
dispo_HTML = dispo_HTML + "<a href=\"#\" onclick=\"DispoSelectContent_create('" + VARstatuses[loop_ct] + "','" + VARcategory[loop_ct] + "');return false;\">" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + "</a> " + CBflag + "<br /><br />";
}
LINEnum++;
}
if (CATflag < 1)
{
if (taskDSgrp == VARstatuses[loop_ct])
{
dispo_HTML = dispo_HTML + "<font size=\"3\" style=\"BACKGROUND-COLOR: #66BBEE\"><b><a href=\"#\" onclick=\"DispoSelect_submit();return false;\">" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + "</a> " + CBflag + "</b></font><br /><br />";
}
else
{
dispo_HTML = dispo_HTML + "<a href=\"#\" onclick=\"DispoSelectContent_create('" + VARstatuses[loop_ct] + "','ADD');return false;\">" + VARstatuses[loop_ct] + " - " + VARstatusnames[loop_ct] + "</a> " + CBflag + "<br /><br />";
}
}
// if (print_ct == VD_statuses_ct_half)
// if (print_ct % 2 != 0)
if (SPANflag > 0 || LINEnum > 15)
{
// dispo_HTML = dispo_HTML + "</span></font></td><td bgcolor=\"#99FF99\" height=\"500px\" width=\"300px\" valign=\"top\"><font class=\"log_text\"><span id=\"DispoSelectB\">";
dispo_HTML = dispo_HTML + "</span></font></td><td bgcolor=\"#F5F6CE\" height=\"500px\" width=\"300px\" valign=\"top\"><font class=\"log_text\"><span id=\"DispoSelectB\">";
SPANflag = 0;
LINEnum = 0;
}
print_ct++;
}
loop_ct++;
}
}
else
{
dispo_HTML = dispo_HTML + "Disposition Status List Hidden<br /><br />";
}
dispo_HTML = dispo_HTML + "</span></font></td></tr></table>";
if (taskDSstage == 'ReSET') {document.vicidial_form.DispoSelection.value = '';}
else {document.vicidial_form.DispoSelection.value = taskDSgrp;}
document.getElementById("DispoSelectContent").innerHTML = dispo_HTML;
if (focus_blur_enabled==1)
{
document.inert_form.inert_button.focus();
document.inert_form.inert_button.blur();
}
if (my_callback_option == 'CHECKED')
{document.vicidial_form.CallBackOnlyMe.checked=true;}
}
}
**********************************************************************************************************************************************************************************************************************************
Good luck.