diff --git a/bin/ADMIN_keepalive_ALL.pl b/bin/ADMIN_keepalive_ALL.pl index cd18d1e7..dc0661b4 100644 --- a/bin/ADMIN_keepalive_ALL.pl +++ b/bin/ADMIN_keepalive_ALL.pl @@ -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";} diff --git a/bin/ADMIN_update_server_ip.pl b/bin/ADMIN_update_server_ip.pl index 1199a90c..f867be74 100644 --- a/bin/ADMIN_update_server_ip.pl +++ b/bin/ADMIN_update_server_ip.pl @@ -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"; diff --git a/docs/TIMECLOCK_PROCESS.txt b/docs/TIMECLOCK_PROCESS.txt index 3a9b0ac1..d9b1ae22 100644 --- a/docs/TIMECLOCK_PROCESS.txt +++ b/docs/TIMECLOCK_PROCESS.txt @@ -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; diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 1f724a0a..6ec753eb 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -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'; diff --git a/extras/upgrade_2.0.5.sql b/extras/upgrade_2.0.5.sql index cc2b1a80..dff56882 100644 --- a/extras/upgrade_2.0.5.sql +++ b/extras/upgrade_2.0.5.sql @@ -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'; + diff --git a/install.pl b/install.pl index 103a6c01..29e0c3bd 100644 --- a/install.pl +++ b/install.pl @@ -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 = ; 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"; diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt index 43dda2a9..aeeac2d8 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.0.5.txt @@ -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 diff --git a/www/agc/timeclock.php b/www/agc/timeclock.php index 08cee3b1..a7ef018b 100644 --- a/www/agc/timeclock.php +++ b/www/agc/timeclock.php @@ -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 "\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'; diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 9965ca19..fc227b75 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -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
Enable Agent Transfer Logfile - This option will log to a text logfile on the webserver every time a call is transferred to an agent. Default is 0, disabled. +
+ +
+Timeclock End Of Day - 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 - This field displays the date of the last auto-logout. + @@ -8188,7 +8202,7 @@ if ($ADD==411111111111111) echo "
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 "\n"; echo "\n"; echo "\n"; - echo "\n"; echo "\n"; echo "\n"; @@ -13702,8 +13717,8 @@ if ($ADD==311111111111111) echo "\n"; echo "\n"; echo "\n"; - - + echo "\n"; + echo "\n"; echo "\n"; echo "
\n"; echo ""; - $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 "
MODIFY VICIDIAL SYSTEM SETTINGS
\n"; echo "\n"; @@ -13675,7 +13691,6 @@ if ($ADD==311111111111111) echo "
Use Non-Latin: $NWB#settings-use_non_latin$NWE
Webroot Writable: $NWB#settings-webroot_writable$NWE
Enable QueueMetrics Logging: $NWB#settings-enable_queuemetrics_logging$NWE
QueueMetrics Server IP: $NWB#settings-queuemetrics_server_ip$NWE
QueueMetrics DB Name: $NWB#settings-queuemetrics_dbname$NWE
QueueMetrics DB Login: $NWB#settings-queuemetrics_login$NWE
Allow SIPSAK Messages: $NWB#settings-allow_sipsak_messages$NWE
Admin Home URL: $NWB#settings-admin_home_url$NWE
Enable Agent Transfer Logfile: $NWB#settings-enable_agc_xfer_log$NWE
Timeclock End Of Day: $NWB#settings-timeclock_end_of_day$NWE
Timeclock Last Auto Logout: $timeclock_last_reset_date
\n"; echo "\n";