Added daily_reset_limit Lists feature(editable by level 9 users only)
git-svn-id: svn://192.168.202.10@3032 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -351,6 +351,8 @@ OTHER CHANGES:
|
||||
96. Added new 'force_fronter_leave_3way' Agent API function, allowing an API
|
||||
command to be sent to the fronter of a call to leave-3way their call.
|
||||
|
||||
97. Added List Daily Reset Limit option, only editable by level 9 users.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -131,9 +131,10 @@
|
||||
# 180512-2214 - Added reset of hopper_calls_today
|
||||
# 180818-2229 - Added rolling of vicidial_recent_ascb_calls records
|
||||
# 180908-1428 - Added daily rolling of vicidial_ccc_log records
|
||||
# 180916-1003 - Added vicidial_lists.resets_today resetting at TEOD, timed reset resets_today verification before reset
|
||||
#
|
||||
|
||||
$build = '180908-1428';
|
||||
$build = '180916-1003';
|
||||
|
||||
$DB=0; # Debug flag
|
||||
$teodDB=0; # flag to log Timeclock End of Day processes to log file
|
||||
@@ -1168,6 +1169,21 @@ if ($timeclock_end_of_day_NOW > 0)
|
||||
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
|
||||
$sthA->finish();
|
||||
|
||||
$stmtA = "update vicidial_lists SET resets_today=0;";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if($DB){print STDERR "\n|$affected_rows vicidial_lists resets counts reset|\n";}
|
||||
if ($teodDB) {$event_string = "vicidial_lists records reset: $affected_rows"; &teod_logger;}
|
||||
|
||||
$stmtA = "optimize table vicidial_lists;";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
|
||||
$sthA->finish();
|
||||
|
||||
$stmtA = "update vicidial_campaign_agents SET calls_today=0,hopper_calls_today=0,hopper_calls_hour=0;";
|
||||
if($DBX){print STDERR "\n|$stmtA|\n";}
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
@@ -4312,7 +4328,7 @@ if ( ($AST_VDadapt > 0) && ($reset_test =~ /00$/) )
|
||||
if ($AST_VDadapt > 0)
|
||||
{
|
||||
### reset lists if reset time matches
|
||||
$stmtA = "SELECT list_id FROM vicidial_lists where reset_time LIKE \"%$reset_test%\";";
|
||||
$stmtA = "SELECT list_id,daily_reset_limit,resets_today FROM vicidial_lists where reset_time LIKE \"%$reset_test%\";";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthBrows=$sthA->rows;
|
||||
@@ -4320,7 +4336,9 @@ if ($AST_VDadapt > 0)
|
||||
while ($sthBrows > $i)
|
||||
{
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
$list_id[$i] = "$aryA[0]";
|
||||
$list_id[$i] = $aryA[0];
|
||||
$daily_reset_limit[$i] = $aryA[1];
|
||||
$resets_today[$i] = $aryA[2];
|
||||
$i++;
|
||||
}
|
||||
$sthA->finish();
|
||||
@@ -4330,18 +4348,32 @@ if ($AST_VDadapt > 0)
|
||||
$i=0;
|
||||
while ($sthBrows > $i)
|
||||
{
|
||||
$stmtA="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id[$i]';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
if ( ($daily_reset_limit[$i] > $resets_today[$i]) || ($daily_reset_limit[$i] < 0) )
|
||||
{
|
||||
$stmtA="UPDATE vicidial_lists set resets_today=(resets_today + 1) where list_id='$list_id[$i]';";
|
||||
$affected_rows = $dbhA->do($stmtA);
|
||||
|
||||
$SQL_log = "$stmtA|";
|
||||
$SQL_log =~ s/;|\\|\'|\"//gi;
|
||||
$stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id[$i]';";
|
||||
$affected_rowsB = $dbhA->do($stmtB);
|
||||
|
||||
if ($DB) {print "DONE\n";}
|
||||
if ($DB) {print "$trigger_results\n";}
|
||||
$SQL_log = "$stmtA|$stmtB|";
|
||||
$SQL_log =~ s/;|\\|\'|\"//gi;
|
||||
$resets_today[$i] = ($resets_today[$i] + 1);
|
||||
|
||||
$stmtA="INSERT INTO vicidial_admin_log set event_date='$now_date', user='VDAD', ip_address='1.1.1.1', event_section='LISTS', event_type='RESET', record_id='$list_id[$i]', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='$affected_rows leads reset';";
|
||||
$Iaffected_rows = $dbhA->do($stmtA);
|
||||
if ($DB) {print "FINISHED: $affected_rows|$Iaffected_rows|$stmtA";}
|
||||
if ($DB) {print "List Reset DONE: $list_id[$i]($affected_rows)\n";}
|
||||
|
||||
$stmtA="INSERT INTO vicidial_admin_log set event_date='$now_date', user='VDAD', ip_address='1.1.1.1', event_section='LISTS', event_type='RESET', record_id='$list_id[$i]', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='$affected_rowsB leads reset, list resets today: $resets_today[$i]';";
|
||||
$Iaffected_rows = $dbhA->do($stmtA);
|
||||
if ($DB) {print "FINISHED: $affected_rows|$Iaffected_rows|$stmtA";}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($DB) {print "List Reset FAILED: $list_id[$i](Reset Limit $daily_reset_limit[$i] / $resets_today[$i])\n";}
|
||||
|
||||
$stmtA="INSERT INTO vicidial_admin_log set event_date='$now_date', user='VDAD', ip_address='1.1.1.1', event_section='LISTS', event_type='RESET', record_id='$list_id[$i]', event_code='ADMIN RESET LIST FAILED', event_sql=\"Reset Limit Reached $daily_reset_limit[$i] / $resets_today[$i]\", event_notes='Reset failed';";
|
||||
$Iaffected_rows = $dbhA->do($stmtA);
|
||||
if ($DB) {print "FINISHED: $affected_rows|$Iaffected_rows|$stmtA";}
|
||||
}
|
||||
|
||||
$i++;
|
||||
}
|
||||
@@ -4376,7 +4408,6 @@ if ($AST_VDadapt > 0)
|
||||
$SQL_log =~ s/;|\\|\'|\"//gi;
|
||||
|
||||
if ($DB) {print "DONE\n";}
|
||||
if ($DB) {print "$trigger_results\n";}
|
||||
|
||||
$stmtA="INSERT INTO vicidial_admin_log set event_date='$now_date', user='VDAD', ip_address='1.1.1.1', event_section='LISTS', event_type='MODIFY', record_id='$expired_list_id[$i]', event_code='ADMIN EXPIRED LIST INACTIVE', event_sql=\"$SQL_log\", event_notes='$affected_rows list expired';";
|
||||
$Iaffected_rows = $dbhA->do($stmtA);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2018-03-31
|
||||
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2018-09-16
|
||||
|
||||
This document describes the functions of an API(Application Programming
|
||||
Interface) for all functions NOT directly relating to the VICIDIAL Agent screen.
|
||||
@@ -136,6 +136,7 @@ Changes:
|
||||
180109-1313 - Added call_status_stats function
|
||||
180208-1655 - Added call_dispo_report function
|
||||
180331-1716 - Added options to update_campaign, add_user, update_phone. Added function update_did
|
||||
180916-1059 - Added check for daily list reset limit
|
||||
|
||||
|
||||
API Functions use the 'function' variable
|
||||
@@ -1405,6 +1406,7 @@ ERROR: update_list EXPIRATION DATE IS NOT VALID, THIS IS AN OPTIONAL FIELD - 666
|
||||
NOTICE: update_list NO UPDATES DEFINED - 6666|
|
||||
SUCCESS: update_list LIST HAS BEEN UPDATED - 6666|1101
|
||||
NOTICE: update_list LEADS IN LIST HAVE BEEN RESET - 6666|1101|324
|
||||
NOTICE: update_list LIST RESET FAILED, daily reset limit reached: 2 / 2 - 6666|1101
|
||||
NOTICE: update_list USER DOES NOT HAVE PERMISSION TO DELETE LISTS - 6666|0
|
||||
NOTICE: update_list LIST HAS BEEN DELETED - 6666|1101|1
|
||||
NOTICE: update_list USER DOES NOT HAVE PERMISSION TO DELETE LEADS - 6666|0
|
||||
|
||||
@@ -1042,7 +1042,9 @@ web_form_address_three TEXT,
|
||||
status_group_id VARCHAR(20) default '',
|
||||
user_new_lead_limit SMALLINT(5) default '-1',
|
||||
inbound_list_script_override VARCHAR(20),
|
||||
default_xfer_group VARCHAR(20) default '---NONE---'
|
||||
default_xfer_group VARCHAR(20) default '---NONE---',
|
||||
daily_reset_limit SMALLINT(5) default '-1',
|
||||
resets_today SMALLINT(5) UNSIGNED default '0'
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_statuses (
|
||||
@@ -4299,4 +4301,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='1556',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1557',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -755,3 +755,8 @@ CREATE TABLE vicidial_ccc_log_archive LIKE vicidial_ccc_log;
|
||||
CREATE UNIQUE INDEX ccc_unq_key on vicidial_ccc_log_archive(uniqueid, call_date, lead_id);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1556',db_schema_update_date=NOW() where db_schema_version < 1556;
|
||||
|
||||
ALTER TABLE vicidial_lists ADD daily_reset_limit SMALLINT(5) default '-1';
|
||||
ALTER TABLE vicidial_lists ADD resets_today SMALLINT(5) UNSIGNED default '0';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1557',db_schema_update_date=NOW() where db_schema_version < 1557;
|
||||
|
||||
@@ -2407,6 +2407,8 @@ if (isset($_GET["scheduled_callbacks_auto_reschedule"])) {$scheduled_callbacks
|
||||
elseif (isset($_POST["scheduled_callbacks_auto_reschedule"])) {$scheduled_callbacks_auto_reschedule=$_POST["scheduled_callbacks_auto_reschedule"];}
|
||||
if (isset($_GET["scheduled_callbacks_timezones_container"])) {$scheduled_callbacks_timezones_container=$_GET["scheduled_callbacks_timezones_container"];}
|
||||
elseif (isset($_POST["scheduled_callbacks_timezones_container"])) {$scheduled_callbacks_timezones_container=$_POST["scheduled_callbacks_timezones_container"];}
|
||||
if (isset($_GET["daily_reset_limit"])) {$daily_reset_limit=$_GET["daily_reset_limit"];}
|
||||
elseif (isset($_POST["daily_reset_limit"])) {$daily_reset_limit=$_POST["daily_reset_limit"];}
|
||||
|
||||
|
||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||
@@ -2844,6 +2846,7 @@ if ($non_latin < 1)
|
||||
$inbound_no_agents_no_dial_threshold = preg_replace('/[^-0-9]/','',$inbound_no_agents_no_dial_threshold);
|
||||
$dead_trigger_seconds = preg_replace('/[^-0-9]/','',$dead_trigger_seconds);
|
||||
$cid_cb_valid_length = preg_replace('/[^-0-9]/','',$cid_cb_valid_length);
|
||||
$daily_reset_limit = preg_replace('/[^-0-9]/','',$daily_reset_limit);
|
||||
|
||||
### DIGITS and COLONS
|
||||
$shift_length = preg_replace('/[^\:0-9]/','',$shift_length);
|
||||
@@ -4442,12 +4445,13 @@ else
|
||||
# 180825-2100 - Added scheduled_callbacks_timezones_container campaign setting and timezones display
|
||||
# 180904-1206 - Added copying of in-group user grades/ranks when copying an in-group
|
||||
# 180908-1618 - Added force_fronter_leave_3way API function
|
||||
# 180916-0824 - Added daily_reset_limit Lists feature(level 9 users only)
|
||||
#
|
||||
|
||||
# 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-687a';
|
||||
$build = '180908-1618';
|
||||
$admin_version = '2.14-688a';
|
||||
$build = '180916-0824';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -15144,9 +15148,13 @@ if ($ADD==411)
|
||||
if (strlen($reset_time) < 4) {$reset_time='';}
|
||||
if (strlen($expiration_date) < 10) {$expiration_date='2099-12-31';}
|
||||
|
||||
|
||||
$daily_reset_limitSQL='';
|
||||
if ($LOGuser_level >= 9) {$daily_reset_limitSQL = ",daily_reset_limit='$daily_reset_limit'";}
|
||||
|
||||
echo "<br><B>"._QXZ("LIST MODIFIED").": $list_id</B>\n";
|
||||
|
||||
$stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate',reset_time='$reset_time',agent_script_override='$agent_script_override',inbound_list_script_override='$inbound_list_script_override',campaign_cid_override='$campaign_cid_override',am_message_exten_override='$am_message_exten_override',drop_inbound_group_override='$drop_inbound_group_override',xferconf_a_number='$xferconf_a_number',xferconf_b_number='$xferconf_b_number',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',web_form_address='" . mysqli_real_escape_string($link, $web_form_address) . "',web_form_address_two='" . mysqli_real_escape_string($link, $web_form_address_two) . "',time_zone_setting='$time_zone_setting',inventory_report='$inventory_report',expiration_date='$expiration_date',na_call_url='" . mysqli_real_escape_string($link, $na_call_url) . "',local_call_time='$local_call_time',web_form_address_three='" . mysqli_real_escape_string($link, $web_form_address_three) . "',status_group_id='$status_group_id',user_new_lead_limit='$user_new_lead_limit',default_xfer_group='$default_xfer_group' where list_id='$list_id';";
|
||||
$stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate',reset_time='$reset_time',agent_script_override='$agent_script_override',inbound_list_script_override='$inbound_list_script_override',campaign_cid_override='$campaign_cid_override',am_message_exten_override='$am_message_exten_override',drop_inbound_group_override='$drop_inbound_group_override',xferconf_a_number='$xferconf_a_number',xferconf_b_number='$xferconf_b_number',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',web_form_address='" . mysqli_real_escape_string($link, $web_form_address) . "',web_form_address_two='" . mysqli_real_escape_string($link, $web_form_address_two) . "',time_zone_setting='$time_zone_setting',inventory_report='$inventory_report',expiration_date='$expiration_date',na_call_url='" . mysqli_real_escape_string($link, $na_call_url) . "',local_call_time='$local_call_time',web_form_address_three='" . mysqli_real_escape_string($link, $web_form_address_three) . "',status_group_id='$status_group_id',user_new_lead_limit='$user_new_lead_limit',default_xfer_group='$default_xfer_group' $daily_reset_limitSQL where list_id='$list_id';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
|
||||
## QC Addition for Audited Comments
|
||||
@@ -15164,17 +15172,33 @@ if ($ADD==411)
|
||||
|
||||
if ($reset_list == 'Y')
|
||||
{
|
||||
echo "<br>"._QXZ("RESETTING LIST-CALLED-STATUS")."\n";
|
||||
$stmtB="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';";
|
||||
$rslt=mysql_to_mysqli($stmtB, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQL_log = "$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='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$stmt="SELECT daily_reset_limit,resets_today from vicidial_lists where list_id='$list_id';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
if ( ($row[0] > $row[1]) or ($row[0] < 0) )
|
||||
{
|
||||
echo "<br>"._QXZ("RESETTING LIST-CALLED-STATUS")."\n";
|
||||
$stmtB="UPDATE vicidial_lists set resets_today=(resets_today + 1) where list_id='$list_id';";
|
||||
$rslt=mysql_to_mysqli($stmtB, $link);
|
||||
|
||||
$stmtC="UPDATE vicidial_list set called_since_last_reset='N' where list_id='$list_id';";
|
||||
$rslt=mysql_to_mysqli($stmtC, $link);
|
||||
$affected_rowsC = mysqli_affected_rows($link);
|
||||
|
||||
$row[1] = ($row[1] + 1);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQL_log = "$stmtB|$stmtC|";
|
||||
$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='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='leads reset: $affected_rowsC list resets today: $row[1] limit: $row[0]';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br>"._QXZ("CANNOT RESET LIST, LIMIT REACHED").": $row[0] / $row[1]\n";
|
||||
}
|
||||
}
|
||||
if ($campaign_id != "$old_campaign_id")
|
||||
{
|
||||
@@ -26323,7 +26347,7 @@ if ($ADD==311)
|
||||
}
|
||||
}
|
||||
|
||||
$stmt="SELECT vicidial_lists.list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting,inventory_report,IFNULL(audit_comments,0),expiration_date,DATE_FORMAT(expiration_date,'%Y%m%d'),na_call_url,local_call_time,web_form_address_three,status_group_id,user_new_lead_limit,inbound_list_script_override,default_xfer_group from vicidial_lists left outer join vicidial_lists_custom on vicidial_lists.list_id=vicidial_lists_custom.list_id where vicidial_lists.list_id='$list_id' $LOGallowed_campaignsSQL;";
|
||||
$stmt="SELECT vicidial_lists.list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting,inventory_report,IFNULL(audit_comments,0),expiration_date,DATE_FORMAT(expiration_date,'%Y%m%d'),na_call_url,local_call_time,web_form_address_three,status_group_id,user_new_lead_limit,inbound_list_script_override,default_xfer_group,daily_reset_limit,resets_today from vicidial_lists left outer join vicidial_lists_custom on vicidial_lists.list_id=vicidial_lists_custom.list_id where vicidial_lists.list_id='$list_id' $LOGallowed_campaignsSQL;";
|
||||
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -26358,6 +26382,8 @@ if ($ADD==311)
|
||||
$user_new_lead_limit = $row[28];
|
||||
$inbound_list_script_override = $row[29];
|
||||
$default_xfer_group = $row[30];
|
||||
$daily_reset_limit = $row[31];
|
||||
$resets_today = $row[32];
|
||||
|
||||
# grab names of global statuses and statuses in the selected campaign
|
||||
$stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed,min_sec,max_sec,answering_machine from vicidial_statuses order by status;";
|
||||
@@ -26457,6 +26483,17 @@ if ($ADD==311)
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Reset Lead-Called-Status for this list").": </td><td align=left><select size=1 name=reset_list><option value='Y'>"._QXZ("Y")."</option><option value='N' SELECTED>"._QXZ("N")."</option></select>$NWB#lists-reset_list$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Reset Times").": </td><td align=left><input type=text name=reset_time size=30 maxlength=100 value=\"$reset_time\">$NWB#lists-reset_time$NWE</td></tr>\n";
|
||||
|
||||
if ($LOGuser_level >= 9)
|
||||
{
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Daily Reset Limit").": </td><td align=left><input type=text name=daily_reset_limit size=4 maxlength=3 value=\"$daily_reset_limit\"> <i>"._QXZ("Resets Today").":</i> $resets_today $NWB#lists-daily_reset_limit$NWE</td></tr>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$daily_reset_limitTEXT = $daily_reset_limit;
|
||||
if ($daily_reset_limit < 0) {$daily_reset_limitTEXT=_QXZ("none");}
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Daily Reset Limit").": </td><td align=left><input type=hidden name=daily_reset_limit value=\"$daily_reset_limit\">$daily_reset_limitTEXT <i>"._QXZ("Resets Today").":</i> $resets_today $NWB#lists-daily_reset_limit$NWE</td></tr>\n";
|
||||
}
|
||||
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Expiration Date").": </td><td align=left><input type=text name=expiration_date size=12 maxlength=10 value=\"$expiration_date\"> \n";
|
||||
echo "<script language=\"JavaScript\">\n";
|
||||
echo "var o_cal = new tcal ({\n";
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
# version: 201808252106
|
||||
# version: 201809161104
|
||||
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length.</QXZ>
|
||||
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
|
||||
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N.</QXZ>
|
||||
users-last_login_date Last Login Info <QXZ>This shows the last login attempt date and time, and if there has been a recent failed login attempt. If this modify user form is submitted, then the failed login attempt counter will be reset and the agent can immediately attempt to log in again. If an agent has 10 failed login attempts in a row then they cannot attempt to log in again for at least 15 minutes unless their account is manually reset.</QXZ>
|
||||
users-full_name Full Name <QXZ>This field is where you put the users full name. Must be at least 2 characters in length.</QXZ>
|
||||
users-user_level User Level <QXZ>This menu is where you select the users user level. Must be a level of 1 to log into the agent screen, Must be level greater than 2 to log in as a closer, Must be user level 8 or greater to get into admin web section.</QXZ>
|
||||
users-user_level User Level <QXZ>This menu is where you select the users user level. Must be a level of 1 to log into the agent screen, Must be level greater than 2 to log in as a closer, level 7 is for Reports only. Must be user level 8 or greater to get into admin web section. User Level 9 is able to edit all user levels in the admin web section. User Level 8 can only edit level 7 users and lower.</QXZ>
|
||||
users-user_group User Group <QXZ>This menu is where you select the users group that this user will belong to. There are several agent screen features that can be controlled through user group settings. If this field is left blank then the user cannot log in to the agent screen.</QXZ>
|
||||
users-phone_login Phone Login <QXZ>Here is where you can set a default phone login value for when the user logs into the agent screen. This value will populate the phone_login automatically when the user logs in with their user-pass-campaign in the agent login screen.</QXZ>
|
||||
users-phone_pass Phone Pass <QXZ>Here is where you can set a default phone pass value for when the user logs into the agent screen. This value will populate the phone_pass automatically when the user logs in with their user-pass-campaign in the agent login screen.</QXZ>
|
||||
@@ -360,6 +360,7 @@ lists-campaign_id Campaign <QXZ>This is the campaign that this list belongs to.
|
||||
lists-active Active <QXZ>This defines whether the list is to be dialed on or not.</QXZ>
|
||||
lists-reset_list Reset Lead-Called-Status for this list <QXZ>This resets all leads in this list to N for not called since last reset and means that any lead can now be called if it is the right status as defined in the campaign screen.</QXZ>
|
||||
lists-reset_time Reset Times <QXZ>This field allows you to put times in, separated by a dash-, that this list will be automatically reset by the system. The times must be in 24 hour format with no punctuation, for example 0800-1700 would reset the list at 8AM and 5PM every day. Default is empty.</QXZ>
|
||||
lists-daily_reset_limit Daily Reset Limit <QXZ>This setting is only editable by a level 9 user. This setting allows an Administrator to limit the number of times that a list can be reset per day. The Resets Today number is counted from the Timeclock End Of Day time that is set in the system. Default is -1 for disabled.
|
||||
lists-expiration_date Expiration Date <QXZ>This option allows you to set the date after which leads in this list will not be allowed to be auto-dialed or manual-list-dialed by the system. Default is 2099-12-31.</QXZ>
|
||||
lists-local_call_time Local Call Time <QXZ>This is a setting for this list only, where you set during which hours you would like to dial leads within this specific list, as determined by the local time in the area in which you are calling. This is controlled by the time zone, as defined by that list setting, and is adjusted for Daylight Savings time if applicable. However, state rules are based on the state field for the lead and not only the time zone that is set. This call time setting is applied after the campaign local call time has been applied to the list and will NOT override the campaign settings. This setting will only narrow down call times in relation to the campaign local call time setting. It will NOT allow calling outside the hours set by the campaign local call time setting. This is useful if you have lists that need different call times within the same campaign. For example calling business numbers between 9am to 5pm and consumer phones between 9am to 9pm within the same campaign. General Guidelines in the USA for Business to Business is 9am to 5pm and Business to Consumer calls is 9am to 9pm. Default is campaign.</QXZ>
|
||||
lists-audit_comments Audit Comments <QXZ>This option allows comments to be moved to an audit table. No longer editable, but viewable along with the date-time-creator of each comment. Default is N. This is a part of the Quality Control Add-On.</QXZ>
|
||||
|
||||
@@ -132,10 +132,11 @@
|
||||
# 180301-2301 - Added GET-AND-POST URL logging
|
||||
# 180331-1716 - Added options to update_campaign, add_user, update_phone. Added function update_did
|
||||
# 180529-1102 - Fix for QM live monitoring
|
||||
# 180916-1059 - Added check for daily list reset limit
|
||||
#
|
||||
|
||||
$version = '2.14-109';
|
||||
$build = '180529-1102';
|
||||
$version = '2.14-110';
|
||||
$build = '180916-1059';
|
||||
$api_url_log = 0;
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -4214,28 +4215,50 @@ if ($function == 'update_list')
|
||||
|
||||
if ($reset_list == 'Y')
|
||||
{
|
||||
$stmt="UPDATE vicidial_lists SET list_changedate='$NOW_TIME' WHERE list_id='$list_id';";
|
||||
$stmt="SELECT daily_reset_limit,resets_today from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$daily_reset_limit = $row[0];
|
||||
$resets_today = $row[1];
|
||||
if ( ($daily_reset_limit > $resets_today) or ($daily_reset_limit < 0) )
|
||||
{
|
||||
$stmt="UPDATE vicidial_lists SET list_changedate='$NOW_TIME',resets_today=(resets_today + 1) WHERE list_id='$list_id';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
|
||||
$stmt="UPDATE vicidial_list SET called_since_last_reset='N' WHERE list_id='$list_id';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$affected_rows = mysqli_affected_rows($link);
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$resets_today = ($resets_today + 1);
|
||||
|
||||
### 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='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN API RESET LIST', event_sql=\"$SQL_log\", event_notes='list: $list_id';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$stmtB="UPDATE vicidial_list SET called_since_last_reset='N' WHERE list_id='$list_id';";
|
||||
$rslt=mysql_to_mysqli($stmtB, $link);
|
||||
$affected_rowsB = mysqli_affected_rows($link);
|
||||
if ($DB) {echo "|$stmtB|\n";}
|
||||
|
||||
$result = 'NOTICE';
|
||||
$result_reason = "update_list LEADS IN LIST HAVE BEEN RESET";
|
||||
$data = "$list_id|$affected_rows";
|
||||
echo "$result: $result_reason - $user|$data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
### 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='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN API RESET LIST', event_sql=\"$SQL_log\", event_notes='$affected_rowsB leads reset, list resets today: $resets_today';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
|
||||
$result = 'NOTICE';
|
||||
$result_reason = "update_list LEADS IN LIST HAVE BEEN RESET";
|
||||
$data = "$list_id|$affected_rows";
|
||||
echo "$result: $result_reason - $user|$data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN API RESET LIST FAILED', event_sql=\"\", event_notes='daily list resets limit reached: $resets_today / $daily_reset_limit';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
|
||||
$result = 'NOTICE';
|
||||
$result_reason = "update_list LIST RESET FAILED, daily reset limit reached: $resets_today / $daily_reset_limit";
|
||||
$data = "$list_id";
|
||||
echo "$result: $result_reason - $user|$data\n";
|
||||
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
|
||||
}
|
||||
}
|
||||
|
||||
if ($delete_list == 'Y')
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# reset_campaign_lists.php - VICIDIAL administration page
|
||||
#
|
||||
# Copyright (C) 2017 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 130711-2051 - First build
|
||||
@@ -10,10 +10,11 @@
|
||||
# 141229-2009 - Added code for on-the-fly language translations display
|
||||
# 160508-2301 - Added colors features, fixed allowed campaigns bug
|
||||
# 170409-1541 - Added IP List validation code
|
||||
# 180916-1027 - Added per-list daily reset limit
|
||||
#
|
||||
|
||||
$admin_version = '2.14-6';
|
||||
$build = '170409-1541';
|
||||
$admin_version = '2.14-7';
|
||||
$build = '180916-1027';
|
||||
|
||||
require("dbconnect_mysqli.php");
|
||||
require("functions.php");
|
||||
@@ -260,7 +261,7 @@ if ( ($LOGuser_level >= 9) and $LOGmodify_campaigns>0 and $LOGmodify_lists>0 and
|
||||
{
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$campaign_stmt="select vl.campaign_id, vc.campaign_name, count(*) as ct from vicidial_lists vl, vicidial_campaigns vc where vc.active='Y' and vc.campaign_id=vl.campaign_id $LOGallowed_campaignsSQL group by campaign_id order by campaign_id, campaign_name asc";
|
||||
$campaign_stmt="SELECT vl.campaign_id, vc.campaign_name, count(*) as ct from vicidial_lists vl, vicidial_campaigns vc where vc.active='Y' and vc.campaign_id=vl.campaign_id $LOGallowed_campaignsSQL group by campaign_id order by campaign_id, campaign_name asc";
|
||||
$campaign_rslt=mysql_to_mysqli($campaign_stmt, $link);
|
||||
if ($DB > 0) {echo $campaign_stmt;}
|
||||
|
||||
@@ -275,15 +276,18 @@ if ( ($LOGuser_level >= 9) and $LOGmodify_campaigns>0 and $LOGmodify_lists>0 and
|
||||
echo "<tr bgcolor='#$SSstd_row2_background'>";
|
||||
echo "<td align='left'>";
|
||||
echo "<select name='reset_lead_called_campaigns'>\n";
|
||||
while ($campaign_row=mysqli_fetch_array($campaign_rslt)) {
|
||||
if ($campaign_row["ct"]>0) {
|
||||
while ($campaign_row=mysqli_fetch_array($campaign_rslt))
|
||||
{
|
||||
if ($campaign_row["ct"]>0)
|
||||
{
|
||||
$selected="";
|
||||
if ($reset_lead_called_campaigns==$campaign_row["campaign_id"]) {
|
||||
if ($reset_lead_called_campaigns==$campaign_row["campaign_id"])
|
||||
{
|
||||
$selected="selected";
|
||||
}
|
||||
}
|
||||
echo "<option value='$campaign_row[campaign_id]' $selected>$campaign_row[campaign_id] - $campaign_row[campaign_name], $campaign_row[ct] list(s)</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</select></td>";
|
||||
echo "<td><select name='all_or_active_only'>";
|
||||
echo "<option value='Y'>"._QXZ("Active lists only")."</option>";
|
||||
@@ -293,13 +297,15 @@ if ( ($LOGuser_level >= 9) and $LOGmodify_campaigns>0 and $LOGmodify_lists>0 and
|
||||
echo "<td align='right'><input type='submit' name='submit_campaign_reset' value='"._QXZ("SUBMIT")."'></td></tr>";
|
||||
echo "<tr ><td colspan='3'>";
|
||||
|
||||
if ($submit_campaign_reset && $reset_lead_called_campaigns) {
|
||||
if ($submit_campaign_reset && $reset_lead_called_campaigns)
|
||||
{
|
||||
if ($all_or_active_only=="Y") {$list_id_clause="and active='Y'"; $verbiage="(active lists only)";}
|
||||
|
||||
$list_id_stmt="select list_id from vicidial_lists where campaign_id='$reset_lead_called_campaigns' $list_id_clause order by list_id asc";
|
||||
$list_id_stmt="SELECT list_id,daily_reset_limit,resets_today from vicidial_lists where campaign_id='$reset_lead_called_campaigns' $list_id_clause order by list_id asc";
|
||||
if ($DB > 0) {echo $list_id_stmt;}
|
||||
$list_id_rslt=mysql_to_mysqli($list_id_stmt, $link);
|
||||
if (mysqli_num_rows($list_id_rslt)>0) {
|
||||
if (mysqli_num_rows($list_id_rslt)>0)
|
||||
{
|
||||
echo _QXZ("CAMPAIGN")." <B>$reset_lead_called_campaigns</B> "._QXZ("LISTS RESETTING")." $verbiage:<BR>\n<UL>";
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
@@ -310,32 +316,51 @@ if ( ($LOGuser_level >= 9) and $LOGmodify_campaigns>0 and $LOGmodify_lists>0 and
|
||||
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='RESET', record_id='$reset_lead_called_campaigns', event_code='ADMIN RESET CAMPAIGN LISTS', event_sql=\"$SQL_log\", event_notes='';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
}
|
||||
}
|
||||
|
||||
while ($list_id_row=mysqli_fetch_array($list_id_rslt)) {
|
||||
$list_id=$list_id_row["list_id"];
|
||||
$upd_stmt="UPDATE vicidial_list SET called_since_last_reset='N' where list_id='$list_id';";
|
||||
$upd_rslt=mysql_to_mysqli($upd_stmt, $link);
|
||||
while ($list_id_row=mysqli_fetch_array($list_id_rslt))
|
||||
{
|
||||
$list_id = $list_id_row["list_id"];
|
||||
$daily_reset_limit = $list_id_row["daily_reset_limit"];
|
||||
$resets_today = $list_id_row["resets_today"];
|
||||
if ( ($daily_reset_limit > $resets_today) or ($daily_reset_limit < 0) )
|
||||
{
|
||||
$upd_stmt="UPDATE vicidial_lists SET resets_today=(resets_today + 1) where list_id='$list_id';";
|
||||
$upd_rslt=mysql_to_mysqli($upd_stmt, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQLdate=date("Y-m-d H:i:s");
|
||||
$SQL_log = "$upd_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='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
|
||||
echo "<LI>"._QXZ("LIST ID")." $list_id - ";
|
||||
if (mysqli_affected_rows($link)>0) {echo _QXZ("RESET")."<BR>";} else {echo "<B>"._QXZ("NOT")."</B> "._QXZ("RESET")."<BR>";}
|
||||
}
|
||||
$resets_today=($resets_today + 1);
|
||||
|
||||
$upd_stmtB="UPDATE vicidial_list SET called_since_last_reset='N' where list_id='$list_id';";
|
||||
$upd_rsltB=mysql_to_mysqli($upd_stmtB, $link);
|
||||
$affected_rowsB = mysqli_affected_rows($link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
$SQLdate=date("Y-m-d H:i:s");
|
||||
$SQL_log = "$upd_stmt|$upd_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='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN RESET LIST', event_sql=\"$SQL_log\", event_notes='$affected_rowsB leads reset, list resets today: $resets_today';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
|
||||
echo "<LI>"._QXZ("LIST ID")." $list_id - ";
|
||||
if ($affected_rowsB > 0) {echo _QXZ("RESET")."<BR>";} else {echo "<B>"._QXZ("NOT")."</B> "._QXZ("RESET")."<BR>";}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<LI>"._QXZ("LIST ID")." $list_id - <B>"._QXZ("NOT RESET, daily reset limit reached").": $daily_reset_limit / $resets_today</B><BR>";
|
||||
}
|
||||
}
|
||||
if (mysqli_num_rows($list_id_rslt)>0) {echo "</UL>";}
|
||||
if (mysqli_num_rows($list_id_rslt)<7) {
|
||||
if (mysqli_num_rows($list_id_rslt)<7)
|
||||
{
|
||||
for ($j=mysqli_num_rows($list_id_rslt); $j<7; $j++) {echo "<BR>";}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
else
|
||||
{
|
||||
echo "<BR><BR><BR><BR><BR><BR><BR> ";
|
||||
}
|
||||
}
|
||||
echo "</td></tr>";
|
||||
echo "</TABLE></center></form>\n";
|
||||
|
||||
@@ -349,15 +374,17 @@ if ( ($LOGuser_level >= 9) and $LOGmodify_campaigns>0 and $LOGmodify_lists>0 and
|
||||
if (!preg_match("/_BUILD_/",$SShosted_settings))
|
||||
{echo "<BR><a href=\"$PHP_SELF?ADD=999995\"><font color=white>© 2016 "._QXZ("ViciDial Group")."</font></a><BR><img src=\"images/pixel.gif\">";}
|
||||
echo "</font>\n";
|
||||
?>
|
||||
?>
|
||||
|
||||
</TD><TD BGCOLOR=#<?php echo $SSframe_background; ?>>
|
||||
</TD></TR><TABLE>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
} else {
|
||||
</TD><TD BGCOLOR=#<?php echo $SSframe_background; ?>>
|
||||
</TD></TR><TABLE>
|
||||
</body>
|
||||
</html>
|
||||
<?php
|
||||
}
|
||||
else
|
||||
{
|
||||
echo _QXZ("You are not authorized to view this page.");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user