Added web lead loader phone number length restriction, use system setting to enable

Added more options to the callbacks bulk move and bulk change admin utilities

git-svn-id: svn://192.168.202.10@2611 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2016-11-05 07:10:09 +00:00
parent 3e902086e7
commit 765070842b
13 changed files with 2329 additions and 71 deletions
+4
View File
@@ -302,7 +302,11 @@ OTHER CHANGES:
84. Added option to allow agents to park 3way calls in the agent screen
85. Added option to web lead loader to restrict leads to only those with a
phone number of a specified length. Options for forced system-wide and
per-list-load
86. Added more options to the Callback moving utilites in Admin Utilities page
+1 -1
View File
@@ -92,7 +92,7 @@ If it did, then you want to add the following lines to your /etc/rc.d/rc.local f
cd /usr/local
*** download QueueMetrics and place it in /usr/local ***
http//downloads.loway.ch/qm/QueueMetrics-16.09.2.tar.gz
wget http://downloads.loway.ch/qm/QueueMetrics-16.09.2.tar.gz
tar xvfz QueueMetrics-16.09.2.tar.gz
mv queuemetrics-16.09.2 /usr/local/tomcat/webapps/qm
cd /usr/local/tomcat/webapps/qm/WEB_INF
+4 -2
View File
@@ -1677,7 +1677,9 @@ script_remove_js ENUM('1','0') default '1',
manual_auto_next ENUM('1','0') default '0',
user_new_lead_limit ENUM('1','0') default '0',
agent_xfer_park_3way ENUM('1','0') default '0',
rec_prompt_count INT(9) UNSIGNED default '0'
rec_prompt_count INT(9) UNSIGNED default '0',
agent_soundboards ENUM('1','0') default '0',
web_loader_phone_length VARCHAR(10) default 'DISABLED'
) ENGINE=MyISAM;
CREATE TABLE vicidial_campaigns_list_mix (
@@ -3807,4 +3809,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1474',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1475',db_schema_update_date=NOW(),reload_timestamp=NOW();
+5
View File
@@ -734,3 +734,8 @@ UPDATE system_settings SET db_schema_version='1473',db_schema_update_date=NOW()
ALTER TABLE vicidial_users ADD user_new_lead_limit SMALLINT(5) default '-1';
UPDATE system_settings SET db_schema_version='1474',db_schema_update_date=NOW() where db_schema_version < 1474;
ALTER TABLE system_settings ADD agent_soundboards ENUM('1','0') default '0';
ALTER TABLE system_settings ADD web_loader_phone_length VARCHAR(10) default 'DISABLED';
UPDATE system_settings SET db_schema_version='1475',db_schema_update_date=NOW() where db_schema_version < 1475;
+39 -3
View File
@@ -86,10 +86,11 @@
# 150928-1157 - Fix allowing for * and # in phone_number field
# 160113-0921 - Fix for numeric audio files in playback function
# 161102-1042 - Fixed QM partition problem
# 161103-1729 - Added agent_debug to audio playing
#
$version = '2.12-52';
$build = '161102-1042';
$version = '2.12-53';
$build = '161103-1729';
$startMS = microtime();
@@ -215,6 +216,8 @@ if (isset($_GET["callback_comments"])) {$callback_comments=$_GET["callback_com
elseif (isset($_POST["callback_comments"])) {$callback_comments=$_POST["callback_comments"];}
if (isset($_GET["qm_dispo_code"])) {$qm_dispo_code=$_GET["qm_dispo_code"];}
elseif (isset($_POST["qm_dispo_code"])) {$qm_dispo_code=$_POST["qm_dispo_code"];}
if (isset($_GET["agent_debug"])) {$agent_debug=$_GET["agent_debug"];}
elseif (isset($_POST["agent_debug"])) {$agent_debug=$_POST["agent_debug"];}
header ("Content-type: text/html; charset=utf-8");
@@ -241,7 +244,7 @@ if ($sl_ct > 0)
$VUuser_group = $row[3];
}
$stmt = "SELECT use_non_latin,enable_languages,language_method FROM system_settings;";
$stmt = "SELECT use_non_latin,enable_languages,language_method,agent_debug_logging FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -252,6 +255,7 @@ if ($qm_conf_ct > 0)
$non_latin = $row[0];
$SSenable_languages = $row[1];
$SSlanguage_method = $row[2];
$SSagent_debug_logging = $row[3];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -333,6 +337,7 @@ if ($non_latin < 1)
$qm_dispo_code = preg_replace("/[^-\.\_0-9a-zA-Z]/","",$qm_dispo_code);
$alt_user = preg_replace("/[^0-9a-zA-Z]/","",$alt_user);
$postal_code = preg_replace("/[^- \.\_0-9a-zA-Z]/","",$postal_code);
$agent_debug = preg_replace("/[^- \.\:\|\_0-9a-zA-Z]/","",$agent_debug);
}
else
{
@@ -1449,6 +1454,37 @@ if ($function == 'audio_playback')
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
}
}
if ($source == 'soundboard')
{
### log any events that are sent from agent sub-screens
if ( (strlen($agent_debug) > 1) and ($SSagent_debug_logging > 0) )
{
$endMS = microtime();
$startMSary = explode(" ",$startMS);
$endMSary = explode(" ",$endMS);
$runS = ($endMSary[0] - $startMSary[0]);
$runM = ($endMSary[1] - $startMSary[1]);
$TOTALrun = ($runS + $runM);
$cd=0;
$agent_debug = preg_replace("/\|$/",'',$agent_debug);
$debug_details = explode('|',$agent_debug);
$debug_details_ct = count($debug_details);
while($cd < $debug_details_ct)
{
$debug_data = explode('-----',$debug_details[$cd]);
$debug_time = $debug_data[0];
$debug_function_data = explode('---',$debug_data[1]);
$debug_function = $debug_function_data[0];
$debug_options = $debug_function_data[1];
$stmtA="INSERT INTO vicidial_ajax_log set user='$agent_user',start_time='$debug_time',db_time=NOW(),run_time='$TOTALrun',php_script='api.php',action='$debug_function',stage='$cd|$debug_options',last_sql='';";
$rslt=mysql_to_mysqli($stmtA, $link);
$cd++;
}
}
}
}
################################################################################
### END - audio_playback
+817
View File
@@ -0,0 +1,817 @@
<?php
# vdc_soundboard_display.php
#
# Copyright (C) 2016 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed display the contents of an audio soundboard in the system
#
# CHANGELOG:
# 140708-1030 - First build of script
# 141126-0754 - Code updates and added progress timer within top STOP button
# 141216-2135 - Added language settings lookups and user/pass variable standardization
# 160428-1848 - Fix for user_authorization
# 161103-1656 - Added Agent Debug Logging
#
$version = '2.12-5';
$build = '161103-1656';
require_once("dbconnect_mysqli.php");
require_once("functions.php");
$bcrypt=1;
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
if (isset($_GET["soundboard_id"])) {$soundboard_id=$_GET["soundboard_id"];}
elseif (isset($_POST["soundboard_id"])) {$soundboard_id=$_POST["soundboard_id"];}
if (isset($_GET["avatar_id"])) {$avatar_id=$_GET["avatar_id"];}
elseif (isset($_POST["avatar_id"])) {$avatar_id=$_POST["avatar_id"];}
if (isset($_GET["user"])) {$user=$_GET["user"];}
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
if (isset($_GET["pass"])) {$pass=$_GET["pass"];}
elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];}
if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];}
elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];}
if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];}
elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];}
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
if (isset($_GET["submit_button"])) {$submit_button=$_GET["submit_button"];}
elseif (isset($_POST["submit_button"])) {$submit_button=$_POST["submit_button"];}
if (isset($_GET["admin_submit"])) {$admin_submit=$_GET["admin_submit"];}
elseif (isset($_POST["admin_submit"])) {$admin_submit=$_POST["admin_submit"];}
if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];}
elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];}
if (isset($_GET["bcrypt"])) {$bcrypt=$_GET["bcrypt"];}
elseif (isset($_POST["bcrypt"])) {$bcrypt=$_POST["bcrypt"];}
if ($bcrypt == 'OFF')
{$bcrypt=0;}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
$txt = '.txt';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$CIDdate = date("mdHis");
$ENTRYdate = date("YmdHis");
$MT[0]='';
$agents='@agents';
$script_height = ($script_height - 20);
if (strlen($bgcolor) < 6) {$bgcolor='FFFFFF';}
$IFRAME=0;
$wav='.wav';
$gsm='.gsm';
$user = preg_replace("/\'|\"|\\\\|;| /","",$user);
$pass = preg_replace("/\'|\"|\\\\|;| /","",$pass);
#############################################
##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP #####
$VUselected_language = '';
$stmt="SELECT selected_language from vicidial_users where user='$user';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
$sl_ct = mysqli_num_rows($rslt);
if ($sl_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$VUselected_language = $row[0];
}
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,active_modules,enable_languages,language_method,agent_soundboards FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysqli_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$non_latin = $row[0];
$timeclock_end_of_day = $row[1];
$agentonly_callback_campaign_lock = $row[2];
$active_modules = $row[3];
$SSenable_languages = $row[4];
$SSlanguage_method = $row[5];
$SSagent_soundboards = $row[6];
}
##### END SETTINGS LOOKUP #####
###########################################
if ($non_latin < 1)
{
$user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
$soundboard_id=preg_replace("/[^-_0-9a-zA-Z]/","",$soundboard_id);
$avatar_id=preg_replace("/[^-_0-9a-zA-Z]/","",$avatar_id);
$session_name=preg_replace("/[^-_0-9a-zA-Z]/","",$session_name);
}
else
{
$soundboard_id=preg_replace("/\'|\"|\\\\|;| /","",$soundboard_id);
$avatar_id=preg_replace("/\'|\"|\\\\|;| /","",$avatar_id);
$session_name=preg_replace("/[^-_0-9a-zA-Z]/","",$session_name);
}
# default optional vars if not set
if (!isset($format)) {$format="text";}
if ($format == 'debug') {$DB=1;}
if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if ( (strlen($soundboard_id) < 1) and (strlen($avatar_id) > 0) ) {$soundboard_id=$avatar_id;}
$auth=0;
$auth_message = user_authorization($user,$pass,'',0,$bcrypt,0,0);
if ($auth_message == 'GOOD')
{$auth=1;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and ( (modify_audiostore='1') or (modify_scripts='1') );";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt);
$VUmodify=$row[0];
$stmt="SELECT count(*) from vicidial_live_agents where user='$user';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt);
$LVAactive=$row[0];
$stmt="SELECT count(*) from web_client_sessions where session_name='$session_name';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt);
$WCSactive=$row[0];
if ( (!preg_match("/soundboard/i",$active_modules)) and ($SSagent_soundboards < 1) )
{
echo _QXZ("Soundboards disabled on your system")."\n";
exit;
}
if ( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ( ( ($LVAactive < 1) or ($WCSactive < 1) ) and ($VUmodify < 1) ) )
{
echo _QXZ("Invalid Username/Password").": |$user|$pass|$auth_message|$LVAactive|$WCSactive|$VUmodify|\n";
exit;
}
else
{
# do nothing for now
}
$stmt="SELECT avatar_id,avatar_name,avatar_notes,avatar_api_user,avatar_api_pass,active,audio_functions,user_group,audio_display from vicidial_avatars where avatar_id='$soundboard_id' and active='Y';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$soundboard_ct = mysqli_num_rows($rslt);
if ($soundboard_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$soundboard_id = $row[0];
$avatar_name = $row[1];
$avatar_notes = $row[2];
$avatar_api_user = $row[3];
$avatar_api_set = $row[4];
$active = $row[5];
$audio_functions = $row[6];
$user_group = $row[7];
$audio_display = $row[8];
}
else
{
echo _QXZ("error: soundboard not valid")."\n";
exit;
}
$stmt="SELECT vdc_agent_api_access,user_level from vicidial_users where user='$avatar_api_user' and active='Y' and vdc_agent_api_access='1';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$api_user_ct = mysqli_num_rows($rslt);
if ($api_user_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$api_access = $row[0];
$api_level = $row[1];
}
else
{
echo _QXZ("error: API user not valid")."\n";
exit;
}
$api_set_enc = base64_encode($avatar_api_set);
### BEGIN display soundboard content ###
echo "<html>\n";
echo "<head>\n";
echo "<!-- "._QXZ("VERSION").": $version "._QXZ("BUILD").": $build "._QXZ("USER").": $user -->\n";
echo "<title>"._QXZ("Agent Audio Soundboard Display Script")."</title>\n";
?>
<script language="Javascript">
var DB = '<?php echo $DB ?>';
var agent_user = '<?php echo $user ?>';
var api_user = '<?php echo $avatar_api_user ?>';
var api_sname = '<?php echo $session_name ?>';
var api_set = '<?php echo $api_set_enc ?>';
var api_level = '<?php echo $api_level ?>';
var last_played_id = '';
var last_over_id = '';
var regTOP = new RegExp("TOP---","g");
var next_color = '';
var last_action = '';
var countdown_active=0;
var countdown_length=0;
var countdown_length_new=0;
var countdown_length_px=0;
var countdown_counter=0;
var countdown_counter_new=0;
var countdown_bar=0;
var countdown_reset=1;
var refresh_interval=99;
var ten_count=0;
var soundboard_event_log='';
var SQLdate='';
get_date();
function countdown_run()
{
if (countdown_reset > 0)
{
countdown_counter=countdown_counter_new;
countdown_length=countdown_length_new;
countdown_reset=0;
}
if ( (countdown_active > 0) && (countdown_counter > -1) )
{
var bar_length = 300;
countdown_length_px = parseInt( (bar_length / (countdown_length * 10) ) * ( (countdown_counter * 10) - ten_count) );
if (countdown_length_px < 0)
{countdown_length_px=0;}
var countdown_length_px_alt = (bar_length - countdown_length_px);
document.getElementById('stop_progress').innerHTML = "<table width=300 height=5 border=0 cellpadding=0 cellspacing=0 bgcolor=white><tr><td width=" + countdown_length_px_alt + " bgcolor=white> </td><td width=" + countdown_length_px + " bgcolor=black></td></tr></table>";
ten_count++;
if (ten_count > 9)
{
ten_count=0;
countdown_counter = (countdown_counter - 1);
if (countdown_counter < 0)
{
get_date();
// soundboard_event_log = soundboard_event_log + "" + SQLdate + "-----SB_done_playing---|";
document.getElementById("countdown_audio").innerHTML = '';
document.getElementById("last_action_auto").innerHTML = 'audio done playing';
document.getElementById('stop_progress').innerHTML = '';
countdown_active=0;
countdown_length=0;
countdown_length_px=0;
countdown_counter=0;
countdown_bar=0;
}
else
{
document.getElementById("countdown_audio").innerHTML = countdown_counter;
}
}
document.getElementById("last_action_auto").innerHTML = countdown_counter + "|" + countdown_length_px;
}
}
function over_cell(temp_cell)
{
if (temp_cell.length > 0)
{
document.getElementById("debugsoundboardspan").innerHTML = temp_cell;
if (last_over_id != '')
{
next_color = '#e5e5e5';
if (last_over_id.match(regTOP))
{next_color = '#d6d6d6';}
if (last_over_id == last_played_id)
{next_color = '#99FF99';}
document.getElementById(last_over_id).bgColor = next_color;
}
last_over_id = temp_cell;
document.getElementById(temp_cell).bgColor = '#FFFF99';
}
}
function out_cell(temp_cell)
{
document.getElementById("debugsoundboardspan").innerHTML = temp_cell;
if (last_over_id != '')
{
next_color = '#e5e5e5';
if (last_over_id.match(regTOP))
{next_color = '#d6d6d6';}
if (temp_cell == last_played_id)
{next_color = '#99FF99';}
document.getElementById(last_over_id).bgColor = next_color;
}
last_over_id = temp_cell;
next_color = '#e5e5e5';
if (last_over_id.match(regTOP))
{next_color = '#d6d6d6';}
if (temp_cell == last_played_id)
{next_color = '#99FF99';}
document.getElementById(temp_cell).bgColor = next_color;
}
function clean_var(s)
{
var e={},i,b=0,c,x,l=0,a,r='',w=String.fromCharCode,L=s.length;
var A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
for(i=0;i<64;i++){e[A.charAt(i)]=i;}
for(x=0;x<L;x++)
{
c=e[s.charAt(x)];b=(b<<6)+c;l+=6;
while(l>=8){((a=(b>>>(l-=8))&0xff)||(x<(L-2)))&&(r+=w(a));}
}
// document.getElementById("debugsoundboardspan").innerHTML = '|' + s + '|' + r + '|';
return r;
}
function get_date()
{
var t = new Date();
var year= t.getYear()
var month= t.getMonth()
month++;
var daym= t.getDate()
var hours = t.getHours();
var min = t.getMinutes();
var sec = t.getSeconds();
if (year < 1000) {year+=1900}
if (month< 10) {month= "0" + month}
if (daym< 10) {daym= "0" + daym}
if (hours < 10) {hours = "0" + hours;}
if (min < 10) {min = "0" + min;}
if (sec < 10) {sec = "0" + sec;}
SQLdate = year + "-" + month + "-" + daym + " " + hours + ":" + min + ":" + sec;
}
function stop_audio()
{
get_date();
soundboard_event_log = soundboard_event_log + "" + SQLdate + "-----SB_stop_audio---" + countdown_counter + " seconds|";
document.getElementById("debugsoundboardspan").innerHTML = 'stop audio';
last_action = 'stop audio';
document.getElementById('last_action_span').innerHTML = last_action;
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
{
xmlhttp = new XMLHttpRequest();
}
if (xmlhttp)
{
http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=audio_playback&value=ss-noservice&stage=PLAY&dial_override=Y
PLAY_query = "source=soundboard&stage=STOP&function=audio_playback&user=" + api_user + "&pass=" + clean_var(api_set) + "&agent_user=" + agent_user + "&agent_debug=" + soundboard_event_log;
document.getElementById("debugsoundboardAJAXspanIN").innerHTML = PLAY_query;
xmlhttp.open('POST', 'api.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(PLAY_query);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
document.getElementById("debugsoundboardAJAXspanOUT").innerHTML = xmlhttp.responseText;
// alert(xmlhttp.responseText);
}
}
delete xmlhttp;
soundboard_event_log='';
}
countdown_active=0;
countdown_length=0;
countdown_length_px=0;
countdown_counter=0;
countdown_bar=0;
document.getElementById("countdown_audio").innerHTML = '';
document.getElementById('stop_progress').innerHTML = '';
}
function click_cell(temp_cell)
{
document.getElementById("debugsoundboardspan").innerHTML = temp_cell;
if (last_played_id != '')
{
next_color = '#e5e5e5';
if (last_played_id.match(regTOP))
{next_color = '#d6d6d6';}
document.getElementById(last_played_id).bgColor = next_color;
}
last_played_id = temp_cell;
document.getElementById(temp_cell).bgColor = '#99FF99';
last_action = 'play audio';
document.getElementById('last_action_span').innerHTML = last_action;
var temp_cell_array = temp_cell.split("---");
var temp_audio_file = temp_cell_array[1];
countdown_active=1;
if (temp_cell_array[0] == 'TOP')
{countdown_counter_new=temp_cell_array[5];}
else
{countdown_counter_new=temp_cell_array[7];}
countdown_counter_new++;
document.getElementById("countdown_audio").innerHTML = countdown_counter_new;
countdown_length_new=countdown_counter_new;
countdown_reset=1;
get_date();
soundboard_event_log = soundboard_event_log + "" + SQLdate + "-----SB_click_cell---" + temp_audio_file + "--" + countdown_counter_new + " seconds--" + temp_cell_array[0] + "--" + temp_cell_array[2] + "--" + temp_cell_array[3] + "--" + temp_cell_array[4] + "|";
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/
if (!xmlhttp && typeof XMLHttpRequest!='undefined')
{
xmlhttp = new XMLHttpRequest();
}
if (xmlhttp)
{
// http://server/agc/api.php?source=test&user=6666&pass=1234&agent_user=1000&function=audio_playback&value=ss-noservice&stage=PLAY&dial_override=Y
PLAY_query = "source=soundboard&stage=PLAY&dial_override=Y&function=audio_playback&user=" + api_user + "&pass=" + clean_var(api_set) + "&agent_user=" + agent_user + "&value=" + temp_audio_file + "&agent_debug=" + soundboard_event_log;
document.getElementById("debugsoundboardAJAXspanIN").innerHTML = PLAY_query;
xmlhttp.open('POST', 'api.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(PLAY_query);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
document.getElementById("debugsoundboardAJAXspanOUT").innerHTML = xmlhttp.responseText;
// alert(xmlhttp.responseText);
}
}
delete xmlhttp;
soundboard_event_log='';
}
}
function js_startup()
{
if (DB != '1')
{
document.getElementById('last_action_span').style.visibility = 'hidden';
document.getElementById('last_action_auto').style.visibility = 'hidden';
document.getElementById('debugsoundboardspan').style.visibility = 'hidden';
document.getElementById('debugsoundboardAJAXspanIN').style.visibility = 'hidden';
document.getElementById('debugsoundboardAJAXspanOUT').style.visibility = 'hidden';
}
setInterval("countdown_run()", refresh_interval);
}
</script>
<?php
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
echo "</head>\n";
echo "<BODY BGCOLOR=\"#" . $bgcolor . "\" marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onLoad=\"js_startup();\">";
echo "\n";
echo "<!-- Soundboard: $soundboard_id --><form action=$PHP_SELF method=POST name=soundboard_form id=soundboard_form>\n";
echo "<input type=hidden name=last_played id=last_played value=\"\">\n";
echo "<input type=hidden name=soundboard_id id=soundboard_id value=\"$soundboard_id\">\n";
##### get files listing for display
$stmt="SELECT audio_filename,audio_name,rank,level,parent_audio_filename,parent_rank,h_ord from vicidial_avatar_audio where avatar_id='$soundboard_id' and level='1' order by rank,h_ord;";
if ($DB) {echo "$stmt\n";}
$rsltx=mysql_to_mysqli($stmt, $link);
$soundboardfiles_to_print = mysqli_num_rows($rsltx);
$levels = 2;
$ranks=0;
$rank_max_count=0;
$o=0;
while ($soundboardfiles_to_print > $o)
{
$rowx=mysqli_fetch_row($rsltx);
$Aaudio_filename[$o] = $rowx[0];
$Aaudio_name[$o] = $rowx[1];
$Arank[$o] = $rowx[2];
$Alevel[$o] = $rowx[3];
$Aparent_audio_filename[$o] = $rowx[4];
$Aparent_rank[$o] = $rowx[5];
$Ah_ord[$o] = $rowx[6];
if ($o == 0)
{
$Uranks[$ranks] = $Arank[$o];
$Rcount[$ranks]=1;
$rank_max_count=1;
$ranks++;
}
else
{
$rc=0;
$rc_found=0;
while($rc < $ranks)
{
if ($Arank[$o] == $Uranks[$rc])
{
$Rcount[$rc]++;
if ($rank_max_count < $Rcount[$rc])
{$rank_max_count = $Rcount[$rc];}
$rc_found++;
}
$rc++;
}
if ($rc_found < 1)
{
$Uranks[$ranks] = $Arank[$o];
$Rcount[$ranks]=1;
$ranks++;
}
}
$o++;
}
$stmt="SELECT count(*) as tally,parent_rank,rank from vicidial_avatar_audio where avatar_id='$soundboard_id' and level='2' group by parent_rank,rank order by tally desc limit 1;";
if ($DB) {echo "$stmt\n";}
$rslty=mysql_to_mysqli($stmt, $link);
$max_kids_rows = mysqli_num_rows($rslty);
if ($max_kids_rows > 0)
{
$rowC=mysqli_fetch_row($rslty);
$max_kids_cells = $rowC[0];
if ($max_kids_cells > $rank_max_count)
{$rank_max_count = $max_kids_cells;}
}
### count number of entries for each unique rank
$o=0;
while($o < $ranks)
{
$Rtally[$o]=0;
if ($DB > 0) {echo "$Uranks[$o] - $Rcount[$o] - $ranks - $rank_max_count - $max_kids_cells<BR>\n";}
$o++;
}
if ($DB > 0) {echo _QXZ("Max rank count").": $rank_max_count<br>\n";}
echo "<center><table width=99% cellspacing=1 bgcolor=white>\n";
echo "<tr bgcolor=white>";
echo "<td rowspan=2 align=center colspan=2><b>$avatar_name</b></td>";
if (preg_match("/STOP/",$audio_functions))
{echo "<td width=300 align=center id=\"stop_td\" onMouseOver=\"this.bgColor='#FF0000'\" onMouseOut=\"this.bgColor='#FF9999'\" bgColor=\"#FF9999\" onClick=\"stop_audio()\"><b>"._QXZ("stop audio")." &nbsp; &nbsp; &nbsp; &nbsp; <span id=countdown_audio></span></b></td>";}
else
{echo "<td width=300 align=center id=\"stop_td\" bgColor=\"white\"> &nbsp; <span id=countdown_audio></span></td>";}
echo "</tr><tr><td width=300 height=5 align=center id=\"stop_td\" bgColor=\"white\"><span id=stop_progress></span></td>";
echo "</tr></table>\n";
echo "<table width=99% cellspacing=3 bgcolor=white>\n";
### generate display tables
$o=0;
while ($soundboardfiles_to_print > $o)
{
$ro = ($o + 1);
$display_button='';
if (preg_match("/FILE/",$audio_display))
{$display_button .= " $Aaudio_filename[$o]";}
if (preg_match("/NAME/",$audio_display))
{
if (strlen($display_button) > 1)
{$display_button .= " - ";}
$display_button .= " $Aaudio_name[$o]";
}
$rc=0;
$rc_found=0;
$Rcolspan=1;
$tr_begin='';
$tr_end='';
while($rc < $ranks)
{
if ($Arank[$o] == $Uranks[$rc])
{
if ($Rtally[$rc] == '0')
{
$tr_begin='<tr>';
}
if ($Rcount[$rc] == '1')
{
$Rcolspan = ($rank_max_count + 1);
$tr_end='</tr>';
}
else
{
$Rtally[$rc]++;
if ($Rtally[$rc] == 1)
{$Rcolspan=2;}
else
{$Rcolspan=1;}
if ($Rcount[$rc] == $Rtally[$rc])
{
$Rdiff = ($rank_max_count - $Rtally[$rc]);
$Rcolspan = ($Rcolspan + $Rdiff);
$tr_end='</tr>';
}
}
}
$rc++;
}
$audio_length=0;
$stmt="SELECT audio_length from audio_store_details where audio_filename IN('$Aaudio_filename[$o]$wav','$Aaudio_filename[$o]$gsm') order by audio_length desc limit 1;";
if ($DB) {echo "$stmt\n";}
$rslty=mysql_to_mysqli($stmt, $link);
$al_ct = mysqli_num_rows($rslty);
if ($al_ct > 0)
{
$rowD=mysqli_fetch_row($rslty);
$audio_length = $rowD[0];
if ($audio_length < 1)
{$audio_length = '1';}
}
echo "$tr_begin<td onClick=\"click_cell('TOP---$Aaudio_filename[$o]---$Arank[$o]---$Alevel[$o]---$Ah_ord[$o]---$audio_length')\" onMouseOver=\"over_cell('TOP---$Aaudio_filename[$o]---$Arank[$o]---$Alevel[$o]---$Ah_ord[$o]---$audio_length')\" onMouseOut=\"out_cell('TOP---$Aaudio_filename[$o]---$Arank[$o]---$Alevel[$o]---$Ah_ord[$o]---$audio_length')\" id=\"TOP---$Aaudio_filename[$o]---$Arank[$o]---$Alevel[$o]---$Ah_ord[$o]---$audio_length\" align=\"left\" bgColor=\"#d6d6d6\" colspan=$Rcolspan nowrap>$ro. $display_button</td>";
echo "$tr_end\n";
if (strlen($tr_end)>4)
{
$stmt="SELECT audio_filename,audio_name,rank,level,parent_audio_filename,parent_rank,h_ord from vicidial_avatar_audio where avatar_id='$soundboard_id' and level='2' and parent_rank='$Arank[$o]' order by parent_audio_filename,rank,h_ord;";
# and parent_audio_filename='$Aaudio_filename[$o]' removed for multi-entries per line
if ($DB) {echo "$stmt\n";}
$rslty=mysql_to_mysqli($stmt, $link);
$Csoundboardfiles_to_print = mysqli_num_rows($rslty);
$Clevels = 2;
$Cranks=0;
$Crank_max_count=0;
$Co=0;
while ($Csoundboardfiles_to_print > $Co)
{
$rowC=mysqli_fetch_row($rslty);
$Caudio_filename[$Co] = $rowC[0];
$Caudio_name[$Co] = $rowC[1];
$Crank[$Co] = $rowC[2];
$Clevel[$Co] = $rowC[3];
$Cparent_audio_filename[$Co] = $rowC[4];
$Cparent_rank[$Co] = $rowC[5];
$Ch_ord[$Co] = $rowC[6];
if ($Co == 0)
{
$CUranks[$Cranks] = $Crank[$Co];
$CRcount[$Cranks]=1;
$Crank_max_count=1;
$Cranks++;
}
else
{
$rc=0;
$rc_found=0;
while($rc < $Cranks)
{
if ($Crank[$Co] == $CUranks[$rc])
{
$CRcount[$rc]++;
if ($Crank_max_count < $CRcount[$rc])
{$Crank_max_count = $CRcount[$rc];}
$rc_found++;
}
$rc++;
}
if ($rc_found < 1)
{
$CUranks[$Cranks] = $Crank[$Co];
$CRcount[$Cranks]=1;
$Cranks++;
}
}
$Co++;
}
### count number of entries for each unique rank
$Co=0;
while($Co < $Cranks)
{
$CRtally[$Co]=0;
if ($DB > 0) {echo "$CUranks[$Co] - $CRcount[$Co] - $Cranks - $Crank_max_count<BR>\n";}
$Co++;
}
if ($DB > 0) {echo _QXZ("Max rank count").": $Crank_max_count<br>\n";}
$Co=0;
while ($Csoundboardfiles_to_print > $Co)
{
$ro = ($Co + 1);
$display_button='';
if (preg_match("/FILE/",$audio_display))
{$display_button .= " $Caudio_filename[$Co]";}
if (preg_match("/NAME/",$audio_display))
{
if (strlen($display_button) > 1)
{$display_button .= " - ";}
$display_button .= " $Caudio_name[$Co]";
}
$rc=0;
$rc_found=0;
$CRcolspan=1;
$tr_begin='';
$tr_end='';
while($rc < $Cranks)
{
if ($Crank[$Co] == $CUranks[$rc])
{
if ($CRtally[$rc] == '0')
{
$tr_begin='<tr><td nowrap width=10> &nbsp; </td>';
}
if ($CRcount[$rc] == '1')
{
$CRcolspan = $rank_max_count;
$tr_end='</tr>';
}
else
{
$CRtally[$rc]++;
$CRcolspan=1;
if ($CRcount[$rc] == $CRtally[$rc])
{
$CRdiff = ($rank_max_count - $CRtally[$rc]);
$CRcolspan = ($CRcolspan + $CRdiff);
$tr_end='</tr>';
}
}
}
$rc++;
}
$audio_length=0;
$stmt="SELECT audio_length from audio_store_details where audio_filename IN('$Caudio_filename[$Co]$wav','$Caudio_filename[$Co]$gsm') order by audio_length desc limit 1;";
if ($DB) {echo "$stmt\n";}
$rslty=mysql_to_mysqli($stmt, $link);
$al_ct = mysqli_num_rows($rslty);
if ($al_ct > 0)
{
$rowD=mysqli_fetch_row($rslty);
$audio_length = $rowD[0];
if ($audio_length < 1)
{$audio_length = '1';}
}
echo "$tr_begin<td onClick=\"click_cell('MID---$Caudio_filename[$Co]---$Crank[$Co]---$Clevel[$Co]---$Cparent_audio_filename[$Co]---$Cparent_rank[$Co]---$Ch_ord[$Co]---$audio_length')\" onMouseOver=\"over_cell('MID---$Caudio_filename[$Co]---$Crank[$Co]---$Clevel[$Co]---$Cparent_audio_filename[$Co]---$Cparent_rank[$Co]---$Ch_ord[$Co]---$audio_length')\" onMouseOut=\"out_cell('MID---$Caudio_filename[$Co]---$Crank[$Co]---$Clevel[$Co]---$Cparent_audio_filename[$Co]---$Cparent_rank[$Co]---$Ch_ord[$Co]---$audio_length')\" id=\"MID---$Caudio_filename[$Co]---$Crank[$Co]---$Clevel[$Co]---$Cparent_audio_filename[$Co]---$Cparent_rank[$Co]---$Ch_ord[$Co]---$audio_length\" align=\"left\" bgColor=\"#e5e5e5\" colspan=$CRcolspan nowrap>$ro. $display_button</td>";
echo "$tr_end\n";
$Co++;
}
}
$o++;
}
echo "</table><br>\n";
echo "<span id=last_action_span></span>\n";
echo "<br>\n";
echo "<span id=last_action_auto></span>\n";
echo "<br>\n";
echo "<span id=debugsoundboardspan></span>\n";
echo "<br>\n";
echo "<span id=debugsoundboardAJAXspanIN></span>\n";
echo "<br>\n";
echo "<span id=debugsoundboardAJAXspanOUT></span>\n";
echo "\n";
echo "</form></center><BR><BR>\n";
echo "</BODY></HTML>\n";
### END display soundboard content ###
exit;
?>
+20 -6
View File
File diff suppressed because one or more lines are too long
+5 -3
View File
@@ -67,10 +67,11 @@
# 160611-2229 - Added style for diff on admin changes
# 160617-1426 - Added link from screen colors to system settings screen color settings
# 161101-2129 - Added user_new_lead_limit Users subhead
# 161103-2136 - Added agent_soundboards option
#
$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled,allow_emails,level_8_disable_add,allow_chats,enable_languages,admin_row_click,admin_screen_colors,user_new_lead_limit,user_territories_active,qc_features_active from system_settings;";
$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled,allow_emails,level_8_disable_add,allow_chats,enable_languages,admin_row_click,admin_screen_colors,user_new_lead_limit,user_territories_active,qc_features_active,agent_soundboards from system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
$row=mysqli_fetch_row($rslt);
$admin_home_url_LU = $row[0];
@@ -86,6 +87,7 @@ $SSadmin_screen_colors = $row[9];
$SSuser_new_lead_limit = $row[10];
$SSuser_territories_active = $row[11];
$SSqc_features_active = $row[12];
$SSagent_soundboards = $row[13];
$SSmenu_background='015B91';
$SSframe_background='D9E6FE';
@@ -2002,7 +2004,7 @@ if ($subcamp_font_size < 4) {$subcamp_font_size='11';}
<a href="admin_languages.php?ADD=163000000000" STYLE="text-decoration:none;"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> &nbsp; <img src="images/icon_languages.png" border=0 alt=\"Users\" width=14 height=14 valign=middle> <?php echo _QXZ("Languages"); ?> </a></TD>
</TR>
<?php }
if (preg_match("/soundboard/",$SSactive_modules) )
if ( (preg_match("/soundboard/",$SSactive_modules) ) or ($SSagent_soundboards > 0) )
{
?>
<TR <?php echo $soundboard_sh ?><?php if ($SSadmin_row_click > 0) {echo " onclick=\"window.document.location='admin_soundboard.php?ADD=162000000000';\"";} ?>><TD ALIGN=LEFT <?php echo $soundboard_sh ?>> &nbsp;
@@ -2174,7 +2176,7 @@ if ($SSenable_languages == '1')
?>
<TR BGCOLOR=<?php echo $languages_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="admin_languages.php?ADD=163000000000"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <?php echo _QXZ("Show Languages"); ?> </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="admin_languages.php?ADD=163111111111"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <?php echo _QXZ("Add A New Language"); ?></FONT></a> &nbsp; | &nbsp; <a href="admin_languages.php?ADD=163211111111"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <?php echo _QXZ("Copy A Languages Entry"); ?></FONT></a> &nbsp; | &nbsp; <a href="admin_languages.php?ADD=163311111111"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <?php echo _QXZ("Import Phrases"); ?></FONT></a> &nbsp; | &nbsp; <a href="admin_languages.php?ADD=163411111111"><FONT STYLE="font-family:HELVETICA;font-size:<?php echo $subcamp_font_size ?>;color:BLACK;"> <?php echo _QXZ("Export Phrases"); ?></FONT></a> &nbsp; <?php } ?></TD></TR>
<?php }
if (preg_match("/soundboard/",$SSactive_modules) )
if ( (preg_match("/soundboard/",$SSactive_modules) ) or ($SSagent_soundboards > 0) )
{
if ( (strlen($soundboard_sh) > 25) and (strlen($admin_hh) > 25) ) {
?>
+76 -18
View File
@@ -66,10 +66,11 @@
# 160102-1039 - Better special characters support
# 160428-2359 - Fixed custom table bug
# 160508-0757 - Added colors features
# 161103-2224 - Added web_loader_phone_length option
#
$version = '2.12-64';
$build = '160508-0757';
$version = '2.12-65';
$build = '161103-2224';
require("dbconnect_mysqli.php");
require("functions.php");
@@ -172,6 +173,9 @@ if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];}
elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];}
if (isset($_GET["state_conversion"])) {$state_conversion=$_GET["state_conversion"];}
elseif (isset($_POST["state_conversion"])) {$state_conversion=$_POST["state_conversion"];}
if (isset($_GET["web_loader_phone_length"])) {$web_loader_phone_length=$_GET["web_loader_phone_length"];}
elseif (isset($_POST["web_loader_phone_length"])) {$web_loader_phone_length=$_POST["web_loader_phone_length"];}
if (strlen($dedupe_statuses_override)>0) {
$dedupe_statuses=explode(",", $dedupe_statuses_override);
@@ -189,21 +193,22 @@ $vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable,enable_languages,language_method,active_modules,admin_screen_colors FROM system_settings;";
$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable,enable_languages,language_method,active_modules,admin_screen_colors,web_loader_phone_length FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysqli_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$non_latin = $row[0];
$admin_web_directory = $row[1];
$custom_fields_enabled = $row[2];
$webroot_writable = $row[3];
$SSenable_languages = $row[4];
$SSlanguage_method = $row[5];
$SSactive_modules = $row[6];
$SSadmin_screen_colors = $row[7];
$non_latin = $row[0];
$admin_web_directory = $row[1];
$custom_fields_enabled = $row[2];
$webroot_writable = $row[3];
$SSenable_languages = $row[4];
$SSlanguage_method = $row[5];
$SSactive_modules = $row[6];
$SSadmin_screen_colors = $row[7];
$SSweb_loader_phone_length = $row[8];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -219,6 +224,7 @@ else
$PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
}
$list_id_override = preg_replace('/[^0-9]/','',$list_id_override);
$web_loader_phone_length = preg_replace('/[^0-9]/','',$web_loader_phone_length);
$STARTtime = date("U");
$TODAY = date("Y-m-d");
@@ -688,6 +694,21 @@ if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard" && $file_l
<option value="STATELOOKUP"><?php echo _QXZ("FULL STATE NAME TO ABBREVIATION"); ?></option>
</select></td>
</tr>
<tr>
<td align=right width="25%"><font face="arial, helvetica" size=2><?php echo _QXZ("Required Phone Number Length"); ?>: </font></td>
<td align=left width="75%"><font face="arial, helvetica" size=1><select size=1 name=web_loader_phone_length>
<?php if ($SSweb_loader_phone_length == 'DISABLED') { ?>
<option selected value=""><?php echo _QXZ("DISABLED"); ?>
<?php }
if ($SSweb_loader_phone_length == 'CHOOSE') { ?>
<option selected value=""><?php echo _QXZ("DISABLED"); ?></option>
<option>5</option><option>6</option><option>7</option><option>8</option><option>9</option><option>10</option><option>11</option><option>12</option><option>13</option><option>14</option><option>15</option><option>16</option><option>17</option><option>18</option>
<?php }
if ( (strlen($SSweb_loader_phone_length) > 0) and (strlen($SSweb_loader_phone_length) < 3) and ($SSweb_loader_phone_length > 4) and ($SSweb_loader_phone_length < 19) ) { ?>
<option selected value="<?php echo $SSweb_loader_phone_length ?>"><?php echo $SSweb_loader_phone_length ?></option>
<?php } ?>
</select></td>
</tr>
<tr>
<td align=center colspan=2><input type=submit value="<?php echo _QXZ("SUBMIT"); ?>" name='submit_file'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=button onClick="javascript:document.location='admin_listloader_fourth_gen.php'" value="<?php echo _QXZ("START OVER"); ?>" name='reload_page'></td>
@@ -730,6 +751,11 @@ else
<td align=right width="35%"><B><font face="arial, helvetica" size=2><?php echo _QXZ("State Abbreviation Lookup"); ?>:</font></B></td>
<td align=left width="75%"><font face="arial, helvetica" size=2><?php echo $state_conversion ?></font></td>
</tr>
<tr>
<td align=right width="35%"><B><font face="arial, helvetica" size=2><?php echo _QXZ("Required Phone Number Length"); ?>:</font></B></td>
<td align=left width="75%"><font face="arial, helvetica" size=2><?php echo $web_loader_phone_length ?></font></td>
</tr>
<tr>
@@ -805,6 +831,10 @@ if ($OK_to_process)
{
print "<BR>"._QXZ("CONVERSION OF STATE NAMES TO ABBREVIATIONS ENABLED").": $state_conversion<BR>\n";
}
if ( (strlen($web_loader_phone_length)>0) and (strlen($web_loader_phone_length)< 3) )
{
print "<BR>"._QXZ("REQUIRED PHONE NUMBER LENGTH").": $web_loader_phone_length<BR>\n";
}
if ($custom_fields_enabled > 0)
{
@@ -1135,11 +1165,16 @@ if ($OK_to_process)
$valid_number=1;
$invalid_reason='';
if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) )
if ( (strlen($phone_number)<5) || (strlen($phone_number)>18) )
{
$valid_number=0;
$invalid_reason = _QXZ("INVALID PHONE NUMBER LENGTH");
}
if ( (strlen($web_loader_phone_length)>0) and (strlen($web_loader_phone_length)< 3) and ( (strlen($phone_number) > $web_loader_phone_length) or (strlen($phone_number) < $web_loader_phone_length) ) )
{
$valid_number=0;
$invalid_reason = _QXZ("INVALID REQUIRED PHONE NUMBER LENGTH");
}
if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) )
{
$USprefix = substr($phone_number, 3, 1);
@@ -1263,7 +1298,7 @@ if ($OK_to_process)
}
### LOG INSERTION Admin Log Table ###
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total, DEBUG: dedupe_statuses:$dedupe_statuses[0]| dedupe_statuses_override:$dedupe_statuses_override| dupcheck:$dupcheck| lead_file:$lead_file| list_id_override:$list_id_override| phone_code_override:$phone_code_override| postalgmt:$postalgmt| template_id:$template_id| usacan_check:$usacan_check| state_conversion:$state_conversion|';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST CUSTOM', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total, DEBUG: dedupe_statuses:$dedupe_statuses[0]| dedupe_statuses_override:$dedupe_statuses_override| dupcheck:$dupcheck| lead_file:$lead_file| list_id_override:$list_id_override| phone_code_override:$phone_code_override| postalgmt:$postalgmt| template_id:$template_id| usacan_check:$usacan_check| state_conversion:$state_conversion| web_loader_phone_length:$web_loader_phone_length|';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
@@ -1281,7 +1316,7 @@ if (($leadfile) && ($LF_path))
$total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list='';
### LOG INSERTION Admin Log Table ###
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name, DEBUG: dedupe_statuses:$dedupe_statuses[0]| dedupe_statuses_override:$dedupe_statuses_override| dupcheck:$dupcheck| lead_file:$lead_file| list_id_override:$list_id_override| phone_code_override:$phone_code_override| postalgmt:$postalgmt| template_id:$template_id| usacan_check:$usacan_check| state_conversion:$state_conversion|';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name, DEBUG: dedupe_statuses:$dedupe_statuses[0]| dedupe_statuses_override:$dedupe_statuses_override| dupcheck:$dupcheck| lead_file:$lead_file| list_id_override:$list_id_override| phone_code_override:$phone_code_override| postalgmt:$postalgmt| template_id:$template_id| usacan_check:$usacan_check| state_conversion:$state_conversion| web_loader_phone_length:$web_loader_phone_length|';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
@@ -1418,6 +1453,10 @@ if (($leadfile) && ($LF_path))
{
print "<BR>"._QXZ("CONVERSION OF STATE NAMES TO ABBREVIATIONS ENABLED").": $state_conversion<BR>\n";
}
if ( (strlen($web_loader_phone_length)>0) and (strlen($web_loader_phone_length)< 3) )
{
print "<BR>"._QXZ("REQUIRED PHONE NUMBER LENGTH").": $web_loader_phone_length<BR>\n";
}
while (!feof($file))
{
@@ -1653,11 +1692,16 @@ if (($leadfile) && ($LF_path))
$valid_number=1;
$invalid_reason='';
if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) )
if ( (strlen($phone_number)<5) || (strlen($phone_number)>18) )
{
$valid_number=0;
$invalid_reason = _QXZ("INVALID PHONE NUMBER LENGTH");
}
if ( (strlen($web_loader_phone_length)>0) and (strlen($web_loader_phone_length)< 3) and ( (strlen($phone_number) > $web_loader_phone_length) or (strlen($phone_number) < $web_loader_phone_length) ) )
{
$valid_number=0;
$invalid_reason = _QXZ("INVALID REQUIRED PHONE NUMBER LENGTH");
}
if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) )
{
$USprefix = substr($phone_number, 3, 1);
@@ -1854,7 +1898,7 @@ if (($leadfile) && ($LF_path))
{fwrite($stmt_file, $custom_ins_stmt."\r\n");}
}
### LOG INSERTION Admin Log Table ###
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total, DEBUG: dedupe_statuses:$dedupe_statuses[0]| dedupe_statuses_override:$dedupe_statuses_override| dupcheck:$dupcheck| lead_file:$lead_file| list_id_override:$list_id_override| phone_code_override:$phone_code_override| postalgmt:$postalgmt| template_id:$template_id| usacan_check:$usacan_check| state_conversion:$state_conversion|';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total, DEBUG: dedupe_statuses:$dedupe_statuses[0]| dedupe_statuses_override:$dedupe_statuses_override| dupcheck:$dupcheck| lead_file:$lead_file| list_id_override:$list_id_override| phone_code_override:$phone_code_override| postalgmt:$postalgmt| template_id:$template_id| usacan_check:$usacan_check| state_conversion:$state_conversion| web_loader_phone_length:$web_loader_phone_length|';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
@@ -1960,6 +2004,10 @@ if (($leadfile) && ($LF_path))
{
print "<BR>"._QXZ("CONVERSION OF STATE NAMES TO ABBREVIATIONS ENABLED").": $state_conversion<BR>\n";
}
if ( (strlen($web_loader_phone_length)>0) and (strlen($web_loader_phone_length)< 3) )
{
print "<BR>"._QXZ("REQUIRED PHONE NUMBER LENGTH").": $web_loader_phone_length<BR>\n";
}
while (!feof($file))
{
@@ -2190,11 +2238,16 @@ if (($leadfile) && ($LF_path))
$valid_number=1;
$invalid_reason='';
if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) )
if ( (strlen($phone_number)<5) || (strlen($phone_number)>18) )
{
$valid_number=0;
$invalid_reason = _QXZ("INVALID PHONE NUMBER LENGTH");
}
if ( (strlen($web_loader_phone_length)>0) and (strlen($web_loader_phone_length)< 3) and ( (strlen($phone_number) > $web_loader_phone_length) or (strlen($phone_number) < $web_loader_phone_length) ) )
{
$valid_number=0;
$invalid_reason = _QXZ("INVALID REQUIRED PHONE NUMBER LENGTH");
}
if ( (preg_match("/PREFIX/",$usacan_check)) and ($valid_number > 0) )
{
$USprefix = substr($phone_number, 3, 1);
@@ -2298,7 +2351,7 @@ if (($leadfile) && ($LF_path))
{fwrite($stmt_file, $stmtZ."\r\n");}
}
### LOG INSERTION Admin Log Table ###
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total, DEBUG: dedupe_statuses:$dedupe_statuses[0]| dedupe_statuses_override:$dedupe_statuses_override| dupcheck:$dupcheck| lead_file:$lead_file| list_id_override:$list_id_override| phone_code_override:$phone_code_override| postalgmt:$postalgmt| template_id:$template_id| usacan_check:$usacan_check| state_conversion:$state_conversion|';";
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST STANDARD', event_sql='', event_notes='File Name: $leadfile_name, GOOD: $good, BAD: $bad, TOTAL: $total, DEBUG: dedupe_statuses:$dedupe_statuses[0]| dedupe_statuses_override:$dedupe_statuses_override| dupcheck:$dupcheck| lead_file:$lead_file| list_id_override:$list_id_override| phone_code_override:$phone_code_override| postalgmt:$postalgmt| template_id:$template_id| usacan_check:$usacan_check| state_conversion:$state_conversion| web_loader_phone_length:$web_loader_phone_length|';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
@@ -2457,6 +2510,10 @@ if (($leadfile) && ($LF_path))
{
print "<BR>"._QXZ("CONVERSION OF STATE NAMES TO ABBREVIATIONS ENABLED").": $state_conversion<BR>\n";
}
if ( (strlen($web_loader_phone_length)>0) and (strlen($web_loader_phone_length)< 3) )
{
print "<BR>"._QXZ("REQUIRED PHONE NUMBER LENGTH").": $web_loader_phone_length<BR>\n";
}
$buffer=rtrim(fgets($file, 4096));
$buffer=stripslashes($buffer);
@@ -2491,6 +2548,7 @@ if (($leadfile) && ($LF_path))
print " <input type=hidden name=dupcheck value=\"$dupcheck\">\r\n";
print " <input type=hidden name=usacan_check value=\"$usacan_check\">\r\n";
print " <input type=hidden name=state_conversion value=\"$state_conversion\">\r\n";
print " <input type=hidden name=web_loader_phone_length value=\"$web_loader_phone_length\">\r\n";
print " <input type=hidden name=postalgmt value=\"$postalgmt\">\r\n";
print " <input type=hidden name=lead_file value=\"$lead_file\">\r\n";
print " <input type=hidden name=list_id_override value=\"$list_id_override\">\r\n";
File diff suppressed because it is too large Load Diff
+11 -3
View File
@@ -1,7 +1,7 @@
<?php
# callbacks_bulk_change.php
#
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2016 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 120819-0119 - First build
@@ -11,6 +11,7 @@
# 130901-1940 - Changed to mysqli PHP functions
# 141007-2207 - Finalized adding QXZ translation to all admin files
# 141229-2050 - Added code for on-the-fly language translations display
# 161104-0702 - Added option to change callbacks to ANYONE callbacks
#
require("dbconnect_mysqli.php");
@@ -35,6 +36,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
if (isset($_GET["convert_to_anyone"])) {$convert_to_anyone=$_GET["convert_to_anyone"];}
elseif (isset($_POST["convert_to_anyone"])) {$convert_to_anyone=$_POST["convert_to_anyone"];}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
@@ -162,7 +165,11 @@ while ($i < $groups_to_print)
}
if ($SUBMIT && $old_user && $new_user && $confirm_transfer) {
$upd_stmt="UPDATE vicidial_callbacks set user='$new_user' where recipient='USERONLY' and status!='INACTIVE' and user='$old_user' $LOGadmin_viewable_groupsSQL";
if ($new_user=="ANYONE") {
$upd_stmt="UPDATE vicidial_callbacks set recipient='ANYONE' where recipient='USERONLY' and status!='INACTIVE' and user='$old_user' $LOGadmin_viewable_groupsSQL";
} else {
$upd_stmt="UPDATE vicidial_callbacks set user='$new_user' where recipient='USERONLY' and status!='INACTIVE' and user='$old_user' $LOGadmin_viewable_groupsSQL";
}
$upd_rslt=mysql_to_mysqli($upd_stmt, $link);
if ($DB) {echo "$upd_stmt\n";}
@@ -237,7 +244,7 @@ if ($SUBMIT && $old_user && $new_user && !$confirm_transfer)
echo "<input type=hidden name=new_user value=\"$new_user\">\n";
echo _QXZ("You are about to transfer")." $callback_ct "._QXZ("callbacks")."<BR>\n";
echo _QXZ("from user")." $old_user - $old_user_name<BR>\n";
echo _QXZ("to user")." $new_user - $new_user_name<BR><BR><BR>\n";
echo _QXZ("to user")." $new_user".($new_user_name!="" ? " - $new_user_name" : "")."<BR><BR><BR>\n";
echo "<a href='$PHP_SELF?DB=$DB&old_user=$old_user&new_user=$new_user&confirm_transfer=1&SUBMIT=1'>"._QXZ("CLICK TO CONFIRM")."</a><BR><BR>";
echo "<a href='$PHP_SELF?DB=$DB'>"._QXZ("CLICK TO CANCEL")."</a><BR><BR>";
}
@@ -272,6 +279,7 @@ else
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
echo "<select name='new_user' size=5>\n";
echo "\t<option value='ANYONE'>Anyone - available to all agents in campaign</option>\n";
while ($row=mysqli_fetch_array($rslt))
{
echo "\t<option value='$row[user]'>$row[user] - $row[full_name]</option>\n";
+146 -35
View File
@@ -1,11 +1,12 @@
<?php
# callbacks_bulk_move.php
#
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2016 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 150218-0923 - First build based on callbacks_bulk_change.php
# 151025-1041 - Fixed issue with check-all
# 161105-0056 - Added options to purge uncalled callbacks, and also to revert callbacks to their most recent non-callback-dispo based on the callback entry time and the log tables.
#
require("dbconnect_mysqli.php");
@@ -51,10 +52,14 @@ if (isset($_GET["days_uncalled"])) {$days_uncalled=$_GET["days_uncalled"];}
elseif (isset($_POST["days_uncalled"])) {$days_uncalled=$_POST["days_uncalled"];}
if (isset($_GET["purge_called_records"])) {$purge_called_records=$_GET["purge_called_records"];}
elseif (isset($_POST["purge_called_records"])) {$purge_called_records=$_POST["purge_called_records"];}
if (isset($_GET["purge_uncalled_records"])) {$purge_uncalled_records=$_GET["purge_uncalled_records"];}
elseif (isset($_POST["purge_uncalled_records"])) {$purge_uncalled_records=$_POST["purge_uncalled_records"];}
if (isset($_GET["revert_status"])) {$revert_status=$_GET["revert_status"];}
elseif (isset($_POST["revert_status"])) {$revert_status=$_POST["revert_status"];}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,enable_languages,language_method FROM system_settings;";
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,enable_languages,language_method,qc_features_active FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysqli_num_rows($rslt);
@@ -66,6 +71,7 @@ if ($qm_conf_ct > 0)
$SSoutbound_autodial_active = $row[2];
$SSenable_languages = $row[3];
$SSlanguage_method = $row[4];
$SSqc_features_active = $row[5];
}
##### END SETTINGS LOOKUP #####
###########################################
@@ -89,7 +95,7 @@ $date = date("r");
$ip = getenv("REMOTE_ADDR");
$browser = getenv("HTTP_USER_AGENT");
$stmt="SELECT selected_language from vicidial_users where user='$PHP_AUTH_USER';";
$stmt="SELECT selected_language,qc_enabled from vicidial_users where user='$PHP_AUTH_USER';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$sl_ct = mysqli_num_rows($rslt);
@@ -97,6 +103,7 @@ if ($sl_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$VUselected_language = $row[0];
$qc_auth = $row[1];
}
$category='';
@@ -480,13 +487,13 @@ require("admin_header.php");
?>
<CENTER>
<TABLE WIDTH=680 BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0><TR BGCOLOR=#015B91><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> &nbsp; <?php echo _QXZ("Callbacks Bulk Move"); ?><?php echo "$NWB#cb-bulk$NWE"; ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> &nbsp; </TD></TR>
<TABLE WIDTH=680 BGCOLOR=<?php echo $SSmenu_background ?> cellpadding=2 cellspacing=0><TR BGCOLOR=#<?php echo $SSmenu_background ?>><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> &nbsp; <?php echo _QXZ("Callbacks Bulk Move"); ?><?php echo "$NWB#cb-bulk$NWE"; ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B> &nbsp; </TD></TR>
<?php
echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=center COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B> &nbsp; \n";
echo "<TR BGCOLOR=\"#".$SSstd_row1_background."\"><TD ALIGN=center COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3><B> &nbsp; \n";
### callbacks change form
echo "<form action=$PHP_SELF method=POST>\n";
@@ -495,7 +502,7 @@ echo "<input type=hidden name=DB value=\"$DB\">\n";
if ($SUBMIT && $new_list_id && $new_status)
if ($SUBMIT && $new_list_id && ($new_status || $revert_status))
{
if (count($cb_users)>0)
{
@@ -618,8 +625,8 @@ if ($SUBMIT && $new_list_id && $new_status)
{
$daySQL=" and vc.callback_time<='".date("Y-m-d H:i:s")."'-INTERVAL $days_uncalled DAY ";
}
else
{}
# else
# {}
$callback_dispo_stmt="SELECT distinct status from vicidial_statuses where scheduled_callback='Y' UNION SELECT distinct status from vicidial_campaign_statuses where scheduled_callback='Y' ".preg_replace("/vc\./", "", $groupsSQL);
if ($DB) {echo $callback_dispo_stmt."<BR>";}
@@ -631,18 +638,46 @@ if ($SUBMIT && $new_list_id && $new_status)
}
}
$purge_trigger=0;
$callback_statuses="'LIVE'";
$purge_verbiage=array();
if ($purge_called_records)
{
### DELETE INACTIVE RECORDS
$purge_called_clause="(vc.status='INACTIVE' or (vc.status='LIVE' and vl.status not in ('".implode("','", $cb_dispos)."')))";
$purge_trigger++;
array_push($purge_verbiage, "CALLED", "INACTIVE");
}
if ($purge_uncalled_records)
{
### DELETE ACTIVE RECORDS
$purge_uncalled_clause="(vc.status in ('ACTIVE', 'LIVE') and vl.status in ('".implode("','", $cb_dispos)."'))";
$purge_trigger++;
$callback_statuses.=",'ACTIVE'";
array_push($purge_verbiage, "UNCALLED");
}
if ($SUBMIT && $new_list_id && $new_status && (count($cb_users)>0 || count($cb_user_groups)>0 || count($cb_lists)>0 || count($cb_groups)>0) && $confirm_transfer)
if ($purge_trigger==1)
{
$purge_clause=$purge_called_clause.$purge_uncalled_clause;
}
else if ($purge_trigger==2)
{
$purge_clause="(".$purge_called_clause." or ".$purge_uncalled_clause.")";
}
if ($SUBMIT && $new_list_id && ($new_status || $revert_status) && (count($cb_users)>0 || count($cb_user_groups)>0 || count($cb_lists)>0 || count($cb_groups)>0) && $confirm_transfer)
{
$actual_archived_ct=0;
$actual_purged_ct=0;
$arch_stmts='';
$del_stmts='';
if ($purge_called_records)
if ($purge_trigger>0)
{
### DELETE INACTIVE RECORDS
$stmt = "SELECT vc.callback_id, vc.lead_id, vc.status from vicidial_callbacks vc, vicidial_list vl where (vc.status='INACTIVE' or (vc.status='LIVE' and vl.status not in ('".implode("','", $cb_dispos)."'))) and vc.lead_id=vl.lead_id $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL;";
$stmt = "SELECT vc.callback_id, vc.lead_id, vc.status from vicidial_callbacks vc, vicidial_list vl where $purge_clause and vc.lead_id=vl.lead_id $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL;";
$rslt = mysql_to_mysqli($stmt, $link);
$purge_ct=mysqli_num_rows($rslt);
@@ -659,12 +694,11 @@ if ($SUBMIT && $new_list_id && $new_status && (count($cb_users)>0 || count($cb_u
$del_stmts .= " $delete_stmt";
}
# $callback_stmt="SELECT vc.callback_id, vc.lead_id, vc.status from vicidial_callbacks vc, vicidial_list vl where vc.status='LIVE' and vl.status in ('".implode("','", $cb_dispos)."') and vc.lead_id=vl.lead_id $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL";
# $callback_stmt="SELECT vc.callback_id, vc.lead_id, vc.status from vicidial_callbacks vc, vicidial_list vl where vc.status='LIVE' and vl.status in ('".implode("','", $cb_dispos)."') and vc.lead_id=vl.lead_id $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL";
}
# else
# {
$callback_stmt="SELECT vc.callback_id, vc.lead_id, vc.status from vicidial_callbacks vc where status='LIVE' $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL";
# }
$callback_stmt="SELECT vc.callback_id, vc.lead_id, vc.status, vc.entry_time from vicidial_callbacks vc where status in ($callback_statuses) $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL order by callback_time asc";
if ($DB) {echo "|$callback_stmt|\n";}
$callback_rslt=mysql_to_mysqli($callback_stmt, $link);
$callback_ct=mysqli_num_rows($callback_rslt);
@@ -676,6 +710,51 @@ if ($SUBMIT && $new_list_id && $new_status && (count($cb_users)>0 || count($cb_u
while ($cb_row=mysqli_fetch_row($callback_rslt))
{
$lead_id=$cb_row[1];
if ($revert_status) {
$callback_entry_time=$cb_row[3];
# SET UPDATE STATUS TO NEW IN CASE NO CALL HISTORY IS FOUND BEFORE LEAD WAS MARKED CALLBACK
$new_status='NEW';
$callback_time_clause=" and call_date<='$callback_entry_time'";
$sort_by="desc";
# FIND THE STATUS THE CALLBACK WAS BEFORE THE CALL THAT THE AGENT DISPO'ED IT AS, IF IT EXISTS
$revert_stmt="select event_time, status, uniqueid from vicidial_agent_log where lead_id='$lead_id' and event_time<='$callback_entry_time' and status not in ('".implode("','", $cb_dispos)."') order by event_time desc limit 1";
$revert_rslt=mysql_to_mysqli($revert_stmt, $link);
if (mysqli_num_rows($revert_rslt)>0) {
$revert_row=mysqli_fetch_row($revert_rslt);
if ($revert_row[0]!="") {
$callback_entry_time=$revert_row[0]; # THIS BECOMES THE MOST RECENT CALLBACK TIME TO CHECK THE CLOSER LOG FOR
$new_status=$revert_row[1];
$callback_time_clause=" and call_date>='$callback_entry_time' and call_date<'$cb_row[3]' ";
}
}
# FIND ANY OUTBOUND CALL MADE AFTER CALL WAS DISPO'ED BY AGENT AND NOT A CALLBACK
$revert_stmt2="select call_date, status, uniqueid from vicidial_log where lead_id='$lead_id' $callback_time_clause and status not in ('".implode("','", $cb_dispos)."') order by call_date desc limit 1";
$revert_rslt2=mysql_to_mysqli($revert_stmt2, $link);
if (mysqli_num_rows($revert_rslt2)>0) {
$revert_row2=mysqli_fetch_row($revert_rslt2);
if ($revert_row2[0]!="") {
$callback_entry_time=$revert_row2[0];
$new_status=$revert_row2[1];
$callback_time_clause=" and call_date>='$callback_entry_time' and call_date<'$cb_row[3]' ";
}
}
# FIND ANY INBOUND CALL MADE AFTER CALL WAS DISPO'ED BY AGENT AND NOT A CALLBACK
$revert_stmt3="select call_date, status, closecallid from vicidial_closer_log where lead_id='$lead_id' $callback_time_clause and status not in ('".implode("','", $cb_dispos)."') order by call_date asc limit 1";
$revert_rslt3=mysql_to_mysqli($revert_stmt3, $link);
if (mysqli_num_rows($revert_rslt3)>0) {
$revert_row3=mysqli_fetch_row($revert_rslt3);
if ($revert_row3[0]!="") {
$callback_entry_time=$revert_row3[0];
$new_status=$revert_row3[1];
}
}
if ($DB) {echo "|$cb_row[0]<BR>$revert_stmt - $revert_row[2]<BR>$revert_stmt2 - $revert_row2[2]<BR>$revert_stmt3 - $revert_row3[2]|\n";}
}
$upd_stmt="update vicidial_list set $new_listSQL status='$new_status' where lead_id='$lead_id';";
$upd_rslt=mysql_to_mysqli($upd_stmt, $link);
$actual_callback_ct+=mysqli_affected_rows($link);
@@ -714,25 +793,32 @@ if ($SUBMIT && $new_list_id && $new_status && (count($cb_users)>0 || count($cb_u
echo "<a href='$PHP_SELF?DB=$DB'>"._QXZ("BACK")."</a><BR><BR>";
}
else if ($SUBMIT && $new_list_id && $new_status && (count($cb_users)>0 || count($cb_user_groups)>0 || count($cb_lists)>0 || count($cb_groups)>0) && !$confirm_transfer)
else if ($SUBMIT && $new_list_id && ($new_status || $revert_status) && (count($cb_users)>0 || count($cb_user_groups)>0 || count($cb_lists)>0 || count($cb_groups)>0) && !$confirm_transfer)
{
if (!$purge_called_records)
# $DB=1;
if ($purge_trigger==0)
{
$callback_stmt="SELECT * from vicidial_callbacks vc where status='LIVE' $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL";
}
else
{
$callback_stmt="SELECT * from vicidial_callbacks vc, vicidial_list vl where vc.status='LIVE' and vl.status in ('".implode("','", $cb_dispos)."') and vc.lead_id=vl.lead_id $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL";
$callback_stmt="SELECT * from vicidial_callbacks vc, vicidial_list vl where $purge_clause and vc.lead_id=vl.lead_id $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL";
$purge_stmt="SELECT * from vicidial_callbacks vc, vicidial_list vl where (vc.status='INACTIVE' or (vc.status='LIVE' and vl.status not in ('".implode("','", $cb_dispos)."'))) and vc.lead_id=vl.lead_id $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL";
$purge_stmt="SELECT vc.status, vl.status from vicidial_callbacks vc, vicidial_list vl where $purge_clause and vc.lead_id=vl.lead_id $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL";
$purge_rslt=mysql_to_mysqli($purge_stmt, $link);
$purge_ct=mysqli_num_rows($purge_rslt);
$purge_called_ct=0;
$purge_uncalled_ct=0;
while ($purge_row=mysqli_fetch_row($purge_rslt))
{
if ($purge_row[0]=="INACTIVE" || ($purge_row[0]=="LIVE" && !in_array("$purge_row[1]", $cb_dispos))) {$purge_called_ct++;}
if ($purge_row[0]=="ACTIVE" || ($purge_row[0]=="LIVE" && in_array("$purge_row[1]", $cb_dispos))) {$purge_uncalled_ct++;}
}
}
$callback_rslt=mysql_to_mysqli($callback_stmt, $link);
$callback_ct=mysqli_num_rows($callback_rslt);
if ($DB) {echo $callback_stmt."<BR>";}
if ($DB) {echo $purge_stmt."<BR>";}
# if ($DB) {echo $purge_stmt."<BR>";}
$list_name_stmt="SELECT list_name from vicidial_lists where list_id='$new_list_id'";
$list_name_rslt=mysql_to_mysqli($list_name_stmt, $link);
@@ -740,19 +826,21 @@ else if ($SUBMIT && $new_list_id && $new_status && (count($cb_users)>0 || count(
$new_list_id_name=$list_name_row[0];
echo "<table width='500' align='center'><tr><td align='left'>";
echo _QXZ("You are about to transfer")." $callback_ct "._QXZ("callbacks")." from <BR><UL>\n";
echo _QXZ("You are about to transfer")." $callback_ct "._QXZ("callbacks from")."<BR><UL>\n";
if (count($cb_groups)>0) {echo "<LI>"._QXZ("campaigns")." ".implode(",", $cb_groups)."</LI>\n";}
if (count($cb_lists)>0) {echo "<LI>"._QXZ("lists")." ".implode(",", $cb_lists)."</LI>\n";}
if (count($cb_user_groups)>0) {echo"<LI>". _QXZ("user groups")." ".implode(",", $cb_user_groups)."</LI>\n";}
if (count($cb_users)>0) {echo "<LI>"._QXZ("users")." ".implode(",", $cb_users)."</LI>\n";}
if ($days_uncalled) {echo "<LI>"._QXZ("where leads have been LIVE and uncalled for ")." $days_uncalled days</LI>\n";}
if ($days_uncalled) {echo "<LI>"._QXZ("where leads have been LIVE and uncalled for ")." $days_uncalled "._QXZ("days")."</LI>\n";}
echo "</UL><BR>";
echo _QXZ("to list ID")." <B>$new_list_id - $new_list_id_name</B> "._QXZ("as status")." <B>$new_status</B><BR><BR>\n";
if ($purge_called_records) {echo "<B><font color='#990000'>**$purge_ct "._QXZ("RECORDS HAVING BEEN CALLED or INACTIVE WILL BE PURGED")."**</font></B><BR><BR>\n";}
echo _QXZ("to list ID")." <B>$new_list_id - $new_list_id_name</B> ".($revert_status ? "as <B>previous status</B>" :_QXZ("as status")." <B>$new_status</B>")."<BR><BR>\n";
if ($purge_called_records) {echo "<B><font color='#990000'>**$purge_called_ct "._QXZ("RECORDS HAVING BEEN CALLED or INACTIVE WILL BE PURGED")."**</font></B><BR><BR>\n";}
if ($purge_uncalled_records) {echo "<B><font color='#990000'>**$purge_uncalled_ct "._QXZ("ACTIVE RECORDS WILL BE PURGED")."**</font></B><BR><BR>\n";}
if ($purge_called_records && $purge_uncalled_records) {echo "<B><font color='#990000'>**$purge_ct "._QXZ("RECORDS HAVING BEEN ").implode(" or ", $purge_verbiage)._QXZ(" WILL BE PURGED")."**</font></B><BR><BR>\n";}
echo "</td></tr></table>";
echo "<a href='$PHP_SELF?DB=$DB&new_list_id=$new_list_id&new_status=$new_status&days_uncalled=$days_uncalled&purge_called_records=$purge_called_records&SUBMIT=1&confirm_transfer=YES$usersQS$user_groupsQS$listsQS$groupsQS'>"._QXZ("CLICK TO CONFIRM")."</a><BR><BR>";
echo "<a href='$PHP_SELF?DB=$DB&new_list_id=$new_list_id&new_status=$new_status&days_uncalled=$days_uncalled&revert_status=$revert_status&purge_called_records=$purge_called_records&purge_uncalled_records=$purge_uncalled_records&SUBMIT=1&confirm_transfer=YES$usersQS$user_groupsQS$listsQS$groupsQS'>"._QXZ("CLICK TO CONFIRM")."</a><BR><BR>";
echo "<a href='$PHP_SELF?DB=$DB'>"._QXZ("CLICK TO CANCEL")."</a><BR><BR>";
}
@@ -837,7 +925,7 @@ else
$stmt="SELECT user, count(*) as ct from vicidial_callbacks $whereLOGadmin_viewable_groupsSQL group by user order by user";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "$stmt\n";}
echo "<B>"._QXZ("Agents with callbacks").":</B>$NWB#cb-bulk-agents$NWE<BR><select name='cb_users[]' size=5 multiple>\n";
echo "<B>"._QXZ("Agents with callbacks (USERONLY)").":</B>$NWB#cb-bulk-agents$NWE<BR><select name='cb_users[]' size=5 multiple>\n";
echo "<option value='ALL'>"._QXZ("CHECK ALL AGENTS")."</option>\n";
if (mysqli_num_rows($rslt)>0)
{
@@ -863,8 +951,9 @@ else
echo "<tr>";
echo "<td align='left' width='270'>";
echo "<B><input type='checkbox' name='purge_called_records' value='Y' checked>"._QXZ("Purge called records");
echo "$NWB#cb-bulk-purge$NWE</td>";
echo "<B><input type='checkbox' name='purge_called_records' value='Y' checked>"._QXZ("Purge called records")."$NWB#cb-bulk-purge$NWE<BR>";
echo "<input type='checkbox' name='purge_uncalled_records' value='Y' checked>"._QXZ("Purge uncalled records")."$NWB#cb-bulk-purge$NWE<BR>";
echo "</td>";
echo "<td align='left' width='400'>";
echo "<B>"._QXZ("Live and uncalled for over")." <select name='days_uncalled'>";
echo "<option value='0'>--</option>\n";
@@ -878,23 +967,45 @@ else
echo " "._QXZ("days, leave blank to ignore")."</B>$NWB#cb-bulk-liveanduncalled$NWE";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<BR/><BR/><input type='submit' name='SUBMIT' value=' "._QXZ("TRANSFER TO")." '><BR/><BR/>";
echo "<BR><BR>";
echo "<table width='650' align='center' border=0>";
echo "<tr>";
echo "<td align='center' colspan='2'>";
echo "<input type='submit' name='SUBMIT' value=' "._QXZ("TRANSFER TO")." '><BR/><BR/>";
echo "</td>";
echo "</tr>";
$stmt="SELECT list_id, list_name from vicidial_lists $whereLOGadmin_viewable_groupsSQL order by list_id asc";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
echo "<tr>";
echo "<td align='left' width='400'><B>";
echo _QXZ("List ID").": <select name='new_list_id' size=1>\n";
echo "<option value='X'>"._QXZ("DO NOT ALTER LIST ID")."</option>";
while ($row=mysqli_fetch_array($rslt))
{
echo "\t<option value='$row[list_id]'>$row[list_id] - $row[list_name]</option>\n";
}
echo "</select>$NWB#cb-bulk-newlist$NWE &nbsp; \n";
echo "</select>$NWB#cb-bulk-newlist$NWE\n";
echo "</B></td>";
echo "<td align='right' width='250'><B>";
echo _QXZ("New Status").": <input type=text name='new_status' size=7 maxlength=6 value='$new_status'>$NWB#cb-bulk-newstatus$NWE<BR>\n";
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align='right' colspan='2'>";
echo "<B><input type='checkbox' name='revert_status' value='checked' $revert_status>&nbsp;"._QXZ("Revert to last status")."<BR><font size='1'>("._QXZ("overrides 'New Status'").")</font></B>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo _QXZ("New Status").": <input type=text name='new_status' size=7 maxlength=6 value='$new_status'>$NWB#cb-bulk-newstatus$NWE\n";
}
echo "</form>\n";
+14
View File
@@ -99,6 +99,7 @@
# 161018-2245 - Added allow_required_fields
# 161028-1548 - Added agent_xfer_park_3way entry for system_settings
# 161031-1410 - Added users-user_new_lead_limit entry
# 161105-0246 - Added web_loader_phone_length, agent soundboards and purge uncalled records
#
@@ -4950,6 +4951,11 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
<BR>
<B><?php echo _QXZ("Agent Screen Park Xfer Button"); ?> -</B><?php echo _QXZ("This option defines whether the agent screen can have a button in the Transfer Conference frame that will allow the agent to park a 3way call. Default is 0 for disabled."); ?>
<BR>
<A NAME="settings-agent_soundboards">
<BR>
<B><?php echo _QXZ("Agent Soundboards"); ?> -</B><?php echo _QXZ("This option allows you to create agent soundboards that allow an agent in the user screen to click on audio files to have them play in their session. Default is 0 for disabled."); ?>
<BR>
<A NAME="settings-agentonly_callback_campaign_lock">
<BR>
@@ -5030,6 +5036,11 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
<BR>
<B><?php echo _QXZ("New Leads Per List Limit"); ?> -</B><?php echo _QXZ("This setting enables the new lead limits per list to be set on the list modify page and the user list new lead limit page. This feature will only work properly if the campaign is set to either the MANUAL or INBOUND_MAN Dial Method and No Hopper dialing is enabled. Default is 0 for disabled."); ?>
<BR>
<A NAME="settings-web_loader_phone_length">
<BR>
<B><?php echo _QXZ("Web Lead Loader Phone Length"); ?> -</B><?php echo _QXZ("This setting allows you to only allow phone numbers of a specific length into the system when loading leads with the web lead loader. The CHOOSE option allows a manager to optionally select a number of phone number digits to check the length by when loading leads one file at a time. Selecting a number option will not allow a manager to choose while loading leads, the check will be used every time the web lead loader is used. Default is DISABLED."); ?>
<BR>
<A NAME="settings-allow_custom_dialplan">
<BR>
@@ -6231,6 +6242,9 @@ if ($SSqc_features_active > 0)
<A NAME="cb-bulk-purge">
<BR>
<B><?php echo _QXZ("Purge called records"); ?> -</B><?php echo _QXZ("If this box is checked, before the leads meeting the selected criteria are moved, the callbacks table will purge itself of all inactive records in the table. This includes records that have a status of INACTIVE, OR any record still in the callback table that is LIVE but whose status in the vicidial_list table is NOT listed as a callback, i.e. it has been called, lead has called in, lead dispo has been modified. The page will notify you how many leads will be purged before you confirm that you would like to proceed."); ?>
<BR>
<B><?php echo _QXZ("Purge uncalled records"); ?> - </B><?php echo _QXZ("If this box is checked, before the leads meeting the selected criteria are moved, the callbacks table will purge itself of all uncalled records in the table. This includes records that have a status of ACTIVE, OR any record still in the callback table that is LIVE but whose status in the vicidial_list table is still listed as a callback, i.e. it has not been called, has not called in, and has not had the lead dispo modified. The page will notify you how many leads will be purged before you confirm that you would like to proceed."); ?>
<BR>
<A NAME="cb-bulk-liveanduncalled">