From a24e32ce77f5b3e6585b0eedc76d242ade9bd7ce Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 15 Feb 2018 18:26:33 +0000 Subject: [PATCH] Added CID Groups, allowing for groups of caller IDs to be defined by state or areacode git-svn-id: svn://192.168.202.10@2917 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/UPGRADE | 4 + agc_2-X/trunk/bin/AST_VDauto_dial.pl | 138 ++-- agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl | 136 +++- .../trunk/extras/MySQL_AST_CREATE_tables.sql | 14 +- agc_2-X/trunk/extras/upgrade_2.14.sql | 13 + agc_2-X/trunk/www/agc/vdc_db_query.php | 400 +++++++---- agc_2-X/trunk/www/agc/vicidial.php | 7 +- agc_2-X/trunk/www/vicidial/admin.php | 654 +++++++++++++++++- .../trunk/www/vicidial/admin_bulk_tools.php | 230 ++++-- agc_2-X/trunk/www/vicidial/admin_header.php | 24 +- .../vicidial/admin_listloader_fourth_gen.php | 2 +- agc_2-X/trunk/www/vicidial/help.php | 28 +- .../www/vicidial/images/icon_cidgroups.png | Bin 0 -> 567 bytes 13 files changed, 1336 insertions(+), 314 deletions(-) create mode 100644 agc_2-X/trunk/www/vicidial/images/icon_cidgroups.png diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 1ab6b219..62a3d79b 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -272,6 +272,10 @@ OTHER CHANGES: 72. Added basic GDPR features for lead activity download and delete. Must enable System setting and user permission to use. +73. Added CID Groups, allowing for groups of caller IDs to be defined by state + or areacode, and allowing a single CID Group to be set across multiple + campaigns. + diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial.pl b/agc_2-X/trunk/bin/AST_VDauto_dial.pl index 38a34d51..9b2f582f 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial.pl @@ -25,7 +25,7 @@ # It is good practice to keep this program running by placing the associated # KEEPALIVE script running every minute to ensure this program is always running # -# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2018 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: # 50125-1201 - Changed dial timeout to 120 seconds from 180 seconds @@ -126,6 +126,7 @@ # 170527-2347 - Fix for rare inbound logging issue #1017 # 170915-1817 - Added support for per server routing prefix needed for Asterisk 13+ # 180130-1346 - Added inbound_no_agents_no_dial campaign options +# 180214-1559 - Added CID Group functionality # ### begin parsing run-time options ### @@ -388,6 +389,7 @@ while($one_day_interval > 0) @DBIPqueue_priority=@MT; @DBIPdial_method=@MT; @DBIPuse_custom_cid=@MT; + @DBIPcid_group_id=@MT; @DBIPinbound_queue_no_dial=@MT; @DBIPinbound_no_agents_no_dial=@MT; @DBIPinbound_no_agents_no_dial_threshold=@MT; @@ -636,7 +638,7 @@ while($one_day_interval > 0) ### grab the dial_level and multiply by active agents to get your goalcalls $DBIPadlevel[$user_CIPct]=0; - $stmtA = "SELECT auto_dial_level,local_call_time,dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,closer_campaigns,omit_phone_code,available_only_ratio_tally,auto_alt_dial,campaign_allow_inbound,queue_priority,dial_method,use_custom_cid,inbound_queue_no_dial,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,adaptive_dl_diff_target,dl_diff_target_method,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold FROM vicidial_campaigns where campaign_id='$DBIPcampaign[$user_CIPct]'"; + $stmtA = "SELECT auto_dial_level,local_call_time,dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,closer_campaigns,omit_phone_code,available_only_ratio_tally,auto_alt_dial,campaign_allow_inbound,queue_priority,dial_method,use_custom_cid,inbound_queue_no_dial,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,adaptive_dl_diff_target,dl_diff_target_method,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id FROM vicidial_campaigns where campaign_id='$DBIPcampaign[$user_CIPct]'"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -671,6 +673,7 @@ while($one_day_interval > 0) $DBIPdl_diff_target_method[$user_CIPct] = $aryA[21]; $DBIPinbound_no_agents_no_dial[$user_CIPct] = $aryA[22]; $DBIPinbound_no_agents_no_dial_threshold[$user_CIPct] = $aryA[23]; + $DBIPcid_group_id[$user_CIPct] = $aryA[24]; if ($DBIPdl_diff_target_method[$user_CIPct] =~ /ADAPT_CALC_ONLY/) { @@ -1202,7 +1205,7 @@ while($one_day_interval > 0) print "hopper row updated to INCALL: |$UQaffected_rows|$lead_id|\n"; ### Gather lead data - $stmtA = "SELECT list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,address3,alt_phone,called_count,security_phrase FROM vicidial_list where lead_id='$lead_id';"; + $stmtA = "SELECT list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,address3,alt_phone,called_count,security_phrase,state FROM vicidial_list where lead_id='$lead_id';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -1220,6 +1223,7 @@ while($one_day_interval > 0) $alt_phone = $aryA[6]; $called_count = $aryA[7]; $security_phrase = $aryA[8]; + $state = $aryA[9]; $rec_countCUSTDATA++; $rec_count++; @@ -1332,48 +1336,104 @@ while($one_day_interval > 0) $VDAD_dial_exten = $routing_prefix . $VDAD_dial_exten; } - if (length($DBIPcampaigncid[$user_CIPct]) > 6) {$CCID = "$DBIPcampaigncid[$user_CIPct]"; $CCID_on++;} if (length($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} - if ($DBIPuse_custom_cid[$user_CIPct] =~ /Y/) + else { - $temp_CID = $security_phrase; - $temp_CID =~ s/\D//gi; - if (length($temp_CID) > 6) - {$CCID = "$temp_CID"; $CCID_on++;} - } - if ($DBIPuse_custom_cid[$user_CIPct] =~ /AREACODE/) - { - $temp_CID=''; - $temp_vcca=''; - $temp_ac=''; - $temp_ac_two = substr("$phone_number", 0, 2); - $temp_ac_three = substr("$phone_number", 0, 3); - $temp_ac_four = substr("$phone_number", 0, 4); - $temp_ac_five = substr("$phone_number", 0, 5); - $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcampaign[$user_CIPct]' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $act=0; - while ($sthArows > $act) + if (length($DBIPcampaigncid[$user_CIPct]) > 6) {$CCID = "$DBIPcampaigncid[$user_CIPct]"; $CCID_on++;} + if ($DBIPuse_custom_cid[$user_CIPct] =~ /Y/) { - @aryA = $sthA->fetchrow_array; - $temp_vcca = $aryA[0]; - $temp_ac = $aryA[1]; - $act++; + $temp_CID = $security_phrase; + $temp_CID =~ s/\D//gi; + if (length($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} } - if ($act > 0) + $CIDG_set=0; + if ($DBIPcid_group_id[$user_CIPct] !~ /\-\-\-DISABLED\-\-\-/) { - $sthA->finish(); - $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBIPcampaign[$user_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; - $affected_rows = $dbhA->do($stmtA); + $stmtA = "SELECT cid_group_type FROM vicidial_cid_groups where cid_group_id='$DBIPcid_group_id[$user_CIPct]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $cid_group_type = $aryA[0]; + $temp_CID=''; + $temp_vcca=''; + $temp_ac=''; + + if ($cid_group_type =~ /AREACODE/) + { + $temp_ac_two = substr("$phone_number", 0, 2); + $temp_ac_three = substr("$phone_number", 0, 3); + $temp_ac_four = substr("$phone_number", 0, 4); + $temp_ac_five = substr("$phone_number", 0, 5); + $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcid_group_id[$user_CIPct]' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; + } + if ($cid_group_type =~ /STATE/) + { + $temp_state = $state; + $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcid_group_id[$user_CIPct]' and areacode IN('$temp_state') and active='Y' order by call_count_today desc limit 100000;"; + } $temp_CID=''; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $act=0; + while ($sthArows > $act) + { + @aryA = $sthA->fetchrow_array; + $temp_vcca = $aryA[0]; + $temp_ac = $aryA[1]; + $act++; + } + if ($act > 0) + { + $sthA->finish(); + $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBIPcid_group_id[$user_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + $affected_rows = $dbhA->do($stmtA); + } + else + {$sthA->finish();} + $temp_CID = $temp_vcca; + $temp_CID =~ s/\D//gi; + if (length($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++; $CIDG_set++;} + } + } + if ( ($DBIPuse_custom_cid[$user_CIPct] =~ /AREACODE/) && ($CIDG_set < 1) ) + { + $temp_CID=''; + $temp_vcca=''; + $temp_ac=''; + $temp_ac_two = substr("$phone_number", 0, 2); + $temp_ac_three = substr("$phone_number", 0, 3); + $temp_ac_four = substr("$phone_number", 0, 4); + $temp_ac_five = substr("$phone_number", 0, 5); + $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcampaign[$user_CIPct]' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $act=0; + while ($sthArows > $act) + { + @aryA = $sthA->fetchrow_array; + $temp_vcca = $aryA[0]; + $temp_ac = $aryA[1]; + $act++; + } + if ($act > 0) + { + $sthA->finish(); + $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBIPcampaign[$user_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + $affected_rows = $dbhA->do($stmtA); + } + else + {$sthA->finish();} + $temp_CID = $temp_vcca; + $temp_CID =~ s/\D//gi; + if (length($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} } - else - {$sthA->finish();} - $temp_CID = $temp_vcca; - $temp_CID =~ s/\D//gi; - if (length($temp_CID) > 6) - {$CCID = "$temp_CID"; $CCID_on++;} } if ($DBIPdialprefix[$user_CIPct] =~ /x/i) {$Local_out_prefix = '';} diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl b/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl index 4264f911..f24572f4 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial_FILL.pl @@ -12,7 +12,7 @@ # # Should only be run on one server in a multi-server Asterisk/VICIDIAL cluster # -# Copyright (C) 2017 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2018 Matt Florell LICENSE: AGPLv2 # # CHANGELOG: # 61115-1246 - First build, framework setup, non-functional @@ -40,6 +40,7 @@ # 151006-0937 - Changed campaign_cid_areacodes to operate with 2-5 digit areacodes # 170915-1915 - Added support for per server routing prefix needed for Asterisk 13+ # 171205-2022 - Fix for double-dialing issue on high-volume systems +# 180214-1558 - Added CID Group functionality # ### begin parsing run-time options ### @@ -252,6 +253,7 @@ while($one_day_interval > 0) @DBIPserver_trunks_allowed=@MT; @DBIPqueue_priority=@MT; @DBIPuse_custom_cid=@MT; + @DBIPcid_group_id=@MT; $active_line_counter=0; $camp_counter=0; @@ -339,7 +341,7 @@ while($one_day_interval > 0) ### grab the dial_level and multiply by active agents to get your goalcalls $DBIPadlevel[$camp_CIPct]=0; - $stmtA = "SELECT dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,omit_phone_code,auto_alt_dial,queue_priority,use_custom_cid FROM vicidial_campaigns where campaign_id='$DBfill_campaign[$camp_CIPct]';"; + $stmtA = "SELECT dial_timeout,dial_prefix,campaign_cid,active,campaign_vdad_exten,omit_phone_code,auto_alt_dial,queue_priority,use_custom_cid,cid_group_id FROM vicidial_campaigns where campaign_id='$DBfill_campaign[$camp_CIPct]';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -357,6 +359,7 @@ while($one_day_interval > 0) $DBIPautoaltdial[$camp_CIPct] = $aryA[6]; $DBIPqueue_priority[$camp_CIPct] = $aryA[7]; $DBIPuse_custom_cid[$camp_CIPct] = $aryA[8]; + $DBIPcid_group_id[$camp_CIPct] = $aryA[9]; if ($omit_phone_code =~ /Y/) {$DBIPomitcode[$camp_CIPct] = 1;} else {$DBIPomitcode[$camp_CIPct] = 0;} @@ -636,7 +639,7 @@ while($one_day_interval > 0) $UQaffected_rows = $dbhA->do($stmtA); # print "hopper row updated to INCALL: |$UQaffected_rows|$lead_id|\n"; - $stmtA = "SELECT list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,address3,alt_phone,called_count,security_phrase FROM vicidial_list where lead_id='$lead_id';"; + $stmtA = "SELECT list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,address3,alt_phone,called_count,security_phrase,state FROM vicidial_list where lead_id='$lead_id';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -653,6 +656,7 @@ while($one_day_interval > 0) $alt_phone = $aryA[6]; $called_count = $aryA[7]; $security_phrase = $aryA[8]; + $state = $aryA[9]; $rec_countCUSTDATA++; } @@ -767,46 +771,102 @@ while($one_day_interval > 0) if (length($DBIPcampaigncid[$camp_CIPct]) > 6) {$CCID = "$DBIPcampaigncid[$camp_CIPct]"; $CCID_on++;} if (length($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} - if ($DBIPuse_custom_cid[$camp_CIPct] =~ /Y/) + else { - $temp_CID = $security_phrase; - $temp_CID =~ s/\D//gi; - if (length($temp_CID) > 6) - {$CCID = "$temp_CID"; $CCID_on++;} - } - if ($DBIPuse_custom_cid[$camp_CIPct] =~ /AREACODE/) - { - $temp_CID=''; - $temp_vcca=''; - $temp_ac=''; - $temp_ac_two = substr("$phone_number", 0, 2); - $temp_ac_three = substr("$phone_number", 0, 3); - $temp_ac_four = substr("$phone_number", 0, 4); - $temp_ac_five = substr("$phone_number", 0, 5); - $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBfill_campaign[$camp_CIPct]' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; - $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; - $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; - $sthArows=$sthA->rows; - $act=0; - while ($sthArows > $act) + if ($DBIPuse_custom_cid[$camp_CIPct] =~ /Y/) { - @aryA = $sthA->fetchrow_array; - $temp_vcca = $aryA[0]; - $temp_ac = $aryA[1]; - $act++; + $temp_CID = $security_phrase; + $temp_CID =~ s/\D//gi; + if (length($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} } - if ($act > 0) + $CIDG_set=0; + if ($DBIPcid_group_id[$camp_CIPct] !~ /\-\-\-DISABLED\-\-\-/) { - $sthA->finish(); - $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBfill_campaign[$camp_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; - $affected_rows = $dbhA->do($stmtA); + $stmtA = "SELECT cid_group_type FROM vicidial_cid_groups where cid_group_id='$DBIPcid_group_id[$camp_CIPct]';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $cid_group_type = $aryA[0]; + $temp_CID=''; + $temp_vcca=''; + $temp_ac=''; + + if ($cid_group_type =~ /AREACODE/) + { + $temp_ac_two = substr("$phone_number", 0, 2); + $temp_ac_three = substr("$phone_number", 0, 3); + $temp_ac_four = substr("$phone_number", 0, 4); + $temp_ac_five = substr("$phone_number", 0, 5); + $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcid_group_id[$camp_CIPct]' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; + } + if ($cid_group_type =~ /STATE/) + { + $temp_state = $state; + $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBIPcid_group_id[$camp_CIPct]' and areacode IN('$temp_state') and active='Y' order by call_count_today desc limit 100000;"; + } + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $act=0; + while ($sthArows > $act) + { + @aryA = $sthA->fetchrow_array; + $temp_vcca = $aryA[0]; + $temp_ac = $aryA[1]; + $act++; + } + if ($act > 0) + { + $sthA->finish(); + $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBIPcid_group_id[$camp_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + $affected_rows = $dbhA->do($stmtA); + } + else + {$sthA->finish();} + $temp_CID = $temp_vcca; + $temp_CID =~ s/\D//gi; + if (length($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++; $CIDG_set++;} + } + } + if ( ($DBIPuse_custom_cid[$camp_CIPct] =~ /AREACODE/) && ($CIDG_set < 1) ) + { + $temp_CID=''; + $temp_vcca=''; + $temp_ac=''; + $temp_ac_two = substr("$phone_number", 0, 2); + $temp_ac_three = substr("$phone_number", 0, 3); + $temp_ac_four = substr("$phone_number", 0, 4); + $temp_ac_five = substr("$phone_number", 0, 5); + $stmtA = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$DBfill_campaign[$camp_CIPct]' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $act=0; + while ($sthArows > $act) + { + @aryA = $sthA->fetchrow_array; + $temp_vcca = $aryA[0]; + $temp_ac = $aryA[1]; + $act++; + } + if ($act > 0) + { + $sthA->finish(); + $stmtA="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$DBfill_campaign[$camp_CIPct]' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + $affected_rows = $dbhA->do($stmtA); + } + else + {$sthA->finish();} + $temp_CID = $temp_vcca; + $temp_CID =~ s/\D//gi; + if (length($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} } - else - {$sthA->finish();} - $temp_CID = $temp_vcca; - $temp_CID =~ s/\D//gi; - if (length($temp_CID) > 6) - {$CCID = "$temp_CID"; $CCID_on++;} } if ($DBIPdialprefix[$camp_CIPct] =~ /x/i) {$Local_out_prefix = '';} diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index 330bbeed..3795f12e 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -996,7 +996,8 @@ manual_auto_next_options ENUM('DEFAULT','PAUSE_NO_COUNT') default 'DEFAULT', agent_screen_time_display ENUM('DISABLED','ENABLED_BASIC','ENABLED_FULL','ENABLED_BILL_BREAK_LUNCH_COACH') default 'DISABLED', next_dial_my_callbacks ENUM('DISABLED','ENABLED') default 'DISABLED', inbound_no_agents_no_dial_container VARCHAR(40) default '---DISABLED---', -inbound_no_agents_no_dial_threshold SMALLINT(5) default '0' +inbound_no_agents_no_dial_threshold SMALLINT(5) default '0', +cid_group_id VARCHAR(20) default '---DISABLED---' ) ENGINE=MyISAM; CREATE TABLE vicidial_lists ( @@ -2864,7 +2865,7 @@ index (call_date) ) ENGINE=MyISAM; CREATE TABLE vicidial_campaign_cid_areacodes ( -campaign_id VARCHAR(8) NOT NULL, +campaign_id VARCHAR(20) NOT NULL, areacode VARCHAR(5) NOT NULL, outbound_cid VARCHAR(20), active ENUM('Y','N','') default '', @@ -3893,6 +3894,13 @@ date_deleted DATETIME, index (date_deleted) ) ENGINE=MyISAM; +CREATE TABLE vicidial_cid_groups ( +cid_group_id VARCHAR(20) PRIMARY KEY NOT NULL, +cid_group_notes VARCHAR(255) default '', +cid_group_type ENUM('AREACODE','STATE') default 'AREACODE', +user_group VARCHAR(20) default '---ALL---' +) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; + ALTER TABLE vicidial_email_list MODIFY message text character set utf8; @@ -4177,4 +4185,4 @@ INSERT INTO vicidial_settings_containers(container_id,container_notes,container_ UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1535',db_schema_update_date=NOW(),reload_timestamp=NOW(); +UPDATE system_settings SET db_schema_version='1536',db_schema_update_date=NOW(),reload_timestamp=NOW(); diff --git a/agc_2-X/trunk/extras/upgrade_2.14.sql b/agc_2-X/trunk/extras/upgrade_2.14.sql index 374b8649..a3843780 100644 --- a/agc_2-X/trunk/extras/upgrade_2.14.sql +++ b/agc_2-X/trunk/extras/upgrade_2.14.sql @@ -556,3 +556,16 @@ index (date_deleted) ) ENGINE=MyISAM; UPDATE system_settings SET db_schema_version='1535',db_schema_update_date=NOW() where db_schema_version < 1535; + +CREATE TABLE vicidial_cid_groups ( +cid_group_id VARCHAR(20) PRIMARY KEY NOT NULL, +cid_group_notes VARCHAR(255) default '', +cid_group_type ENUM('AREACODE','STATE') default 'AREACODE', +user_group VARCHAR(20) default '---ALL---' +) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci; + +ALTER TABLE vicidial_campaign_cid_areacodes MODIFY campaign_id VARCHAR(20) NOT NULL; + +ALTER TABLE vicidial_campaigns ADD cid_group_id VARCHAR(20) default '---DISABLED---'; + +UPDATE system_settings SET db_schema_version='1536',db_schema_update_date=NOW() where db_schema_version < 1536; diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index fb387761..26f7cd54 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -448,10 +448,11 @@ # 180204-1651 - Added update for inbound callback queue functionality # 180210-0707 - Fix for callback list issue #1062 # 180212-0654 - Added callback_datetime as dispo call url variable +# 180214-1553 - Added CID Group functionality # -$version = '2.14-342'; -$build = '180212-0654'; +$version = '2.14-343'; +$build = '180214-1553'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=709; @@ -4117,10 +4118,9 @@ if ($ACTION == 'manDiaLnextCaLL') $Local_dial_timeout = ($Local_dial_timeout * 1000); if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";} if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;} - if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} ### check for custom cid use $use_custom_cid=0; - $stmt = "SELECT use_custom_cid,manual_dial_hopper_check,start_call_url,manual_dial_filter,use_internal_dnc,use_campaign_dnc,use_other_campaign_dnc FROM vicidial_campaigns where campaign_id='$campaign';"; + $stmt = "SELECT use_custom_cid,manual_dial_hopper_check,start_call_url,manual_dial_filter,use_internal_dnc,use_campaign_dnc,use_other_campaign_dnc,cid_group_id FROM vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00313',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -4135,6 +4135,7 @@ if ($ACTION == 'manDiaLnextCaLL') $use_internal_dnc = $row[4]; $use_campaign_dnc = $row[5]; $use_other_campaign_dnc = $row[6]; + $cid_group_id = $row[7]; } if ($no_hopper_dialing_used > 0) @@ -4218,64 +4219,126 @@ if ($ACTION == 'manDiaLnextCaLL') } } - if ($uccid_ct > 0) + if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} + else { - if ( (preg_match('/^USER_CUSTOM/', $use_custom_cid)) and ($cid_lock < 1) ) + if ($uccid_ct > 0) { - $temp_vu=''; - $use_custom_cid=preg_replace('/^USER_/', "", $use_custom_cid); - $pattern=array('/1/', '/2/', '/3/', '/4/', '/5/'); - $replace=array('one', 'two', 'three', 'four', 'five'); - $use_custom_cid = strtolower(preg_replace($pattern,$replace, $use_custom_cid)); - $stmt="select $use_custom_cid from vicidial_users where user='$user'"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00660',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $vu_ct = mysqli_num_rows($rslt); - $act=0; - while ($vu_ct > $act) + if ($use_custom_cid == 'Y') { - $row=mysqli_fetch_row($rslt); - $temp_vu = $row[0]; - $act++; + $temp_CID = preg_replace("/\D/",'',$security_phrase); + if (strlen($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} } - $temp_CID = preg_replace("/\D/",'',$temp_vu); - } - else if ( ($use_custom_cid == 'AREACODE') and ($cid_lock < 1) ) - { - $temp_vcca=''; - $temp_ac=''; - $temp_ac_two = substr("$agent_dialed_number", 0, 2); - $temp_ac_three = substr("$agent_dialed_number", 0, 3); - $temp_ac_four = substr("$agent_dialed_number", 0, 4); - $temp_ac_five = substr("$agent_dialed_number", 0, 5); - $stmt = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$campaign' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00426',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $vcca_ct = mysqli_num_rows($rslt); - $act=0; - while ($vcca_ct > $act) + if ( (preg_match('/^USER_CUSTOM/', $use_custom_cid)) and ($cid_lock < 1) ) { - $row=mysqli_fetch_row($rslt); - $temp_vcca = $row[0]; - $temp_ac = $row[1]; - $act++; - } - if ($act > 0) - { - $stmt="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$campaign' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; - if ($format=='debug') {echo "\n";} + $temp_vu=''; + $use_custom_cid=preg_replace('/^USER_/', "", $use_custom_cid); + $pattern=array('/1/', '/2/', '/3/', '/4/', '/5/'); + $replace=array('one', 'two', 'three', 'four', 'five'); + $use_custom_cid = strtolower(preg_replace($pattern,$replace, $use_custom_cid)); + $stmt="select $use_custom_cid from vicidial_users where user='$user'"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00427',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00660',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vu_ct = mysqli_num_rows($rslt); + $act=0; + while ($vu_ct > $act) + { + $row=mysqli_fetch_row($rslt); + $temp_vu = $row[0]; + $act++; + } + $temp_CID = preg_replace("/\D/",'',$temp_vu); + if (strlen($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} } + $CIDG_set=0; + if ( ($cid_group_id != '---DISABLED---') and ($cid_lock < 1) ) + { + $stmt = "SELECT cid_group_type FROM vicidial_cid_groups where cid_group_id='$cid_group_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $cidg_ct = mysqli_num_rows($rslt); + if ($cidg_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $cid_group_type = $row[0]; + $temp_vcca=''; + $temp_ac=''; - $temp_CID = preg_replace("/\D/",'',$temp_vcca); + if ($cid_group_type == 'AREACODE') + { + $temp_ac_two = substr("$agent_dialed_number", 0, 2); + $temp_ac_three = substr("$agent_dialed_number", 0, 3); + $temp_ac_four = substr("$agent_dialed_number", 0, 4); + $temp_ac_five = substr("$agent_dialed_number", 0, 5); + $stmt = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$cid_group_id' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; + } + if ($cid_group_type == 'STATE') + { + $temp_state = $state; + $stmt = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$cid_group_id' and areacode IN('$temp_state') and active='Y' order by call_count_today desc limit 100000;"; + } + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vcca_ct = mysqli_num_rows($rslt); + $act=0; + while ($vcca_ct > $act) + { + $row=mysqli_fetch_row($rslt); + $temp_vcca = $row[0]; + $temp_ac = $row[1]; + $act++; + } + if ($act > 0) + { + $stmt="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$cid_group_id' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + } + $temp_CID = preg_replace("/\D/",'',$temp_vcca); + if (strlen($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++; $CIDG_set++;} + } + if ( ($use_custom_cid == 'AREACODE') and ($cid_lock < 1) and ($CIDG_set < 1) ) + { + $temp_vcca=''; + $temp_ac=''; + $temp_ac_two = substr("$agent_dialed_number", 0, 2); + $temp_ac_three = substr("$agent_dialed_number", 0, 3); + $temp_ac_four = substr("$agent_dialed_number", 0, 4); + $temp_ac_five = substr("$agent_dialed_number", 0, 5); + $stmt = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$campaign' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00426',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vcca_ct = mysqli_num_rows($rslt); + $act=0; + while ($vcca_ct > $act) + { + $row=mysqli_fetch_row($rslt); + $temp_vcca = $row[0]; + $temp_ac = $row[1]; + $act++; + } + if ($act > 0) + { + $stmt="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$campaign' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00427',$user,$server_ip,$session_name,$one_mysql_log);} + } + + $temp_CID = preg_replace("/\D/",'',$temp_vcca); + if (strlen($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} + } } - if ($use_custom_cid == 'Y') - {$temp_CID = preg_replace("/\D/",'',$security_phrase);} - if (strlen($temp_CID) > 6) - {$CCID = "$temp_CID"; $CCID_on++;} } if (preg_match("/x/i",$dial_prefix)) {$Local_out_prefix = '';} @@ -5491,103 +5554,164 @@ if ($ACTION == 'manDiaLonly') } if (strlen($campaign_cid_override) > 6) {$CCID = "$campaign_cid_override"; $CCID_on++;} - - ### check for custom cid use - $use_custom_cid=0; - $stmt = "SELECT use_custom_cid,manual_dial_hopper_check FROM vicidial_campaigns where campaign_id='$campaign';"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00314',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $uccid_ct = mysqli_num_rows($rslt); - if ($uccid_ct > 0) + else { - $row=mysqli_fetch_row($rslt); - $use_custom_cid = $row[0]; - $manual_dial_hopper_check = $row[1]; - if ( (preg_match('/^USER_CUSTOM/', $use_custom_cid)) and ($cid_lock < 1) ) + ### check for custom cid use + $use_custom_cid=0; + $stmt = "SELECT use_custom_cid,manual_dial_hopper_check,cid_group_id FROM vicidial_campaigns where campaign_id='$campaign';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00314',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $uccid_ct = mysqli_num_rows($rslt); + if ($uccid_ct > 0) { - $temp_vu=''; - $use_custom_cid=preg_replace('/^USER_/', "", $use_custom_cid); - $pattern=array('/1/', '/2/', '/3/', '/4/', '/5/'); - $replace=array('one', 'two', 'three', 'four', 'five'); - $use_custom_cid = strtolower(preg_replace($pattern,$replace, $use_custom_cid)); - $stmt="select $use_custom_cid from vicidial_users where user='$user'"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00661',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $vu_ct = mysqli_num_rows($rslt); - $act=0; - while ($vu_ct > $act) + $row=mysqli_fetch_row($rslt); + $use_custom_cid = $row[0]; + $manual_dial_hopper_check = $row[1]; + $cid_group_id = $row[2]; + if ($use_custom_cid == 'Y') { - $row=mysqli_fetch_row($rslt); - $temp_vu = $row[0]; - $act++; + $temp_CID = preg_replace("/\D/",'',$security_phrase); + if (strlen($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} } - $temp_CID = preg_replace("/\D/",'',$temp_vu); - } - else if ( ($use_custom_cid == 'AREACODE') and ($cid_lock < 1) ) - { - $temp_vcca=''; - $temp_ac=''; - $temp_ac_two = substr("$phone_number", 0, 2); - $temp_ac_three = substr("$phone_number", 0, 3); - $temp_ac_four = substr("$phone_number", 0, 4); - $temp_ac_five = substr("$phone_number", 0, 5); - $stmt = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$campaign' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00429',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $vcca_ct = mysqli_num_rows($rslt); - $act=0; - while ($vcca_ct > $act) + if ( (preg_match('/^USER_CUSTOM/', $use_custom_cid)) and ($cid_lock < 1) ) { - $row=mysqli_fetch_row($rslt); - $temp_vcca = $row[0]; - $temp_ac = $row[1]; - $act++; - } - if ($act > 0) - { - $stmt="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$campaign' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; - if ($format=='debug') {echo "\n";} + $temp_vu=''; + $use_custom_cid=preg_replace('/^USER_/', "", $use_custom_cid); + $pattern=array('/1/', '/2/', '/3/', '/4/', '/5/'); + $replace=array('one', 'two', 'three', 'four', 'five'); + $use_custom_cid = strtolower(preg_replace($pattern,$replace, $use_custom_cid)); + $stmt="select $use_custom_cid from vicidial_users where user='$user'"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00430',$user,$server_ip,$session_name,$one_mysql_log);} - } - - $temp_CID = preg_replace("/\D/",'',$temp_vcca); - } - if ($use_custom_cid == 'Y') - {$temp_CID = preg_replace("/\D/",'',$security_phrase);} - if (strlen($temp_CID) > 6) - {$CCID = "$temp_CID"; $CCID_on++;} - - #### BEGIN run manual_dial_hopper_check process if enabled - if ($manual_dial_hopper_check == 'Y') - { - $mdhc_lead_ids_SQL=''; - $stmt = "SELECT lead_id FROM vicidial_list where phone_number='$phone_number';"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00652',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $mdhc_ct = mysqli_num_rows($rslt); - $d=0; - while ($mdhc_ct > $d) - { - $row=mysqli_fetch_row($rslt); - $mdhc_lead_ids_SQL .= "'$row[0]',"; - $d++; - } - if ($mdhc_ct > 0) - { - $stmt = "DELETE FROM vicidial_hopper where lead_id IN($mdhc_lead_ids_SQL'');"; + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00661',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} + $vu_ct = mysqli_num_rows($rslt); + $act=0; + while ($vu_ct > $act) + { + $row=mysqli_fetch_row($rslt); + $temp_vu = $row[0]; + $act++; + } + $temp_CID = preg_replace("/\D/",'',$temp_vu); + if (strlen($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} + } + $CIDG_set=0; + if ( ($cid_group_id != '---DISABLED---') and ($cid_lock < 1) ) + { + $stmt = "SELECT cid_group_type FROM vicidial_cid_groups where cid_group_id='$cid_group_id';"; $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00653',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $cidg_ct = mysqli_num_rows($rslt); + if ($cidg_ct > 0) + { + $row=mysqli_fetch_row($rslt); + $cid_group_type = $row[0]; + $temp_vcca=''; + $temp_ac=''; + + if ($cid_group_type == 'AREACODE') + { + $temp_ac_two = substr("$agent_dialed_number", 0, 2); + $temp_ac_three = substr("$agent_dialed_number", 0, 3); + $temp_ac_four = substr("$agent_dialed_number", 0, 4); + $temp_ac_five = substr("$agent_dialed_number", 0, 5); + $stmt = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$cid_group_id' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; + } + if ($cid_group_type == 'STATE') + { + $temp_state = $state; + $stmt = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$cid_group_id' and areacode IN('$temp_state') and active='Y' order by call_count_today desc limit 100000;"; + } + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vcca_ct = mysqli_num_rows($rslt); + $act=0; + while ($vcca_ct > $act) + { + $row=mysqli_fetch_row($rslt); + $temp_vcca = $row[0]; + $temp_ac = $row[1]; + $act++; + } + if ($act > 0) + { + $stmt="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$cid_group_id' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + } + $temp_CID = preg_replace("/\D/",'',$temp_vcca); + if (strlen($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++; $CIDG_set++;} + } + if ( ($use_custom_cid == 'AREACODE') and ($cid_lock < 1) and ($CIDG_set < 1) ) + { + $temp_vcca=''; + $temp_ac=''; + $temp_ac_two = substr("$phone_number", 0, 2); + $temp_ac_three = substr("$phone_number", 0, 3); + $temp_ac_four = substr("$phone_number", 0, 4); + $temp_ac_five = substr("$phone_number", 0, 5); + $stmt = "SELECT outbound_cid,areacode FROM vicidial_campaign_cid_areacodes where campaign_id='$campaign' and areacode IN('$temp_ac_two','$temp_ac_three','$temp_ac_four','$temp_ac_five') and active='Y' order by CAST(areacode as SIGNED INTEGER) asc, call_count_today desc limit 100000;"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00429',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $vcca_ct = mysqli_num_rows($rslt); + $act=0; + while ($vcca_ct > $act) + { + $row=mysqli_fetch_row($rslt); + $temp_vcca = $row[0]; + $temp_ac = $row[1]; + $act++; + } + if ($act > 0) + { + $stmt="UPDATE vicidial_campaign_cid_areacodes set call_count_today=(call_count_today + 1) where campaign_id='$campaign' and areacode='$temp_ac' and outbound_cid='$temp_vcca';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00430',$user,$server_ip,$session_name,$one_mysql_log);} + } + + $temp_CID = preg_replace("/\D/",'',$temp_vcca); + if (strlen($temp_CID) > 6) + {$CCID = "$temp_CID"; $CCID_on++;} } } - #### END run manual_dial_hopper_check process if enabled } + #### BEGIN run manual_dial_hopper_check process if enabled + if ($manual_dial_hopper_check == 'Y') + { + $mdhc_lead_ids_SQL=''; + $stmt = "SELECT lead_id FROM vicidial_list where phone_number='$phone_number';"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00652',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $mdhc_ct = mysqli_num_rows($rslt); + $d=0; + while ($mdhc_ct > $d) + { + $row=mysqli_fetch_row($rslt); + $mdhc_lead_ids_SQL .= "'$row[0]',"; + $d++; + } + if ($mdhc_ct > 0) + { + $stmt = "DELETE FROM vicidial_hopper where lead_id IN($mdhc_lead_ids_SQL'');"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00653',$user,$server_ip,$session_name,$one_mysql_log);} + } + } + #### END run manual_dial_hopper_check process if enabled + $PADlead_id = sprintf("%010s", $lead_id); while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 55b2b5ed..2ec7ef67 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -579,10 +579,11 @@ # 180126-0855 - Added more agent api pause debug output # 180204-2304 - Added API dial_ingroup option to external_dial # 180210-0001 - Added flag for WebRTC webphone compatibility in iframe +# 180215-1105 - Changes for CID Groups functionality # -$version = '2.14-549c'; -$build = '180210-0001'; +$version = '2.14-550c'; +$build = '180215-1105'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=87; $one_mysql_log=0; @@ -9829,7 +9830,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection) else {var call_prefix = manual_dial_prefix;} - manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + manual_dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + dialed_number + "&agent_dialed_type=" + dialed_label + "&dial_method=" + dial_method + "&agent_log_id=" + agent_log_id + "&security=" + document.vicidial_form.security_phrase.value + "&qm_extension=" + qm_extension + "&old_CID=" + LastCallCID + "&cid_lock=" + cid_lock; + manDiaLonly_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=manDiaLonly&conf_exten=" + session_id + "&user=" + user + "&pass=" + pass + "&lead_id=" + document.vicidial_form.lead_id.value + "&phone_number=" + manDiaLonly_num + "&phone_code=" + document.vicidial_form.phone_code.value + "&campaign=" + campaign + "&ext_context=" + ext_context + "&dial_timeout=" + manual_dial_timeout + "&dial_prefix=" + call_prefix + "&campaign_cid=" + call_cid + "&omit_phone_code=" + omit_phone_code + "&usegroupalias=" + usegroupalias + "&account=" + active_group_alias + "&agent_dialed_number=" + dialed_number + "&agent_dialed_type=" + dialed_label + "&dial_method=" + dial_method + "&agent_log_id=" + agent_log_id + "&security=" + document.vicidial_form.security_phrase.value + "&qm_extension=" + qm_extension + "&old_CID=" + LastCallCID + "&cid_lock=" + cid_lock + "&state=" + encodeURIComponent(document.vicidial_form.state.value); xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.send(manDiaLonly_query); diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index c8dc0cd0..a70c688f 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -2337,7 +2337,12 @@ if (isset($_GET["add_lead_timezone"])) {$add_lead_timezone=$_GET["add_lead_tim elseif (isset($_POST["add_lead_timezone"])) {$add_lead_timezone=$_POST["add_lead_timezone"];} if (isset($_GET["icbq_dial_filter"])) {$icbq_dial_filter=$_GET["icbq_dial_filter"];} elseif (isset($_POST["icbq_dial_filter"])) {$icbq_dial_filter=$_POST["icbq_dial_filter"];} - +if (isset($_GET["cid_group_id"])) {$cid_group_id=$_GET["cid_group_id"];} + elseif (isset($_POST["cid_group_id"])) {$cid_group_id=$_POST["cid_group_id"];} +if (isset($_GET["cid_group_notes"])) {$cid_group_notes=$_GET["cid_group_notes"];} + elseif (isset($_POST["cid_group_notes"])) {$cid_group_notes=$_POST["cid_group_notes"];} +if (isset($_GET["cid_group_type"])) {$cid_group_type=$_GET["cid_group_type"];} + elseif (isset($_POST["cid_group_type"])) {$cid_group_type=$_POST["cid_group_type"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} @@ -3283,6 +3288,8 @@ if ($non_latin < 1) $icbq_call_time_id = preg_replace('/[^-_0-9a-zA-Z]/','',$icbq_call_time_id); $add_lead_timezone = preg_replace('/[^-_0-9a-zA-Z]/','',$add_lead_timezone); $icbq_dial_filter = preg_replace('/[^-_0-9a-zA-Z]/','',$icbq_dial_filter); + $cid_group_id = preg_replace('/[^-_0-9a-zA-Z]/','',$cid_group_id); + $cid_group_type = preg_replace('/[^-_0-9a-zA-Z]/','',$cid_group_type); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_timeout_prompt = preg_replace('/[^-\/\|\._0-9a-zA-Z]/','',$menu_timeout_prompt); @@ -3468,6 +3475,7 @@ if ($non_latin < 1) $dl_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$dl_name); $drop_status = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$drop_status); $ip_list_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$ip_list_name); + $cid_group_notes = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$cid_group_notes); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$call_out_number_group); @@ -4299,12 +4307,13 @@ else # 180211-1024 - Changed campaign dial statuses to allow List and allowed In-Group selected status group statuses # 180211-1126 - Added Outbound Lead Source Report # 180213-0010 - Added GDPR system and user settings +# 180215-1318 - Added CID Groups admin screens # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-655a'; -$build = '180213-0010'; +$admin_version = '2.14-656a'; +$build = '180215-1318'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -4872,6 +4881,7 @@ if ($ADD==192111111111) {$hh='admin'; $sh='sc'; echo _QXZ("ADD SETTINGS CONTAINE if ($ADD==193111111111) {$hh='admin'; $sh='sg'; echo _QXZ("ADD STATUS GROUP");} if ($ADD==194111111111) {$hh='admin'; $sh='ar'; echo _QXZ("ADD AUTOMATED REPORT");} if ($ADD==195111111111) {$hh='admin'; $sh='il'; echo _QXZ("ADD IP LIST");} +if ($ADD==196111111111) {$hh='admin'; $sh='cg'; echo _QXZ("ADD CID GROUP");} if ($ADD==1111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("ADD NEW CONFERENCE");} if ($ADD==11111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("ADD NEW AGENT CONFERENCE");} if ($ADD=='2') {$hh='users'; $sh='new'; echo _QXZ("New User Addition");} @@ -4926,6 +4936,7 @@ if ($ADD==292111111111) {$hh='admin'; $sh='sc'; echo _QXZ("ADDING NEW SETTINGS C if ($ADD==293111111111) {$hh='admin'; $sh='sg'; echo _QXZ("ADDING NEW STATUS GROUP");} if ($ADD==294111111111) {$hh='admin'; $sh='ar'; echo _QXZ("ADDING NEW AUTOMATED REPORT");} if ($ADD==295111111111) {$hh='admin'; $sh='il'; echo _QXZ("ADDING NEW IP LIST");} +if ($ADD==296111111111) {$hh='admin'; $sh='cg'; echo _QXZ("ADDING NEW CID GROUP");} if ($ADD==2111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("ADDING NEW CONFERENCE");} if ($ADD==21111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("ADDING NEW AGENT CONFERENCE");} if ($ADD==221111111111111) {$hh='admin'; $sh='status'; echo _QXZ("ADDING SYSTEM STATUSES");} @@ -5008,6 +5019,7 @@ if ($ADD==392111111111) {$hh='admin'; $sh='sc'; echo _QXZ("MODIFY SETTINGS CONTA if ($ADD==393111111111) {$hh='admin'; $sh='sg'; echo _QXZ("MODIFY STATUS GROUP");} if ($ADD==394111111111) {$hh='admin'; $sh='ar'; echo _QXZ("MODIFY AUTOMATED REPORT");} if ($ADD==395111111111) {$hh='admin'; $sh='il'; echo _QXZ("MODIFY IP LIST");} +if ($ADD==396111111111) {$hh='admin'; $sh='cg'; echo _QXZ("MODIFY CID GROUP");} if ($ADD==3111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("MODIFY CONFERENCE");} if ($ADD==31111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("MODIFY AGENT CONFERENCE");} if ($ADD==311111111111111) {$hh='admin'; $sh='settings'; echo _QXZ("MODIFY SYSTEM SETTINGS");} @@ -5060,6 +5072,7 @@ if ($ADD==491111111111) {$hh='admin'; $sh='cts'; echo _QXZ("MODIFY CONTACT");} if ($ADD==492111111111) {$hh='admin'; $sh='sc'; echo _QXZ("MODIFY SETTINGS CONTAINER");} if ($ADD==493111111111) {$hh='admin'; $sh='sg'; echo _QXZ("MODIFY STATUS GROUP");} if ($ADD==494111111111) {$hh='admin'; $sh='ar'; echo _QXZ("MODIFY AUTOMATED REPORT");} +if ($ADD==496111111111) {$hh='admin'; $sh='cg'; echo _QXZ("MODIFY CID GROUP");} if ($ADD==4111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("MODIFY CONFERENCE");} if ($ADD==41111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("MODIFY CONFERENCE");} if ($ADD==411111111111111) {$hh='admin'; $sh='settings'; echo _QXZ("MODIFY SYSTEM SETTINGS");} @@ -5103,6 +5116,7 @@ if ($ADD==592111111111) {$hh='admin'; $sh='sc'; echo _QXZ("DELETE SETTINGS CONTA if ($ADD==593111111111) {$hh='admin'; $sh='sg'; echo _QXZ("DELETE STATUS GROUP");} if ($ADD==594111111111) {$hh='admin'; $sh='ar'; echo _QXZ("DELETE AUTOMATED REPORT");} if ($ADD==595111111111) {$hh='admin'; $sh='il'; echo _QXZ("DELETE IP LIST");} +if ($ADD==596111111111) {$hh='admin'; $sh='cg'; echo _QXZ("DELETE CID GROUP");} if ($ADD==5111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("DELETE CONFERENCE");} if ($ADD==51111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("DELETE AGENT CONFERENCE");} if ($ADD==6) {$hh='users'; $sh='list'; echo _QXZ("Delete User");} @@ -5149,6 +5163,7 @@ if ($ADD==692111111111) {$hh='admin'; $sh='sc'; echo _QXZ("DELETE SETTINGS CONTA if ($ADD==693111111111) {$hh='admin'; $sh='sg'; echo _QXZ("DELETE STATUS GROUP");} if ($ADD==694111111111) {$hh='admin'; $sh='ar'; echo _QXZ("DELETE AUTOMATED REPORT");} if ($ADD==695111111111) {$hh='admin'; $sh='il'; echo _QXZ("DELETE IP LIST");} +if ($ADD==696111111111) {$hh='admin'; $sh='cg'; echo _QXZ("DELETE CID GROUP");} if ($ADD==6111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("DELETE CONFERENCE");} if ($ADD==61111111111111) {$hh='admin'; $sh='conference'; echo _QXZ("DELETE AGENT CONFERENCE");} if ($ADD==73) {$hh='campaigns'; echo _QXZ("Dialable Lead Count");} @@ -5200,6 +5215,7 @@ if ($ADD==192000000000) {$hh='admin'; $sh='sc'; echo _QXZ("SETTINGS CONTAINTER L if ($ADD==193000000000) {$hh='admin'; $sh='sg'; echo _QXZ("STATUS GROUP LIST");} if ($ADD==194000000000) {$hh='admin'; $sh='ar'; echo _QXZ("AUTOMATED REPORTS LIST");} if ($ADD==195000000000) {$hh='admin'; $sh='il'; echo _QXZ("IP LISTS");} +if ($ADD==196000000000) {$hh='admin'; $sh='cg'; echo _QXZ("CID GROUP LIST");} if ($ADD==1000000000000) {$hh='admin'; $sh='conference'; echo _QXZ("CONFERENCE LIST");} if ($ADD==10000000000000) {$hh='admin'; $sh='conference'; echo _QXZ("AGENT CONFERENCE LIST");} if ($ADD==100000000000000) {$hh='qc'; $sh='list'; echo _QXZ("Quality Control");} @@ -8882,6 +8898,42 @@ if ($ADD==195111111111) } +###################### +# ADD=196111111111 display the ADD NEW CID Group +###################### +if ($ADD==196111111111) + { + if ($LOGmodify_statuses==1) + { + echo "\n"; + if ($SScampaign_cid_areacodes_enabled == '1') + { + ##### get vicidial_cid_groups listings for dynamic pulldown list + $stmt="SELECT cid_group_id,cid_group_type,cid_group_notes from vicidial_cid_groups $LOGadmin_viewable_groupsSQL order by cid_group_id;"; + $rslt=mysql_to_mysqli($stmt, $link); + $cid_groups_to_print = mysqli_num_rows($rslt); + $cid_groups_menu=''; + $cid_groups_selected=0; + $o=0; + while ($cid_groups_to_print > $o) + { + $rowx=mysqli_fetch_row($rslt); + $cid_groups_menu .= "\n"; + $o++; + } + + echo "\n"; + } + else + {echo "";} + if ($SSoutbound_autodial_active > 0) { echo "\n"; } + else + {echo "";} echo "\n"; echo "\n"; @@ -30315,7 +30692,6 @@ if ($ADD==3311) echo "\n"; $o++; } - echo "
\n"; + echo "\"CID "; + + echo "
"._QXZ("ADD NEW CID GROUP")."
\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "
"._QXZ("CID Group ID").": $NWB#cid_groups$NWE
"._QXZ("CID Group Notes").": $NWB#cid_groups$NWE
"._QXZ("CID Group Type").": $NWB#cid_groups$NWE
"._QXZ("Admin User Group").": $NWB#cid_groups$NWE
\n"; + } + else + { + echo _QXZ("You do not have permission to view this page")."\n"; + exit; + } + } + + ###################### # ADD=1111111111111 display the ADD NEW CONFERENCE SCREEN ###################### @@ -9352,7 +9404,7 @@ if ($ADD=="2A") $pass=''; } - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,pass_hash,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,\"$pass_hash\",alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads from vicidial_users where user=\"$source_user_id\";"; + $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,pass_hash,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads,access_recordings) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,agentcall_chat,modify_email_accounts,\"$pass_hash\",alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,admin_cf_show_hidden,user_hide_realtime,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads,access_recordings from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today,group_type) SELECT \"$user\",group_id,group_rank,group_weight,\"0\",group_type from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -9752,7 +9804,7 @@ if ($ADD==20) $rslt=mysql_to_mysqli($stmtX, $link); } - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,allow_chats,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,allow_chats,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,allow_chats,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,allow_chats,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_to_mysqli($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; @@ -12666,6 +12718,57 @@ if ($ADD==295111111111) } + +###################### +# ADD=296111111111 adds new CID group to the system +###################### +if ($ADD==296111111111) + { + if ( ($LOGmodify_statuses!=1) or ($add_copy_disabled > 0) ) + { + echo "
"._QXZ("You do not have permission to add records on this system")." -system_settings-\n"; + } + else + { + echo ""; + $stmt="SELECT count(*) from vicidial_cid_groups where cid_group_id='$cid_group_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] > 0) + {echo "
"._QXZ("CID GROUP NOT ADDED - there is already a CID group in the system with this ID")."\n";} + else + { + $stmt="SELECT count(*) from vicidial_campaigns where campaign_id='$cid_group_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] > 0) + {echo "
"._QXZ("CID GROUP NOT ADDED - there is already a campaign in the system with this ID")."\n";} + else + { + if ( (strlen($cid_group_id) < 2) or (strlen($cid_group_notes) < 2) or (strlen($cid_group_type) < 2) ) + {echo "
"._QXZ("CID GROUP NOT ADDED - Please go back and look at the data you entered")."\n";} + else + { + echo "
"._QXZ("CID GROUP ADDED")."\n"; + + $stmt="INSERT INTO vicidial_cid_groups SET cid_group_id='$cid_group_id',cid_group_notes='$cid_group_notes',cid_group_type='$cid_group_type',user_group='$user_group';"; + $rslt=mysql_to_mysqli($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = preg_replace('/;/', '', $SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CIDGROUPS', event_type='ADD', record_id='$cid_group_id', event_code='ADMIN ADD CID GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + } + } + } + } + $ADD=396111111111; + } + + ###################### # ADD=2111111111111 adds new conference to the system ###################### @@ -13974,7 +14077,7 @@ if ($ADD==41) if ($dial_timeout < 4) {$dial_timeout='30';} if ( ($manual_auto_next > 0) and ($manual_auto_next < 5) ) {$manual_auto_next='5';} - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysqli_real_escape_string($link, $web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysqli_real_escape_string($link, $web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysqli_real_escape_string($link, $crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysqli_real_escape_string($link, $start_call_url) . "',dispo_call_url='" . mysqli_real_escape_string($link, $dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysqli_real_escape_string($link, $blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysqli_real_escape_string($link, $na_call_url) . "',pllb_grouping='$pllb_grouping',pllb_grouping_limit='$pllb_grouping_limit',call_count_limit='$call_count_limit',call_count_target='$call_count_target',callback_hours_block='$callback_hours_block',callback_list_calltime='$callback_list_calltime',user_group='$user_group',hopper_vlc_dup_check='$hopper_vlc_dup_check',in_group_dial='$in_group_dial',in_group_dial_select='$in_group_dial_select',safe_harbor_audio_field='$safe_harbor_audio_field',pause_after_next_call='$pause_after_next_call',owner_populate='$owner_populate',use_other_campaign_dnc='$use_other_campaign_dnc',allow_emails='$allow_emails',allow_chats='$allow_chats',amd_inbound_group='$amd_inbound_group',amd_callmenu='$amd_callmenu',manual_dial_lead_id='$manual_dial_lead_id',dead_max='$dead_max',dispo_max='$dispo_max',pause_max='$pause_max',dead_max_dispo='$dead_max_dispo',dispo_max_dispo='$dispo_max_dispo',max_inbound_calls='$max_inbound_calls',manual_dial_search_checkbox='$manual_dial_search_checkbox',hide_call_log_info='$hide_call_log_info',timer_alt_seconds='$timer_alt_seconds',wrapup_bypass='$wrapup_bypass',wrapup_after_hotkey='$wrapup_after_hotkey',callback_active_limit='$callback_active_limit',callback_active_limit_override='$callback_active_limit_override',comments_all_tabs='$comments_all_tabs',comments_dispo_screen='$comments_dispo_screen',comments_callback_screen='$comments_callback_screen',qc_comment_history='$qc_comment_history',show_previous_callback='$show_previous_callback',clear_script='$clear_script',cpd_unknown_action='$cpd_unknown_action',manual_dial_search_filter='$manual_dial_search_filter',web_form_address_three='" . mysqli_real_escape_string($link, $web_form_address_three) . "',manual_dial_override_field='$manual_dial_override_field',status_display_ingroup='$status_display_ingroup',customer_gone_seconds='$customer_gone_seconds',agent_display_fields='$agent_display_fields',am_message_wildcards='$am_message_wildcards',manual_dial_timeout='$manual_dial_timeout',routing_initiated_recordings='$routing_initiated_recordings',manual_dial_hopper_check='$manual_dial_hopper_check',callback_useronly_move_minutes='$callback_useronly_move_minutes',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',manual_auto_next='$manual_auto_next',manual_auto_show='$manual_auto_show',allow_required_fields='$allow_required_fields',dead_to_dispo='$dead_to_dispo',agent_xfer_validation='$agent_xfer_validation',ready_max_logout='$ready_max_logout',callback_display_days='$callback_display_days',three_way_record_stop='$three_way_record_stop',hangup_xfer_record_start='$hangup_xfer_record_start',scheduled_callbacks_email_alert='$scheduled_callbacks_email_alert',max_inbound_calls_outcome='$max_inbound_calls_outcome',manual_auto_next_options='$manual_auto_next_options',agent_screen_time_display='$agent_screen_time_display',next_dial_my_callbacks='$next_dial_my_callbacks',inbound_no_agents_no_dial_container='$inbound_no_agents_no_dial_container',inbound_no_agents_no_dial_threshold='$inbound_no_agents_no_dial_threshold' where campaign_id='$campaign_id';"; + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', auto_trim_hopper='$auto_trim_hopper', use_auto_hopper='$use_auto_hopper', auto_hopper_multi='$auto_hopper_multi', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysqli_real_escape_string($link, $web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns=$closer_campaignsSQL,use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysqli_real_escape_string($link, $web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysqli_real_escape_string($link, $crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysqli_real_escape_string($link, $start_call_url) . "',dispo_call_url='" . mysqli_real_escape_string($link, $dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysqli_real_escape_string($link, $blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats',api_manual_dial='$api_manual_dial',manual_dial_call_time_check='$manual_dial_call_time_check',lead_order_randomize='$lead_order_randomize',lead_order_secondary='$lead_order_secondary',per_call_notes='$per_call_notes',my_callback_option='$my_callback_option',agent_lead_search='$agent_lead_search',agent_lead_search_method='$agent_lead_search_method',queuemetrics_phone_environment='$queuemetrics_phone_environment',auto_pause_precall='$auto_pause_precall',auto_resume_precall='$auto_resume_precall',auto_pause_precall_code='$auto_pause_precall_code',manual_dial_cid='$manual_dial_cid',post_phone_time_diff_alert='$post_phone_time_diff_alert',custom_3way_button_transfer='$custom_3way_button_transfer',available_only_tally_threshold='$available_only_tally_threshold',available_only_tally_threshold_agents='$available_only_tally_threshold_agents',dial_level_threshold='$dial_level_threshold',dial_level_threshold_agents='$dial_level_threshold_agents',safe_harbor_audio='$safe_harbor_audio',safe_harbor_menu_id='$safe_harbor_menu_id',callback_days_limit='$callback_days_limit',dl_diff_target_method='$dl_diff_target_method',disable_dispo_screen='$disable_dispo_screen',disable_dispo_status='$disable_dispo_status',screen_labels='$screen_labels',status_display_fields='$status_display_fields',na_call_url='" . mysqli_real_escape_string($link, $na_call_url) . "',pllb_grouping='$pllb_grouping',pllb_grouping_limit='$pllb_grouping_limit',call_count_limit='$call_count_limit',call_count_target='$call_count_target',callback_hours_block='$callback_hours_block',callback_list_calltime='$callback_list_calltime',user_group='$user_group',hopper_vlc_dup_check='$hopper_vlc_dup_check',in_group_dial='$in_group_dial',in_group_dial_select='$in_group_dial_select',safe_harbor_audio_field='$safe_harbor_audio_field',pause_after_next_call='$pause_after_next_call',owner_populate='$owner_populate',use_other_campaign_dnc='$use_other_campaign_dnc',allow_emails='$allow_emails',allow_chats='$allow_chats',amd_inbound_group='$amd_inbound_group',amd_callmenu='$amd_callmenu',manual_dial_lead_id='$manual_dial_lead_id',dead_max='$dead_max',dispo_max='$dispo_max',pause_max='$pause_max',dead_max_dispo='$dead_max_dispo',dispo_max_dispo='$dispo_max_dispo',max_inbound_calls='$max_inbound_calls',manual_dial_search_checkbox='$manual_dial_search_checkbox',hide_call_log_info='$hide_call_log_info',timer_alt_seconds='$timer_alt_seconds',wrapup_bypass='$wrapup_bypass',wrapup_after_hotkey='$wrapup_after_hotkey',callback_active_limit='$callback_active_limit',callback_active_limit_override='$callback_active_limit_override',comments_all_tabs='$comments_all_tabs',comments_dispo_screen='$comments_dispo_screen',comments_callback_screen='$comments_callback_screen',qc_comment_history='$qc_comment_history',show_previous_callback='$show_previous_callback',clear_script='$clear_script',cpd_unknown_action='$cpd_unknown_action',manual_dial_search_filter='$manual_dial_search_filter',web_form_address_three='" . mysqli_real_escape_string($link, $web_form_address_three) . "',manual_dial_override_field='$manual_dial_override_field',status_display_ingroup='$status_display_ingroup',customer_gone_seconds='$customer_gone_seconds',agent_display_fields='$agent_display_fields',am_message_wildcards='$am_message_wildcards',manual_dial_timeout='$manual_dial_timeout',routing_initiated_recordings='$routing_initiated_recordings',manual_dial_hopper_check='$manual_dial_hopper_check',callback_useronly_move_minutes='$callback_useronly_move_minutes',ofcom_uk_drop_calc='$ofcom_uk_drop_calc',manual_auto_next='$manual_auto_next',manual_auto_show='$manual_auto_show',allow_required_fields='$allow_required_fields',dead_to_dispo='$dead_to_dispo',agent_xfer_validation='$agent_xfer_validation',ready_max_logout='$ready_max_logout',callback_display_days='$callback_display_days',three_way_record_stop='$three_way_record_stop',hangup_xfer_record_start='$hangup_xfer_record_start',scheduled_callbacks_email_alert='$scheduled_callbacks_email_alert',max_inbound_calls_outcome='$max_inbound_calls_outcome',manual_auto_next_options='$manual_auto_next_options',agent_screen_time_display='$agent_screen_time_display',next_dial_my_callbacks='$next_dial_my_callbacks',inbound_no_agents_no_dial_container='$inbound_no_agents_no_dial_container',inbound_no_agents_no_dial_threshold='$inbound_no_agents_no_dial_threshold',cid_group_id='$cid_group_id' where campaign_id='$campaign_id';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmtA, $link); @@ -16854,6 +16957,175 @@ if ($ADD==494111111111) } +###################### +# ADD=496111111111 modify CID group record in the system +###################### +if ($ADD==496111111111) + { + if ($LOGmodify_statuses==1) + { + echo ""; + + if (strlen($cid_group_id) < 2) + {echo "
"._QXZ("CID GROUP NOT MODIFIED - Please go back and look at the data you entered")."\n";} + else + { + if ($stage == 'ADD') + { + $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$cid_group_id' and areacode='$areacode' and outbound_cid='$outbound_cid';"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] > 0) + {echo "
"._QXZ("CID GROUP CID NOT ADDED - there is already an entry for this group with this CID")."
\n";} + else + { + if ( (strlen($cid_group_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
"._QXZ("CID GROUP CID NOT ADDED - Please go back and look at the data you entered")."
\n"; + } + else + { + echo "
"._QXZ("CID GROUP CID ADDED").": $cid_group_id - $areacode - $outbound_cid
\n"; + + $stmt="INSERT INTO vicidial_campaign_cid_areacodes(campaign_id,areacode,outbound_cid,cid_description) values('$cid_group_id','$areacode','$outbound_cid','$cid_description');"; + $rslt=mysql_to_mysqli($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = preg_replace('/;/', '', $SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CIDGROUPS', event_type='ADD', record_id='$cid_group_id', event_code='ADMIN ADD CID GROUP ENTRY', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + } + } + } + elseif ($stage == 'DELETE') + { + $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id='$cid_group_id' and areacode='$areacode' and outbound_cid='$outbound_cid' $LOGallowed_campaignsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] < 1) + {echo "
"._QXZ("CID GROUP CID NOT DELETED - this entry does not exist")."
\n";} + else + { + if ( (strlen($cid_group_id) < 2) or (strlen($areacode) < 2) or (strlen($outbound_cid) < 6) ) + { + echo "
"._QXZ("CID GROUP CID NOT DELETED - Please go back and look at the data you entered")."
\n"; + } + else + { + echo "
"._QXZ("CID GROUP CID DELETED").": $cid_group_id - $areacode - $outbound_cid
\n"; + + $stmt="DELETE FROM vicidial_campaign_cid_areacodes WHERE campaign_id='$cid_group_id' and areacode='$areacode' and outbound_cid='$outbound_cid';"; + $rslt=mysql_to_mysqli($stmt, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = preg_replace('/;/', '', $SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CIDGROUPS', event_type='DELETE', record_id='$cid_group_id', event_code='ADMIN DELETE CID GROUP ENTRY', event_sql=\"$SQL_log\", event_notes='CID: $areacode - $outbound_cid';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + } + } + } + elseif ($stage == 'MODIFY') + { + $stmt="SELECT areacode,outbound_cid,active,cid_description,call_count_today from vicidial_campaign_cid_areacodes where campaign_id='$cid_group_id' $LOGallowed_campaignsSQL order by areacode,outbound_cid"; + $rslt=mysql_to_mysqli($stmt, $link); + $accids_to_print = mysqli_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysqli_fetch_row($rslt); + $Xareacode[$o] = $rowx[0]; + $Xoutbound_cid[$o] = $rowx[1]; + $Xactive[$o] = $rowx[2]; + $Xcid_description[$o] = $rowx[3]; + $Xcall_count_today[$o] = $rowx[4]; + $o++; + } + + $accid_modified=0; + $stmt_log=''; + $accid_log=''; + $o=0; + while ($accids_to_print > $o) + { + $Factive_value=''; + $Fcid_description_value=''; + $Factive = "active_$Xareacode[$o]_$Xoutbound_cid[$o]"; + $Fcid_description = "cid_description_$Xareacode[$o]_$Xoutbound_cid[$o]"; + + if (isset($_GET[$Factive])) {$Factive_value=$_GET[$Factive];} + elseif (isset($_POST[$Factive])) {$Factive_value=$_POST[$Factive];} + if (isset($_GET[$Fcid_description])) {$Fcid_description_value=$_GET[$Fcid_description];} + elseif (isset($_POST[$Fcid_description])) {$Fcid_description_value=$_POST[$Fcid_description];} + $Fcid_description_value = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$Fcid_description_value); + $Factive_value = preg_replace('/[^A-Z]/','',$Factive_value); + + # echo "$cid_group_id - $Xareacode[$o] - $Xoutbound_cid[$o] - $Factive($Factive_value|$Xactive[$o]) - $Fcid_description($Fcid_description_value|$Xcid_description[$o])
"; + + if ( ($Factive_value == $Xactive[$o]) and ($Fcid_description_value == $Xcid_description[$o]) ) + { + # echo "
AREACODE CID NOT MODIFIED - Please go back and look at the data you entered
\n"; + } + else + { + $accid_modified++; + echo ""._QXZ("CID GROUP CID MODIFIED").": $Xareacode[$o] - $Xoutbound_cid[$o]
\n"; + + $stmt="UPDATE vicidial_campaign_cid_areacodes SET active='$Factive_value',cid_description='$Fcid_description_value' WHERE campaign_id='$cid_group_id' and areacode='$Xareacode[$o]' and outbound_cid='$Xoutbound_cid[$o]';"; + $rslt=mysql_to_mysqli($stmt, $link); + + $stmt_log .= "$stmt|"; + $accid_log .= "CID: $Xareacode[$o] - $Xoutbound_cid[$o] - $Factive_value - $Fcid_description_value|"; + } + $o++; + } + if ($accid_modified > 0) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt_log|"; + $SQL_log = preg_replace('/;/', '', $SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CIDGROUPS', event_type='MODIFY', record_id='$cid_group_id', event_code='ADMIN MODIFY CID GROUP ENTRY', event_sql=\"$SQL_log\", event_notes='$accid_modified CIDs MODIFIED. CHANGES: $accid_log';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + } + } + else + { + if (strlen($cid_group_notes) < 2) + {echo "
"._QXZ("CID GROUP NOT MODIFIED - Please go back and look at the data you entered")."\n";} + else + { + $stmt="UPDATE vicidial_cid_groups set cid_group_notes='$cid_group_notes',user_group='$user_group' where cid_group_id='$cid_group_id';"; + $rslt=mysql_to_mysqli($stmt, $link); + + echo "
"._QXZ("CID GROUP MODIFIED").": $cid_group_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = preg_replace('/;/', '', $SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CIDGROUPS', event_type='MODIFY', record_id='$cid_group_id', event_code='ADMIN MODIFY CID GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + } + } + } + } + else + { + echo _QXZ("You do not have permission to view this page")."\n"; + exit; + } + $ADD=396111111111; # go to CID group entry modification form below + } + + ###################### # ADD=4111111111111 modify conference record in the system ###################### @@ -18073,6 +18345,28 @@ if ($ADD==595111111111) } +###################### +# ADD=596111111111 confirmation before deletion of CID group record +###################### +if ($ADD==596111111111) + { + echo ""; + + if (strlen($cid_group_id) < 2) + { + echo "
"._QXZ("CID GROUP NOT DELETED - Please go back and look at the data you entered")."\n"; + echo "
"._QXZ("CID Group ID be at least 2 characters in length")."\n"; + } + else + { + echo "
"._QXZ("CID GROUP DELETION CONFIRMATION").": $cid_group_id\n"; + echo "

