added DB and admin parts of agent pause codes

git-svn-id: svn://192.168.202.10@492 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2007-02-02 18:49:48 +00:00
parent d0dbfc9faa
commit 701ad98286
10 changed files with 261 additions and 23 deletions
+2 -2
View File
@@ -212,7 +212,7 @@ while($one_day_interval > 0)
&event_logger;
$stmtA = "UPDATE vicidial_live_agents set status='INCALL', last_call_time='$SQLdate' where server_ip='$server_ip' and status IN('QUEUE') and extension LIKE \"R/%\";";
$stmtA = "UPDATE vicidial_live_agents set status='INCALL', last_call_time='$SQLdate',comments='REMOTE' where server_ip='$server_ip' and status IN('QUEUE') and extension LIKE \"R/%\";";
$affected_rows = $dbhA->do($stmtA);
$event_string = "| QUEUEd call listing vla UPDATEd $affected_rows";
@@ -411,7 +411,7 @@ while($one_day_interval > 0)
}
$sthA->finish();
$stmtA = "INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,campaign_id,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,channel,uniqueid,callerid,user_level) values('$DBremote_user[$h]','$server_ip','$DBremote_conf_exten[$h]','R/$DBremote_user[$h]','READY','$DBremote_campaign[$h]','$DBremote_random[$h]','$SQLdate','$tsSQLdate','$SQLdate','$DBremote_closer[$h]','','','','$DBuser_level[$h]');";
$stmtA = "INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,campaign_id,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,channel,uniqueid,callerid,user_level,comments) values('$DBremote_user[$h]','$server_ip','$DBremote_conf_exten[$h]','R/$DBremote_user[$h]','READY','$DBremote_campaign[$h]','$DBremote_random[$h]','$SQLdate','$tsSQLdate','$SQLdate','$DBremote_closer[$h]','','','','$DBuser_level[$h]','REMOTE');";
$affected_rows = $dbhA->do($stmtA);
if ($DBX) {print STDERR "$DBremote_user[$h] NEW INSERT\n";}
if ($TESTrun > 0)
+1 -1
View File
@@ -21,7 +21,7 @@ REQUIREMENTS:
- asterisk-perl 0.08, do NOT use the 0.09 version, it does not work with VICIDIAL
- MySQL server or mysqlclientlibs, must be version 4.0.X or higher
- If you will be installing Asterisk 1.4 releases you need Gnu Make 3.81
- Apache/PHP server with php.ini memory_limit set to 12M minimum
- Apache/PHP server with php.ini memory_limit set to 24M
+1 -1
View File
@@ -20,7 +20,7 @@ Requirements for installing astGUIclient/VICIDIAL on an Asterisk server:
- Perl5 with several CPAN modules(Time::HiRes, DBD::mysql, Net::Telnet, etc)
- asterisk-per-0.08 perl module required (0.09 version does NOT work)
- Access to MySQL server and mysqlclientlibs, must be version 4.0.X or higher
- Access to Apache/PHP webserver, php.ini memory_limit set to 12M minimum
- Access to Apache/PHP webserver, php.ini memory_limit set to 24M
- Several entries in the crontab for interval-running scripts and keepalives
Requirements for using the astGUIclient/VICIDIAL web-client versions
+1 -1
View File
@@ -692,7 +692,7 @@ installation on another machine)
- cp php.ini-dist /usr/local/lib/php.ini
NOTE: you will want to make sure notice logging is turned off:
error_reporting = E_ALL & ~E_NOTICE ; (this is default)
!!! REQUIRED !!! raise the memory limit for scripts in php.ini:
!!! REQUIRED !!! raise the memory limit for scripts in php.ini:
memory_limit = 24M
- vi /usr/local/apache2/conf/httpd.conf
add the following lines:
@@ -308,6 +308,7 @@ last_call_finish DATETIME,
closer_campaigns TEXT,
call_server_ip VARCHAR(15),
user_level INT(2) default '0',
comments VARCHAR(20),
index (random_id),
index (last_call_time),
index (last_update_time),
@@ -512,7 +513,8 @@ adaptive_intensity VARCHAR(6) default '0',
adaptive_dl_diff_target SMALLINT(3) default '0',
concurrent_transfers ENUM('AUTO','1','2','3','4','5','6','7','8','9','10') default 'AUTO',
auto_alt_dial ENUM('NONE','ALT_ONLY','ADDR3_ONLY','ALT_AND_ADDR3') default 'NONE',
auto_alt_dial_statuses VARCHAR(255) default ' B N NA DC -'
auto_alt_dial_statuses VARCHAR(255) default ' B N NA DC -',
agent_pause_codes_active ENUM('Y','N') default 'N'
);
CREATE TABLE vicidial_lists (
@@ -658,7 +660,7 @@ user VARCHAR(20),
server_ip VARCHAR(15) NOT NULL,
event_time DATETIME,
lead_id INT(9) UNSIGNED,
campaign_id VARCHAR(8),
campaign_id VARCHAR(8),
pause_epoch INT(10) UNSIGNED,
pause_sec SMALLINT(5) UNSIGNED default '0',
wait_epoch INT(10) UNSIGNED,
@@ -668,7 +670,9 @@ talk_sec SMALLINT(5) UNSIGNED default '0',
dispo_epoch INT(10) UNSIGNED,
dispo_sec SMALLINT(5) UNSIGNED default '0',
status VARCHAR(6),
user_group VARCHAR(20)
user_group VARCHAR(20),
comments VARCHAR(20),
sub_status VARCHAR(6)
);
CREATE TABLE vicidial_scripts (
@@ -842,6 +846,14 @@ country CHAR(3),
country_code SMALLINT(5) UNSIGNED
);
CREATE TABLE vicidial_pause_codes (
pause_code VARCHAR(6) NOT NULL,
pause_code_name VARCHAR(30),
billable ENUM('NO','YES','HALF') default 'NO',
campaign_id VARCHAR(8),
index (campaign_id)
);
INSERT INTO vicidial_user_groups SET user_group='ADMIN',group_name='VICIDIAL ADMINISTRATORS',allowed_campaigns=' -ALL-CAMPAIGNS- - -';
+14
View File
@@ -36,3 +36,17 @@ UPDATE vicidial_users SET modify_remoteagents='1' where delete_remote_agents='1'
UPDATE vicidial_users SET modify_servers='1' where ast_admin_access='1';
ALTER TABLE inbound_numbers ADD department VARCHAR(30);
ALTER TABLE vicidial_agent_log ADD comments VARCHAR(20);
ALTER TABLE vicidial_agent_log ADD sub_status VARCHAR(6);
ALTER TABLE vicidial_live_agents ADD comments VARCHAR(20);
ALTER TABLE vicidial_campaigns ADD agent_pause_codes_active ENUM('Y','N') default 'N';
CREATE TABLE vicidial_pause_codes (
pause_code VARCHAR(6) NOT NULL,
pause_code_name VARCHAR(30),
billable ENUM('NO','YES','HALF') default 'NO',
campaign_id VARCHAR(8),
index (campaign_id)
);
@@ -84,6 +84,24 @@ View Reports: ||
You do not have permission to view this page||
Lead Time Zone Lookup: ||
Lead Duplicate Check: ||
Agent Pause Codes Active -<\/B> Allows agents to select a pause code when they click on the PAUSE button in vicidial.php. Pause codes are definable per campaign at the bottom of the campaign view detail screen and they are stored in the vicidial_agent_log table. Default is N||
AGENT PAUSE CODES||
If the Agent Pause Codes Active field is set to active then the agents will be able to select from these pause codes when they click on the PAUSE button on their screens. This data is then stored in the vicidial agent log. The Pause code must contain only letters and numbers and be less than 7 characters long. The pause code name can be no longer than 30 characters.||
AGENT PAUSE CODES FOR THIS CAMPAIGN||
PAUSE CODES||
BILLABLE||
ADD NEW AGENT PAUSE CODE||
Pause Code: ||
Pause Code Name: ||
Billable: ||
New Agent Pause Code||
Modify Agent Pause Code||
Delete Agent Pause Code||
AGENT PAUSE CODE NOT ADDED||
there is already an entry for this campaign with this pause code||
AGENT PAUSE CODE ADDED||
AGENT PAUSE CODE NOT MODIFIED||
CAMPAIGN PAUSE CODE NOT DELETED||
############################################################ CLIENT
+7 -7
View File
@@ -539,7 +539,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$rslt=mysql_query($stmt, $link);
}
$stmt="UPDATE vicidial_agent_log set lead_id='$lead_id' where agent_log_id='$agent_log_id';";
$stmt="UPDATE vicidial_agent_log set lead_id='$lead_id',comments='MANUAL' where agent_log_id='$agent_log_id';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
@@ -583,7 +583,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$rslt=mysql_query($stmt, $link);
### update the agent status to INCALL in vicidial_live_agents
$stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id' where user='$user' and server_ip='$server_ip';";
$stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -720,7 +720,7 @@ if ($ACTION == 'manDiaLonly')
$rslt=mysql_query($stmt, $link);
### update the agent status to INCALL in vicidial_live_agents
$stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id' where user='$user' and server_ip='$server_ip';";
$stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',callerid='$MqueryCID',lead_id='$lead_id',comments='MANUAL' where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
@@ -970,7 +970,7 @@ if ($stage == "end")
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';";
$stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -980,7 +980,7 @@ if ($stage == "end")
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
$stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME' where user='$user' and server_ip='$server_ip';";
$stmt = "UPDATE vicidial_live_agents set status='PAUSED',lead_id='',uniqueid=0,callerid='',channel='',call_server_ip='',last_call_finish='$NOW_TIME',comments='' where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
}
@@ -1182,7 +1182,7 @@ if ($ACTION == 'VDADcheckINCOMING')
echo "1\n" . $lead_id . '|' . $uniqueid . '|' . $callerid . '|' . $channel . '|' . $call_server_ip . "|\n";
### update the agent status to INCALL in vicidial_live_agents
$stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';";
$stmt = "UPDATE vicidial_live_agents set status='INCALL',last_call_time='$NOW_TIME',comments='AUTO' where user='$user' and server_ip='$server_ip';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
@@ -1666,7 +1666,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
else
{
$random = (rand(1000000, 9999999) + 10000000);
$stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random' where user='$user' and server_ip='$server_ip';";
$stmt="UPDATE vicidial_live_agents set status='$stage',lead_id='',uniqueid=0,callerid='',channel='', random_id='$random',comments='' where user='$user' and server_ip='$server_ip';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
+1 -1
View File
@@ -1061,7 +1061,7 @@ else
$StarTtimE = date("U");
$NOW_TIME = date("Y-m-d H:i:s");
##### Agent is going to log in so insert the vicidial_agent_log entry now
$stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE','$VU_user_group');";
$stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE','$VU_user_group','LOGIN');";
if ($DB) {echo "$stmt\n";}
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
+201 -7
View File
@@ -529,6 +529,14 @@ if (isset($_GET["modify_servers"])) {$modify_servers=$_GET["modify_servers"];
elseif (isset($_POST["modify_servers"])) {$modify_servers=$_POST["modify_servers"];}
if (isset($_GET["view_reports"])) {$view_reports=$_GET["view_reports"];}
elseif (isset($_POST["view_reports"])) {$view_reports=$_POST["view_reports"];}
if (isset($_GET["agent_pause_codes_active"])) {$agent_pause_codes_active=$_GET["agent_pause_codes_active"];}
elseif (isset($_POST["agent_pause_codes_active"])) {$agent_pause_codes_active=$_POST["agent_pause_codes_active"];}
if (isset($_GET["pause_code"])) {$pause_code=$_GET["pause_code"];}
elseif (isset($_POST["pause_code"])) {$pause_code=$_POST["pause_code"];}
if (isset($_GET["pause_code_name"])) {$pause_code_name=$_GET["pause_code_name"];}
elseif (isset($_POST["pause_code_name"])) {$pause_code_name=$_POST["pause_code_name"];}
if (isset($_GET["billable"])) {$billable=$_GET["billable"];}
elseif (isset($_POST["billable"])) {$billable=$_POST["billable"];}
if (isset($script_id)) {$script_id= strtoupper($script_id);}
@@ -666,6 +674,7 @@ $available_only_ratio_tally = ereg_replace("[^NY]","",$available_only_ratio_tall
$sys_perf_log = ereg_replace("[^NY]","",$sys_perf_log);
$vicidial_balance_active = ereg_replace("[^NY]","",$vicidial_balance_active);
$vd_server_logs = ereg_replace("[^NY]","",$vd_server_logs);
$agent_pause_codes_active = ereg_replace("[^NY]","",$agent_pause_codes_active);
### ALPHA-NUMERIC ONLY ###
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
@@ -894,12 +903,13 @@ $lead_filter_sql = ereg_replace(";","",$lead_filter_sql);
# 70118-1706 - Added new user group displays and links
# 70123-1519 - Added user permission settings for all sections
# 70124-1346 - Fixed spelling errors and formatting consistency
# 70202-1120 - Added agent_pause_codes section to campaigns
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
$version = '2.0.82';
$build = '70124-1346';
$version = '2.0.83';
$build = '70202-1120';
$STARTtime = date("U");
@@ -1023,6 +1033,7 @@ if ($ADD==22) {$hh='campaigns'; echo "New Campaign Status Addition";}
if ($ADD==23) {$hh='campaigns'; echo "New Campaign HotKey Addition";}
if ($ADD==25) {$hh='campaigns'; echo "New Campaign Lead Recycle Addition";}
if ($ADD==26) {$hh='campaigns'; echo "New Auto Alt Dial Status";}
if ($ADD==27) {$hh='campaigns'; echo "New Agent Pause Code";}
if ($ADD==211) {$hh='lists'; echo "New List Addition";}
if ($ADD==2111) {$hh='ingroups'; echo "New In-Group Addition";}
if ($ADD==21111) {$hh='remoteagent'; echo "New Remote Agents Addition";}
@@ -1061,6 +1072,7 @@ if ($ADD==42) {$hh='campaigns'; echo "Modify Campaign Status";}
if ($ADD==43) {$hh='campaigns'; echo "Modify Campaign HotKey";}
if ($ADD==44) {$hh='campaigns'; echo "Modify Campaign - Basic View";}
if ($ADD==45) {$hh='campaigns'; echo "Modify Campaign Lead Recycle";}
if ($ADD==47) {$hh='campaigns'; echo "Modify Agent Pause Code";}
if ($ADD==411) {$hh='lists'; echo "Modify List";}
if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";}
if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";}
@@ -1096,6 +1108,7 @@ if ($ADD==62) {$hh='campaigns'; echo "Logout Agents";}
if ($ADD==63) {$hh='campaigns'; echo "Emergency VDAC Jam Clear";}
if ($ADD==65) {$hh='campaigns'; echo "Delete Lead Recycle";}
if ($ADD==66) {$hh='campaigns'; echo "Delete Auto Alt Dial Status";}
if ($ADD==67) {$hh='campaigns'; echo "Delete Agent Pause Code";}
if ($ADD==611) {$hh='lists'; echo "Delete List";}
if ($ADD==6111) {$hh='ingroups'; echo "Delete In-Group";}
if ($ADD==61111) {$hh='remoteagent'; echo "Delete Remote Agents";}
@@ -1804,6 +1817,11 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR>
<B>Allowed Inbound Groups -</B> For CLOSER campaigns only. Here is where you select the inbound groups you want agents in this CLOSER campaign to be able to take calls from. It is important for BLENDED inbound-outbound campaigns only to select the inbound groups that are used for agents in this campaign. The calls coming into the inbound groups selected here will be counted as active calls for a blended campaign even if all agents in the campaign are not logged in to receive calls from all of those selected inbound groups.
<BR>
<A NAME="vicidial_campaigns-agent_pause_codes_active">
<BR>
<B>Agent Pause Codes Active -</B> Allows agents to select a pause code when they click on the PAUSE button in vicidial.php. Pause codes are definable per campaign at the bottom of the campaign view detail screen and they are stored in the vicidial_agent_log table. Default is N.
<BR><BR><BR><BR>
@@ -2006,6 +2024,17 @@ echo "<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR><TD ALIGN
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL AGENT PAUSE CODES</FONT></B><BR><BR>
<A NAME="vicidial_pause_codes">
<BR>
<B>If the Agent Pause Codes Active field is set to active then the agents will be able to select from these pause codes when they click on the PAUSE button on their screens. This data is then stored in the vicidial agent log. The Pause code must contain only letters and numbers and be less than 7 characters long. The pause code name can be no longer than 30 characters.</B>
<BR><BR><BR><BR>
<B><FONT SIZE=3>VICIDIAL_USER_GROUPS TABLE</FONT></B><BR><BR>
@@ -3848,6 +3877,46 @@ $ADD=31;
}
######################
# ADD=27 adds the new campaign agent pause code entry to the system
######################
if ($ADD==27)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
$stmt="SELECT count(*) from vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';";
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{echo "<br>AGENT PAUSE CODE NOT ADDED - there is already an entry for this campaign with this pause code\n";}
else
{
if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) or (strlen($pause_code) > 6) or (strlen($pause_code_name) < 2) )
{
echo "<br>AGENT PAUSE CODE NOT ADDED - Please go back and look at the data you entered\n";
echo "<br>pause code must be between 1 and 6 characters in length\n";
echo "<br>pause code name must be between 2 and 30 characters in length\n";
}
else
{
echo "<br><B>AGENT PAUSE CODE ADDED: $campaign_id - $pause_code - $pause_code_name</B>\n";
$stmt="INSERT INTO vicidial_pause_codes(campaign_id,pause_code,pause_code_name,billable) values('$campaign_id','$pause_code','$pause_code_name','$billable');";
$rslt=mysql_query($stmt, $link);
### LOG CHANGES TO LOG FILE ###
if ($WeBRooTWritablE > 0)
{
$fp = fopen ("./admin_changes_log.txt", "a");
fwrite ($fp, "$date|ADD A NEW AGENT PAUSE CODE|$PHP_AUTH_USER|$ip|$stmt|\n");
fclose($fp);
}
}
}
$ADD=31;
}
######################
# ADD=211 adds the new list to the system
######################
@@ -4517,7 +4586,7 @@ if ($ADD==41)
}
}
}
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial' where campaign_id='$campaign_id';";
$stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',safe_harbor_message='$safe_harbor_message',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active' where campaign_id='$campaign_id';";
$rslt=mysql_query($stmtA, $link);
if ($reset_hopper == 'Y')
@@ -4752,6 +4821,46 @@ if ($ADD==45)
$ADD=31; # go to campaign modification form below
}
######################
# ADD=47 modify agent pause code in the system
######################
if ($ADD==47)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) or (strlen($pause_code) > 6) or (strlen($pause_code_name) < 2) )
{
echo "<br>AGENT PAUSE CODE NOT MODIFIED - Please go back and look at the data you entered\n";
echo "<br>pause_code must be between 1 and 6 characters in length\n";
echo "<br>pause_code name must be between 2 and 30 characters in length\n";
}
else
{
echo "<br><B>AGENT PAUSE CODE MODIFIED: $campaign_id - $pause_code - $pause_code_name</B>\n";
$stmt="UPDATE vicidial_pause_codes SET pause_code_name='$pause_code_name',billable='$billable' where campaign_id='$campaign_id' and pause_code='$pause_code';";
$rslt=mysql_query($stmt, $link);
### LOG CHANGES TO LOG FILE ###
if ($WeBRooTWritablE > 0)
{
$fp = fopen ("./admin_changes_log.txt", "a");
fwrite ($fp, "$date|MODIFY AGENT PAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n");
fclose($fp);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=31; # go to campaign modification form below
}
######################
# ADD=411 submit list modifications to the system
######################
@@ -5967,6 +6076,45 @@ if ($ADD==66)
$ADD=31; # go to campaign modification form below
}
######################
# ADD=67 delete agent pause code in the system
######################
if ($ADD==67)
{
if ($LOGmodify_campaigns==1)
{
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
if ( (strlen($campaign_id) < 2) or (strlen($pause_code) < 1) )
{
echo "<br>CAMPAIGN PAUSE CODE NOT DELETED - Please go back and look at the data you entered\n";
echo "<br>pause code must be between 1 and 6 characters in length\n";
}
else
{
echo "<br><B>CAMPAIGN PAUSE CODE DELETED: $campaign_id - $pause_code</B>\n";
$stmt="DELETE FROM vicidial_pause_codes where campaign_id='$campaign_id' and pause_code='$pause_code';";
$rslt=mysql_query($stmt, $link);
### LOG CHANGES TO LOG FILE ###
if ($WeBRooTWritablE > 0)
{
$fp = fopen ("./admin_changes_log.txt", "a");
fwrite ($fp, "$date|DELETE AGENT PAUSECODE|$PHP_AUTH_USER|$ip|$stmt|\n");
fclose($fp);
}
}
}
else
{
echo "You do not have permission to view this page\n";
exit;
}
$ADD=31; # go to campaign modification form below
}
######################
# ADD=611 delete list record and all leads within it
@@ -6692,6 +6840,7 @@ if ($ADD==31)
$concurrent_transfers = $row[53];
$auto_alt_dial = $row[54];
$auto_alt_dial_statuses = $row[55];
$agent_pause_codes_active = $row[56];
echo "<br>MODIFY A CAMPAIGNS RECORD: $row[0] - <a href=\"$PHP_SELF?ADD=34&campaign_id=$campaign_id\">Basic View</a>";
echo " | Detail View</a> | ";
@@ -6895,6 +7044,8 @@ if ($ADD==31)
echo "<tr bgcolor=#B6D3FC><td align=right>Use Internal DNC List: </td><td align=left><select size=1 name=use_internal_dnc><option>Y</option><option>N</option><option SELECTED>$use_internal_dnc</option></select>$NWB#vicidial_campaigns-use_internal_dnc$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Agent Pause Codes Active: </td><td align=left><select size=1 name=agent_pause_codes_active><option>Y</option><option>N</option><option SELECTED>$agent_pause_codes_active</option></select>$NWB#vicidial_campaigns-agent_pause_codes_active$NWE</td></tr>\n";
if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)", $campaign_id))
{
@@ -7086,8 +7237,8 @@ if ($ADD==31)
echo "<input type=hidden name=status value=\"$rowx[2]\">\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=ADD value=45></td>\n";
echo "<td><font size=1><input size=7 maxlength=5 name=attempt_delay value=\"$rowx[3]\"></td>\n";
echo "<td><font size=1><input size=5 maxlength=3 name=attempt_maximum value=\"$rowx[4]\"></td>\n";
echo "<td><font size=1><input type=text size=7 maxlength=5 name=attempt_delay value=\"$rowx[3]\"></td>\n";
echo "<td><font size=1><input type=text size=5 maxlength=3 name=attempt_maximum value=\"$rowx[4]\"></td>\n";
echo "<td><select size=1 name=active><option>Y</option><option>N</option><option SELECTED>$rowx[5]</option></select></td>\n";
echo "<td><font size=1><input type=submit name=submit value=MODIFY></form></td>\n";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=65&campaign_id=$campaign_id&status=$rowx[2]\">DELETE</a></td></tr>\n";
@@ -7102,8 +7253,8 @@ if ($ADD==31)
echo "Status: <select size=1 name=status>\n";
echo "$LRstatuses_list\n";
echo "</select> &nbsp; \n";
echo "Attempt Delay: <input size=7 maxlength=5 name=attempt_delay>\n";
echo "Attempt Maximum: <input size=5 maxlength=3 name=attempt_maximum>\n";
echo "Attempt Delay: <input type=text size=7 maxlength=5 name=attempt_delay>\n";
echo "Attempt Maximum: <input type=text size=5 maxlength=3 name=attempt_maximum>\n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</FORM><br>\n";
@@ -7141,11 +7292,54 @@ if ($ADD==31)
echo "</select> &nbsp; \n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</FORM><br>\n";
echo "<br><br><b>AGENT PAUSE CODES FOR THIS CAMPAIGN: &nbsp; $NWB#vicidial_pause_codes$NWE</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>PAUSE CODES</td><td>BILLABLE</td><td>MODIFY</td><td>DELETE</td></tr>\n";
$stmt="SELECT * from vicidial_pause_codes where campaign_id='$campaign_id' order by pause_code";
$rslt=mysql_query($stmt, $link);
$pause_codes_to_print = mysql_num_rows($rslt);
$o=0;
while ($pause_codes_to_print > $o) {
$rowx=mysql_fetch_row($rslt);
$o++;
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><form action=$PHP_SELF method=POST><font size=1>$rowx[0]\n";
echo "<input type=hidden name=ADD value=47>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "<input type=hidden name=pause_code value=\"$rowx[0]\"> &nbsp;\n";
echo "<input type=text size=20 maxlength=30 name=pause_code_name value=\"$rowx[1]\"></td>\n";
echo "<td><select size=1 name=billable><option>YES</option><option>NO</option><option>HALF</option><option SELECTED>$rowx[2]</option></select></td>\n";
echo "<td><font size=1><input type=submit name=submit value=MODIFY></form></td>\n";
echo "<td><font size=1><a href=\"$PHP_SELF?ADD=67&campaign_id=$campaign_id&pause_code=$rowx[0]\">DELETE</a></td></tr>\n";
}
echo "</table>\n";
echo "<br>ADD NEW AGENT PAUSE CODE<BR><form action=$PHP_SELF method=POST>\n";
echo "<input type=hidden name=ADD value=27>\n";
echo "<input type=hidden name=campaign_id value=\"$campaign_id\">\n";
echo "Pause Code: <input type=text size=8 maxlength=6 name=pause_code>\n";
echo "Pause Code Name: <input type=text size=20 maxlength=30 name=pause_code_name>\n";
echo " &nbsp; Billable: <select size=1 name=billable><option>YES</option><option>NO</option><option>HALF</option></select>\n";
echo "<input type=submit name=submit value=ADD><BR>\n";
echo "</center></FORM><br>\n";
echo "<BR><BR>\n";
echo "<a href=\"$PHP_SELF?ADD=52&campaign_id=$campaign_id\">LOG ALL AGENTS OUT OF THIS CAMPAIGN</a><BR><BR>\n";
echo "<a href=\"$PHP_SELF?ADD=53&campaign_id=$campaign_id\">EMERGENCY VDAC CLEAR FOR THIS CAMPAIGN</a><BR><BR>\n";