Added new Grade-Random Next-Agent-Call methods that allow for agents to have a higher or lower probability of receiving the next call depending on their grade for a specific in-group or campaign.

git-svn-id: svn://192.168.202.10@1759 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2011-12-02 18:51:29 +00:00
parent 83ca0686aa
commit 6b7b7374f4
10 changed files with 400 additions and 99 deletions
+4
View File
@@ -771,6 +771,10 @@ OTHER CHANGES:
176. Added new Inbound Daily Report.
177. Added new Grade-Random Next-Agent-Call methods that allow for agents to
have a higher or lower probability of receiving the next call depending
on their grade for a specific in-group or campaign.
+95 -19
View File
@@ -170,6 +170,7 @@
# 110923-1133 - Added drop and after-hours to callmenu, and added action transfer cid setting
# 111102-2014 - Added in-group max_calls_ feature
# 111116-0157 - Added ALT and ADDR3 methods for CIDLOOKUP
# 111201-1457 - Added grade-random next-agent-call option for inbound
#
$script = 'agi-VDAD_ALL_inbound.agi';
@@ -181,7 +182,7 @@ $wait_prompt_runs=0;
$at='@';
$S='*';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=189;
$mysql_log_count=191;
$one_mysql_log=0;
@@ -2002,6 +2003,8 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
if ($CAMP_callorder =~ /campaign_rank/i) {$agent_call_order = 'order by campaign_weight desc,last_call_finish';}
if ($CAMP_callorder =~ /fewest_calls_campaign/i) {$agent_call_order = 'order by vicidial_live_agents.calls_today,vicidial_live_agents.last_call_finish';}
if ($CAMP_callorder =~ /inbound_group_rank/i) {$aco_sub=1; $agent_call_order = 'order by group_weight desc,vicidial_live_inbound_agents.last_call_finish';}
if ($CAMP_callorder =~ /ingroup_grade_random/i) {$aco_sub=1; $agent_call_order = 'order by random_id';}
if ($CAMP_callorder =~ /campaign_grade_random/i) {$aco_sub=1; $agent_call_order = 'order by random_id';}
if ($CAMP_callorder =~ /fewest_calls$/i) {$aco_sub=1; $agent_call_order = 'order by vicidial_live_inbound_agents.calls_today,vicidial_live_inbound_agents.last_call_finish';}
if ($CAMP_callorder =~ /ring_all$/i) {$aco_sub=0; $agent_call_order = 'order by vicidial_live_agents.last_state_change';}
@@ -2164,26 +2167,99 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
{$sthArows=0;}
else
{
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight,ra_user,vicidial_live_agents.campaign_id,on_hook_agent,on_hook_ring_time from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($ring_no_answer_agents$vlia_users) and ring_callerid='' $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='02058'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
### BEGIN grade random next-agent-call routing ###
if ($CAMP_callorder =~ /grade/)
{
@aryA = $sthA->fetchrow_array;
$VDADconf_exten = $aryA[0];
$VDADuser = $aryA[1];
$VDADextension = $aryA[2];
$VDADserver_ip = $aryA[3];
$VDADgroup_weight = $aryA[4];
$ra_user = $aryA[5];
$log_campaign = $aryA[6];
$VDADon_hook_agent = $aryA[7];
$VDADon_hook_ring_time = $aryA[8];
@GRADEuser=@MT;
@GRADEgrade=@MT;
@userGRADEarray=@MT;
$stmtA = "SELECT vicidial_live_agents.user,vicidial_live_inbound_agents.group_grade,vicidial_live_agents.campaign_grade from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($ring_no_answer_agents$vlia_users) and ring_callerid='' $qp_groupWAIT_camp_SQL limit 1000;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='02190'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$gg=0;
$ga=0;
while ($gg < $sthArows)
{
@aryA = $sthA->fetchrow_array;
$GRADEuser[$gg] = $aryA[0];
if ($CAMP_callorder =~ /ingroup_grade_random/)
{$GRADEgrade[$gg] = $aryA[1];}
else
{$GRADEgrade[$gg] = $aryA[2];}
if ($GRADEgrade[$gg] < 1)
{$GRADEgrade[$gg] = 1;}
$gi=0;
while ($gi < $GRADEgrade[$gg])
{
$userGRADEarray[$ga] = $GRADEuser[$gg];
# print STDERR " GRADE ENTRY: $userGRADEarray[$ga]|$ga|$gi|$GRADEgrade[$gg]\n";
$gi++;
$ga++;
}
$gg++;
}
$sthA->finish();
$sthArows=0;
if ($ga > 0)
{
$GRADErandom = int( rand($ga));
$userGRADEchosen = $userGRADEarray[$GRADErandom];
if ($AGILOG) {$agi_string = "GRADE RANDOM: $userGRADEchosen|$GRADErandom|$CAMP_callorder|$gg|$ga|$callerid"; &agi_output;}
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight,ra_user,vicidial_live_agents.campaign_id,on_hook_agent,on_hook_ring_time,vicidial_live_inbound_agents.group_grade,vicidial_live_agents.campaign_grade from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user='$userGRADEchosen' limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='02191'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VDADconf_exten = $aryA[0];
$VDADuser = $aryA[1];
$VDADextension = $aryA[2];
$VDADserver_ip = $aryA[3];
$VDADgroup_weight = $aryA[4];
$ra_user = $aryA[5];
$log_campaign = $aryA[6];
$VDADon_hook_agent = $aryA[7];
$VDADon_hook_ring_time = $aryA[8];
$group_grade = $aryA[9];
$campaign_grade = $aryA[10];
}
$sthA->finish();
}
if ($AGILOG) {$agi_string = "$VDADuser|$VDADgroup_weight|$stmtA|"; &agi_output;}
}
### END grade random next-agent-call routing ###
else
{
$stmtA = "SELECT vicidial_live_agents.conf_exten,vicidial_live_agents.user,vicidial_live_agents.extension,vicidial_live_agents.server_ip,vicidial_live_inbound_agents.group_weight,ra_user,vicidial_live_agents.campaign_id,on_hook_agent,on_hook_ring_time,vicidial_live_inbound_agents.group_grade,vicidial_live_agents.campaign_grade from vicidial_live_agents, vicidial_live_inbound_agents WHERE vicidial_live_agents.user=vicidial_live_inbound_agents.user and status IN('CLOSER','READY') and lead_id<1 $ADUfindSQL and vicidial_live_inbound_agents.group_id='$channel_group' and last_update_time > '$BDtsSQLdate' and vicidial_live_agents.user NOT IN($ring_no_answer_agents$vlia_users) and ring_callerid='' $qp_groupWAIT_camp_SQL $agent_call_order limit 1;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='02058'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
if ($sthArows > 0)
{
@aryA = $sthA->fetchrow_array;
$VDADconf_exten = $aryA[0];
$VDADuser = $aryA[1];
$VDADextension = $aryA[2];
$VDADserver_ip = $aryA[3];
$VDADgroup_weight = $aryA[4];
$ra_user = $aryA[5];
$log_campaign = $aryA[6];
$VDADon_hook_agent = $aryA[7];
$VDADon_hook_ring_time = $aryA[8];
$group_grade = $aryA[9];
$campaign_grade = $aryA[10];
}
$sthA->finish();
if ($AGILOG) {$agi_string = "$VDADuser|$VDADgroup_weight|$stmtA|"; &agi_output;}
}
$sthA->finish();
if ($AGILOG) {$agi_string = "$VDADuser|$VDADgroup_weight|$stmtA|"; &agi_output;}
}
### END in-group-rank-based next-agent-call processing ###
}
+126 -7
View File
@@ -91,12 +91,13 @@
# 110812-1514 - Added static tts file parsing and replacement
# 110829-2324 - Added survey_recording option
# 110926-1929 - Small fixes
# 111201-1751 - Added grade-random next-agent-call option
#
$script = 'agi-VDAD_ALL_outbound.agi';
$AGILOG = '0';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=84;
$mysql_log_count=92;
$one_mysql_log=0;
@@ -1696,6 +1697,7 @@ while ($drop_timer <= $DROP_TIME)
if ($CAMP_callorder =~ /random/i) {$agent_call_order = 'order by random_id';}
if ($CAMP_callorder =~ /campaign_rank/i) {$agent_call_order = 'order by campaign_weight desc,last_call_finish';}
if ($CAMP_callorder =~ /fewest_calls/i) {$aco_sub=1; $agent_call_order = 'order by calls_today';}
if ($CAMP_callorder =~ /campaign_grade_random/i) {$aco_sub=1; $agent_call_order = 'order by random_id';}
##### Attempt to send call to an agent on this server only #####
@@ -1846,10 +1848,68 @@ while ($drop_timer <= $DROP_TIME)
$rec_countWAIT = ($rec_countWAITOUT + $rec_countWAITIN);
if ($rec_countWAIT < $concurrent_transfers)
{
$stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', call_server_ip='$VARserver_ip', callerid='$callerid',comments='AUTO' where status = 'READY' and lead_id<1 and server_ip='$VARserver_ip' and ring_callerid='' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01035'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
### BEGIN grade random next-agent-call routing ###
if ($CAMP_callorder =~ /grade/)
{
$stmtA = "LOCK TABLES vicidial_live_agents WRITE;";
my $LOCKaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01085'; $MEL_aff_rows=$LOCKaffected_rows; &mysql_error_logging;
@GRADEuser=@MT;
@GRADEgrade=@MT;
@userGRADEarray=@MT;
$stmtA = "SELECT user,campaign_grade from vicidial_live_agents WHERE status='READY' and lead_id<1 and ring_callerid='' and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' limit 1000;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='01086'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$gg=0;
$ga=0;
while ($gg < $sthArows)
{
@aryA = $sthA->fetchrow_array;
$GRADEuser[$gg] = $aryA[0];
$GRADEgrade[$gg] = $aryA[1];
if ($GRADEgrade[$gg] < 1)
{$GRADEgrade[$gg] = 1;}
$gi=0;
while ($gi < $GRADEgrade[$gg])
{
$userGRADEarray[$ga] = $GRADEuser[$gg];
# print STDERR " GRADE ENTRY: $userGRADEarray[$ga]|$ga|$gi|$GRADEgrade[$gg]\n";
$gi++;
$ga++;
}
$gg++;
}
$sthA->finish();
$sthArows=0;
$affected_rows=0;
if ($ga > 0)
{
$GRADErandom = int( rand($ga));
$userGRADEchosen = $userGRADEarray[$GRADErandom];
if ($AGILOG) {$agi_string = "GRADE RANDOM: $userGRADEchosen|$GRADErandom|$CAMP_callorder|$gg|$ga|$callerid"; &agi_output;}
$stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', call_server_ip='$VARserver_ip', callerid='$callerid',comments='AUTO' where status='READY' and lead_id<1 and ring_callerid='' and server_ip='$VARserver_ip' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' and user='$userGRADEchosen' limit 1;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01087'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
if ($AGILOG) {$agi_string = "$VDADuser|$VDADgroup_weight|$stmtA|"; &agi_output;}
$stmtA = "UNLOCK TABLES;";
my $LOCKaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01088'; $MEL_aff_rows=$LOCKaffected_rows; &mysql_error_logging;
}
### END grade random next-agent-call routing ###
else
{
$stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', call_server_ip='$VARserver_ip', callerid='$callerid',comments='AUTO' where status = 'READY' and lead_id<1 and server_ip='$VARserver_ip' and ring_callerid='' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01035'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
if ($AGILOG) {$agi_string = "-- VDAD get agent: |$affected_rows|update of vla table: $VDADcampaign|$VARserver_ip\n|$stmtA|"; &agi_output;}
if ($affected_rows > 0)
{
@@ -2297,9 +2357,68 @@ while ($drop_timer <= $DROP_TIME)
$rec_countWAITrem = ($rec_countWAITremOUT + $rec_countWAITremIN);
if ($rec_countWAITrem < $concurrent_transfers)
{
$stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', call_server_ip='$VARserver_ip', callerid='$callerid',comments='AUTO' where status = 'READY' and lead_id<1 and ring_callerid='' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01042'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
### BEGIN grade random next-agent-call routing ###
if ($CAMP_callorder =~ /grade/)
{
$stmtA = "LOCK TABLES vicidial_live_agents WRITE;";
my $LOCKaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01089'; $MEL_aff_rows=$LOCKaffected_rows; &mysql_error_logging;
@GRADEuser=@MT;
@GRADEgrade=@MT;
@userGRADEarray=@MT;
$stmtA = "SELECT user,campaign_grade from vicidial_live_agents WHERE status='READY' and lead_id<1 and ring_callerid='' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' limit 1000;";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArows=$sthA->rows;
$dbhP=$dbhA; $mysql_count='01090'; $MEL_aff_rows=$sthArows; &mysql_error_logging;
$gg=0;
$ga=0;
while ($gg < $sthArows)
{
@aryA = $sthA->fetchrow_array;
$GRADEuser[$gg] = $aryA[0];
$GRADEgrade[$gg] = $aryA[1];
if ($GRADEgrade[$gg] < 1)
{$GRADEgrade[$gg] = 1;}
$gi=0;
while ($gi < $GRADEgrade[$gg])
{
$userGRADEarray[$ga] = $GRADEuser[$gg];
# print STDERR " GRADE ENTRY: $userGRADEarray[$ga]|$ga|$gi|$GRADEgrade[$gg]\n";
$gi++;
$ga++;
}
$gg++;
}
$sthA->finish();
$sthArows=0;
$affected_rows=0;
if ($ga > 0)
{
$GRADErandom = int( rand($ga));
$userGRADEchosen = $userGRADEarray[$GRADErandom];
if ($AGILOG) {$agi_string = "GRADE RANDOM: $userGRADEchosen|$GRADErandom|$CAMP_callorder|$gg|$ga|$callerid"; &agi_output;}
$stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', call_server_ip='$VARserver_ip', callerid='$callerid',comments='AUTO' where status='READY' and lead_id<1 and ring_callerid='' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' and user='$userGRADEchosen' limit 1;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01091'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
if ($AGILOG) {$agi_string = "$VDADuser|$VDADgroup_weight|$stmtA|"; &agi_output;}
$stmtA = "UNLOCK TABLES;";
my $LOCKaffected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01092'; $MEL_aff_rows=$LOCKaffected_rows; &mysql_error_logging;
}
### END grade random next-agent-call routing ###
else
{
$stmtA = "UPDATE vicidial_live_agents set status='QUEUE',lead_id='$CIDlead_id',uniqueid='$unique_id', channel='$channel', call_server_ip='$VARserver_ip', callerid='$callerid',comments='AUTO' where status='READY' and lead_id<1 and ring_callerid='' and campaign_id='$VDADcampaign' and last_update_time > '$BDtsSQLdate' $agent_call_order limit 1;";
$affected_rows = $dbhA->do($stmtA);
$dbhP=$dbhA; $mysql_count='01042'; $MEL_aff_rows=$affected_rows; &mysql_error_logging;
}
if ($AGILOG) {$agi_string = "-- VDAD get agent: |$affected_rows|update of vla table: $VDADcampaign|$VARserver_ip\n|$stmtA|"; &agi_output;}
if ($affected_rows > 0)
+6 -4
View File
@@ -42,6 +42,7 @@
# 110304-0007 - Added agent on-hook compatibility
# 110626-0030 - Added queuemetrics_pe_phone_append
# 110707-1342 - Added last_inbound_call_time to next agent call options for inbound
# 111201-1428 - Added grade-random next-agent-call option for inbound
#
### begin parsing run-time options ###
@@ -676,7 +677,7 @@ while($one_day_interval > 0)
}
}
}
##### If there are selected inbound/closer groups, gather in-group rankings and insert/update if needed
##### If there are selected inbound/closer groups, gather in-group rankings/gradings and insert/update if needed
@TEMPingroups=@MT;
$TEMPagentINGROUPS='';
if (length($DBremote_closer[$h]) > 1)
@@ -699,7 +700,7 @@ while($one_day_interval > 0)
$TEMPexistsVLIA=0;
# grab the group weight and calls today of the agent in each in-group
$DBuser_level[$h]='1';
$stmtA = "SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$DBuser_start[$h]' and group_id='$TEMPingroups[$s]';";
$stmtA = "SELECT group_weight,calls_today,group_grade FROM vicidial_inbound_group_agents where user='$DBuser_start[$h]' and group_id='$TEMPingroups[$s]';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArowsVIGA=$sthA->rows;
@@ -708,10 +709,11 @@ while($one_day_interval > 0)
@aryA = $sthA->fetchrow_array;
$TEMPagentWEIGHT = $aryA[0];
$TEMPagentCALLS = $aryA[1];
$TEMPagentGRADE = $aryA[2];
}
$sthA->finish();
$stmtA = "SELECT count(*) FROM vicidial_live_inbound_agents where user='$DBremote_user[$h]' and group_id='$TEMPingroups[$s]' and group_weight='$TEMPagentWEIGHT';";
$stmtA = "SELECT count(*) FROM vicidial_live_inbound_agents where user='$DBremote_user[$h]' and group_id='$TEMPingroups[$s]' and group_weight='$TEMPagentWEIGHT' and group_grade='$TEMPagentGRADE';";
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
$sthArowsVLIA=$sthA->rows;
@@ -728,7 +730,7 @@ while($one_day_interval > 0)
if ($TEMPexistsVLIA < 1)
{
$stmtA = "INSERT IGNORE INTO vicidial_live_inbound_agents SET user='$DBremote_user[$h]', group_id='$TEMPingroups[$s]', group_weight='$TEMPagentWEIGHT', calls_today='$TEMPagentCALLS', last_call_time='$SQLdate', last_call_finish='$SQLdate' ON DUPLICATE KEY UPDATE group_weight='$TEMPagentWEIGHT';";
$stmtA = "INSERT IGNORE INTO vicidial_live_inbound_agents SET user='$DBremote_user[$h]', group_id='$TEMPingroups[$s]', group_weight='$TEMPagentWEIGHT', calls_today='$TEMPagentCALLS', last_call_time='$SQLdate', last_call_finish='$SQLdate', group_grade='$TEMPagentGRADE' ON DUPLICATE KEY UPDATE group_weight='$TEMPagentWEIGHT',group_grade='$TEMPagentGRADE';";
$affected_rows = $dbhA->do($stmtA);
if ( ($DBX) && ($affected_rows > 0) ) {print STDERR "$DBremote_user[$h] VLIA UPDATE: $affected_rows|$TEMPingroups[$s]|$TEMPagentWEIGHT\n";}
@@ -295,7 +295,7 @@ source_id VARCHAR(50),
list_id BIGINT(14) UNSIGNED NOT NULL DEFAULT '0',
gmt_offset_now DECIMAL(4,2) DEFAULT '0.00',
called_since_last_reset ENUM('Y','N','Y1','Y2','Y3','Y4','Y5','Y6','Y7','Y8','Y9','Y10') default 'N',
phone_code VARCHAR(10),
phone_code VARCHAR(10),
phone_number VARCHAR(18) NOT NULL,
title VARCHAR(4),
first_name VARCHAR(30),
@@ -334,9 +334,9 @@ index (owner)
CREATE TABLE vicidial_hopper (
hopper_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
lead_id INT(9) UNSIGNED NOT NULL,
campaign_id VARCHAR(8),
campaign_id VARCHAR(8),
status ENUM('READY','QUEUE','INCALL','DONE','HOLD','DNC') default 'READY',
user VARCHAR(20),
user VARCHAR(20),
list_id BIGINT(14) UNSIGNED NOT NULL,
gmt_offset_now DECIMAL(4,2) DEFAULT '0.00',
state VARCHAR(2) default '',
@@ -354,7 +354,7 @@ conf_exten VARCHAR(20),
extension VARCHAR(100),
status ENUM('READY','QUEUE','INCALL','PAUSED','CLOSER') default 'PAUSED',
lead_id INT(9) UNSIGNED NOT NULL,
campaign_id VARCHAR(8),
campaign_id VARCHAR(8),
uniqueid VARCHAR(20),
callerid VARCHAR(20),
channel VARCHAR(100),
@@ -396,6 +396,7 @@ on_hook_ring_time SMALLINT(5) default '15',
ring_callerid VARCHAR(20) default '',
last_inbound_call_time DATETIME,
last_inbound_call_finish DATETIME,
campaign_grade TINYINT(2) UNSIGNED default '1',
index (random_id),
index (last_call_time),
index (last_update_time),
@@ -405,7 +406,7 @@ index (last_call_finish)
CREATE TABLE vicidial_auto_calls (
auto_call_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
server_ip VARCHAR(15) NOT NULL,
campaign_id VARCHAR(20),
campaign_id VARCHAR(20),
status ENUM('SENT','RINGING','LIVE','XFER','PAUSED','CLOSER','BUSY','DISCONNECT','IVR') default 'PAUSED',
lead_id INT(9) UNSIGNED NOT NULL,
uniqueid VARCHAR(20),
@@ -657,7 +658,7 @@ web_form_address TEXT,
allow_closers ENUM('Y','N'),
hopper_level INT(8) UNSIGNED default '1',
auto_dial_level VARCHAR(6) default '0',
next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','campaign_rank','overall_user_level','fewest_calls','longest_wait_time') default 'longest_wait_time',
next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','campaign_rank','overall_user_level','fewest_calls','longest_wait_time','campaign_grade_random') default 'longest_wait_time',
local_call_time VARCHAR(10) DEFAULT '9am-9pm',
voicemail_ext VARCHAR(10),
dial_timeout TINYINT UNSIGNED default '60',
@@ -1170,14 +1171,14 @@ extensions_list TEXT
CREATE TABLE vicidial_callbacks (
callback_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
lead_id INT(9) UNSIGNED,
list_id BIGINT(14) UNSIGNED,
campaign_id VARCHAR(8),
list_id BIGINT(14) UNSIGNED,
campaign_id VARCHAR(8),
status VARCHAR(10),
entry_time DATETIME,
callback_time DATETIME,
modify_date TIMESTAMP,
user VARCHAR(20),
recipient ENUM('USERONLY','ANYONE'),
recipient ENUM('USERONLY','ANYONE'),
comments VARCHAR(255),
user_group VARCHAR(20),
lead_status VARCHAR(6) default 'CALLBK',
@@ -1191,7 +1192,7 @@ pins_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL,
entry_time DATETIME,
phone_number VARCHAR(18),
lead_id INT(9) UNSIGNED,
campaign_id VARCHAR(20),
campaign_id VARCHAR(20),
product_code VARCHAR(20),
user VARCHAR(20),
digits VARCHAR(20),
@@ -1505,7 +1506,7 @@ recording_filename VARCHAR(50),
company_id VARCHAR(12),
phone_number VARCHAR(18),
lead_id INT(9) UNSIGNED,
campaign_id VARCHAR(20),
campaign_id VARCHAR(20),
product_code VARCHAR(20),
user VARCHAR(20),
prompt_audio_1 VARCHAR(20),
@@ -1556,11 +1557,12 @@ ALTER TABLE vicidial_ivr AUTO_INCREMENT = 1000000;
CREATE TABLE vicidial_inbound_group_agents (
user VARCHAR(20),
group_id VARCHAR(20),
group_id VARCHAR(20),
group_rank TINYINT(1) default '0',
group_weight TINYINT(1) default '0',
calls_today SMALLINT(5) UNSIGNED default '0',
group_web_vars VARCHAR(255) default '',
group_grade TINYINT(2) UNSIGNED default '1',
index (group_id),
index (user),
unique index viga_user_group_id (user, group_id)
@@ -1568,11 +1570,12 @@ unique index viga_user_group_id (user, group_id)
CREATE TABLE vicidial_live_inbound_agents (
user VARCHAR(20),
group_id VARCHAR(20),
group_id VARCHAR(20),
group_weight TINYINT(1) default '0',
calls_today SMALLINT(5) UNSIGNED default '0',
last_call_time DATETIME,
last_call_finish DATETIME,
group_grade TINYINT(2) UNSIGNED default '1',
index (group_id),
index (group_weight),
unique index vlia_user_group_id (user, group_id)
@@ -1580,11 +1583,12 @@ unique index vlia_user_group_id (user, group_id)
CREATE TABLE vicidial_campaign_agents (
user VARCHAR(20),
campaign_id VARCHAR(20),
campaign_id VARCHAR(20),
campaign_rank TINYINT(1) default '0',
campaign_weight TINYINT(1) default '0',
calls_today SMALLINT(5) UNSIGNED default '0',
group_web_vars VARCHAR(255) default '',
campaign_grade TINYINT(2) UNSIGNED default '1',
index (campaign_id),
index (user)
);
@@ -2140,7 +2144,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,
@@ -2754,7 +2758,7 @@ CREATE TABLE vicidial_log_noanswer_archive LIKE vicidial_log_noanswer;
CREATE TABLE vicidial_did_agent_log_archive LIKE vicidial_did_agent_log;
CREATE UNIQUE INDEX vdala on vicidial_did_agent_log_archive (uniqueid,call_date,did_route);
UPDATE system_settings SET db_schema_version='1309',db_schema_update_date=NOW();
UPDATE system_settings SET db_schema_version='1310',db_schema_update_date=NOW();
GRANT RELOAD ON *.* TO cron@'%';
GRANT RELOAD ON *.* TO cron@localhost;
+12
View File
@@ -1205,3 +1205,15 @@ ALTER TABLE vicidial_live_agents MODIFY external_status VARCHAR(255) default '';
ALTER TABLE system_settings ADD svn_version VARCHAR(100) default '';
UPDATE system_settings SET db_schema_version='1309',db_schema_update_date=NOW() where db_schema_version < 1309;
ALTER TABLE vicidial_live_agents ADD campaign_grade TINYINT(2) UNSIGNED default '1';
ALTER TABLE vicidial_inbound_group_agents ADD group_grade TINYINT(2) UNSIGNED default '1';
ALTER TABLE vicidial_live_inbound_agents ADD group_grade TINYINT(2) UNSIGNED default '1';
ALTER TABLE vicidial_campaign_agents ADD campaign_grade TINYINT(2) UNSIGNED default '1';
ALTER TABLE vicidial_campaigns MODIFY next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','campaign_rank','overall_user_level','fewest_calls','longest_wait_time','campaign_grade_random') default 'longest_wait_time';
UPDATE system_settings SET db_schema_version='1310',db_schema_update_date=NOW() where db_schema_version < 1310;
@@ -818,6 +818,10 @@ This option must be set higher than 0 if you want to use the Max Calls Method fe
Max Calls Action||
This is the action to be taken if the Max Calls Method is enabled and the number of calls exceeds what is set above in the Max Calls Count setting. The calls above that amount will be sent to either the DROP action, the AFTERHOURS action or the NO_AGENT_NO_QUEUE action and will be logged as a MAXCAL status with a MAXCALLS hangup reason. Default is NO_AGENT_NO_QUEUE||
If a CIDLOOKUP method is used with ALT, it will search the alt_phone field for the phone number if no matches are found for the main phone number. If a CIDLOOKUP method is used with ADDR3, it will search the address3 field for the phone number if no matches are found for the main phone number and optionally the alt_phone field||
Another field in this section is GRADE, which allows for the campaign_grade_random Next Agent Call setting to be used. This grade setting will increase or decrease the probability that the agent will receive the call||
gives a higher probability of getting a call to the higher graded agents||
gives a higher probability of getting a call to the higher graded agents by in-group||
gives a higher probability of getting a call to the higher graded agents by campaign||
lead_report_export.php
+9 -6
View File
@@ -300,10 +300,11 @@
# 111021-1707 - Added callback_hours_block feature
# 111024-1238 - Added callback_list_calltime option
# 111114-0035 - Added qm-dispo-code field to updatedispo function
# 111201-1443 - Added group_grade option
#
$version = '2.4-200';
$build = '111114-0035';
$version = '2.4-201';
$build = '111201-1443';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=438;
$one_mysql_log=0;
@@ -1017,7 +1018,7 @@ if ($ACTION == 'regCLOSER')
{
if (strlen($in_groups[$k])>1)
{
$stmt="SELECT group_weight,calls_today FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';";
$stmt="SELECT group_weight,calls_today,group_grade FROM vicidial_inbound_group_agents where user='$user' and group_id='$in_groups[$k]';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00013',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -1025,15 +1026,17 @@ if ($ACTION == 'regCLOSER')
if ($viga_ct > 0)
{
$row=mysql_fetch_row($rslt);
$group_weight = $row[0];
$group_weight = $row[0];
$calls_today = $row[1];
$group_grade = $row[2];
}
else
{
$group_weight = 0;
$calls_today = 0;
$group_grade = 1;
}
$stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME';";
$stmt="INSERT INTO vicidial_live_inbound_agents set user='$user',group_id='$in_groups[$k]',group_weight='$group_weight',calls_today='$calls_today',last_call_time='$NOW_TIME',last_call_finish='$NOW_TIME',group_grade='$group_grade';";
if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00014',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -5850,7 +5853,7 @@ if ($ACTION == 'userLOGout')
$vla_delete = mysql_affected_rows($link);
##### Delete the vicidial_live_inbound_agents records for this session
$stmt="DELETE from vicidial_live_inbound_agents where user ='$user';";
$stmt="DELETE from vicidial_live_inbound_agents where user='$user';";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00131',$user,$server_ip,$session_name,$one_mysql_log);}
+9 -6
View File
@@ -371,10 +371,11 @@
# 111021-1623 - Fix for rare stuck vac issue with manual alt dial
# 111024-1237 - Added callback_list_calltime option
# 111114-0039 - Added scheduled callback and qm-dispo-code fields to API
# 111202-1444 - Added grade-random next-agent-call options
#
$version = '2.4-338c';
$build = '111114-0039';
$version = '2.4-339c';
$build = '111202-1444';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=75;
$one_mysql_log=0;
@@ -2523,7 +2524,7 @@ else
}
##### grab the campaign_weight and number of calls today on that campaign for the agent
$stmt="SELECT campaign_weight,calls_today FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';";
$stmt="SELECT campaign_weight,calls_today,campaign_grade FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";}
@@ -2533,13 +2534,15 @@ else
$row=mysql_fetch_row($rslt);
$campaign_weight = $row[0];
$calls_today = $row[1];
$campaign_grade = $row[2];
$i++;
}
else
{
$campaign_weight = '0';
$calls_today = '0';
$stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today) values('$VD_login','$VD_campaign','0','0','$calls_today');";
$campaign_grade = '1';
$stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today,campaign_grade) values('$VD_login','$VD_campaign','0','0','$calls_today','$campaign_grade');";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);}
@@ -2552,7 +2555,7 @@ else
echo "<!-- campaign is set to auto_dial_level: $auto_dial_level -->\n";
$closer_chooser_string='';
$stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today,last_state_change,outbound_autodial,manager_ingroup_set,on_hook_ring_time,on_hook_agent,last_inbound_call_time,last_inbound_call_finish) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today','$NOW_TIME','Y','N','$phone_ring_timeout','$on_hook_agent','$NOW_TIME','$NOW_TIME');";
$stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today,last_state_change,outbound_autodial,manager_ingroup_set,on_hook_ring_time,on_hook_agent,last_inbound_call_time,last_inbound_call_finish,campaign_grade) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today','$NOW_TIME','Y','N','$phone_ring_timeout','$on_hook_agent','$NOW_TIME','$NOW_TIME','$campaign_grade');";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);}
@@ -2615,7 +2618,7 @@ else
{
print "<!-- campaign is set to manual dial: $auto_dial_level -->\n";
$stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,user_level,campaign_weight,calls_today,last_state_change,outbound_autodial,manager_ingroup_set,on_hook_ring_time,on_hook_agent) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level', '$campaign_weight', '$calls_today','$NOW_TIME','N','N','$phone_ring_timeout','$on_hook_agent');";
$stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,user_level,campaign_weight,calls_today,last_state_change,outbound_autodial,manager_ingroup_set,on_hook_ring_time,on_hook_agent,campaign_grade) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level', '$campaign_weight', '$calls_today','$NOW_TIME','N','N','$phone_ring_timeout','$on_hook_agent','$campaign_grade');";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);}
+115 -41
View File
@@ -3018,12 +3018,13 @@ else
# 111106-1116 - Many fixes for user_group restrictions
# 111116-0207 - Added ALT and ADDR3 in-group handle methods
# 111122-1333 - Added Inbound Daily Report
# 111201-0939 - Added graded-random next-agent-call option
#
# 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
$admin_version = '2.4-349a';
$build = '111122-1333';
$admin_version = '2.4-350a';
$build = '111201-0939';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -3698,7 +3699,7 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
$campaigns_to_print = mysql_num_rows($rslt);
$campaigns_list='';
$campaigns_value='';
$RANKcampaigns_list="<tr><td>CAMPAIGN</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n";
$RANKcampaigns_list="<tr><td>CAMPAIGN</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; GRADE</td><td> &nbsp; &nbsp; CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n";
$o=0;
while ($campaigns_to_print > $o)
@@ -3715,18 +3716,19 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
{
$group_web_vars='';
$campaign_web='';
$stmt="SELECT campaign_rank,calls_today,group_web_vars from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]' $LOGallowed_campaignsSQL;";
$stmt="SELECT campaign_rank,calls_today,group_web_vars,campaign_grade from vicidial_campaign_agents where user='$user' and campaign_id='$campaign_id_values[$o]' $LOGallowed_campaignsSQL;";
$rslt=mysql_query($stmt, $link);
$ranks_to_print = mysql_num_rows($rslt);
if ($ranks_to_print > 0)
{
$row=mysql_fetch_row($rslt);
$SELECT_campaign_rank = $row[0];
$calls_today = $row[1];
$group_web_vars = $row[2];
$SELECT_campaign_rank = $row[0];
$calls_today = $row[1];
$group_web_vars = $row[2];
$SELECT_campaign_grade = $row[3];
}
else
{$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';}
{$calls_today=0; $SELECT_campaign_rank=0; $SELECT_campaign_grade=1; $group_web_vars='';}
if ( ($ADD=="4A") or ($ADD=="4B") )
{
$stmt_grp_values='';
@@ -3734,30 +3736,37 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];}
if (isset($_GET["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_GET["WEB_$campaign_id_values[$o]"];}
elseif (isset($_POST["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_POST["WEB_$campaign_id_values[$o]"];}
if (isset($_GET["GRADE_$campaign_id_values[$o]"])) {$campaign_grade=$_GET["GRADE_$campaign_id_values[$o]"];}
elseif (isset($_POST["GRADE_$campaign_id_values[$o]"])) {$campaign_grade=$_POST["GRADE_$campaign_id_values[$o]"];}
if ($non_latin < 1)
{
$campaign_rank = ereg_replace("[^-\_0-9]","",$campaign_rank);
$campaign_web = preg_replace("/;|\"|\'/","",$campaign_web);
$campaign_grade = ereg_replace("[^-\_0-9]","",$campaign_grade);
}
if ($ranks_to_print > 0)
{
$stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web' where campaign_id='$campaign_id_values[$o]' and user='$user';";
$stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web',campaign_grade='$campaign_grade' where campaign_id='$campaign_id_values[$o]' and user='$user';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
else
{
$stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';";
$stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web',campaign_grade='$campaign_grade';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
$stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';";
$stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank',campaign_grade='$campaign_grade' where campaign_id='$campaign_id_values[$o]' and user='$user';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
else {$campaign_rank = $SELECT_campaign_rank;}
else
{
$campaign_rank = $SELECT_campaign_rank;
$campaign_grade = $SELECT_campaign_grade;
}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
@@ -3777,16 +3786,16 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
$allowed_campaigns = preg_replace("/ -$/","",$allowed_campaigns);
$UGcampaigns = explode(" ", $allowed_campaigns);
$p=0; $RANK_camp_active=0; $CR_disabled = '';
$p=0; $RANK_camp_active=0; $GRADE_camp_active=0; $CR_disabled = '';
if (eregi('-ALL-CAMPAIGNS-',$allowed_campaigns))
{$RANK_camp_active++;}
{$RANK_camp_active++; $GRADE_camp_active++;}
else
{
$UGcampaign_ct = count($UGcampaigns);
while ($p < $UGcampaign_ct)
{
if ($campaign_id_values[$o] == $UGcampaigns[$p])
{$RANK_camp_active++;}
{$RANK_camp_active++; $GRADE_camp_active++;}
$p++;
}
}
@@ -3795,7 +3804,7 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
$RANKcampaigns_list .= "<tr $bgcolor><td>";
$campaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] <BR>\n";
$RANKcampaigns_list .= "<a href=\"$PHP_SELF?ADD=31&campaign_id=$campaign_id_values[$o]\">$campaign_id_values[$o]</a> - $campaign_name_values[$o] </td>";
$RANKcampaigns_list .= "<td> &nbsp; &nbsp; <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n";
$RANKcampaigns_list .= "<td> &nbsp; <select size=1 name=RANK_$campaign_id_values[$o] $CR_disabled>\n";
$h="9";
while ($h>=-9)
{
@@ -3808,6 +3817,19 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
if ( (strlen($campaign_web) < 1) and (strlen($group_web_vars) > 0) )
{$campaign_web=$group_web_vars;}
$RANKcampaigns_list .= "</select></td>\n";
$RANKcampaigns_list .= "<td> &nbsp; <select size=1 name=GRADE_$campaign_id_values[$o] $CR_disabled>\n";
$h="10";
while ($h>=1)
{
$RANKcampaigns_list .= "<option value=\"$h\"";
if ($h==$campaign_grade)
{$RANKcampaigns_list .= " SELECTED";}
$RANKcampaigns_list .= ">$h</option>";
$h--;
}
if ( (strlen($campaign_web) < 1) and (strlen($group_web_vars) > 0) )
{$campaign_web=$group_web_vars;}
$RANKcampaigns_list .= "</select></td>\n";
$RANKcampaigns_list .= "<td align=right> &nbsp; &nbsp; $calls_today</td>\n";
$RANKcampaigns_list .= "<td> &nbsp; &nbsp; <input type=text size=25 maxlength=255 name=WEB_$campaign_id_values[$o] value=\"$campaign_web\"></td></tr>\n";
$o++;
@@ -3873,7 +3895,7 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
$groups_list='';
$groups_value='';
$XFERgroups_list='';
$RANKgroups_list="<tr><td>INBOUND GROUP</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n";
$RANKgroups_list="<tr><td>INBOUND GROUP</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; GRADE</td><td> &nbsp; &nbsp; CALLS</td><td ALIGN=CENTER>WEB VARS</td></tr>\n";
$o=0;
while ($groups_to_print > $o)
@@ -3889,7 +3911,7 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
{
$group_web_vars='';
$group_web='';
$stmt="SELECT group_rank,calls_today,group_web_vars from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]';";
$stmt="SELECT group_rank,calls_today,group_web_vars,group_grade from vicidial_inbound_group_agents where user='$user' and group_id='$group_id_values[$o]';";
$rslt=mysql_query($stmt, $link);
$ranks_to_print = mysql_num_rows($rslt);
if ($ranks_to_print > 0)
@@ -3898,40 +3920,48 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
$SELECT_group_rank = $row[0];
$calls_today = $row[1];
$group_web_vars = $row[2];
$SELECT_group_grade = $row[3];
}
else
{$calls_today=0; $SELECT_group_rank=0;}
{$calls_today=0; $SELECT_group_rank=0; $SELECT_group_grade=1;}
if ( ($ADD=="4A") or ($ADD=="4B") )
{
if (isset($_GET["RANK_$group_id_values[$o]"])) {$group_rank=$_GET["RANK_$group_id_values[$o]"];}
elseif (isset($_POST["RANK_$group_id_values[$o]"])) {$group_rank=$_POST["RANK_$group_id_values[$o]"];}
if (isset($_GET["WEB_$group_id_values[$o]"])) {$group_web=$_GET["WEB_$group_id_values[$o]"];}
elseif (isset($_POST["WEB_$group_id_values[$o]"])) {$group_web=$_POST["WEB_$group_id_values[$o]"];}
if (isset($_GET["GRADE_$group_id_values[$o]"])) {$group_grade=$_GET["GRADE_$group_id_values[$o]"];}
elseif (isset($_POST["GRADE_$group_id_values[$o]"])) {$group_grade=$_POST["GRADE_$group_id_values[$o]"];}
if ($non_latin < 1)
{
$group_rank = ereg_replace("[^-\_0-9]","",$group_rank);
$group_web = preg_replace("/;|\"|\'/","",$group_web);
$group_grade = ereg_replace("[^-\_0-9]","",$group_grade);
}
if ($ranks_to_print > 0)
{
$stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_web_vars='$group_web' where group_id='$group_id_values[$o]' and user='$user';";
$stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_web_vars='$group_web', group_grade='$group_grade' where group_id='$group_id_values[$o]' and user='$user';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
else
{
$stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';";
$stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web', group_grade='$group_grade';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
$stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';";
$stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank', group_grade='$group_grade' where group_id='$group_id_values[$o]' and user='$user';";
$rslt=mysql_query($stmt, $link);
$stmt_grp_values .= "$stmt|";
}
else {$group_rank = $SELECT_group_rank;}
else
{
$group_rank = $SELECT_group_rank;
$group_grade = $SELECT_group_grade;
}
if (eregi("1$|3$|5$|7$|9$", $o))
{$bgcolor='bgcolor="#B9CBFD"';}
@@ -3972,7 +4002,7 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
$groups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] - $VIG_priority <BR>\n";
$XFERgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] <BR>\n";
$RANKgroups_list .= "> <a href=\"$PHP_SELF?ADD=3111&group_id=$group_id_values[$o]\">$group_id_values[$o]</a> - $group_name_values[$o] </td>";
$RANKgroups_list .= "<td> &nbsp; &nbsp; <select size=1 name=RANK_$group_id_values[$o]>\n";
$RANKgroups_list .= "<td> &nbsp; <select size=1 name=RANK_$group_id_values[$o]>\n";
$h="9";
while ($h>=-9)
{
@@ -3985,6 +4015,19 @@ if ( ( (strlen($ADD)>4) and ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($AD
if ( (strlen($group_web) < 1) and (strlen($group_web_vars) > 0) )
{$group_web=$group_web_vars;}
$RANKgroups_list .= "</select></td>\n";
$RANKgroups_list .= "<td> &nbsp; <select size=1 name=GRADE_$group_id_values[$o]>\n";
$h="10";
while ($h>=1)
{
$RANKgroups_list .= "<option value=\"$h\"";
if ($h==$group_grade)
{$RANKgroups_list .= " SELECTED";}
$RANKgroups_list .= ">$h</option>";
$h--;
}
if ( (strlen($group_web) < 1) and (strlen($group_web_vars) > 0) )
{$group_web=$group_web_vars;}
$RANKgroups_list .= "</select></td>\n";
$RANKgroups_list .= "<td align=right> &nbsp; &nbsp; $calls_today</td>\n";
$RANKgroups_list .= "<td> &nbsp; &nbsp; <input type=text size=25 maxlength=255 name=WEB_$group_id_values[$o] value=\"$group_web\"></td></tr>\n";
$o++;
@@ -4306,9 +4349,9 @@ if ($ADD==99999)
<B>Preset Contact Search -</B> If the user is logged into a campaign that has Transfer Presets set to CONTACTS, then this setting can disable contact searching for this user only. Default is NOT_ACTIVE which will use whatever the campaign setting is.
<BR>
<A NAME="vicidial_users-vicidial_users-campaign_ranks">
<A NAME="vicidial_users-campaign_ranks">
<BR>
<B>Campaign Ranks -</B> In this section you can define the rank an agent will have for each campaign. These ranks can be used to allow for preferred call routing when Next Agent Call is set to campaign_rank. Also in this section are the WEB VARs for each campaign. These allow each agent to have a different variable string that can be added to the WEB FORM or SCRIPT tab URLs by simply putting --A--web_vars--B-- as you would put any other field.
<B>Campaign Ranks -</B> In this section you can define the rank an agent will have for each campaign. These ranks can be used to allow for preferred call routing when Next Agent Call is set to campaign_rank. Also in this section are the WEB VARs for each campaign. These allow each agent to have a different variable string that can be added to the WEB FORM or SCRIPT tab URLs by simply putting --A--web_vars--B-- as you would put any other field. Another field in this section is GRADE, which allows for the campaign_grade_random Next Agent Call setting to be used. This grade setting will increase or decrease the probability that the agent will receive the call.
<BR>
<A NAME="vicidial_users-closer_campaigns">
@@ -5057,6 +5100,7 @@ if ($ADD==99999)
<BR> &nbsp; - oldest_call_finish: orders by the last time an agent finished a call. AKA agent waiting longest receives first call.
<BR> &nbsp; - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls.
<BR> &nbsp; - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest.
<BR> &nbsp; - campaign_grade_random: gives a higher probability of getting a call to the higher graded agents.
<BR> &nbsp; - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first.
<BR> &nbsp; - longest_wait_time: orders by the amount of time agent has been actively waiting for a call.
@@ -5698,8 +5742,10 @@ if ($ADD==99999)
<BR> &nbsp; - oldest_inbound_call_finish: orders by the last time an agent finished an inbound call. AKA agent waiting longest receives first call.
<BR> &nbsp; - overall_user_level: orders by the user_level of the agent as defined in the vicidial_users table a higher user_level will receive more calls.
<BR> &nbsp; - inbound_group_rank: orders by the rank given to the agent for the specific inbound group. Highest to Lowest.
<BR> &nbsp; - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first.
<BR> &nbsp; - campaign_rank: orders by the rank given to the agent for the campaign. Highest to Lowest.
<BR> &nbsp; - ingroup_grade_random: gives a higher probability of getting a call to the higher graded agents by in-group.
<BR> &nbsp; - campaign_grade_random: gives a higher probability of getting a call to the higher graded agents by campaign.
<BR> &nbsp; - fewest_calls: orders by the number of calls received by an agent for that specific inbound group. Least calls first.
<BR> &nbsp; - fewest_calls_campaign: orders by the number of calls received by an agent for the campaign. Least calls first.
<BR> &nbsp; - longest_wait_time: orders by the amount of time agent has been actively waiting for a call.
<BR> &nbsp; - ring_all: rings all available agents until one picks up the phone.
@@ -8954,7 +9000,7 @@ if ($ADD==11)
}
echo "<option>$adl</option></select>(0 = off)$NWB#vicidial_campaigns-auto_dial_level$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>campaign_rank</option><option>fewest_calls</option><option>longest_wait_time</option></select>$NWB#vicidial_campaigns-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>campaign_rank</option><option>campaign_grade_random</option><option>fewest_calls</option><option>longest_wait_time</option></select>$NWB#vicidial_campaigns-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Local Call Time: </td><td align=left><select size=1 name=local_call_time>";
echo "$call_times_list";
echo "</select>$NWB#vicidial_campaigns-local_call_time$NWE</td></tr>\n";
@@ -9424,7 +9470,7 @@ if ($ADD==1111)
echo "</select>$NWB#vicidial_inbound_groups-user_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form: </td><td align=left><input type=text name=web_form_address size=70 maxlength=9999 value=\"$web_form_address\">$NWB#vicidial_inbound_groups-web_form_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Voicemail: </td><td align=left><input type=text name=voicemail_ext size=10 maxlength=10 value=\"$voicemail_ext\">$NWB#vicidial_inbound_groups-voicemail_ext$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>oldest_inbound_call_start</option><option>oldest_inbound_call_finish</option><option>overall_user_level</option><option>inbound_group_rank</option><option>campaign_rank</option><option>fewest_calls</option><option>fewest_calls_campaign</option><option>longest_wait_time</option><option>ring_all</option></select>$NWB#vicidial_inbound_groups-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>oldest_inbound_call_start</option><option>oldest_inbound_call_finish</option><option>overall_user_level</option><option>inbound_group_rank</option><option>campaign_rank</option><option>ingroup_grade_random</option><option>campaign_grade_random</option><option>fewest_calls</option><option>fewest_calls_campaign</option><option>longest_wait_time</option><option>ring_all</option></select>$NWB#vicidial_inbound_groups-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Fronter Display: </td><td align=left><select size=1 name=fronter_display><option SELECTED>Y</option><option>N</option></select>$NWB#vicidial_inbound_groups-fronter_display$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Script: </td><td align=left><select size=1 name=script_id>\n";
echo "$scripts_list";
@@ -19947,12 +19993,12 @@ if ($ADD==3)
echo "<tr bgcolor=#B6D3FC><td align=right>Preset Contact Search: </td><td align=left><select size=1 name=preset_contact_search><option>NOT_ACTIVE</option><option>DISABLED</option><option SELECTED>$preset_contact_search</option></select>$NWB#vicidial_users-preset_contact_search$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Campaign Ranks: $NWB#vicidial_users-campaign_ranks$NWE<BR>\n";
echo "<table border=0>\n";
echo "<table border=0 width=850>\n";
echo "$RANKcampaigns_list";
echo "</table>\n";
echo "</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2>Inbound Groups: $NWB#vicidial_users-closer_campaigns$NWE<BR>\n";
echo "<table border=0>\n";
echo "<table border=0 width=850>\n";
echo "$RANKgroups_list";
echo "</table>\n";
echo "</td></tr>\n";
@@ -21024,7 +21070,7 @@ if ($ADD==31)
echo "<tr bgcolor=#B6D3FC><td align=right>Auto Alt-Number Dialing: </td><td align=left><select size=1 name=auto_alt_dial><option >NONE</option><option>ALT_ONLY</option><option>ADDR3_ONLY</option><option>ALT_AND_ADDR3</option><option>ALT_AND_EXTENDED</option><option>ALT_AND_ADDR3_AND_EXTENDED</option><option>EXTENDED_ONLY</option><option>MULTI_LEAD</option><option SELECTED>$auto_alt_dial</option></select>$NWB#vicidial_campaigns-auto_alt_dial$NWE $ALTmultiLINK</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>campaign_rank</option><option>fewest_calls</option><option>longest_wait_time</option><option SELECTED>$next_agent_call</option></select>$NWB#vicidial_campaigns-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>overall_user_level</option><option>campaign_rank</option><option>campaign_grade_random</option><option>fewest_calls</option><option>longest_wait_time</option><option SELECTED>$next_agent_call</option></select>$NWB#vicidial_campaigns-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"$PHP_SELF?ADD=311111111&call_time_id=$local_call_time\">Local Call Time: </a></td><td align=left><select size=1 name=local_call_time>\n";
echo "$call_times_list";
@@ -23072,10 +23118,10 @@ if ($ADD==34)
### list of agent rank or skill-level for this campaign
echo "<center>\n";
echo "<br><b>AGENT RANKS FOR THIS CAMPAIGN:</b><br>\n";
echo "<TABLE width=500 cellspacing=3>\n";
echo "<tr><td>USER</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; CALLS TODAY</td></tr>\n";
echo "<TABLE width=600 cellspacing=3>\n";
echo "<tr><td>USER</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; GRADE</td><td> &nbsp; &nbsp; CALLS TODAY</td></tr>\n";
$stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user $LOGadmin_viewable_groupsSQL order by vu.user;";
$stmt="SELECT vu.user,vca.campaign_rank,vca.calls_today,full_name,vca.campaign_grade from vicidial_campaign_agents vca, vicidial_users vu where campaign_id='$campaign_id' and active='Y' and vu.user=vca.user $LOGadmin_viewable_groupsSQL order by vu.user;";
$rsltx=mysql_query($stmt, $link);
$users_to_print = mysql_num_rows($rsltx);
@@ -23090,7 +23136,7 @@ if ($ADD==34)
else
{$bgcolor='bgcolor="#9BB9FB"';}
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3&user=$rowx[0]\">$rowx[0]</a> - $rowx[3]</td><td><font size=1>$rowx[1]</td><td><font size=1>$rowx[2]</td></tr>\n";
echo "<tr $bgcolor><td><font size=1><a href=\"$PHP_SELF?ADD=3&user=$rowx[0]\">$rowx[0]</a> - $rowx[3]</td><td><font size=1>$rowx[1]</td><td><font size=1>$rowx[4]</td><td><font size=1>$rowx[2]</td></tr>\n";
}
echo "</table></center><br>\n";
@@ -24809,7 +24855,7 @@ if ($ADD==3111)
{
echo "<tr bgcolor=#B6D3FC><td align=right>Web Form Two: </td><td align=left><input type=text name=web_form_address_two size=70 maxlength=9999 value=\"$web_form_address_two\">$NWB#vicidial_inbound_groups-web_form_address$NWE</td></tr>\n";
}
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>oldest_inbound_call_start</option><option>oldest_inbound_call_finish</option><option>overall_user_level</option><option>inbound_group_rank</option><option>campaign_rank</option><option>fewest_calls</option><option>fewest_calls_campaign</option><option>longest_wait_time</option><option>ring_all</option><option SELECTED>$next_agent_call</option></select>$NWB#vicidial_inbound_groups-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Next Agent Call: </td><td align=left><select size=1 name=next_agent_call><option >random</option><option>oldest_call_start</option><option>oldest_call_finish</option><option>oldest_inbound_call_start</option><option>oldest_inbound_call_finish</option><option>overall_user_level</option><option>inbound_group_rank</option><option>campaign_rank</option><option>ingroup_grade_random</option><option>campaign_grade_random</option><option>fewest_calls</option><option>fewest_calls_campaign</option><option>longest_wait_time</option><option>ring_all</option><option SELECTED>$next_agent_call</option></select>$NWB#vicidial_inbound_groups-next_agent_call$NWE</td></tr>\n";
echo "<tr bgcolor=#BDFFBD><td align=right>Queue Priority: </td><td align=left><select size=1 name=queue_priority>\n";
$n=99;
@@ -25249,7 +25295,7 @@ if ($ADD==3111)
echo "<center>\n";
echo "<br><b>AGENT RANKS FOR THIS INBOUND GROUP:</b><br>\n";
echo "<TABLE width=600 cellspacing=3>\n";
echo "<tr><td>USER</td><td>SELECTED</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; CALLS TODAY</td></tr>\n";
echo "<tr><td>USER</td><td>SELECTED</td><td> &nbsp; &nbsp; RANK</td><td> &nbsp; &nbsp; GRADE</td><td> &nbsp; &nbsp; CALLS TODAY</td></tr>\n";
$stmt="SELECT user,full_name,closer_campaigns from vicidial_users where active='Y' $LOGadmin_viewable_groupsSQL order by user;";
$rsltx=mysql_query($stmt, $link);
@@ -25275,7 +25321,7 @@ if ($ADD==3111)
while ($users_to_print > $o)
{
$o++;
$stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where group_id='$group_id' and user='$ARIG_user[$o]';";
$stmt="SELECT group_rank,calls_today,group_grade from vicidial_inbound_group_agents where group_id='$group_id' and user='$ARIG_user[$o]';";
$rsltx=mysql_query($stmt, $link);
$viga_to_print = mysql_num_rows($rsltx);
if ($viga_to_print > 0)
@@ -25283,16 +25329,18 @@ if ($ADD==3111)
$rowx=mysql_fetch_row($rsltx);
$ARIG_rank[$o] = $rowx[0];
$ARIG_calls[$o] = $rowx[1];
$ARIG_grade[$o] = $rowx[2];
}
else
{
$stmtD="INSERT INTO vicidial_inbound_group_agents set calls_today='0',group_rank='0',group_weight='0',user='$ARIG_user[$o]',group_id='$group_id';";
$stmtD="INSERT INTO vicidial_inbound_group_agents set calls_today='0',group_rank='0',group_weight='0',user='$ARIG_user[$o]',group_id='$group_id',group_grade='1';";
$rslt=mysql_query($stmtD, $link);
if ($DB > 0) {echo "|$stmtD|";}
$stmtDlog .= "$stmtD|";
$ARIG_changenotes .= "added missing user to viga table $ARIG_user[$o]|";
$ARIG_rank[$o] = '0';
$ARIG_calls[$o] = '0';
$ARIG_grade[$o] = '1';
}
}
if (strlen($ARIG_changenotes) > 10)
@@ -25316,16 +25364,21 @@ if ($ADD==3111)
$ARIG_checked='';
$ARIG_ranked='';
$ARIG_graded='';
$checkbox_field="CHECK_$ARIG_user[$o]$US$group_id";
$rank_field="RANK_$ARIG_user[$o]$US$group_id";
$grade_field="GRADE_$ARIG_user[$o]$US$group_id";
if (isset($_GET["$checkbox_field"])) {$ARIG_checked=$_GET["$checkbox_field"];}
elseif (isset($_POST["$checkbox_field"])) {$ARIG_checked=$_POST["$checkbox_field"];}
if (isset($_GET["$rank_field"])) {$ARIG_ranked=$_GET["$rank_field"];}
elseif (isset($_POST["$rank_field"])) {$ARIG_ranked=$_POST["$rank_field"];}
if (isset($_GET["$grade_field"])) {$ARIG_graded=$_GET["$grade_field"];}
elseif (isset($_POST["$grade_field"])) {$ARIG_graded=$_POST["$grade_field"];}
$ARIG_checked = ereg_replace("[^A-Z]","",$ARIG_checked);
$ARIG_ranked = ereg_replace("[^-0-9]","",$ARIG_ranked);
$ARIG_graded = ereg_replace("[^-0-9]","",$ARIG_graded);
$stmtA='';
$stmtB='';
@@ -25358,6 +25411,14 @@ if ($ADD==3111)
$ARIG_updated++;
$ARIG_changenotes .= "changed rank from $ARIG_rank[$o] to $ARIG_ranked|";
}
if ( ($ARIG_graded < $ARIG_grade[$o]) or ($ARIG_graded > $ARIG_grade[$o]) )
{
$stmtC="UPDATE vicidial_inbound_group_agents set group_grade='$ARIG_graded' where user='$ARIG_user[$o]' and group_id='$group_id';";
$rslt=mysql_query($stmtC, $link);
if ($DB > 0) {echo "|$stmtC|";}
$ARIG_updated++;
$ARIG_changenotes .= "changed grade from $ARIG_grade[$o] to $ARIG_graded|";
}
if ($ARIG_updated > 0)
{
### LOG INSERTION Admin Log Table ###
@@ -25370,7 +25431,7 @@ if ($ADD==3111)
}
}
$stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user $LOGadmin_viewable_groupsSQL order by vu.user;";
$stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns,viga.group_grade from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user $LOGadmin_viewable_groupsSQL order by vu.user;";
$rsltx=mysql_query($stmt, $link);
$users_to_print = mysql_num_rows($rsltx);
@@ -25385,6 +25446,7 @@ if ($ADD==3111)
$ARIG_calls[$o] = $rowx[2];
$ARIG_name[$o] = $rowx[3];
$ARIG_close[$o] = $rowx[4];
$ARIG_grade[$o] = $rowx[5];
$ARIG_check[$o] = '';
if (preg_match("/ $group_id /",$ARIG_close[$o]))
{$ARIG_check[$o] = ' CHECKED';}
@@ -25404,6 +25466,7 @@ if ($ADD==3111)
$checkbox_field="CHECK_$ARIG_user[$o]$US$group_id";
$rank_field="RANK_$ARIG_user[$o]$US$group_id";
$grade_field="GRADE_$ARIG_user[$o]$US$group_id";
$checkbox_list .= "|$checkbox_field";
$checkbox_count++;
@@ -25420,6 +25483,17 @@ if ($ADD==3111)
$h--;
}
$users_output .= "</select></td>\n";
$users_output .= "<td><select size=1 name=$grade_field>\n";
$h="10";
while ($h>=1)
{
$users_output .= "<option value=\"$h\"";
if ($h==$ARIG_grade[$o])
{$users_output .= " SELECTED";}
$users_output .= ">$h</option>";
$h--;
}
$users_output .= "</select></td>\n";
$users_output .= "<td><font size=1>$ARIG_calls[$o]</td></tr>\n";
}
echo "<tr><td><font size=1> &nbsp; </font></td><td align=left><a href=\"#\" onclick=\"IGU_selectall('$checkbox_count','$checkbox_list');return false;\"><font size=1>select all</font></a></td><td colspan=2><font size=1> &nbsp; </font></td></tr>\n";