"._QXZ("Click here to delete CID group")." $cid_group_id


\n"; + } + $ADD='396111111111'; # go to CID Group entry modification below + } + + + ###################### # ADD=5111111111111 confirmation before deletion of conference record ###################### @@ -20441,6 +20735,51 @@ if ($ADD==695111111111) } +###################### +# ADD=696111111111 delete CID groups record +###################### +if ($ADD==696111111111) + { + echo ""; + + if ( (strlen($cid_group_id) < 2) or ($CoNfIrM != 'YES') or ($LOGmodify_statuses!=1) ) + { + echo "
"._QXZ("CID GROUP NOT DELETED - Please go back and look at the data you entered")."\n"; + echo "
"._QXZ("CID Group ID must be at least 2 characters in length")."\n"; + } + else + { + $stmt="SELECT count(*) from vicidial_cid_groups where cid_group_id='$cid_group_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if ($row[0] < 1) + {echo "
"._QXZ("CID GROUP NOT FOUND").": $cid_group_id\n";} + else + { + $stmt="DELETE from vicidial_cid_groups where cid_group_id='$cid_group_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + + $stmtB="DELETE from vicidial_campaign_cid_areacodes WHERE campaign_id='$cid_group_id';"; + $rslt=mysql_to_mysqli($stmtB, $link); + $affected_rowsB = mysqli_affected_rows($link); + if ($DB) {echo "$affected_rowsB|$stmtB|\n";} + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtB|"; + $SQL_log = preg_replace('/;/', '', $SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CIDGROUPS', event_type='DELETE', record_id='$cid_group_id', event_code='ADMIN DELETE CID GROUP', event_sql=\"$SQL_log\", event_notes='$affected_rowsB CIDS deleted';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_to_mysqli($stmt, $link); + + echo "
"._QXZ("CID GROUP DELETION COMPLETED").": $cid_group_id\n"; + echo "

