diff --git a/AST_VDhopper.pl b/AST_VDhopper.pl index 2d78bba..1648f49 100644 --- a/AST_VDhopper.pl +++ b/AST_VDhopper.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# AST_VDhopper.pl version 0.7 +# AST_VDhopper.pl version 0.9 # # DESCRIPTION: # uses Net::MySQL to update the VICIDIAL leads hopper for the new streamlined @@ -32,12 +32,16 @@ # 60320-0932 - Added inactive lead list hopper deletion (Thanks Vic Jolin) # 60322-1030 - Added super debug output # 60418-0947 - Added lead filter per campaign +# 60509-1416 - Rewrite of local_call_time functions +# 60511-1150 - Added inserts into vicidial_campaign_stats table # # constants $DB=0; # Debug flag, set to 0 for no debug messages, On an active system this will generate lots of lines of output per minute $US='__'; $MT[0]=''; +#$vicidial_hopper='TEST_vicidial_hopper'; # for testing +$vicidial_hopper='vicidial_hopper'; # options $insert_auto_CB_to_hopper = 1; # set to 1 to automatically insert ANYONE callbacks into the hopper @@ -52,6 +56,7 @@ if ($hour < 10) {$Fhour = "0$hour";} if ($min < 10) {$min = "0$min";} if ($sec < 10) {$sec = "0$sec";} $now_date = "$year-$mon-$mday $hour:$min:$sec"; +$VDL_date = "$year-$mon-$mday 00:00:01"; if (!$VDHLOGfile) {$VDHLOGfile = "/home/cron/hopper.$year-$mon-$mday";} @@ -127,7 +132,7 @@ if (!$DB_port) {$DB_port='3306';} sleep(1); ### sleep for 5 seconds to stagger cron script load -use lib './lib', '../lib'; +#use lib './lib', '../lib'; use Net::MySQL; @@ -170,7 +175,7 @@ $GMT_now = ($secX - ($LOCAL_GMT_OFF * 3600)); if ($wipe_hopper_clean) { - $stmtA = "DELETE from vicidial_hopper;"; + $stmtA = "DELETE from $vicidial_hopper;"; $dbhA->query("$stmtA"); my $affected_rows = $dbhA->get_affected_rows_length; if ($DB) {print "Hopper Wiped Clean: $affected_rows\n";} @@ -201,7 +206,7 @@ if ($DB) {print "Inactive Lists: $inactive_lists_count\n";} if ($inactive_lists_count > 0) { chop($inactive_lists); - $stmtA = "DELETE from vicidial_hopper where list_id IN($inactive_lists);"; + $stmtA = "DELETE from $vicidial_hopper where list_id IN($inactive_lists);"; $dbhA->query("$stmtA"); my $affected_rows = $dbhA->get_affected_rows_length; if ($DB) {print "Inactive List Leads Deleted: $affected_rows |$stmtA|\n";} @@ -278,7 +283,7 @@ if ($CBHOLD_count > 0) $CAu=0; foreach(@CA_lead_id) { - $stmtA = "INSERT INTO vicidial_hopper SET lead_id='$CA_lead_id[$CAu]',campaign_id='$CA_campaign_id[$CAu]',list_id='$CA_list_id[$CAu]',gmt_offset_now='$CA_gmt_offset_now[$CAu]';"; + $stmtA = "INSERT INTO $vicidial_hopper SET lead_id='$CA_lead_id[$CAu]',campaign_id='$CA_campaign_id[$CAu]',list_id='$CA_list_id[$CAu]',gmt_offset_now='$CA_gmt_offset_now[$CAu]';"; $dbhA->query("$stmtA"); $CAu++; } @@ -326,88 +331,455 @@ if ($dbhA->has_selected_record) $i=0; foreach(@campaign_id) { - ##### calculate what gmt_offset_now values are within the allowed local_call_time setting - $GMT_allowed = ''; + ### close out MySQL connection and re-connect to start new connection ### +# $dbhA->close(); +# my $dbhA = ''; - if ($local_call_time[$i] =~ /24hours/) - { - $p='13'; - while ($p > -13) + ### Make sure this file is in a libs path or put the absolute path to it +# require("/home/cron/AST_SERVER_conf.pl"); # local configuration file +# if (!$DB_port) {$DB_port='3306';} +# use Net::MySQL; + +# my $dbhA = Net::MySQL->new(hostname => "$DB_server", database => "$DB_database", user => "$DB_user", password => "$DB_pass", port => "$DB_port") +# or die "Couldn't connect to database: $DB_server - $DB_database\n"; + + + $VCSdialable_leads=0; + $VCScalls_today=0; + $VCSdrops_today=0; + $VCSdrops_today_pct=0; + $vicidial_log = 'vicidial_log'; + + $stmtA = "SELECT dialable_leads from vicidial_campaign_stats where campaign_id='$campaign_id[$i]';"; + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + $rec_count=0; + while ( $record = $iter->each) { - $tz = sprintf("%.2f", $p); $GMT_allowed .= "'$tz',"; - $p = ($p - 0.25); + $VCSdialable_leads = "$record->[0]"; } - } - if ($local_call_time[$i] =~ /9am-9pm/) - { - $p='13'; - while ($p > -13) + } + $stmtA = "SELECT count(*) from $vicidial_log where campaign_id='$campaign_id[$i]' and call_date > '$VDL_date';"; + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + $rec_count=0; + while ( $record = $iter->each) { - $GMT_test = ($GMT_now + ($p * 3600)); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_test); - if ( ($hour >= 9) && ($hour <= 20) ){$tz = sprintf("%.2f", $p); $GMT_allowed .= "'$tz',";} - $p = ($p - 0.25); + $VCScalls_today = "$record->[0]"; } - } - if ($local_call_time[$i] =~ /9am-5pm/) + } + if ($VCScalls_today > 0) { - $p='13'; - while ($p > -13) - { - $GMT_test = ($GMT_now + ($p * 3600)); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_test); - if ( ($hour >= 9) && ($hour <= 16) ){$tz = sprintf("%.2f", $p); $GMT_allowed .= "'$tz',";} - $p = ($p - 0.25); - } + $stmtA = "SELECT count(*) from $vicidial_log where campaign_id='$campaign_id[$i]' and call_date > '$VDL_date' and status IN('DROP','XDROP');"; + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + $rec_count=0; + while ( $record = $iter->each) + { + $VCSdrops_today = "$record->[0]"; + if ($VCSdrops_today > 0) + { + $VCSdrops_today_pct = ( ($VCSdrops_today / $VCScalls_today) * 100 ); + $VCSdrops_today_pct = sprintf("%.2f", $VCSdrops_today_pct); + } + } + } } - if ($local_call_time[$i] =~ /12pm-5pm/) + + $stmtA = "UPDATE vicidial_campaign_stats SET calls_today='$VCScalls_today',drops_today='$VCSdrops_today',drops_today_pct='$VCSdrops_today_pct' where campaign_id='$campaign_id[$i]';"; + $dbhA->query("$stmtA"); + + ##### BEGIN calculate what gmt_offset_now values are within the allowed local_call_time setting ### + $g=0; + $p='13'; + $GMT_gmt[0] = ''; + $GMT_hour[0] = ''; + $GMT_day[0] = ''; + if ($DBX) {print "\n |GMT-DAY-HOUR| ";} + while ($p > -13) { - $p='13'; - while ($p > -13) - { - $GMT_test = ($GMT_now + ($p * 3600)); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_test); - if ( ($hour >= 12) && ($hour <= 16) ){$tz = sprintf("%.2f", $p); $GMT_allowed .= "'$tz',";} - $p = ($p - 0.25); - } + $pzone = ($GMT_now + ($p * 3600)); + ($psec,$pmin,$phour,$pmday,$pmon,$pyear,$pday,$pyday,$pisdst) = localtime($pzone); + $phour=($phour * 100); + $tz = sprintf("%.2f", $p); + $GMT_gmt[$g] = "$tz"; + $GMT_day[$g] = "$pday"; + $GMT_hour[$g] = ($phour + $pmin); + $p = ($p - 0.25); + if ($DBX) {print "|$GMT_gmt[$g]-$GMT_day[$g]-$GMT_hour[$g]|";} + $g++; } - if ($local_call_time[$i] =~ /12pm-9pm/) + if ($DBX) {print "\n";} + + $stmtA = "SELECT * FROM vicidial_call_times where call_time_id='$local_call_time[$i]';"; + if ($DBX) {print " |$stmtA|\n";} + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) { - $p='13'; - while ($p > -13) + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) { - $GMT_test = ($GMT_now + ($p * 3600)); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_test); - if ( ($hour >= 12) && ($hour <= 20) ){$tz = sprintf("%.2f", $p); $GMT_allowed .= "'$tz',";} - $p = ($p - 0.25); - } - } - if ($local_call_time[$i] =~ /5pm-9pm/) - { - $p='13'; - while ($p > -13) - { - $GMT_test = ($GMT_now + ($p * 3600)); - ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($GMT_test); - if ( ($hour >= 17) && ($hour <= 20) ){$tz = sprintf("%.2f", $p); $GMT_allowed .= "'$tz',";} - $p = ($p - 0.25); + $Gct_default_start = "$record->[3]"; + $Gct_default_stop = "$record->[4]"; + $Gct_sunday_start = "$record->[5]"; + $Gct_sunday_stop = "$record->[6]"; + $Gct_monday_start = "$record->[7]"; + $Gct_monday_stop = "$record->[8]"; + $Gct_tuesday_start = "$record->[9]"; + $Gct_tuesday_stop = "$record->[10]"; + $Gct_wednesday_start = "$record->[11]"; + $Gct_wednesday_stop = "$record->[12]"; + $Gct_thursday_start = "$record->[13]"; + $Gct_thursday_stop = "$record->[14]"; + $Gct_friday_start = "$record->[15]"; + $Gct_friday_stop = "$record->[16]"; + $Gct_saturday_start = "$record->[17]"; + $Gct_saturday_stop = "$record->[18]"; + $Gct_state_call_times = "$record->[19]"; } } - $GMT_allowed .= "'99'"; + $ct_states = ''; + $ct_state_gmt_SQL = ''; + $del_state_gmt_SQL = ''; + $ct_srs=0; + $b=0; + if (length($Gct_state_call_times)>2) + { + @state_rules = split(/\|/,$Gct_state_call_times); + $ct_srs = ($#state_rules - 2); + } + while($ct_srs >= $b) + { + if (length($state_rules[$b])>1) + { + $stmtA = "SELECT * from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; + if ($DBX) {print " |$stmtA|\n";} + $dbhA->query("$stmtA"); + if ($dbhA->has_selected_record) + { + $iter=$dbhA->create_record_iterator; + while ( $record = $iter->each) + { + $Gstate_call_time_id = "$record->[0]"; + $Gstate_call_time_state = "$record->[1]"; + $Gsct_default_start = "$record->[4]"; + $Gsct_default_stop = "$record->[5]"; + $Gsct_sunday_start = "$record->[6]"; + $Gsct_sunday_stop = "$record->[7]"; + $Gsct_monday_start = "$record->[8]"; + $Gsct_monday_stop = "$record->[9]"; + $Gsct_tuesday_start = "$record->[10]"; + $Gsct_tuesday_stop = "$record->[11]"; + $Gsct_wednesday_start = "$record->[12]"; + $Gsct_wednesday_stop = "$record->[13]"; + $Gsct_thursday_start = "$record->[14]"; + $Gsct_thursday_stop = "$record->[15]"; + $Gsct_friday_start = "$record->[16]"; + $Gsct_friday_stop = "$record->[17]"; + $Gsct_saturday_start = "$record->[18]"; + $Gsct_saturday_stop = "$record->[19]"; + $ct_states .="'$Gstate_call_time_state',"; + } + } + + $r=0; + $state_gmt=''; + $del_state_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gsct_sunday_start==0) and ($Gsct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_sunday_start) and ($GMT_hour[$r]<$Gsct_sunday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gsct_monday_start==0) and ($Gsct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_monday_start) and ($GMT_hour[$r]<$Gsct_monday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gsct_tuesday_start==0) and ($Gsct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_tuesday_start) and ($GMT_hour[$r]<$Gsct_tuesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gsct_wednesday_start==0) and ($Gsct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_wednesday_start) and ($GMT_hour[$r]<$Gsct_wednesday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gsct_thursday_start==0) and ($Gsct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_thursday_start) and ($GMT_hour[$r]<$Gsct_thursday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gsct_friday_start==0) and ($Gsct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_friday_start) and ($GMT_hour[$r]<$Gsct_friday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gsct_saturday_start==0) and ($Gsct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gsct_default_start) and ($GMT_hour[$r]<$Gsct_default_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gsct_saturday_start) and ($GMT_hour[$r]<$Gsct_saturday_stop) ) + {$state_gmt.="'$GMT_gmt[$r]',";} + else + {$del_state_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + $state_gmt = "$state_gmt'99'"; + $del_state_gmt = "$del_state_gmt'99'"; + $ct_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($state_gmt)) "; + $del_state_gmt_SQL .= "or (state='$Gstate_call_time_state' and gmt_offset_now IN($del_state_gmt)) "; + } + + $b++; + } + if (length($ct_states)>2) + { + $ct_states =~ s/,$//gi; + $ct_statesSQL = "and state NOT IN($ct_states)"; + } + else + { + $ct_statesSQL = ""; + } + + $r=0; + $default_gmt=''; + $del_default_gmt=''; + while($r < $g) + { + if ($GMT_day[$r]==0) #### Sunday local time + { + if (($Gct_sunday_start==0) and ($Gct_sunday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_sunday_start) and ($GMT_hour[$r]<$Gct_sunday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==1) #### Monday local time + { + if (($Gct_monday_start==0) and ($Gct_monday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_monday_start) and ($GMT_hour[$r]<$Gct_monday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==2) #### Tuesday local time + { + if (($Gct_tuesday_start==0) and ($Gct_tuesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_tuesday_start) and ($GMT_hour[$r]<$Gct_tuesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==3) #### Wednesday local time + { + if (($Gct_wednesday_start==0) and ($Gct_wednesday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_wednesday_start) and ($GMT_hour[$r]<$Gct_wednesday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==4) #### Thursday local time + { + if (($Gct_thursday_start==0) and ($Gct_thursday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_thursday_start) and ($GMT_hour[$r]<$Gct_thursday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==5) #### Friday local time + { + if (($Gct_friday_start==0) and ($Gct_friday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_friday_start) and ($GMT_hour[$r]<$Gct_friday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + } + if ($GMT_day[$r]==6) #### Saturday local time + { + if (($Gct_saturday_start==0) and ($Gct_saturday_stop==0)) + { + if ( ($GMT_hour[$r]>=$Gct_default_start) and ($GMT_hour[$r]<$Gct_default_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + else + { + if ( ($GMT_hour[$r]>=$Gct_saturday_start) and ($GMT_hour[$r]<$Gct_saturday_stop) ) + {$default_gmt.="'$GMT_gmt[$r]',";} + else + {$del_default_gmt.="'$GMT_gmt[$r]',";} + } + } + $r++; + } + + $default_gmt = "$default_gmt'99'"; + $del_default_gmt = "$del_default_gmt'99'"; + $all_gmtSQL = "(gmt_offset_now IN($default_gmt) $ct_statesSQL) $ct_state_gmt_SQL"; + $del_gmtSQL = "(gmt_offset_now IN($del_default_gmt) $ct_statesSQL) $del_state_gmt_SQL"; + + ##### END calculate what gmt_offset_now values are within the allowed local_call_time setting ### - if ($DB) {print "Starting hopper run for $campaign_id[$i] campaign- GMT: $local_call_time[$1] $GMT_allowed HOPPER: $hopper_level[$i] \n";} + + if ($DB) {print "Starting hopper run for $campaign_id[$i] campaign- GMT: $local_call_time[$i] HOPPER: $hopper_level[$i] \n";} ### Delete the DONE leads if there are any - $stmtA = "DELETE from vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('DONE');"; + $stmtA = "DELETE from $vicidial_hopper where campaign_id='$campaign_id[$i]' and status IN('DONE');"; $dbhA->query("$stmtA"); my $affected_rows = $dbhA->get_affected_rows_length; if ($DB) {print " hopper DONE cleared: $affected_rows\n";} if ($DBX) {print " |$stmtA|\n";} ### Delete the leads that are out of GMT time range if there are any - $stmtA = "DELETE from vicidial_hopper where campaign_id='$campaign_id[$i]' and gmt_offset_now NOT IN($GMT_allowed);"; + $stmtA = "DELETE from $vicidial_hopper where campaign_id='$campaign_id[$i]' and ($del_gmtSQL);"; $dbhA->query("$stmtA"); my $affected_rows = $dbhA->get_affected_rows_length; if ($DB) {print " hopper GMT BAD cleared: $affected_rows\n";} @@ -415,7 +787,7 @@ foreach(@campaign_id) ### Find out how many leads are in the hopper from a specific campaign $hopper_ready_count=0; - $stmtA = "SELECT count(*) from vicidial_hopper where campaign_id='$campaign_id[$i]' and status='READY';"; + $stmtA = "SELECT count(*) from $vicidial_hopper where campaign_id='$campaign_id[$i]' and status='READY';"; $dbhA->query("$stmtA"); if ($dbhA->has_selected_record) { @@ -429,7 +801,7 @@ foreach(@campaign_id) $rec_countA++; } } - $event_string = "|$campaign_id[$i]|$hopper_level[$i]|$hopper_ready_count|$local_call_time[$i]|$GMT_allowed|"; + $event_string = "|$campaign_id[$i]|$hopper_level[$i]|$hopper_ready_count|$local_call_time[$i]||"; &event_logger; ##### IF hopper level is below set minimum, then try to add more leads ##### @@ -481,7 +853,8 @@ foreach(@campaign_id) if ($DBX) {print " |$lead_filter_id[$i]|\n";} } - $stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a[$i]','$dial_status_b[$i]','$dial_status_c[$i]','$dial_status_d[$i]','$dial_status_e[$i]') and list_id IN($camp_lists) and gmt_offset_now IN($GMT_allowed) $lead_filter_sql[$i];"; + $stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a[$i]','$dial_status_b[$i]','$dial_status_c[$i]','$dial_status_d[$i]','$dial_status_e[$i]') and list_id IN($camp_lists) and ($all_gmtSQL) $lead_filter_sql[$i];"; + if ($DBX) {print " |$stmtA|\n";} $dbhA->query("$stmtA"); $campaign_leads_to_call=0; if ($dbhA->has_selected_record) @@ -494,9 +867,9 @@ foreach(@campaign_id) if ($DBX) {print " |$stmtA|\n";} } } - if ( ($lead_order[$i] eq "DOWN COUNT 2nd NEW") or ($lead_order[$i] eq "DOWN COUNT 3rd NEW") or ($lead_order[$i] eq "DOWN COUNT 4th NEW") ) + if ($lead_order[$i] =~ /DOWN COUNT 2nd NEW|DOWN COUNT 3rd NEW|DOWN COUNT 4th NEW/) { - $stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists) and gmt_offset_now IN($GMT_allowed) $lead_filter_sql[$i];"; + $stmtA = "SELECT count(*) FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists) and ($all_gmtSQL) $lead_filter_sql[$i];"; $dbhA->query("$stmtA"); $NEW_campaign_leads_to_call=0; if ($dbhA->has_selected_record) @@ -512,7 +885,7 @@ foreach(@campaign_id) } ##### IF no NEW leads to be called, error out of this campaign ##### - if ( ( ($lead_order[$i] eq "DOWN COUNT 2nd NEW") or ($lead_order[$i] eq "DOWN COUNT 3rd NEW") or ($lead_order[$i] eq "DOWN COUNT 4th NEW") ) && ($NEW_campaign_leads_to_call > 0) ) {$GOOD=1;} + if ( ($lead_order[$i] =~ /DOWN COUNT 2nd NEW|DOWN COUNT 3rd NEW|DOWN COUNT 4th NEW/) && ($NEW_campaign_leads_to_call > 0) ) {$GOOD=1;} else { if ($DB) {print " ERROR CANNOT ADD ANY NEW LEADS TO HOPPER\n";} @@ -522,12 +895,22 @@ foreach(@campaign_id) if ($campaign_leads_to_call < 1) { if ($DB) {print " ERROR CANNOT ADD ANY LEADS TO HOPPER\n";} + if ($VCSdialable_leads > 0) + { + $stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='0' where campaign_id='$campaign_id[$i]';"; + $dbhA->query("$stmtA"); + } } else { + if ($VCSdialable_leads != $campaign_leads_to_call) + { + $stmtA = "UPDATE vicidial_campaign_stats SET dialable_leads='$campaign_leads_to_call' where campaign_id='$campaign_id[$i]';"; + $dbhA->query("$stmtA"); + } if ($DB) {print " Getting Leads to add to hopper\n";} ### grab leads already in hopper so we don't duplicate - $stmtA = "SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign_id[$i]';"; + $stmtA = "SELECT lead_id FROM $vicidial_hopper where campaign_id='$campaign_id[$i]';"; if ($DBX) {print " |$stmtA|\n";} $dbhA->query("$stmtA"); $rec_countLISTS=0; @@ -566,7 +949,7 @@ foreach(@campaign_id) $order_stmt = 'order by called_count, lead_id asc'; if ($DB) {print " looking for $NEW_level NEW leads mixed in with $OTHER_level other leads\n";} - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and gmt_offset_now IN($GMT_allowed) $lead_filter_sql[$i] $order_stmt limit $NEW_level;"; + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN('NEW') and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL) $lead_filter_sql[$i] $order_stmt limit $NEW_level;"; if ($DBX) {print " |$stmtA|\n";} $dbhA->query("$stmtA"); if ($dbhA->has_selected_record) @@ -582,6 +965,7 @@ foreach(@campaign_id) $NEW_lists_to_hopper[$NEW_rec_countLEADS] = "$record->[1]"; $NEW_gmt_to_hopper[$NEW_rec_countLEADS] = "$record->[2]"; $NEW_phone_to_hopper[$NEW_rec_countLEADS] = "$record->[3]"; + $NEW_state_to_hopper[$NEW_rec_countLEADS] = "$record->[4]"; if ($DB_show_offset) {print "LEAD_ADD: $record->[2] $record->[3] $record->[4]\n";} $NEW_rec_countLEADS++; } @@ -592,7 +976,7 @@ foreach(@campaign_id) if ($DB) {print " lead call order: $order_stmt\n";} - $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a[$i]','$dial_status_b[$i]','$dial_status_c[$i]','$dial_status_d[$i]','$dial_status_e[$i]') and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and gmt_offset_now IN($GMT_allowed) $lead_filter_sql[$i] $order_stmt limit $OTHER_level;"; + $stmtA = "SELECT lead_id,list_id,gmt_offset_now,phone_number,state FROM vicidial_list where called_since_last_reset='N' and status IN('$dial_status_a[$i]','$dial_status_b[$i]','$dial_status_c[$i]','$dial_status_d[$i]','$dial_status_e[$i]') and list_id IN($camp_lists) and lead_id NOT IN($lead_id_lists) and ($all_gmtSQL) $lead_filter_sql[$i] $order_stmt limit $OTHER_level;"; if ($DBX) {print " |$stmtA|\n";} $dbhA->query("$stmtA"); if ($dbhA->has_selected_record) @@ -615,6 +999,7 @@ foreach(@campaign_id) $leads_to_hopper[$rec_countLEADS] = "$NEW_leads_to_hopper[$NEW_in]"; $lists_to_hopper[$rec_countLEADS] = "$NEW_lists_to_hopper[$NEW_in]"; $gmt_to_hopper[$rec_countLEADS] = "$NEW_gmt_to_hopper[$NEW_in]"; + $state_to_hopper[$rec_countLEADS] = "$NEW_state_to_hopper[$NEW_in]"; if ($DB_show_offset) {print "LEAD_ADD: $NEW_leads_to_hopper[$NEW_in] $NEW_phone_to_hopper[$NEW_in]\n";} $rec_countLEADS++; $NEW_in++; @@ -624,6 +1009,7 @@ foreach(@campaign_id) $leads_to_hopper[$rec_countLEADS] = "$record->[0]"; $lists_to_hopper[$rec_countLEADS] = "$record->[1]"; $gmt_to_hopper[$rec_countLEADS] = "$record->[2]"; + $state_to_hopper[$rec_countLEADS] = "$record->[4]"; if ($DB_show_offset) {print "LEAD_ADD: $record->[2] $record->[3] $record->[4]\n";} $rec_countLEADS++; } @@ -638,7 +1024,7 @@ foreach(@campaign_id) { if ($leads_to_hopper[$h] != '0') { - $stmtA = "INSERT INTO vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]');"; + $stmtA = "INSERT INTO $vicidial_hopper (lead_id,campaign_id,status,user,list_id,gmt_offset_now,state) values('$leads_to_hopper[$h]','$campaign_id[$i]','READY','','$lists_to_hopper[$h]','$gmt_to_hopper[$h]','$state_to_hopper[$h]');"; $dbhA->query("$stmtA"); } $h++; diff --git a/LANG_admin.zip b/LANG_admin.zip index 27d3067..91cc67d 100644 Binary files a/LANG_admin.zip and b/LANG_admin.zip differ diff --git a/LANG_agc.zip b/LANG_agc.zip index 355e185..8d2ca94 100644 Binary files a/LANG_agc.zip and b/LANG_agc.zip differ diff --git a/MySQL_AST_CREATE_tables.sql b/MySQL_AST_CREATE_tables.sql index 3219fa7..7c3c84b 100644 --- a/MySQL_AST_CREATE_tables.sql +++ b/MySQL_AST_CREATE_tables.sql @@ -273,6 +273,7 @@ status ENUM('READY','QUEUE','INCALL','DONE') default 'READY', user VARCHAR(20), list_id BIGINT(14) UNSIGNED NOT NULL, gmt_offset_now DECIMAL(4,2) DEFAULT '0.00', +state VARCHAR(2) default '', index (lead_id) ); @@ -403,6 +404,8 @@ vicidial_transfers ENUM('0','1') default '1', delete_filters ENUM('0','1') default '0', alter_agent_interface_options ENUM('0','1') default '0', closer_default_blended ENUM('0','1') default '0', +delete_call_times ENUM('0','1') default '0', +modify_call_times ENUM('0','1') default '0', index (user) ); @@ -435,10 +438,10 @@ park_ext VARCHAR(10), park_file_name VARCHAR(10), web_form_address VARCHAR(255), allow_closers ENUM('Y','N'), -hopper_level ENUM('1','5','10','50','100','200','500') default '1', +hopper_level INT(8) UNSIGNED default '1', auto_dial_level ENUM('0','1','1.1','1.2','1.3','1.4','1.5','1.6','1.7','1.8','1.9','2.0','2.2','2.5','2.7','3.0','3.5','4.0') default '0', next_agent_call ENUM('random','oldest_call_start','oldest_call_finish','overall_user_level') default 'oldest_call_finish', -local_call_time VARCHAR(20) DEFAULT '9am-9pm', +local_call_time VARCHAR(10) DEFAULT '9am-9pm', voicemail_ext VARCHAR(10), dial_timeout TINYINT UNSIGNED default '60', dial_prefix VARCHAR(20) default '9', @@ -457,7 +460,13 @@ xferconf_b_dtmf VARCHAR(50), xferconf_b_number VARCHAR(50), alt_number_dialing ENUM('Y','N') default 'N', scheduled_callbacks ENUM('Y','N') default 'N', -lead_filter_id VARCHAR(10) default 'NONE' +lead_filter_id VARCHAR(10) default 'NONE', +drop_call_seconds TINYINT(3) unsigned default '5', +safe_harbor_message ENUM('Y','N') default 'N', +safe_harbor_exten VARCHAR(20) default '8307', +display_dialable_count ENUM('Y','N') default 'Y', +wrapup_seconds SMALLINT(3) UNSIGNED default '0', +wrapup_message VARCHAR(255) default 'Wrapup Call' ); CREATE TABLE vicidial_lists ( @@ -521,7 +530,10 @@ get_call_launch ENUM('NONE','SCRIPT','WEBFORM') default 'NONE', xferconf_a_dtmf VARCHAR(50), xferconf_a_number VARCHAR(50), xferconf_b_dtmf VARCHAR(50), -xferconf_b_number VARCHAR(50) +xferconf_b_number VARCHAR(50), +drop_call_seconds SMALLINT(4) unsigned default '360', +drop_message ENUM('Y','N') default 'N', +drop_exten VARCHAR(20) default '8307' ); CREATE TABLE vicidial_stations ( @@ -663,3 +675,96 @@ lead_filter_name VARCHAR(30) NOT NULL, lead_filter_comments VARCHAR(255), lead_filter_sql TEXT ); + + CREATE TABLE vicidial_call_times ( +call_time_id VARCHAR(10) PRIMARY KEY NOT NULL, +call_time_name VARCHAR(30) NOT NULL, +call_time_comments VARCHAR(255) default '', +ct_default_start SMALLINT(4) unsigned NOT NULL default '900', +ct_default_stop SMALLINT(4) unsigned NOT NULL default '2100', +ct_sunday_start SMALLINT(4) unsigned default '0', +ct_sunday_stop SMALLINT(4) unsigned default '0', +ct_monday_start SMALLINT(4) unsigned default '0', +ct_monday_stop SMALLINT(4) unsigned default '0', +ct_tuesday_start SMALLINT(4) unsigned default '0', +ct_tuesday_stop SMALLINT(4) unsigned default '0', +ct_wednesday_start SMALLINT(4) unsigned default '0', +ct_wednesday_stop SMALLINT(4) unsigned default '0', +ct_thursday_start SMALLINT(4) unsigned default '0', +ct_thursday_stop SMALLINT(4) unsigned default '0', +ct_friday_start SMALLINT(4) unsigned default '0', +ct_friday_stop SMALLINT(4) unsigned default '0', +ct_saturday_start SMALLINT(4) unsigned default '0', +ct_saturday_stop SMALLINT(4) unsigned default '0', +ct_state_call_times TEXT default '' +); + + CREATE TABLE vicidial_state_call_times ( +state_call_time_id VARCHAR(10) PRIMARY KEY NOT NULL, +state_call_time_state VARCHAR(2) NOT NULL, +state_call_time_name VARCHAR(30) NOT NULL, +state_call_time_comments VARCHAR(255) default '', +sct_default_start SMALLINT(4) unsigned NOT NULL default '900', +sct_default_stop SMALLINT(4) unsigned NOT NULL default '2100', +sct_sunday_start SMALLINT(4) unsigned default '0', +sct_sunday_stop SMALLINT(4) unsigned default '0', +sct_monday_start SMALLINT(4) unsigned default '0', +sct_monday_stop SMALLINT(4) unsigned default '0', +sct_tuesday_start SMALLINT(4) unsigned default '0', +sct_tuesday_stop SMALLINT(4) unsigned default '0', +sct_wednesday_start SMALLINT(4) unsigned default '0', +sct_wednesday_stop SMALLINT(4) unsigned default '0', +sct_thursday_start SMALLINT(4) unsigned default '0', +sct_thursday_stop SMALLINT(4) unsigned default '0', +sct_friday_start SMALLINT(4) unsigned default '0', +sct_friday_stop SMALLINT(4) unsigned default '0', +sct_saturday_start SMALLINT(4) unsigned default '0', +sct_saturday_stop SMALLINT(4) unsigned default '0' +); + + CREATE TABLE vicidial_campaign_stats ( +campaign_id VARCHAR(20) PRIMARY KEY NOT NULL, +update_time TIMESTAMP, +dialable_leads INT(9) UNSIGNED default '0', +calls_today INT(9) UNSIGNED default '0', +drops_today INT(9) UNSIGNED default '0', +drops_today_pct VARCHAR(6) default '0', +calls_hour INT(9) UNSIGNED default '0', +drops_hour INT(9) UNSIGNED default '0', +drops_hour_pct VARCHAR(6) default '0', +calls_halfhour INT(9) UNSIGNED default '0', +drops_halfhour INT(9) UNSIGNED default '0', +drops_halfhour_pct VARCHAR(6) default '0', +calls_fivemin INT(9) UNSIGNED default '0', +drops_fivemin INT(9) UNSIGNED default '0', +drops_fivemin_pct VARCHAR(6) default '0', +calls_onemin INT(9) UNSIGNED default '0', +drops_onemin INT(9) UNSIGNED default '0', +drops_onemin_pct VARCHAR(6) default '0' +); + +INSERT INTO vicidial_call_times SET call_time_id='24hours',call_time_name='default 24 hours calling',ct_default_start='0',ct_default_stop='2400'; +INSERT INTO vicidial_call_times SET call_time_id='9am-9pm',call_time_name='default 9am to 9pm calling',ct_default_start='900',ct_default_stop='2100'; +INSERT INTO vicidial_call_times SET call_time_id='9am-5pm',call_time_name='default 9am to 5pm calling',ct_default_start='900',ct_default_stop='1700'; +INSERT INTO vicidial_call_times SET call_time_id='12pm-5pm',call_time_name='default 12pm to 5pm calling',ct_default_start='1200',ct_default_stop='1700'; +INSERT INTO vicidial_call_times SET call_time_id='12pm-9pm',call_time_name='default 12pm to 9pm calling',ct_default_start='1200',ct_default_stop='1200'; +INSERT INTO vicidial_call_times SET call_time_id='5pm-9pm',call_time_name='default 5pm to 9pm calling',ct_default_start='1700',ct_default_stop='2100'; + +INSERT INTO vicidial_state_call_times SET state_call_time_id='alabama',state_call_time_state='AL',state_call_time_name='Alabama 8am-8pm and Sunday',sct_default_start='800',sct_default_stop='2000',sct_sunday_start='2400',sct_sunday_stop='2400'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='illinois',state_call_time_state='IL',state_call_time_name='Illinois 8am',sct_default_start='800',sct_default_stop='2100'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='indiana',state_call_time_state='IN',state_call_time_name='Indiana 8pm restriction',sct_default_start='900',sct_default_stop='2000'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='kentucky',state_call_time_state='KY',state_call_time_name='Kentucky 10am restriction',sct_default_start='1000',sct_default_stop='2100'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='louisiana',state_call_time_state='LA',state_call_time_name='Louisiana 8am-8pm and Sunday',sct_default_start='800',sct_default_stop='2000',sct_sunday_start='2400',sct_sunday_stop='2400'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='massachuse',state_call_time_state='MA',state_call_time_name='Massachusetts 8am-8pm',sct_default_start='800',sct_default_stop='2000'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='mississipp',state_call_time_state='MS',state_call_time_name='Mississippi 8am-8pm and Sunday',sct_default_start='800',sct_default_stop='2000',sct_sunday_start='2400',sct_sunday_stop='2400'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='nebraska',state_call_time_state='NE',state_call_time_name='Nebraska 8am',sct_default_start='800',sct_default_stop='2100'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='nevada',state_call_time_state='NV',state_call_time_name='Nevada 8pm restriction',sct_default_start='900',sct_default_stop='2000'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='pennsylvan',state_call_time_state='PN',state_call_time_name='Pennsylvania sunday restriction',sct_sunday_start='1330',sct_sunday_stop='2100'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='rhodeislan',state_call_time_state='RI',state_call_time_name='Rhode Island restrictions',sct_default_start='900',sct_default_stop='1800',sct_sunday_start='2400',sct_sunday_stop='2400',sct_saturday_start='1000',sct_saturday_stop='1700'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='sdakota',state_call_time_state='SD',state_call_time_name='South Dakota sunday restrict',sct_sunday_start='2400',sct_sunday_stop='2400'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='tennessee',state_call_time_state='TN',state_call_time_name='Tennessee 8am',sct_default_start='800',sct_default_stop='2100'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='texas',state_call_time_state='TX',state_call_time_name='Texas sunday restriction',sct_sunday_start='1200',sct_sunday_stop='2100'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='utah',state_call_time_state='UT',state_call_time_name='Utah 8pm restriction',sct_default_start='900',sct_default_stop='2000'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='washington',state_call_time_state='WA',state_call_time_name='Washington 8am',sct_default_start='800',sct_default_stop='2100'; +INSERT INTO vicidial_state_call_times SET state_call_time_id='wyoming',state_call_time_state='WY',state_call_time_name='Wyoming 8am-8pm',sct_default_start='800',sct_default_stop='2000'; + diff --git a/TO_BE_TRANSLATED.txt b/TO_BE_TRANSLATED.txt index 6d5beed..86cde52 100644 --- a/TO_BE_TRANSLATED.txt +++ b/TO_BE_TRANSLATED.txt @@ -1,74 +1,124 @@ -############################################################ ADMIN - -Add New Filter -New Filter Addition -Modify Filter -Delete Filter -Filters -Filter ID - This is the short name of a Vicidial Lead Filter. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters -Filter Name - This is a more descriptive name of the Filter. This is a short summary of the filter. max 30 characters, minimum of 2 characters -Filter Comments - This is where you can place comments for a Vicidial Filter such as -calls all California leads-. max 255 characters, minimum of 2 characters -Filter SQL - This is where you place the SQL query fragment that you want to filter by. do not begin or end with an AND, that will be added by the hopper cron script automatically. an example SQL query that would work here is- called_count > 4 and called_count < 8 - -ADD NEW FILTER -Filter ID: -Filter Name: -Filter Comments: -Filter SQL: -short description of the filter -FILTER NOT ADDED - there is already a filter entry with this ID -Please go back and look at the data you entered -FILTER NOT ADDED -FILTER NOT MODIFIED -FILTER NOT DELETED -Filter ID, name and SQL must be at least 2 characters in length -FILTER ADDED: -FILTER MODIFIED -Filter ID must be at least 2 characters in length -Click here to delete filter -FILTER DELETION COMPLETED: -MODIFY A FILTER -DELETE THIS FILTER -LEAD FILTER LISTINGS: -VIEW FILTERS -Lead Filter: -Lead Filter - This is a method of filtering your leads using a fragment of a SQL query. Use this feature with caution, it is easy to stop dialing accidentally with the slightest alteration to the SQL statement. Default is NONE -Agent Alt Num Dialing: -Agent Alt Num Dialing - This option allows an agent to manually dial the alternate phone number or address3 field after the main number has been called -Scheduled Callbacks - This option allows an agent to disposition a call as CALLBK and choose the data and time at which the lead will be re-activated -Agent-Only Callbacks - This option allows an agent to set a callback so that they are the only Agent that can call the customer back. This also allows the agent to see their callback listings and call them back any time they want to -Agent Call Manual - This option allows an agent to manually enter a new lead into the system and call them. This also allows the calling of any phone number from their vicidial screen and puts that call into their session. Use this option with caution -Vicidial Recording - This option can prevent an agent from doing any recordings after they log in to vicidial. This option must be on for vicidial to follow the campaign recording session -Vicidial Transfers - This option can prevent an agent from opening the transfer - conference session of vicidial. If this is disabled, the agent cannot third party call or blind transfer any calls -Delete Filters - This option allows the user to be able to delete vicidial lead filters from the system -Scheduled Callbacks: -Agent-Only Callbacks: -Users List - - -############################################################ CLIENT - -Hangup Again -Go Back -Call Agent Again -Finish and Disposition Call -MY CALLBACK ONLY -MANUAL DIAL -ACTIVE CALLBACKS -CALLBACKS FOR AGENT -Click on a callback below to call the customer back now. If you click on a record below to call it, it will be removed from the list -YOU MUST BE PAUSED TO CHECK CALLBACKS IN AUTO-DIAL MODE -YOU CANNOT SKIP A CALLBACK OR MANUAL DIAL, YOU MUST DIAL THE LEAD -YOU MUST BE PAUSED TO MANUAL DIAL A NEW LEAD IN AUTO-DIAL MODE -NEW MANUAL DIAL LEAD FOR -Enter information below for the new lead you wish to call -Note: a dial prefix of -with be added to the beginning of this number -This is usually a 1 in the USA-Canada -Dial Code: -10 digits max - digits only -Note: all new manual dial leads will go into list 999 -If you want to dial a number and have it NOT be added as a new lead, enter in the exact dialstring that you want to call in the Dial Override field below. To hangup this call you will have to open the CALLS IN THIS SESSION link at the bottom of the screen and hang it up by clicking on its channel link there -Dial Override -digits only please -Dial Now -YOU DO NOT HAVE PERMISSIONS TO TRANSFER CALLS +############################################################ ADMIN + +Drop Call Seconds - The number of seconds from the time the customer line is picked up until the call is considered a DROP, only applies to outbound calls +Safe Harbor Message - If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y +Safe Harbor Exten - This is the dialplan extension that the desired Safe Harbor audio file is located at on your server +Drop Message - If set to Y will play a message to customer after the Drop Call Seconds timeout is reached without being transferred to an agent. This setting will override sending to a voicemail box if this is set to Y +Drop Exten - This is the dialplan extension that the desired Dropped call audio file is located at on your server +Call Time ID - This is the short name of a Vicidial Call Time Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 10 characters, minimum of 2 characters +Call Time Name - This is a more descriptive name of the Call Time Definition. This is a short summary of the Call Time definition. max 30 characters, minimum of 2 characters +Call Time Comments - This is where you can place comments for a Vicidial Call Time Definition such as -10am to 4pm with extra call state restrictions-. max 255 characters +Default Start and Stop Times - This is the default time that calling will be allowed to be started or stopped within this call time definition if the day-of-the-week start time is not defined. 0 is midnight. To prevent calling completely set this field to 2400 and set the Default Stop time to 2400. To allow calling 24 hours a day set the start time to 0 and the stop time to 2400 +Weekday Start and Stop Times - These are the custom times per day that can be set for the call time definition. same rules apply as with the Default start and stop times +State Call Time Definitions - This is the list of State specific call time definitions that are followed in this Call Time Definition +State Call Time State - This is the two letter code for the state that this calling time definition is for. For this to be in effect the local call time that is set in the campaign must have this state call time record in it as well as all of the leads having two letter state codes in them +Delete Call Times - This option allows the user to be able to delete vicidial call times records and vicidial state call times records from the system +Modify Call Times - This option allows the user to view and modify the call times and state call times records. A user doesn't need this option enabled if they only need to change the call times option on the campaigns screen +Wrapup Seconds - The number of seconds to force an agent to wait before allowing them to receive or dial another call. The timer begins as soon as an agent hangs up on their customer - or in the case of alternate number dialing when the agent finishes the lead - Default is 0 seconds. If the timer runs out before the agent has dispositioned the call, the agent still will NOT move on to the next call until they select a disposition +Wrapup Message - This is a campaign-specific message to be displayed on the wrapup screen if wrapup seconds is set +You are not authorized to view this page. Please go back +Day and time options will appear once you have created the Call Time Definition +State Call Time ID, name and state must be at least 2 characters in length +Call Time ID and name must be at least 2 characters in length +Active State Call Time Definitions for this Record +there is already a call time entry with this ID +CALL TIMES USING THIS STATE CALL TIME +STATE CALL TIME DEFINITION NOT ADDED +DELETE THIS STATE CALL TIME DEFINITION +Modify Call Time State Definitions List +CALL TIME DEFINITION NOT ADDED +DELETE THIS CALL TIME DEFINITION +short description of the call time +CAMPAIGNS USING THIS CALL TIME +STATE CALL TIME NOT MODIFIED +CALL TIME NOT MODIFIED +STATE CALL TIME MODIFIED +CALL TIME MODIFIED +Default Start: +Default Stop: +Sunday Start: +Sunday Stop: +Monday Start: +Monday Stop: +Tuesday Start: +Tuesday Stop: +Wednesday Start: +Wednesday Stop: +Thursday Start: +Thursday Stop: +Friday Start: +Friday Stop: +Saturday Start: +Saturday Stop: +State Rule Added +State Rule Removed +STATE CALL TIME LISTINGS +CALL TIME LISTINGS +STATE CALL TIME ADDED +CALL TIME ADDED +Drop Call Seconds +Use Safe Harbor Message +Safe Harbor Exten +Use Drop Message +Drop Exten +SIP Listen Version +Add New Call Time +Add New State Call Time +New Call Time Addition +New State Call Time Addition +Modify Call Time +MODIFY A CALL TIME +Modify State Call Time +MODIFY A STATE CALL TIME +Delete Call Time +Delete State Call Time +State Call Times +State Call Time ID +State Call Time Name +State Call Time Comments +STATE CALL TIME NOT DELETED +CALL TIME DELETION COMPLETED +STATE CALL TIME DELETION COMPLETED +CALL TIME NOT DELETED +Call Time ID must be at least 2 characters in length +STATE CALL TIME DELETION CONFIRMATION +CALL TIME DELETION CONFIRMATION +Call Times +CALL TIMES +SHOW CALL TIMES +ADD NEW CALL TIME +SHOW STATE CALL TIMES +ADD NEW STATE CALL TIME +Call Time ID +Call Time Name +Call Time Comments +short description of the call time +HIDE +SHOW +Show Dialable Leads Count +Dialable Lead Count +TEST ON CAMPAIGN +Wrapup Seconds: +Wrapup Message: +Alt Number Dialing +no active lists selected for this campaign +Realtime Screen + + +############################################################ CLIENT + +Search Existing Leads +This option if checked will attempt to find the phone number in the system before inserting it as a new lead +Finish Wrapup and Move On +seconds remaining in wrapup +Call Wrapup: + + +############################################################ CLIENT MANUAL + +Added option to search for a manual-dial lead before inserting it in the system +Added Call Wrapup option and screen with override link to skip out early + + +############################################################ + diff --git a/VICIDIAL_web/AST_CLOSERstats.php b/VICIDIAL_web/AST_CLOSERstats.php index 4d112f0..44b7d1c 100644 --- a/VICIDIAL_web/AST_CLOSERstats.php +++ b/VICIDIAL_web/AST_CLOSERstats.php @@ -49,8 +49,7 @@ while ($i < $groups_to_print) -echo"\n"; -#echo"\n"; +echo "\n"; echo "
";
+ echo "";
+ echo "$Aecho";
+ }
+ else
+ {
+ echo " NO AGENTS ON CALLS \n";
+ }
+
+?>
+
+
+
+
+
+
+
+
diff --git a/VICIDIAL_web/AST_timeoncall.php b/VICIDIAL_web/AST_timeoncall.php
index fc8eece..4227f83 100644
--- a/VICIDIAL_web/AST_timeoncall.php
+++ b/VICIDIAL_web/AST_timeoncall.php
@@ -33,7 +33,7 @@ $STARTtime = date("U");
-echo"\n";
+echo "\n";
echo"\n";
echo "\n\n"; diff --git a/VICIDIAL_web/AST_timeonpark.php b/VICIDIAL_web/AST_timeonpark.php index 2bc03bb..78caf4d 100644 --- a/VICIDIAL_web/AST_timeonpark.php +++ b/VICIDIAL_web/AST_timeonpark.php @@ -62,7 +62,7 @@ if ($reset_counter > 7) -echo"\n"; +echo "\n"; echo"\n"; echo "VICIDIAL: Time On Park \n"; echo "\n\n"; diff --git a/VICIDIAL_web/admin.php b/VICIDIAL_web/admin.php index ec80ac0..3c1d5da 100644 --- a/VICIDIAL_web/admin.php +++ b/VICIDIAL_web/admin.php @@ -12,6 +12,8 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} if (isset($_GET["groups"])) {$groups=$_GET["groups"];} elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];} if (isset($_GET["remote_agent_id"])) {$remote_agent_id=$_GET["remote_agent_id"];} @@ -204,6 +206,70 @@ if (isset($_GET["alter_agent_interface_options"])) {$alter_agent_interface_optio elseif (isset($_POST["alter_agent_interface_options"])) {$alter_agent_interface_options=$_POST["alter_agent_interface_options"];} if (isset($_GET["closer_default_blended"])) {$closer_default_blended=$_GET["closer_default_blended"];} elseif (isset($_POST["closer_default_blended"])) {$closer_default_blended=$_POST["closer_default_blended"];} +if (isset($_GET["drop_call_seconds"])) {$drop_call_seconds=$_GET["drop_call_seconds"];} + elseif (isset($_POST["drop_call_seconds"])) {$drop_call_seconds=$_POST["drop_call_seconds"];} +if (isset($_GET["safe_harbor_message"])) {$safe_harbor_message=$_GET["safe_harbor_message"];} + elseif (isset($_POST["safe_harbor_message"])) {$safe_harbor_message=$_POST["safe_harbor_message"];} +if (isset($_GET["safe_harbor_exten"])) {$safe_harbor_exten=$_GET["safe_harbor_exten"];} + elseif (isset($_POST["safe_harbor_exten"])) {$safe_harbor_exten=$_POST["safe_harbor_exten"];} +if (isset($_GET["drop_message"])) {$drop_message=$_GET["drop_message"];} + elseif (isset($_POST["drop_message"])) {$drop_message=$_POST["drop_message"];} +if (isset($_GET["drop_exten"])) {$drop_exten=$_GET["drop_exten"];} + elseif (isset($_POST["drop_exten"])) {$drop_exten=$_POST["drop_exten"];} +if (isset($_GET["call_time_id"])) {$call_time_id=$_GET["call_time_id"];} + elseif (isset($_POST["call_time_id"])) {$call_time_id=$_POST["call_time_id"];} +if (isset($_GET["call_time_name"])) {$call_time_name=$_GET["call_time_name"];} + elseif (isset($_POST["call_time_name"])) {$call_time_name=$_POST["call_time_name"];} +if (isset($_GET["call_time_comments"])) {$call_time_comments=$_GET["call_time_comments"];} + elseif (isset($_POST["call_time_comments"])) {$call_time_comments=$_POST["call_time_comments"];} +if (isset($_GET["ct_default_start"])) {$ct_default_start=$_GET["ct_default_start"];} + elseif (isset($_POST["ct_default_start"])) {$ct_default_start=$_POST["ct_default_start"];} +if (isset($_GET["ct_default_stop"])) {$ct_default_stop=$_GET["ct_default_stop"];} + elseif (isset($_POST["ct_default_stop"])) {$ct_default_stop=$_POST["ct_default_stop"];} +if (isset($_GET["ct_sunday_start"])) {$ct_sunday_start=$_GET["ct_sunday_start"];} + elseif (isset($_POST["ct_sunday_start"])) {$ct_sunday_start=$_POST["ct_sunday_start"];} +if (isset($_GET["ct_sunday_stop"])) {$ct_sunday_stop=$_GET["ct_sunday_stop"];} + elseif (isset($_POST["ct_sunday_stop"])) {$ct_sunday_stop=$_POST["ct_sunday_stop"];} +if (isset($_GET["ct_monday_start"])) {$ct_monday_start=$_GET["ct_monday_start"];} + elseif (isset($_POST["ct_monday_start"])) {$ct_monday_start=$_POST["ct_monday_start"];} +if (isset($_GET["ct_monday_stop"])) {$ct_monday_stop=$_GET["ct_monday_stop"];} + elseif (isset($_POST["ct_monday_stop"])) {$ct_monday_stop=$_POST["ct_monday_stop"];} +if (isset($_GET["ct_tuesday_start"])) {$ct_tuesday_start=$_GET["ct_tuesday_start"];} + elseif (isset($_POST["ct_tuesday_start"])) {$ct_tuesday_start=$_POST["ct_tuesday_start"];} +if (isset($_GET["ct_tuesday_stop"])) {$ct_tuesday_stop=$_GET["ct_tuesday_stop"];} + elseif (isset($_POST["ct_tuesday_stop"])) {$ct_tuesday_stop=$_POST["ct_tuesday_stop"];} +if (isset($_GET["ct_wednesday_start"])) {$ct_wednesday_start=$_GET["ct_wednesday_start"];} + elseif (isset($_POST["ct_wednesday_start"])) {$ct_wednesday_start=$_POST["ct_wednesday_start"];} +if (isset($_GET["ct_wednesday_stop"])) {$ct_wednesday_stop=$_GET["ct_wednesday_stop"];} + elseif (isset($_POST["ct_wednesday_stop"])) {$ct_wednesday_stop=$_POST["ct_wednesday_stop"];} +if (isset($_GET["ct_thursday_start"])) {$ct_thursday_start=$_GET["ct_thursday_start"];} + elseif (isset($_POST["ct_thursday_start"])) {$ct_thursday_start=$_POST["ct_thursday_start"];} +if (isset($_GET["ct_thursday_stop"])) {$ct_thursday_stop=$_GET["ct_thursday_stop"];} + elseif (isset($_POST["ct_thursday_stop"])) {$ct_thursday_stop=$_POST["ct_thursday_stop"];} +if (isset($_GET["ct_friday_start"])) {$ct_friday_start=$_GET["ct_friday_start"];} + elseif (isset($_POST["ct_friday_start"])) {$ct_friday_start=$_POST["ct_friday_start"];} +if (isset($_GET["ct_friday_stop"])) {$ct_friday_stop=$_GET["ct_friday_stop"];} + elseif (isset($_POST["ct_friday_stop"])) {$ct_friday_stop=$_POST["ct_friday_stop"];} +if (isset($_GET["ct_saturday_start"])) {$ct_saturday_start=$_GET["ct_saturday_start"];} + elseif (isset($_POST["ct_saturday_start"])) {$ct_saturday_start=$_POST["ct_saturday_start"];} +if (isset($_GET["ct_saturday_stop"])) {$ct_saturday_stop=$_GET["ct_saturday_stop"];} + elseif (isset($_POST["ct_saturday_stop"])) {$ct_saturday_stop=$_POST["ct_saturday_stop"];} +if (isset($_GET["ct_state_call_times"])) {$ct_state_call_times=$_GET["ct_state_call_times"];} + elseif (isset($_POST["ct_state_call_times"])) {$ct_state_call_times=$_POST["ct_state_call_times"];} +if (isset($_GET["state_call_time_state"])) {$state_call_time_state=$_GET["state_call_time_state"];} + elseif (isset($_POST["state_call_time_state"])) {$state_call_time_state=$_POST["state_call_time_state"];} +if (isset($_GET["state_rule"])) {$state_rule=$_GET["state_rule"];} + elseif (isset($_POST["state_rule"])) {$state_rule=$_POST["state_rule"];} +if (isset($_GET["delete_call_times"])) {$delete_call_times=$_GET["delete_call_times"];} + elseif (isset($_POST["delete_call_times"])) {$delete_call_times=$_POST["delete_call_times"];} +if (isset($_GET["modify_call_times"])) {$modify_call_times=$_GET["modify_call_times"];} + elseif (isset($_POST["modify_call_times"])) {$modify_call_times=$_POST["modify_call_times"];} +if (isset($_GET["wrapup_seconds"])) {$wrapup_seconds=$_GET["wrapup_seconds"];} + elseif (isset($_POST["wrapup_seconds"])) {$wrapup_seconds=$_POST["wrapup_seconds"];} +if (isset($_GET["wrapup_message"])) {$wrapup_message=$_GET["wrapup_message"];} + elseif (isset($_POST["wrapup_message"])) {$wrapup_message=$_POST["wrapup_message"];} + + if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} @@ -250,12 +316,23 @@ if (isset($_GET["closer_default_blended"])) {$closer_default_blended=$_GET["c # 60419-1628 - Alter Callbacks display to include status and LIVE listings, reordered # 60421-1441 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60425-2355 - Added agent options to vicidial_users, reformatted user page +# 60502-1627 - Added drop_call_seconds and safe_harbor_ fields to campaign screen +# 60503-1228 - Added drop_call_seconds and drop_ fields to inbound groups screen +# 60505-1117 - Added initial framework for new local_call_times tables and definitions +# 60506-1033 - More revisions to the local_call_time section +# 60508-1354 - Finished call_times and state_call_times sections +# - Added modify/delete options for call_times +# 60509-1311 - Functionalize campaign dialable leads calculation +# - Change state_call_times selection from call_times to only allow one per state +# - Added dialable leads count popup to campaign screen if auto-calc is disabled +# - Added test dialable leads count popup to filter screen +# 60510-1050 - Added Wrapup seconds and Wrapup message to campaigns screen # # 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 = '1.1.10-10'; -$build = '60425-2355'; +$version = '1.1.11-8'; +$build = '60510-1050'; $STARTtime = date("U"); @@ -313,6 +390,8 @@ $browser = getenv("HTTP_USER_AGENT"); $LOGdelete_scripts =$row[18]; $LOGdelete_filters =$row[29]; $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; if ($WeBRooTWritablE > 0) { @@ -338,79 +417,95 @@ echo "VICIDIAL ADMIN: "; if (!isset($ADD)) {$ADD=0;} -if ($ADD==1) {$hh='users'; echo "Add New User";} -if ($ADD==11) {$hh='campaigns'; echo "Add New Campaign";} -if ($ADD==111) {$hh='lists'; echo "Add New List";} -if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";} -if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";} -if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";} -if ($ADD==1111111) {$hh='scripts'; echo "Add New Script";} -if ($ADD==11111111) {$hh='filters'; echo "Add New Filter";} -if ($ADD==2) {$hh='users'; echo "New User Addition";} -if ($ADD==21) {$hh='campaigns'; echo "New Campaign Addition";} -if ($ADD==22) {$hh='campaigns'; echo "New Campaign Status Addition";} -if ($ADD==23) {$hh='campaigns'; echo "New Campaign HotKey Addition";} -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";} -if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";} -if ($ADD==2111111) {$hh='scripts'; echo "New Script Addition";} -if ($ADD==21111111) {$hh='filters'; echo "New Filter Addition";} -if ($ADD==3) {$hh='users'; echo "Modify User";} -if ($ADD==31) {$hh='campaigns'; echo "Modify Campaign";} -if ($ADD==34) {$hh='campaigns'; echo "Modify Campaign - Basic View";} -if ($ADD==311) {$hh='lists'; echo "Modify List";} -if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";} -if ($ADD==31111) {$hh='remoteagent'; echo "Modify Remote Agents";} -if ($ADD==311111) {$hh='usergroups'; echo "Modify Users Groups";} -if ($ADD==3111111) {$hh='scripts'; echo "Modify Script";} -if ($ADD==31111111) {$hh='filters'; echo "Modify Filter";} -if ($ADD=="4A") {$hh='users'; echo "Modify User - Admin";} -if ($ADD=="4B") {$hh='users'; echo "Modify User - Admin";} -if ($ADD==4) {$hh='users'; echo "Modify User";} -if ($ADD==41) {$hh='campaigns'; echo "Modify Campaign";} -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==411) {$hh='lists'; echo "Modify List";} -if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";} -if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";} -if ($ADD==411111) {$hh='usergroups'; echo "Modify Users Groups";} -if ($ADD==4111111) {$hh='scripts'; echo "Modify Script";} -if ($ADD==41111111) {$hh='filters'; echo "Modify Filter";} -if ($ADD==5) {$hh='users'; echo "Delete User";} -if ($ADD==51) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==52) {$hh='campaigns'; echo "Logout Agents";} -if ($ADD==511) {$hh='lists'; echo "Delete List";} -if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} -if ($ADD==51111) {$hh='remoteagent'; echo "Delete Remote Agents";} -if ($ADD==511111) {$hh='usergroups'; echo "Delete Users Group";} -if ($ADD==5111111) {$hh='scripts'; echo "Delete Script";} -if ($ADD==51111111) {$hh='filters'; echo "Delete Filter";} -if ($ADD==6) {$hh='users'; echo "Delete User";} -if ($ADD==61) {$hh='campaigns'; echo "Delete Campaign";} -if ($ADD==62) {$hh='campaigns'; echo "Logout Agents";} -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";} -if ($ADD==611111) {$hh='usergroups'; echo "Delete Users Group";} -if ($ADD==6111111) {$hh='scripts'; echo "Delete Script";} -if ($ADD==61111111) {$hh='filters'; echo "Delete Filter";} -if ($ADD==7111111) {$hh='scripts'; echo "Preview Script";} -if ($ADD==0) {$hh='users'; echo "Users List";} -if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";} -if ($ADD==81) {$hh='campaigns'; echo "CallBacks Within Campaign";} -if ($ADD==811) {$hh='campaigns'; echo "CallBacks Within List";} -if ($ADD==10) {$hh='campaigns'; echo "Campaigns";} -if ($ADD==100) {$hh='lists'; echo "Lists";} -if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} -if ($ADD==10000) {$hh='remoteagent'; echo "Remote Agents";} -if ($ADD==100000) {$hh='usergroups'; echo "User Groups";} -if ($ADD==1000000) {$hh='scripts'; echo "Scripts";} -if ($ADD==10000000) {$hh='filters'; echo "Filters";} -if ($ADD==55) {$hh='users'; echo "Search Form";} -if ($ADD==66) {$hh='users'; echo "Search Results";} -if ($ADD==99999) {$hh='users'; echo "HELP";} +if ($ADD==1) {$hh='users'; echo "Add New User";} +if ($ADD==11) {$hh='campaigns'; echo "Add New Campaign";} +if ($ADD==111) {$hh='lists'; echo "Add New List";} +if ($ADD==1111) {$hh='ingroups'; echo "Add New In-Group";} +if ($ADD==11111) {$hh='remoteagent'; echo "Add New Remote Agents";} +if ($ADD==111111) {$hh='usergroups'; echo "Add New Users Group";} +if ($ADD==1111111) {$hh='scripts'; echo "Add New Script";} +if ($ADD==11111111) {$hh='filters'; echo "Add New Filter";} +if ($ADD==111111111) {$hh='times'; echo "Add New Call Time";} +if ($ADD==1111111111) {$hh='times'; echo "Add New State Call Time";} +if ($ADD==2) {$hh='users'; echo "New User Addition";} +if ($ADD==21) {$hh='campaigns'; echo "New Campaign Addition";} +if ($ADD==22) {$hh='campaigns'; echo "New Campaign Status Addition";} +if ($ADD==23) {$hh='campaigns'; echo "New Campaign HotKey Addition";} +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";} +if ($ADD==211111) {$hh='usergroups'; echo "New Users Group Addition";} +if ($ADD==2111111) {$hh='scripts'; echo "New Script Addition";} +if ($ADD==21111111) {$hh='filters'; echo "New Filter Addition";} +if ($ADD==211111111) {$hh='times'; echo "New Call Time Addition";} +if ($ADD==2111111111) {$hh='times'; echo "New State Call Time Addition";} +if ($ADD==3) {$hh='users'; echo "Modify User";} +if ($ADD==31) {$hh='campaigns'; echo "Modify Campaign";} +if ($ADD==34) {$hh='campaigns'; echo "Modify Campaign - Basic View";} +if ($ADD==311) {$hh='lists'; echo "Modify List";} +if ($ADD==3111) {$hh='ingroups'; echo "Modify In-Group";} +if ($ADD==31111) {$hh='remoteagent'; echo "Modify Remote Agents";} +if ($ADD==311111) {$hh='usergroups'; echo "Modify Users Groups";} +if ($ADD==3111111) {$hh='scripts'; echo "Modify Script";} +if ($ADD==31111111) {$hh='filters'; echo "Modify Filter";} +if ($ADD==311111111) {$hh='times'; echo "Modify Call Time";} +if ($ADD==321111111) {$hh='times'; echo "Modify Call Time State Definitions List";} +if ($ADD==3111111111) {$hh='times'; echo "Modify State Call Time";} +if ($ADD=="4A") {$hh='users'; echo "Modify User - Admin";} +if ($ADD=="4B") {$hh='users'; echo "Modify User - Admin";} +if ($ADD==4) {$hh='users'; echo "Modify User";} +if ($ADD==41) {$hh='campaigns'; echo "Modify Campaign";} +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==411) {$hh='lists'; echo "Modify List";} +if ($ADD==4111) {$hh='ingroups'; echo "Modify In-Group";} +if ($ADD==41111) {$hh='remoteagent'; echo "Modify Remote Agents";} +if ($ADD==411111) {$hh='usergroups'; echo "Modify Users Groups";} +if ($ADD==4111111) {$hh='scripts'; echo "Modify Script";} +if ($ADD==41111111) {$hh='filters'; echo "Modify Filter";} +if ($ADD==411111111) {$hh='times'; echo "Modify Call Time";} +if ($ADD==4111111111) {$hh='times'; echo "Modify State Call Time";} +if ($ADD==5) {$hh='users'; echo "Delete User";} +if ($ADD==51) {$hh='campaigns'; echo "Delete Campaign";} +if ($ADD==52) {$hh='campaigns'; echo "Logout Agents";} +if ($ADD==511) {$hh='lists'; echo "Delete List";} +if ($ADD==5111) {$hh='ingroups'; echo "Delete In-Group";} +if ($ADD==51111) {$hh='remoteagent'; echo "Delete Remote Agents";} +if ($ADD==511111) {$hh='usergroups'; echo "Delete Users Group";} +if ($ADD==5111111) {$hh='scripts'; echo "Delete Script";} +if ($ADD==51111111) {$hh='filters'; echo "Delete Filter";} +if ($ADD==511111111) {$hh='times'; echo "Delete Call Time";} +if ($ADD==5111111111) {$hh='times'; echo "Delete State Call Time";} +if ($ADD==6) {$hh='users'; echo "Delete User";} +if ($ADD==61) {$hh='campaigns'; echo "Delete Campaign";} +if ($ADD==62) {$hh='campaigns'; echo "Logout Agents";} +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";} +if ($ADD==611111) {$hh='usergroups'; echo "Delete Users Group";} +if ($ADD==6111111) {$hh='scripts'; echo "Delete Script";} +if ($ADD==61111111) {$hh='filters'; echo "Delete Filter";} +if ($ADD==611111111) {$hh='times'; echo "Delete Call Time";} +if ($ADD==6111111111) {$hh='times'; echo "Delete State Call Time";} +if ($ADD==73) {$hh='campaigns'; echo "Dialable Lead Count";} +if ($ADD==7111111) {$hh='scripts'; echo "Preview Script";} +if ($ADD==0) {$hh='users'; echo "Users List";} +if ($ADD==8) {$hh='users'; echo "CallBacks Within Agent";} +if ($ADD==81) {$hh='campaigns'; echo "CallBacks Within Campaign";} +if ($ADD==811) {$hh='campaigns'; echo "CallBacks Within List";} +if ($ADD==10) {$hh='campaigns'; echo "Campaigns";} +if ($ADD==100) {$hh='lists'; echo "Lists";} +if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} +if ($ADD==10000) {$hh='remoteagent'; echo "Remote Agents";} +if ($ADD==100000) {$hh='usergroups'; echo "User Groups";} +if ($ADD==1000000) {$hh='scripts'; echo "Scripts";} +if ($ADD==10000000) {$hh='filters'; echo "Filters";} +if ($ADD==100000000) {$hh='times'; echo "Call Times";} +if ($ADD==1000000000) {$hh='times'; echo "State Call Times";} +if ($ADD==55) {$hh='users'; echo "Search Form";} +if ($ADD==66) {$hh='users'; echo "Search Results";} +if ($ADD==99999) {$hh='users'; echo "HELP";} if ( ($ADD>9) && ($ADD < 99998) ) { @@ -444,6 +539,20 @@ if ( ($ADD>9) && ($ADD < 99998) ) $filtersql_list["$rowx[0]"] = "$rowx[2]"; $o++; } + + ##### get call_times listing for dynamic pulldown + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times order by call_time_id"; + $rsltx=mysql_query($stmt, $link); + $times_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($times_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $call_times_list .= "\n"; + $call_timename_list["$rowx[0]"] = "$rowx[1]"; + $o++; + } } if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or ($ADD=="4A") or ($ADD=="4B") ) @@ -700,6 +809,16 @@ echo "