added timeclock auto-logout script and associated changes to admin.php/install.pl/update_server_ip/timeclock.php scripts and the database
git-svn-id: svn://192.168.202.10@880 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
# 61011-1348 - first build
|
||||
# 61120-2011 - added option 7 for AST_VDauto_dial_FILL.pl
|
||||
# 80227-1526 - added option 8 for ip_relay
|
||||
# 80526-1350 - added option 9 for timeclock auto-logout
|
||||
#
|
||||
|
||||
$DB=0; # Debug flag
|
||||
@@ -85,6 +86,7 @@ foreach(@conf)
|
||||
# 6 - FastAGI_log\n";
|
||||
# 7 - AST_VDauto_dial_FILL\n";
|
||||
# 8 - ip_relay for blind monitoring\n";
|
||||
# 9 - Timeclock auto logout\n";
|
||||
|
||||
if ($VARactive_keepalives =~ /X/)
|
||||
{
|
||||
@@ -100,6 +102,7 @@ $AST_VDadapt=0;
|
||||
$FastAGI_log=0;
|
||||
$AST_VDauto_dial_FILL=0;
|
||||
$ip_relay=0;
|
||||
$timeclock_auto_logout=0;
|
||||
$runningAST_update=0;
|
||||
$runningAST_send=0;
|
||||
$runningAST_listen=0;
|
||||
@@ -150,6 +153,11 @@ if ($VARactive_keepalives =~ /8/)
|
||||
$ip_relay=1;
|
||||
if ($DB) {print "ip_relay set to keepalive\n";}
|
||||
}
|
||||
if ($VARactive_keepalives =~ /9/)
|
||||
{
|
||||
$timeclock_auto_logout=1;
|
||||
if ($DB) {print "Check to see if Timeclock auto logout should run\n";}
|
||||
}
|
||||
|
||||
$REGhome = $PATHhome;
|
||||
$REGhome =~ s/\//\\\//gi;
|
||||
@@ -419,6 +427,13 @@ if ( ($ip_relay > 0) && ($runningip_relay < 1) )
|
||||
|
||||
|
||||
|
||||
### run the Timeclock auto-logout process ###
|
||||
if ($timeclock_auto_logout > 0)
|
||||
{
|
||||
if ($DB) {print "running Timeclock auto-logout process...\n";}
|
||||
`/usr/bin/screen -d -m -S Timeclock $PATHhome/ADMIN_timeclock_auto_logout.pl 2>/dev/null 1>&2`;
|
||||
}
|
||||
|
||||
|
||||
if ($DB) {print "DONE\n";}
|
||||
|
||||
|
||||
@@ -336,6 +336,7 @@ print conf "# 5 - AST_VDadapt (If multi-server system, this must only be on one
|
||||
print conf "# 6 - FastAGI_log\n";
|
||||
print conf "# 7 - AST_VDauto_dial_FILL (only for multi-server, this must only be on one server)\n";
|
||||
print conf "# 8 - ip_relay (used for blind agent monitoring)\n";
|
||||
print conf "# 9 - Timeclock auto logout\n";
|
||||
print conf "VARactive_keepalives => $VARactive_keepalives\n";
|
||||
print conf "\n";
|
||||
print conf "# FTP recording archive connection information\n";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Timeclock process flow 2008-05-12
|
||||
|
||||
** THIS TIMECLOCK FUNCTIONALITY PROSESS IS PLANNED FOR THE 2.0.5 RELEASE **
|
||||
** THIS TIMECLOCK FUNCTIONALITY PROCESS IS PLANNED FOR THE 2.0.5 RELEASE **
|
||||
|
||||
This will outline the process I have thought through for adding a timeclock component to the VICIDIAL system. The objective is to add the following features to make VICIDIAL a more well-rounded product:
|
||||
- Allow vicidial users to clock-in to the system
|
||||
@@ -23,6 +23,7 @@ To facilitate more workforce management, as is desired with the addition of a ti
|
||||
Newly Created Scripts:
|
||||
timeclock.php - linked to from vicidial.php/admin.php/welcome.php to give easy access for users to use the timeclock and then go back to what they were doing.
|
||||
|
||||
timeclock_auto_logout.pl - script that runs at the defined system_settings.timeclock_end_of_day field that will go through all agents that are currently logged into the timeclock for the day and log them out with the AUTOLOGOUT event. Only runs once a day. Triggered by the ADMIN_keepalive_all.pl script. Defined to run by the '9' flag in the keepalive settings of the astguiclient.conf file
|
||||
|
||||
|
||||
More to come...
|
||||
@@ -99,3 +100,6 @@ index (timeclock_id),
|
||||
index (user)
|
||||
);
|
||||
|
||||
# system settings added fields to define the time when all logged-in agents are to be auto-logged out
|
||||
ALTER TABLE system_settings ADD timeclock_end_of_day VARCHAR(4) default '0000';
|
||||
ALTER TABLE system_settings ADD timeclock_last_reset_date DATE;
|
||||
|
||||
@@ -947,6 +947,8 @@ admin_home_url VARCHAR(255) default '../vicidial/welcome.php',
|
||||
enable_agc_xfer_log ENUM('0','1') default '0',
|
||||
db_schema_version INT(8) UNSIGNED default '0',
|
||||
auto_user_add_value INT(9) UNSIGNED default '101',
|
||||
timeclock_end_of_day VARCHAR(4) default '0000',
|
||||
timeclock_last_reset_date DATE
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_campaigns_list_mix (
|
||||
@@ -1175,5 +1177,5 @@ INSERT INTO vicidial_state_call_times SET state_call_time_id='utah',state_call_t
|
||||
INSERT INTO vicidial_state_call_times SET state_call_time_id='washington',state_call_time_state='WA',state_call_time_name='Washington 8am',sct_default_start='800',sct_default_stop='2100';
|
||||
INSERT INTO vicidial_state_call_times SET state_call_time_id='wyoming',state_call_time_state='WY',state_call_time_name='Wyoming 8am-8pm',sct_default_start='800',sct_default_stop='2000';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1089';
|
||||
UPDATE system_settings SET db_schema_version='1090';
|
||||
|
||||
|
||||
@@ -213,3 +213,9 @@ index (user)
|
||||
);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1089';
|
||||
|
||||
ALTER TABLE system_settings ADD timeclock_end_of_day VARCHAR(4) default '0000';
|
||||
ALTER TABLE system_settings ADD timeclock_last_reset_date DATE;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1090';
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
# 80122-0320 - Added build_phones_conf flag to generate phones conf entries from phones table records
|
||||
# 80227-1536 - Added ip_relay to keepalive list
|
||||
# 80316-2208 - Added $PATHlogs/archive for backups
|
||||
# 80526-1345 - Added Timeclock auto-logout option 9
|
||||
#
|
||||
|
||||
############################################
|
||||
@@ -163,6 +164,7 @@ if (length($ARGV[0])>1)
|
||||
print " 6 - FastAGI_log\n";
|
||||
print " 7 - AST_VDauto_dial_FILL (only for multi-server, this must only be on one server)\n";
|
||||
print " 8 - ip_relay (used for blind agent monitoring)\n";
|
||||
print " 9 - Timeclock auto-logout\n";
|
||||
print " [--copy_sample_conf_files] = copies the sample conf files to /etc/asterisk/\n";
|
||||
print " [--FTP_host=192.168.0.2] = define recording archive server IP address at runtime\n";
|
||||
print " [--FTP_user=cron] = define archive server name at runtime\n";
|
||||
@@ -1560,6 +1562,7 @@ else
|
||||
print " 6 - FastAGI_log\n";
|
||||
print " 7 - AST_VDauto_dial_FILL (only for multi-server, this must only be on one server)\n";
|
||||
print " 8 - ip_relay (used for blind agent monitoring)\n";
|
||||
print " 9 - Timeclock auto logout\n";
|
||||
print "Enter active keepalives or press enter for default: [$VARactive_keepalives] ";
|
||||
$PROMPTactive_keepalives = <STDIN>;
|
||||
chomp($PROMPTactive_keepalives);
|
||||
@@ -2067,6 +2070,7 @@ print conf "# 5 - AST_VDadapt (If multi-server system, this must only be on one
|
||||
print conf "# 6 - FastAGI_log\n";
|
||||
print conf "# 7 - AST_VDauto_dial_FILL (only for multi-server, this must only be on one server)\n";
|
||||
print conf "# 8 - ip_relay (used for blind agent monitoring)\n";
|
||||
print conf "# 9 - Timeclock auto logout\n";
|
||||
print conf "VARactive_keepalives => $VARactive_keepalives\n";
|
||||
print conf "\n";
|
||||
print conf "# FTP recording archive connection information\n";
|
||||
|
||||
@@ -154,6 +154,10 @@ Saturday||
|
||||
Group Shifts: ||
|
||||
Group Shifts -<\/B> This is a selectable list of shifts that can restrict the agents login time on the system||
|
||||
Timeclock||
|
||||
Timeclock End Of Day -<\/B> This setting defines when all users are to be auto logged out of the timeclock system. Only runs once a day. must be only 4 digits 2 digit hour and 2 digit minutes in 24 hour time. Default is 0000||
|
||||
Timeclock Last Auto Logout -<\/B> This field displays the date of the last auto-logout||
|
||||
Timeclock Last Auto Logout: ||
|
||||
Timeclock End Of Day: ||
|
||||
|
||||
|
||||
############################################################ CLIENT
|
||||
|
||||
@@ -260,7 +260,7 @@ if ( ($stage == 'login') or ($stage == 'logout') )
|
||||
|
||||
if ($commit == 'YES')
|
||||
{
|
||||
if ( ( ($status=='AUTO_LOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage=='login') )
|
||||
if ( ( ($status=='AUTOLOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage=='login') )
|
||||
{
|
||||
$VDdisplayMESSAGE = "You have now logged-in";
|
||||
$LOGtimeMESSAGE = "You logged in at $NOW_TIME";
|
||||
@@ -330,7 +330,7 @@ if ( ($stage == 'login') or ($stage == 'logout') )
|
||||
print "<!-- vicidial_timeclock_audit_log record updated for $user: |$affected_rows| -->\n";
|
||||
}
|
||||
|
||||
if ( ( ( ($status=='AUTO_LOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) )
|
||||
if ( ( ( ($status=='AUTOLOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage=='logout') ) or ( ($status=='LOGIN') and ($stage=='login') ) )
|
||||
{echo "ERROR: timeclock log entry already made: $status|$stage"; exit;}
|
||||
|
||||
if ($referrer=='agent')
|
||||
@@ -364,7 +364,7 @@ if ( ($stage == 'login') or ($stage == 'logout') )
|
||||
|
||||
|
||||
|
||||
if ( ($status=='AUTO_LOGOUT') or ($status=='START') or ($status=='LOGOUT') )
|
||||
if ( ($status=='AUTOLOGOUT') or ($status=='START') or ($status=='LOGOUT') )
|
||||
{
|
||||
$VDdisplayMESSAGE = "Time since you were last logged-in: $totTIME_HMS";
|
||||
$log_action = 'login';
|
||||
|
||||
+20
-5
@@ -727,6 +727,9 @@ if (isset($_GET["shift_weekdays"])) {$shift_weekdays=$_GET["shift_weekdays"];
|
||||
elseif (isset($_POST["shift_weekdays"])) {$shift_weekdays=$_POST["shift_weekdays"];}
|
||||
if (isset($_GET["group_shifts"])) {$group_shifts=$_GET["group_shifts"];}
|
||||
elseif (isset($_POST["group_shifts"])) {$group_shifts=$_POST["group_shifts"];}
|
||||
if (isset($_GET["timeclock_end_of_day"])) {$timeclock_end_of_day=$_GET["timeclock_end_of_day"];}
|
||||
elseif (isset($_POST["timeclock_end_of_day"])) {$timeclock_end_of_day=$_POST["timeclock_end_of_day"];}
|
||||
|
||||
|
||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||
if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);}
|
||||
@@ -885,6 +888,7 @@ $qc_commit = ereg_replace("[^0-9]","",$qc_commit);
|
||||
$campaign_shift_start_time = ereg_replace("[^0-9]","",$campaign_shift_start_time);
|
||||
$campaign_day_start_time = ereg_replace("[^0-9]","",$campaign_day_start_time);
|
||||
$shift_start_time = ereg_replace("[^0-9]","",$shift_start_time);
|
||||
$timeclock_end_of_day = ereg_replace("[^0-9]","",$timeclock_end_of_day);
|
||||
|
||||
### DIGITS and COLONS
|
||||
$shift_length = ereg_replace("[^\:0-9]","",$shift_length);
|
||||
@@ -3778,6 +3782,16 @@ The VICIDIAL basic web-based lead loader is designed simply to take a lead file
|
||||
<BR>
|
||||
<B>Enable Agent Transfer Logfile -</B> This option will log to a text logfile on the webserver every time a call is transferred to an agent. Default is 0, disabled.
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-timeclock_end_of_day">
|
||||
<BR>
|
||||
<B>Timeclock End Of Day -</B> This setting defines when all users are to be auto logged out of the timeclock system. Only runs once a day. must be only 4 digits 2 digit hour and 2 digit minutes in 24 hour time. Default is 0000.
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-timeclock_last_reset_date">
|
||||
<BR>
|
||||
<B>Timeclock Last Auto Logout -</B> This field displays the date of the last auto-logout.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8188,7 +8202,7 @@ if ($ADD==411111111111111)
|
||||
|
||||
echo "<br>VICIDIAL SYSTEM SETTINGS MODIFIED\n";
|
||||
|
||||
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log';";
|
||||
$stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG CHANGES TO LOG FILE ###
|
||||
@@ -13643,7 +13657,7 @@ if ($ADD==311111111111111)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value from system_settings;";
|
||||
$stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date from system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$version = $row[0];
|
||||
@@ -13664,6 +13678,8 @@ if ($ADD==311111111111111)
|
||||
$enable_agc_xfer_log = $row[15];
|
||||
$db_schema_version = $row[16];
|
||||
$auto_user_add_value = $row[17];
|
||||
$timeclock_end_of_day = $row[18];
|
||||
$timeclock_last_reset_date = $row[19];
|
||||
|
||||
echo "<br>MODIFY VICIDIAL SYSTEM SETTINGS<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=ADD value=411111111111111>\n";
|
||||
@@ -13675,7 +13691,6 @@ if ($ADD==311111111111111)
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Use Non-Latin: </td><td align=left><select size=1 name=use_non_latin><option>1</option><option>0</option><option selected>$use_non_latin</option></select>$NWB#settings-use_non_latin$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Webroot Writable: </td><td align=left><select size=1 name=webroot_writable><option>1</option><option>0</option><option selected>$webroot_writable</option></select>$NWB#settings-webroot_writable$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Enable QueueMetrics Logging: </td><td align=left><select size=1 name=enable_queuemetrics_logging><option>1</option><option>0</option><option selected>$enable_queuemetrics_logging</option></select>$NWB#settings-enable_queuemetrics_logging$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>QueueMetrics Server IP: </td><td align=left><input type=text name=queuemetrics_server_ip size=18 maxlength=15 value=\"$queuemetrics_server_ip\">$NWB#settings-queuemetrics_server_ip$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>QueueMetrics DB Name: </td><td align=left><input type=text name=queuemetrics_dbname size=18 maxlength=50 value=\"$queuemetrics_dbname\">$NWB#settings-queuemetrics_dbname$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>QueueMetrics DB Login: </td><td align=left><input type=text name=queuemetrics_login size=18 maxlength=50 value=\"$queuemetrics_login\">$NWB#settings-queuemetrics_login$NWE</td></tr>\n";
|
||||
@@ -13702,8 +13717,8 @@ if ($ADD==311111111111111)
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Allow SIPSAK Messages: </td><td align=left><select size=1 name=allow_sipsak_messages><option>1</option><option>0</option><option selected>$allow_sipsak_messages</option></select>$NWB#settings-allow_sipsak_messages$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Admin Home URL: </td><td align=left><input type=text name=admin_home_url size=50 maxlength=255 value=\"$admin_home_url\">$NWB#settings-admin_home_url$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Enable Agent Transfer Logfile: </td><td align=left><select size=1 name=enable_agc_xfer_log><option>1</option><option>0</option><option selected>$enable_agc_xfer_log</option></select>$NWB#settings-enable_agc_xfer_log$NWE</td></tr>\n";
|
||||
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Timeclock End Of Day: </td><td align=left><input type=text name=timeclock_end_of_day size=5 maxlength=4 value=\"$timeclock_end_of_day\">$NWB#settings-timeclock_end_of_day$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Timeclock Last Auto Logout: </td><td align=left> $timeclock_last_reset_date</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=submit VALUE=SUBMIT></td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
Reference in New Issue
Block a user