\n"; + } + } + $ADD='196000000000'; # go to CID groups entry list + } + + ###################### # ADD=6111111111111 delete conference record ###################### @@ -21155,7 +21494,7 @@ if ($ADD==31) $enable_vtiger_integration_LU = $row[0]; $vtiger_url_LU = $row[1]; - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,in_group_dial,in_group_dial_select,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,allow_chats,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; + $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats,use_auto_hopper,auto_hopper_multi,auto_trim_hopper,api_manual_dial,manual_dial_call_time_check,display_leads_count,lead_order_randomize,lead_order_secondary,per_call_notes,my_callback_option,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_resume_precall,auto_pause_precall_code,manual_dial_cid,post_phone_time_diff_alert,custom_3way_button_transfer,available_only_tally_threshold,available_only_tally_threshold_agents,dial_level_threshold,dial_level_threshold_agents,safe_harbor_audio,safe_harbor_menu_id,survey_menu_id,callback_days_limit,dl_diff_target_method,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,na_call_url,survey_recording,pllb_grouping,pllb_grouping_limit,call_count_limit,call_count_target,callback_hours_block,callback_list_calltime,user_group,hopper_vlc_dup_check,in_group_dial,in_group_dial_select,safe_harbor_audio_field,pause_after_next_call,owner_populate,use_other_campaign_dnc,allow_emails,amd_inbound_group,amd_callmenu,survey_wait_sec,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,allow_chats,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,cpd_unknown_action,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,am_message_wildcards,manual_dial_timeout,routing_initiated_recordings,manual_dial_hopper_check,callback_useronly_move_minutes,ofcom_uk_drop_calc,manual_auto_next,manual_auto_show,allow_required_fields,dead_to_dispo,agent_xfer_validation,ready_max_logout,callback_display_days,three_way_record_stop,hangup_xfer_record_start,scheduled_callbacks_email_alert,max_inbound_calls_outcome,manual_auto_next_options,agent_screen_time_display,next_dial_my_callbacks,inbound_no_agents_no_dial_container,inbound_no_agents_no_dial_threshold,cid_group_id from vicidial_campaigns where campaign_id='$campaign_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $campaign_name = $row[1]; @@ -21422,6 +21761,7 @@ if ($ADD==31) $next_dial_my_callbacks=$row[262]; $inbound_no_agents_no_dial_container=$row[263]; $inbound_no_agents_no_dial_threshold=$row[264]; + $cid_group_id=$row[265]; if (preg_match('/DISABLED/', $list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -22324,10 +22664,47 @@ if ($ADD==31) echo "
"._QXZ("Custom CallerID").": $NWB#campaigns-use_custom_cid$NWE
"; + if ($cid_groups_selected > 0) + {echo ""._QXZ("CID Group")."";} + else + {echo _QXZ("CID Group");} + echo ": $NWB#campaigns-cid_group_id$NWE
"._QXZ("Routing Extension").": $NWB#campaigns-campaign_vdad_exten$NWE
"._QXZ("Campaign Rec exten").": $NWB#campaigns-campaign_rec_exten$NWE
"._QXZ("Campaign Recording").": $NWB#campaigns-campaign_recording$NWE
$row[0] $row[1]

\n"; @@ -30332,7 +30708,6 @@ if ($ADD==3311) echo "$row[0] $row[1]
\n"; $o++; } - echo "
\n"; @@ -30349,7 +30724,22 @@ if ($ADD==3311) echo "$row[0] $row[1]
\n"; $o++; } + echo "
\n"; + + echo ""._QXZ("CID GROUPS USING THIS DID").":
\n"; + echo "\n"; + + $stmt="SELECT camp.cid_group_id,cid_group_notes from vicidial_campaign_cid_areacodes campac,vicidial_cid_groups camp where outbound_cid='$did_pattern' and camp.cid_group_id=campac.campaign_id $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $cidgps_to_print = mysqli_num_rows($rslt); + $o=0; + while ($cidgps_to_print > $o) + { + $row=mysqli_fetch_row($rslt); + echo "\n"; + $o++; + } echo "
$row[0] $row[1]

\n"; @@ -30366,7 +30756,6 @@ if ($ADD==3311) echo "$row[0] $row[1]
\n"; $o++; } - echo "
\n"; @@ -30383,7 +30772,6 @@ if ($ADD==3311) echo "$row[0] $row[1]
\n"; $o++; } - echo "
\n"; @@ -34604,7 +34992,7 @@ if ($ADD==392111111111) $user_group = $row[2]; $container_entry = $row[3]; - echo "
"._QXZ("MODIFY SETTINGS CONTAINER").": $tts_id\n"; + echo "
"._QXZ("MODIFY SETTINGS CONTAINER").": $container_id\n"; echo "\n"; echo "\n"; @@ -34668,7 +35056,7 @@ if ($ADD==393111111111) $status_group_notes = $row[0]; $user_group = $row[1]; - echo "
"._QXZ("MODIFY STATUS GROUP").": $tts_id\n"; + echo "
"._QXZ("MODIFY STATUS GROUP").": $status_group_id\n"; echo "\n"; echo "\n"; @@ -35202,7 +35590,179 @@ if ($ADD==395111111111) +###################### +# ADD=396111111111 modify CID group in the system +###################### +if ($ADD==396111111111) + { + if ( ($LOGast_admin_access==1) and ($LOGmodify_statuses==1) ) + { + if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=396111111111&cid_group_id=$cid_group_id"; + $modify_footer_refresh=1; + } + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -38843,6 +39403,65 @@ if ($ADD==195000000000) } +###################### +# ADD=196000000000 display all CID group entries +###################### +if ($ADD==196000000000) + { + echo "
\n"; + echo ""; + $stmt="SELECT cid_group_notes,cid_group_type,user_group from vicidial_cid_groups where cid_group_id='$cid_group_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + $cid_group_notes = $row[0]; + $cid_group_type = $row[1]; + $user_group = $row[2]; + + echo "
"._QXZ("MODIFY CID GROUP").": $cid_group_id\n"; + echo "\n"; + echo "\n"; + + echo "
\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
"._QXZ("CID Group ID").": $cid_group_id
"._QXZ("CID Group Notes").": $NWB#cid_groups$NWE
"._QXZ("CID Group Type").": $cid_group_type$NWB#cid_groups$NWE
"._QXZ("Admin User Group").": $NWB#cid_groups$NWE
\n"; + + echo "
\n"; + + $checkbox_list=''; + $checkbox_count=0; + echo "

"._QXZ("CIDS FOR THIS CID GROUP").":   $NWB#cid_groups$NWE
\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + + $stmt="SELECT areacode,outbound_cid,active,cid_description,call_count_today from vicidial_campaign_cid_areacodes where campaign_id='$cid_group_id' order by areacode,outbound_cid;"; + $rslt=mysql_to_mysqli($stmt, $link); + $accids_to_print = mysqli_num_rows($rslt); + $o=0; + while ($accids_to_print > $o) + { + $rowx=mysqli_fetch_row($rslt); + $Xareacode[$o] = $rowx[0]; + $Xoutbound_cid[$o] = $rowx[1]; + $Xactive[$o] = $rowx[2]; + $Xcid_description[$o] = $rowx[3]; + $Xcall_count_today[$o] = $rowx[4]; + $checkbox_list .= "|active_$Xareacode[$o]_$Xoutbound_cid[$o]"; + $o++; + $checkbox_count++; + } + + echo "\n"; + + $o=0; + while ($accids_to_print > $o) + { + $ct = ($o + 1); + if ($ct == '1') + { + $bgcolor='bgcolor="#'. $SSstd_row1_background .'"'; + $bgac = $Xareacode[$o]; + } + else + { + if ($Xareacode[$o] != $bgac) + { + if (preg_match("/1$|3$|5$|7$|9$/i", $bgct)) + {$bgcolor='bgcolor="#'. $SSstd_row1_background .'"';} + else + {$bgcolor='bgcolor="#'. $SSstd_row2_background .'"';} + $bgct++; + $bgac = $Xareacode[$o]; + } + } + + $DID_edit_link_BEGIN=''; + $DID_edit_link_END=''; + if (strlen($Xoutbound_cid[$o]) > 0) + { + $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$Xoutbound_cid[$o]' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_to_mysqli($stmt, $link); + $dids_to_print = mysqli_num_rows($rslt); + if ($dids_to_print > 0) + { + $rowx=mysqli_fetch_row($rslt); + $DID_edit_link_BEGIN = ""; + $DID_edit_link_END=''; + } + } + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o++; + } + + echo "
#"._QXZ("$cid_group_type").""._QXZ("CID NUMBER").""._QXZ("DESCRIPTION").""._QXZ("ACTIVE")."
"._QXZ("select all")."
"._QXZ("CALLS").""._QXZ("DELETE")."
  $ct   $Xareacode[$o]   $DID_edit_link_BEGIN$Xoutbound_cid[$o]$DID_edit_link_END\n"; + if ($Xactive[$o] == 'Y') + { + echo ""; + } + else + { + echo ""; + } + echo "   $Xcall_count_today[$o]   "._QXZ("DELETE")."
\n"; + echo "

\n"; + + echo "
"._QXZ("ADD NEW $cid_group_type CID")."
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo _QXZ("$cid_group_type").": \n"; + echo _QXZ("Outbound CID").":
\n"; + echo _QXZ("Description").": \n"; + echo "
\n"; + + echo "

\n"; + + echo ""._QXZ("CAMPAIGNS USING THIS CID GROUP").":
\n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where cid_group_id='$cid_group_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_to_mysqli($stmt, $link); + $camps_to_print = mysqli_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysqli_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]

\n"; + + if (($LOGast_admin_access==1) and ($LOGmodify_statuses==1)) + { + echo "

"._QXZ("DELETE THIS CID GROUP")."\n"; + } + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) ) + { + echo "

"._QXZ("Click here to see Admin changes to this CID GROUP")."
\n"; + } + } + else + { + echo _QXZ("You do not have permission to view this page")."\n"; + exit; + } + } @@ -35844,7 +36404,7 @@ if ($ADD==311111111111111) echo "
"._QXZ("Cached Realtime Carrier Stats").": $NWB#settings-cache_carrier_stats_realtime$NWE
"._QXZ("Enable Campaign Areacode CID").": $NWB#settings-campaign_cid_areacodes_enabled$NWE
"._QXZ("Enable CID Groups and Campaign Areacode CID").": $NWB#settings-campaign_cid_areacodes_enabled$NWE
"._QXZ("Enable Remote Agent Extension Overrides").": $NWB#settings-did_ra_extensions_enabled$NWE
\n"; echo "\n"; echo "\n"; + if ($SScampaign_cid_areacodes_enabled == '1') + { + echo " 0) {echo " onclick=\"window.document.location='$PHP_SELF?ADD=196000000000';\"";} echo ">\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } echo "
\n"; + echo " "; + + $stmt="SELECT cid_group_id,cid_group_notes,cid_group_type,user_group from vicidial_cid_groups $whereLOGadmin_viewable_groupsSQL order by cid_group_id;"; + $rslt=mysql_to_mysqli($stmt, $link); + $cid_groups_to_print = mysqli_num_rows($rslt); + + echo "
"._QXZ("CID GROUP LISTINGS").":\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + + $o=0; + $menu_id = $MT; + + while ($cid_groups_to_print > $o) + { + $row=mysqli_fetch_row($rslt); + $cid_group_id[$o] = $row[0]; + $cid_group_notes[$o] = $row[1]; + $cid_group_type[$o] = $row[2]; + $admin_group[$o] = $row[3]; + $o++; + } + + $o=0; + while ($cid_groups_to_print > $o) + { + $stmt="SELECT count(*) from vicidial_campaign_cid_areacodes where campaign_id=\"$cid_group_id[$o]\";"; + $rslt=mysql_to_mysqli($stmt, $link); + $row=mysqli_fetch_row($rslt); + if (preg_match('/1$|3$|5$|7$|9$/i', $o)) + {$bgcolor='class="records_list_x"';} + else + {$bgcolor='class="records_list_y"';} + echo " 0) {echo " onclick=\"window.document.location='$PHP_SELF?ADD=396111111111&cid_group_id=$cid_group_id[$o]'\"";} echo ">"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
"._QXZ("CID GROUP ID").""._QXZ("NOTES").""._QXZ("TYPE").""._QXZ("GROUP").""._QXZ("CIDS").""._QXZ("MODIFY")."
$cid_group_id[$o] $cid_group_notes[$o] $cid_group_type[$o] $admin_group[$o] $row[0]"._QXZ("MODIFY")."
\n"; + } + + ###################### # ADD=1000000000000 display all conferences ###################### @@ -40123,6 +40742,13 @@ if ($ADD==999998) echo "
"._QXZ("Status Groups")."
"._QXZ("CID Groups")."
\n"; echo "\n"; diff --git a/agc_2-X/trunk/www/vicidial/admin_bulk_tools.php b/agc_2-X/trunk/www/vicidial/admin_bulk_tools.php index fc879c9a..1ad2958d 100644 --- a/agc_2-X/trunk/www/vicidial/admin_bulk_tools.php +++ b/agc_2-X/trunk/www/vicidial/admin_bulk_tools.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2018 Mike Coate, Mike Cargile, Matt Florell LICENSE: AGPLv2 # # This is the admin screen for various bulk copy/delete tools. # @@ -20,13 +20,14 @@ # 161218-2144 - Added STATE FILL method to AC-CID and upped the max insertion limit to 5K 'cause why not?' # 170409-1552 - Added IP List validation code # 170915-1105 - Added IGNORE to bulk inserts to not error out entire statement if only one entry is a unique index duplicate +# 180213-2245 - Added CID Groups ability for AC-CID section # require("dbconnect_mysqli.php"); require("functions.php"); -$version = '2.14-14'; -$build = '170409-1552'; +$version = '2.14-15'; +$build = '180213-2245'; $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; @@ -43,6 +44,8 @@ $STARTtime = date("U"); if (isset($_POST["form_to_run"])) {$form_to_run=$_POST["form_to_run"];} elseif (isset($_GET["form_to_run"])) {$form_to_run=$_GET["form_to_run"];} +if (isset($_POST["DB"])) {$DB=$_POST["DB"];} + elseif (isset($_GET["DB"])) {$DB=$_GET["DB"];} if (isset($_POST["ACCIDcampaign"])) {$ACCIDcampaign=$_POST["ACCIDcampaign"];} if (isset($_POST["ACCIDareacode"])) {$ACCIDareacode=$_POST["ACCIDareacode"];} if (isset($_POST["ACCIDdids"])) {$ACCIDto_insert_raw=$_POST["ACCIDdids"];} @@ -289,11 +292,11 @@ if ($form_to_run == "help") echo "

"; echo "
"; - echo ""._QXZ("AC-CID Bulk Add")." - "._QXZ("This allows you to paste in a listing of CIDs to insert into a campaign AC-CID list. There are two methods to choose from:
  • STATE LOOKUP - This will take a list of CIDs and insert them as Area Code Caller IDs into the selected campaign. The area code lookup is designed to work only with numbers in the North American Numbering Plan as it uses the first three digits of each CID. The description will automatically be filled with the appropriate US state abbreviation corresponding to the given CIDs 3-digit area code.
  • CSV - This will take a comma separated list in the format of NPA,CID,DESCRIPTION and insert each line into the specified campaigns AC-CID list using the supplied values. For example, given a listing of 813,7271234567,Florida will result in an AC-CID entry for area code 813 using the CID 7271234567 and a description of -Florida-. Descriptions are limited to 50 characters.
  • STATE FILL - Similar to the STATE LOOKUP method above, this will take a list of CIDs and insert them as AC-CIDs in the specified campaign but will also make an entry for each area code in a state based off the state the CID is in. For example, if given the CID 7271234567, 19 CID entries will be created with the same CID, one each for every area code in Florida.
CIDs must be between 6 and 20 digits in length and only digits 0-9 are allowed. Optionally, you can have the AC-CIDs set to active upon insertion."); + echo ""._QXZ("AC-CID Bulk Add")." - "._QXZ("This allows you to paste in a listing of CIDs to insert into a campaign AC-CID list or CID Group list. There are two methods to choose from:
  • STATE LOOKUP - This will take a list of CIDs and insert them as Area Code Caller IDs into the selected campaign. The area code lookup is designed to work only with numbers in the North American Numbering Plan as it uses the first three digits of each CID. The description will automatically be filled with the appropriate US state abbreviation corresponding to the given CIDs 3-digit area code.
  • CSV - This will take a comma separated list in the format of NPA,CID,DESCRIPTION and insert each line into the specified campaigns AC-CID list using the supplied values. For example, given a listing of 813,7271234567,Florida will result in an AC-CID entry for area code 813 using the CID 7271234567 and a description of -Florida-. Descriptions are limited to 50 characters. For CID Groups of a STATE type, use this format for CSV- STATE,CID,DESCRIPTION.
  • STATE FILL - Similar to the STATE LOOKUP method above, this will take a list of CIDs and insert them as AC-CIDs in the specified campaign but will also make an entry for each area code in a state based off the state the CID is in. For example, if given the CID 7271234567, 19 CID entries will be created with the same CID, one each for every area code in Florida. If you are inserting into a CID Group that is a STATE type, then you will not want to use the STATE FILL method.
CIDs must be between 6 and 20 digits in length and only digits 0-9 are allowed. Optionally, you can have the AC-CIDs set to active upon insertion."); echo "

"; echo "

"; - echo ""._QXZ("AC-CID Bulk Delete")." - "._QXZ("This will delete the Areacode Caller ID entries you select from the next screen based on the campaign you select here. Setting Clear All CIDs to YES will bypass the AC-CID selection and wipe all AC-CIDs for the selected campaign."); + echo ""._QXZ("AC-CID Bulk Delete")." - "._QXZ("This will delete the Areacode Caller ID entries you select from the next screen based on the campaign or CID group you select here. Setting Clear All CIDs to YES will bypass the AC-CID selection and wipe all AC-CIDs for the selected campaign or CID group."); echo "















"; exit; @@ -337,7 +340,7 @@ if ($form_to_run == "ACCID") { if ($ACCIDcampaign=="BLANK") { - echo _QXZ("Go back, you did not specify a campaign.")."\n"; + echo _QXZ("Go back, you did not specify a campaign or CID group.")."\n"; exit; } if ($CIDcheck=="BLANK") @@ -350,46 +353,57 @@ if ($form_to_run == "ACCID") echo _QXZ("This tool has a limit of ")."$INSERTmax_limit"._QXZ(" items. You are trying to insert ") . count($ACCIDto_insert_raw) ._QXZ(". Please go back and make adjustments.")."\n"; exit; } - + + $CGT = 'AREACODE'; + $SQL="SELECT cid_group_type FROM vicidial_cid_groups WHERE cid_group_id='$ACCIDcampaign';"; + if ($DB) {echo "$SQL|";} + $SQL_rslt = mysql_to_mysqli($SQL, $link); + $cgid_count = mysqli_num_rows($SQL_rslt); + if ($cgid_count > 0) + { + $row = mysqli_fetch_row($SQL_rslt); + $CGT = $row[0]; + } + $areacode = array(); # If using the STATE FILL method, build out the array of ACs and CIDs for each represented state. if ($ACCIDmethod == "STATEFILL") - { - $STATEFILLcids = array(); - $STATEFILLareacodes = array(); - $i=0; - $j=0; # Counts total ACCID to be inserted - while ($i < count($ACCIDto_insert_raw)) { - $STATEFILLareacode[$i] = substr($ACCIDto_insert_raw[$i], 0, 3); - $SQL = "SELECT state FROM vicidial_phone_codes WHERE country='USA' AND areacode=$STATEFILLareacode[$i];"; - if ($DB) {echo "$SQL|";} - $SQL_rslt = mysql_to_mysqli($SQL, $link); - $state = mysqli_fetch_row($SQL_rslt); - - $SQL = "SELECT areacode FROM vicidial_phone_codes WHERE country='USA' AND state='$state[0]';"; - if ($DB) {echo "$SQL|";} - $SQL_rslt = mysql_to_mysqli($SQL, $link); - $areacode_count = mysqli_num_rows($SQL_rslt); - - $k = 0; - while ($k < $areacode_count) + $STATEFILLcids = array(); + $STATEFILLareacodes = array(); + $i=0; + $j=0; # Counts total ACCID to be inserted + while ($i < count($ACCIDto_insert_raw)) { - $row = mysqli_fetch_row($SQL_rslt); - $areacode[$j] = $row[0]; - $STATEFILLcids[$j] = $ACCIDto_insert_raw[$i]; - $j++; - $k++; + $STATEFILLareacode[$i] = substr($ACCIDto_insert_raw[$i], 0, 3); + $SQL = "SELECT state FROM vicidial_phone_codes WHERE country='USA' AND areacode='$STATEFILLareacode[$i]';"; + if ($DB) {echo "$SQL|";} + $SQL_rslt = mysql_to_mysqli($SQL, $link); + $state = mysqli_fetch_row($SQL_rslt); + + $SQL = "SELECT areacode FROM vicidial_phone_codes WHERE country='USA' AND state='$state[0]';"; + if ($DB) {echo "$SQL|";} + $SQL_rslt = mysql_to_mysqli($SQL, $link); + $areacode_count = mysqli_num_rows($SQL_rslt); + + $k = 0; + while ($k < $areacode_count) + { + $row = mysqli_fetch_row($SQL_rslt); + $areacode[$j] = $row[0]; + $STATEFILLcids[$j] = $ACCIDto_insert_raw[$i]; + $j++; + $k++; + } + $i++; + } + $i=0; + while ($i < count($STATEFILLcids)) + { + $ACCIDto_insert_raw[$i] = $STATEFILLcids[$i]; + $i++; } - $i++; } - $i=0; - while ($i < count($STATEFILLcids)) - { - $ACCIDto_insert_raw[$i] = $STATEFILLcids[$i]; - $i++; - } - } #Check for duplicates $ACCIDduplicate = array(); @@ -401,9 +415,20 @@ if ($form_to_run == "ACCID") $l=0; #bad length counter while ($i < count($ACCIDto_insert_raw)) { - if ($ACCIDmethod == "CID") {$areacode[$i] = substr($ACCIDto_insert_raw[$i], 0, 3);} - if ($ACCIDmethod == "CSV") {$areacode[$i] = $ACCIDareacode_raw[$i];} - $SQL= "SELECT outbound_cid FROM vicidial_campaign_cid_areacodes WHERE outbound_cid=$ACCIDto_insert_raw[$i] AND areacode=$areacode[$i] AND campaign_id='$ACCIDcampaign';"; + if ($ACCIDmethod == "CID") + { + $areacode[$i] = substr($ACCIDto_insert_raw[$i], 0, 3); + if ($CGT == 'STATE') + { + $SQL = "SELECT state FROM vicidial_phone_codes WHERE country='USA' AND areacode='$areacode[$i]';"; + if ($DB) {echo "$SQL|";} + $SQL_rslt = mysql_to_mysqli($SQL, $link); + $row=mysqli_fetch_row($SQL_rslt); + $areacode[$i] = $row[0]; + } + } + if ($ACCIDmethod == "CSV") {$areacode[$i] = $ACCIDareacode_raw[$i];} + $SQL= "SELECT outbound_cid FROM vicidial_campaign_cid_areacodes WHERE outbound_cid='$ACCIDto_insert_raw[$i]' AND areacode='$areacode[$i]' AND campaign_id='$ACCIDcampaign';"; if ($DB) {echo "$SQL|";} $SQL_rslt=mysql_to_mysqli($SQL, $link); $row = mysqli_fetch_row($SQL_rslt); @@ -477,6 +502,7 @@ if ($form_to_run == "ACCID") if ($ACCIDmethod=="CSV") {$ACCIDdescription_raw = serialize($ACCIDdescription_raw);} echo "
"; echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -492,10 +518,21 @@ if ($form_to_run == "ACCID") ################################################################################ ##### PROCESS AC-CID add elseif ($form_to_run == "ACCIDconfirmed") - { + { + $CGT = 'AREACODE'; + $SQL="SELECT cid_group_type FROM vicidial_cid_groups WHERE cid_group_id='$ACCIDcampaign';"; + if ($DB) {echo "$SQL|";} + $SQL_rslt = mysql_to_mysqli($SQL, $link); + $cgid_count = mysqli_num_rows($SQL_rslt); + if ($cgid_count > 0) + { + $row = mysqli_fetch_row($SQL_rslt); + $CGT = $row[0]; + } + $ACCIDto_insert_CONFIRMED = unserialize($ACCIDto_insert_CONFIRMED); - $ACCIDareacode = unserialize($ACCIDareacode); - if ($ACCIDmethod=="CSV") + $ACCIDareacode = unserialize($ACCIDareacode); + if ($ACCIDmethod=="CSV") { $ACCIDdescription = unserialize($ACCIDdescription); } @@ -505,21 +542,26 @@ elseif ($form_to_run == "ACCIDconfirmed") $i = 0; while ($i < count($ACCIDto_insert_CONFIRMED)) { - $SQL="SELECT state FROM vicidial_phone_codes WHERE areacode=$ACCIDareacode[$i];"; - $SQL_rslt = mysql_to_mysqli($SQL, $link); - $row = mysqli_fetch_row($SQL_rslt); - if ( $row[0] == null ) #Put something in if NULL because areacode.vicidial_campaign_cid_areacodes cannot be NULL + if (!preg_match("/[A-Z]/i",$ACCIDareacode[$i])) { - $ACCIDdescription[$i] = " "; + $SQL="SELECT state FROM vicidial_phone_codes WHERE areacode='$ACCIDareacode[$i]';"; + $SQL_rslt = mysql_to_mysqli($SQL, $link); + $row = mysqli_fetch_row($SQL_rslt); + if ( $row[0] == null ) #Put something in if NULL because areacode.vicidial_campaign_cid_areacodes cannot be NULL + { + $ACCIDdescription[$i] = " "; + } + else + { + $ACCIDdescription[$i] = $row[0]; + } } else - { - $ACCIDdescription[$i] = $row[0]; - } + {$ACCIDdescription[$i] = $ACCIDareacode[$i];} $i++; } } - + ### Divide total AC-CIDs into groups $INSERTtotal = count($ACCIDto_insert_CONFIRMED); $INSERTgroup_counter = 0; @@ -614,11 +656,12 @@ elseif ($form_to_run == "ACCIDDELETEselect") { if ($ACCIDdelete_campaign=="BLANK") { - echo _QXZ("Go back, you did not select a campaign.")."\n"; + echo _QXZ("Go back, you did not select a campaign or CID group.")."\n"; exit; } echo ""; echo ""; + echo ""; echo ""; echo "
"; echo ""; @@ -663,12 +706,13 @@ elseif ($form_to_run == "ACCIDDELETEconfirm") { if ($ACCIDdelete_campaign=="BLANK") { - echo _QXZ("Go back, you did not select a campaign").".\n"; + echo _QXZ("Go back, you did not select a campaign or CID group").".\n"; exit; } echo "
"._QXZ("WANRING! You are about to remove all AC-CID entries for campaign")." $ACCIDdelete_campaign "._QXZ("WARNING!")."


"; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -700,6 +744,7 @@ elseif ($form_to_run == "ACCIDDELETEconfirm") $ACCIDdelete_from = serialize($ACCIDdelete_from); echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -784,8 +829,7 @@ elseif ($form_to_run == "ACCIDDELETEconfirmed") echo "
"._QXZ("AC-CIDs have been deleted")."."; echo "
"._QXZ("Go back to tools")."."; } - - } + } ################################################################################ @@ -888,6 +932,7 @@ elseif ($form_to_run == "BULKDIDS") $DIDto_insert = serialize($DIDto_insert); echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -1080,6 +1125,7 @@ elseif ($form_to_run == "BULKDIDSDELETE") $DIDdelete_from = serialize($DIDdelete_from); echo ""; echo ""; + echo ""; echo ""; echo "\n"; echo "
\n"; @@ -1229,6 +1275,7 @@ elseif ($form_to_run == "BULKUSERS") $USERto_insert = serialize($USERto_insert); echo "
"; echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -1471,6 +1518,7 @@ elseif ($form_to_run == "BULKUSERSDELETE") ### BULK USER DELETE $USERdelete_from = serialize($USERdelete_from); echo ""; echo ""; + echo ""; echo ""; echo "\n"; echo "
\n"; @@ -1526,6 +1574,7 @@ else { echo "
"; echo ""; + echo ""; echo "
"; echo ""; echo "\n"; @@ -1573,6 +1622,7 @@ else { echo ""; echo ""; + echo ""; echo "
"._QXZ("DID Bulk Copy")."$NWB#DIDADD$NWE
"; echo ""; echo "\n"; @@ -1617,6 +1667,7 @@ else { echo ""; echo ""; + echo ""; echo "
"._QXZ("DID Bulk Delete")."$NWB#DIDDELETE$NWE
"; echo ""; echo "\n"; @@ -1633,23 +1684,40 @@ else $SQL_rslt = mysql_to_mysqli($SQL, $link); $camp_count = mysqli_num_rows($SQL_rslt); $i = 0; + $g = 0; while ($i < $camp_count) { $row = mysqli_fetch_row($SQL_rslt); - $ACCIDcampaigns_to_copy[$i] = $row[0]; - $ACCIDcampaigns_to_copy_names[$i] = $row[1]; + $ACCIDcampaigns_to_copy[$g] = $row[0]; + $ACCIDcampaigns_to_copy_names[$g] = $row[1]; + $ACCIDcampaigns_to_copy_type[$g] = 'AREACODE'; $i++; + $g++; } - + $SQL="SELECT cid_group_id,cid_group_notes,cid_group_type FROM vicidial_cid_groups WHERE $admin_viewable_groupsSQL ORDER BY cid_group_id ASC;"; + if ($DB) {echo "$SQL|";} + $SQL_rslt = mysql_to_mysqli($SQL, $link); + $cgid_count = mysqli_num_rows($SQL_rslt); + $i = 0; + while ($i < $cgid_count) + { + $row = mysqli_fetch_row($SQL_rslt); + $ACCIDcampaigns_to_copy[$g] = $row[0]; + $ACCIDcampaigns_to_copy_names[$g] = $row[1]; + $ACCIDcampaigns_to_copy_type[$g] = $row[2]; + $i++; + $g++; + } + echo "\n"; echo "
"._QXZ("AC-CID Bulk Add")."$NWB#ACCIDADD$NWE
"._QXZ("Active?").":"; + echo ""; echo "
"; echo ""; echo "\n"; @@ -1686,21 +1755,38 @@ else $SQL_rslt = mysql_to_mysqli($SQL, $link); $camp_count = mysqli_num_rows($SQL_rslt); $i = 0; + $g = 0; while ($i < $camp_count) { $row = mysqli_fetch_row($SQL_rslt); - $ACCIDdelete_campaign_selection[$i] = $row[0]; - $ACCIDdelete_campaign_name[$i] = $row[1]; + $ACCIDdelete_campaign_selection[$g] = $row[0]; + $ACCIDdelete_campaign_name[$g] = $row[1]; + $ACCIDdelete_campaign_type[$g] = 'AREACODE'; $i++; + $g++; } - + $SQL="SELECT cid_group_id,cid_group_notes,cid_group_type FROM vicidial_cid_groups WHERE $admin_viewable_groupsSQL ORDER BY cid_group_id ASC;"; + if ($DB) {echo "$SQL|";} + $SQL_rslt = mysql_to_mysqli($SQL, $link); + $cgid_count = mysqli_num_rows($SQL_rslt); + $i = 0; + while ($i < $cgid_count) + { + $row = mysqli_fetch_row($SQL_rslt); + $ACCIDdelete_campaign_selection[$g] = $row[0]; + $ACCIDdelete_campaign_name[$g] = $row[1]; + $ACCIDdelete_campaign_type[$g] = $row[2]; + $i++; + $g++; + } + echo ""; + echo ""; echo "
"._QXZ("AC-CID Bulk Delete")."$NWB#ACCIDDELETE$NWE
"; echo ""; echo "\n"; @@ -1779,6 +1866,7 @@ else { echo ""; echo ""; + echo ""; echo "
"._QXZ("User Bulk Copy")."$NWB#USERADD$NWE
"; echo ""; echo "\n"; diff --git a/agc_2-X/trunk/www/vicidial/admin_header.php b/agc_2-X/trunk/www/vicidial/admin_header.php index 14c8841b..92480a96 100644 --- a/agc_2-X/trunk/www/vicidial/admin_header.php +++ b/agc_2-X/trunk/www/vicidial/admin_header.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2018 Matt Florell LICENSE: AGPLv2 # # CHANGES @@ -73,6 +73,7 @@ # 170409-0757 - Added IP Lists # 170623-2113 - Changed password strength parameters # 170821-2010 - Fix for issue #1036 +# 180213-1657 - Added CID Groups # $stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled,allow_emails,level_8_disable_add,allow_chats,enable_languages,admin_row_click,admin_screen_colors,user_new_lead_limit,user_territories_active,qc_features_active,agent_soundboards,enable_drop_lists,allow_ip_lists from system_settings;"; @@ -832,7 +833,7 @@ if ( ($ADD==131111111) or ($ADD==331111111) or ($ADD==431111111) ) ### Javascript for selecting and deselecting all AC-CIDs and other checkboxes "active" on the modify page -if ( ($ADD==3111) or ($ADD==4111) or ($ADD==5111) or ($ADD==3811) or ($ADD==4811) or ($ADD==5811) or ($ADD==3911) or ($ADD==4911) or ($ADD==5911) or ($ADD==31) or ($ADD==34) or ($ADD==202) ) +if ( ($ADD==3111) or ($ADD==4111) or ($ADD==5111) or ($ADD==3811) or ($ADD==4811) or ($ADD==5811) or ($ADD==3911) or ($ADD==4911) or ($ADD==5911) or ($ADD==31) or ($ADD==34) or ($ADD==202) or ($ADD==396111111111) or ($ADD==496111111111) ) { ?> function FORM_selectall(temp_count,temp_fields,temp_option,temp_span) @@ -1943,6 +1944,7 @@ if ($subcamp_font_size < 4) {$subcamp_font_size='11';} $cts_sh="CLASS=\"subhead_style\""; $sc_sh="CLASS=\"subhead_style\""; $sg_sh="CLASS=\"subhead_style\""; + $cg_sh="CLASS=\"subhead_style\""; $emails_sh="CLASS=\"subhead_style\""; $ar_sh="CLASS=\"subhead_style\""; $il_sh="CLASS=\"subhead_style\""; @@ -1968,6 +1970,7 @@ if ($subcamp_font_size < 4) {$subcamp_font_size='11';} if ($sh=='cts') {$cts_sh="CLASS=\"subhead_style_selected\"";} if ($sh=='sc') {$sc_sh="CLASS=\"subhead_style_selected\"";} if ($sh=='sg') {$sg_sh="CLASS=\"subhead_style_selected\"";} + if ($sh=='cg') {$cg_sh="CLASS=\"subhead_style_selected\"";} if ($sh=='emails') {$emails_sh="CLASS=\"subhead_style_selected\"";} if ($sh=='ar') {$ar_sh="CLASS=\"subhead_style_selected\"";} if ($sh=='il') {$il_sh="CLASS=\"subhead_style_selected\"";} @@ -1995,9 +1998,18 @@ if ($subcamp_font_size < 4) {$subcamp_font_size='11';} 0) {echo " onclick=\"window.document.location='$ADMIN?ADD=182000000000';\"";} ?>> 0) {echo " onclick=\"window.document.location='$ADMIN?ADD=321111111111111';\"";} ?>> +   \"Statuses\" 0) {echo " onclick=\"window.document.location='$ADMIN?ADD=193000000000';\"";} ?>> +   \"Status + 0) + { + ?> + 0) {echo " onclick=\"window.document.location='$ADMIN?ADD=196000000000';\"";} ?>> + 0) {echo " onclick=\"window.document.location='$ADMIN?ADD=170000000000';\"";} ?>> @@ -2257,6 +2269,10 @@ if ($SSenable_languages == '1') ?> > 25) { + ?> + > + 25) and (!preg_match('/campaign|user/i',$hh) ) ) { ?> > diff --git a/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php b/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php index d837a47c..f9fb5c77 100644 --- a/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php +++ b/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php @@ -2504,7 +2504,7 @@ if (($leadfile) && ($LF_path)) } ##### END custom fields columns list ### - + if ($DB>0) {echo "$fields_stmt\n";} $rslt=mysql_to_mysqli("$fields_stmt", $link); # csv xls xlsx ods sxc conversion diff --git a/agc_2-X/trunk/www/vicidial/help.php b/agc_2-X/trunk/www/vicidial/help.php index d700787a..867a61ed 100644 --- a/agc_2-X/trunk/www/vicidial/help.php +++ b/agc_2-X/trunk/www/vicidial/help.php @@ -152,6 +152,7 @@ # 180130-2303 - Added inbound_no_agents_no_dial entries # 180204-0213 - Added inbound_groups-icbq_expiration_hours and closed-time entries # 180211-1119 - Added source_vlc_status_report +# 180214-0042 - Added cid_groups # require("dbconnect_mysqli.php"); @@ -1462,12 +1463,22 @@ if ($SSoutbound_autodial_active > 0)

- - + -

- - + - + +
+
+
+ - + +
+
+
+ -1 - List CallerID Override
2 - CID Group entry
3 - AC-CID AREACODE entry
4 - Custom CallerID, Security Phrase
5 - USER_CUSTOM CallerID
6 - Campaign CID
"); ?>
@@ -3761,6 +3772,17 @@ if ($SSoutbound_autodial_active > 0) +



+ +CID GROUPS

+
+
+ + + + + +



USER_GROUPS TABLE

@@ -5583,7 +5605,7 @@ FR_SPAC 00 00 00 00 00 -

- - + -
diff --git a/agc_2-X/trunk/www/vicidial/images/icon_cidgroups.png b/agc_2-X/trunk/www/vicidial/images/icon_cidgroups.png new file mode 100644 index 0000000000000000000000000000000000000000..2f6b1fb814f824a00a79336079e48bd8e0e955a3 GIT binary patch literal 567 zcmV-70?7S|P) zF8adD4$m;d!@INJeRt`SNW!%eGRD}&ZYgr37rx4uoG(OX^ukZ6Th3@Rqi<2e4~%5g z3Mp|~=HD2@DE2aHx%nzLnOwyee8g}@togInslJGnolyUYrCRd!_of^_*MK0S&bR^H9QSjiy8Po8`d1$Mn%&Y z$I%tqB>skcl@suG zZG6H~%)tMKM@0d@(P%|{|L`km!_yNv=l6rr{cd?NIS1k+!c6Jqk#zt7002ovPDHLk FV1j|l_rL%E literal 0 HcmV?d00001
"._QXZ("User Bulk Delete")."$NWB#USERDELETE$NWE
>     \"Colors\"
>   -   \"Users\"
>   -   \"Users\"
>   +   \"CID
>     \"Users\"
    |  
    |  
    |     |