From b181434db313c2932d8c165f0ba0e78b440fcc6f Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 23 May 2008 20:52:14 +0000 Subject: [PATCH] Added timeclock.php for user timeclock logging in and out and linked to it from vicidial.php/admin.php/welcome.php Added vicidial_redirect.php for easy redirection of bookmarked vicidial.php phone login links Fixed bug in service level report git-svn-id: svn://192.168.202.10@872 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 3 +- docs/TIMECLOCK_PROCESS.txt | 5 +- extras/MySQL_AST_CREATE_tables.sql | 32 +- extras/upgrade_2.0.5.sql | 33 ++ extras/vicidial_modules.sh | 158 +++++++ .../TO_BE_TRANSLATED_2.0.5.txt | 20 + www/agc/timeclock.php | 429 ++++++++++++++++++ www/agc/vicidial.php | 18 +- www/agc/vicidial_redirect.php | 46 ++ www/vicidial/AST_CLOSER_service_level.php | 4 +- www/vicidial/admin.php | 2 +- www/vicidial/welcome.php | 2 + 12 files changed, 739 insertions(+), 13 deletions(-) create mode 100644 extras/vicidial_modules.sh create mode 100644 www/agc/timeclock.php create mode 100644 www/agc/vicidial_redirect.php diff --git a/UPGRADE b/UPGRADE index a1ed9041..53a86d99 100644 --- a/UPGRADE +++ b/UPGRADE @@ -110,7 +110,8 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom 22. The start of a new timeclock feature (not finished), including the addition of shifts to VICIDIAL user groups and the ability to auto-generate - user IDs as you are adding users to the system. + user IDs as you are adding users to the system. timeclock.php user login + page created and linked to from admin/agent/welcome screens 23. Added a new inbound/closer report for showing service levels diff --git a/docs/TIMECLOCK_PROCESS.txt b/docs/TIMECLOCK_PROCESS.txt index dccf2bf4..d35df405 100644 --- a/docs/TIMECLOCK_PROCESS.txt +++ b/docs/TIMECLOCK_PROCESS.txt @@ -45,15 +45,12 @@ index (shift_id) # add field for allowable shifts for user groups ALTER TABLE vicidial_user_groups ADD group_shifts TEXT; - - - - # This table contains the log of timeclock activity CREATE TABLE vicidial_timeclock_log ( timeclock_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, event_epoch INT(10) UNSIGNED NOT NULL, event_date TIMESTAMP NOT NULL, +login_sec INT(10) UNSIGNED, event VARCHAR(50) NOT NULL, user VARCHAR(20) NOT NULL, user_group VARCHAR(20) NOT NULL, diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index fc6badc1..75a7bbba 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -737,7 +737,8 @@ dispo_sec SMALLINT(5) UNSIGNED default '0', status VARCHAR(6), user_group VARCHAR(20), comments VARCHAR(20), -sub_status VARCHAR(6) +sub_status VARCHAR(6), +index (lead_id) ); CREATE TABLE vicidial_scripts ( @@ -1078,6 +1079,33 @@ shift_start_time VARCHAR(4) default '0900', shift_length VARCHAR(5) default '16:00', shift_weekdays VARCHAR(7) default '0123456', index (shift_id) +); + + CREATE TABLE vicidial_timeclock_log ( +timeclock_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, +event_epoch INT(10) UNSIGNED NOT NULL, +event_date TIMESTAMP NOT NULL, +login_sec INT(10) UNSIGNED, +event VARCHAR(50) NOT NULL, +user VARCHAR(20) NOT NULL, +user_group VARCHAR(20) NOT NULL, +ip_address VARCHAR(15), +shift_id VARCHAR(20), +notes VARCHAR(255), +manager_user VARCHAR(20), +manager_ip VARCHAR(15), +index (user) +); + + CREATE TABLE vicidial_timeclock_status ( +user VARCHAR(20) UNIQUE NOT NULL, +user_group VARCHAR(20) NOT NULL, +event_epoch INT(10) UNSIGNED, +event_date TIMESTAMP, +status VARCHAR(50), +ip_address VARCHAR(15), +shift_id VARCHAR(20), +index (user) ); ALTER TABLE vicidial_campaign_server_stats ENGINE=HEAP; @@ -1129,5 +1157,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='1084'; +UPDATE system_settings SET db_schema_version='1086'; diff --git a/extras/upgrade_2.0.5.sql b/extras/upgrade_2.0.5.sql index 8e339a0f..612eb8de 100644 --- a/extras/upgrade_2.0.5.sql +++ b/extras/upgrade_2.0.5.sql @@ -150,3 +150,36 @@ index (shift_id) ALTER TABLE vicidial_user_groups ADD group_shifts TEXT; UPDATE system_settings SET db_schema_version='1084'; + +CREATE INDEX lead_id ON vicidial_agent_log (lead_id); + +UPDATE system_settings SET db_schema_version='1085'; + + CREATE TABLE vicidial_timeclock_log ( +timeclock_id INT(9) UNSIGNED AUTO_INCREMENT PRIMARY KEY NOT NULL, +event_epoch INT(10) UNSIGNED NOT NULL, +event_date TIMESTAMP NOT NULL, +login_sec INT(10) UNSIGNED, +event VARCHAR(50) NOT NULL, +user VARCHAR(20) NOT NULL, +user_group VARCHAR(20) NOT NULL, +ip_address VARCHAR(15), +shift_id VARCHAR(20), +notes VARCHAR(255), +manager_user VARCHAR(20), +manager_ip VARCHAR(15), +index (user) +); + + CREATE TABLE vicidial_timeclock_status ( +user VARCHAR(20) UNIQUE NOT NULL, +user_group VARCHAR(20) NOT NULL, +event_epoch INT(10) UNSIGNED, +event_date TIMESTAMP, +status VARCHAR(50), +ip_address VARCHAR(15), +shift_id VARCHAR(20), +index (user) +); + +UPDATE system_settings SET db_schema_version='1086'; diff --git a/extras/vicidial_modules.sh b/extras/vicidial_modules.sh new file mode 100644 index 00000000..0c86d4fb --- /dev/null +++ b/extras/vicidial_modules.sh @@ -0,0 +1,158 @@ +#!/bin/sh + +# +# perl_modules.sh +# +# Developed by Vivian Alan +# Copyright (c) 2008 International Telnet Inc. +# Licensed under terms of GNU General Public License. +# All rights reserved. +# +# Changelog: +# 2008-01-23 - created +# + +# $Platon$ + +echo "Step 1 : Install Perl Modules Accept defaults in most cases" +echo "" + +cpan -if MD5 +cpan -if Digest::MD5 +cpan -if Digest::SHA1 +cpan -if readline +cpan -if Bundle::CPAN +# reload CPAN +# cpan ?? +cpan reload +cpan -if DBI +cpan -if DBD::mysql +cpan -if Net::Telnet +cpan -if Time::HiRes +cpan -if Net::Server +cpan -if Unicode::Map +cpan -if Jcode +cpan -if Spreadsheet::WriteExcel +cpan -if OLE::Storage_Lite +cpan -if Proc::ProcessTable +cpan -if IO::Scalar +cpan -if Spreadsheet::ParseExcel + +echo "Download and install asterisk-perl......" +echo "" + +cd /usr/src/vicidial + +wget http://asterisk.gnuinter.net/files/asterisk-perl-0.10.tar.gz + +tar -xvzf asterisk-perl-0.10.tar.gz + +cd asterisk-perl-0.10 + +perl Makefile.PL + +make + +make install + +cd /usr/src/vicidial + + +echo "Download and install sox mix source......" +echo "" + +wget http://easynews.dl.sourceforge.net/sourceforge/sox/sox-12.17.9.tar.gz + +tar -xvzf sox-12.17.9.tar.gz + +cd sox-12.17.9 + +./configure + +make + +make install + +cd /usr/src/vicidial + +echo "Dowload and install ttyload...." +echo "" + +wget http://www.daveltd.com/src/util/ttyload/ttyload-0.4.4.tar.gz + +tar -xvzf ttyload-0.4.4.tar.gz + +cd ttyload-0.4.4 + +make + +make install + +cd /usr/src/vicidial + +echo "Update ntpd libraries....." +echo "" + +yum install ntp.i386 + +echo "Download and install iftop and dependencies...." +echo "" + +wget http://www.tcpdump.org/release/libpcap-0.9.8.tar.gz + +tar -xvzf libpcap-0.9.8.tar.gz + +cd libpcap-0.9.8 + +./configure + +make + +make install + +cd /usr/src/vicidial + +wget http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz + + +tar -xvzf iftop-0.17.tar.gz + +cd iftop-0.17 + +./configure + +make + +make install + +echo "Download and install ploticus, needs X11 installed....." +echo "" + +cd /usr/src/vicidial + +wget http://internap.dl.sourceforge.net/sourceforge/ploticus/pl240src.tar.gz + +tar -xvzf pl240src.tar.gz + +cd pl240src/src + +make clean + +make + +make install + +echo "Download and install balance from inlab.de........" +echo "" + +cd /usr/src/vicidial + +wget http://www.inlab.de/balance-3.40.tar.gz + +tar -xvzf balance-3.40.tar.gz + +cd balance-3.40 + +make + +make install 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 119f0145..43dda2a9 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 @@ -153,6 +153,7 @@ Friday|| Saturday|| Group Shifts: || Group Shifts -<\/B> This is a selectable list of shifts that can restrict the agents login time on the system|| + Timeclock|| ############################################################ CLIENT @@ -161,10 +162,29 @@ Gender: || Date of Birth: || YOU MUST BE PAUSED TO CHANGE GROUPS|| Calls in Queue:|| + Timeclock|| +The user and password you entered are not active in the system|| +Please try again|| +You cannot log in or out within 30 seconds of your last login or logout|| +You have now logged-out|| +You logged out at || +Amount of time you were logged-in: || +ERROR: timeclock log entry already made: || +BACK to Agent Login Screen|| +BACK to Administration|| +BACK to Welcome Screen|| +Time since you were last logged-in: || +You last logged-out at: || +Click LOGIN below to log-in|| +Amount of time you have been logged-in: || +You logged-in at:|| +Click LOGOUT below to log-out|| ############################################################ MANAGER Manual +Add agc/timeclock.php to all agent definitions files + ############################################################ AGENT Manual diff --git a/www/agc/timeclock.php b/www/agc/timeclock.php new file mode 100644 index 00000000..6da8b6f6 --- /dev/null +++ b/www/agc/timeclock.php @@ -0,0 +1,429 @@ + LICENSE: AGPLv2 +# +# CHANGELOG +# 80523-0134 - First Build +# + +$version = '2.0.5-1'; +$build = '80523-0134'; + +$StarTtimE = date("U"); +$NOW_TIME = date("Y-m-d H:i:s"); + $last_action_date = $NOW_TIME; + +$US='_'; +$CL=':'; +$AT='@'; +$DS='-'; +$date = date("r"); +$ip = getenv("REMOTE_ADDR"); +$browser = getenv("HTTP_USER_AGENT"); +$script_name = getenv("SCRIPT_NAME"); +$server_name = getenv("SERVER_NAME"); +$server_port = getenv("SERVER_PORT"); +if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} + else {$HTTPprotocol = 'http://';} +if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} +else {$server_port = "$CL$server_port";} +$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; +$agcDIR = eregi_replace('timeclock.php','',$agcPAGE); + + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} +if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["stage"])) {$stage=$_GET["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} +if (isset($_GET["commit"])) {$commit=$_GET["commit"];} + elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];} +if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];} + elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];} +if (isset($_GET["user"])) {$user=$_GET["user"];} + elseif (isset($_POST["user"])) {$user=$_POST["user"];} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + +if (!isset($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } + +### security strip all non-alphanumeric characters out of the variables ### + $DB=ereg_replace("[^0-9a-z]","",$DB); + $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login); + $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass); + $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login); + $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass); + $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign); + $user=ereg_replace("[^0-9a-zA-Z]","",$user); + $pass=ereg_replace("[^0-9a-zA-Z]","",$pass); + $stage=ereg_replace("[^0-9a-zA-Z]","",$stage); + $commit=ereg_replace("[^0-9a-zA-Z]","",$commit); + $referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer); + +require("dbconnect.php"); + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,admin_home_url FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +$i=0; +while ($i < $qm_conf_ct) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $welcomeURL = $row[1]; + $i++; + } +##### END SETTINGS LOOKUP ##### +########################################### + + +header ("Content-type: text/html; charset=utf-8"); +header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 +header ("Pragma: no-cache"); // HTTP/1.0 + +if ( ($stage == 'login') or ($stage == 'logout') ) + { + ### see if user/pass exist for this user in vicidial_users table + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $valid_user=$row[0]; + print "\n"; + + if ($valid_user < 1) + { + ### NOT A VALID USER/PASS + $VDdisplayMESSAGE = "The user and password you entered are not active in the system
Please try again:"; + + echo"\n"; + echo"VICIDIAL: Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
User Login:
User Password:
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + else + { + ### VALID USER/PASS, CONTINUE + + ### get name and group for this user + $stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + $user_group = $row[1]; + print "\n"; + + ### get vicidial_timeclock_status record count for this user + $stmt="SELECT count(*) from vicidial_timeclock_status where user='$user';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $vts_count = $row[0]; + + $last_action_sec=99; + + if ($vts_count > 0) + { + ### vicidial_timeclock_status record found, grab status and date of last activity + $stmt="SELECT status,event_epoch from vicidial_timeclock_status where user='$user';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $status = $row[0]; + $event_epoch = $row[1]; + $last_action_date = date("Y-m-d H:i:s", $event_epoch); + $last_action_sec = ($StarTtimE - $event_epoch); + if ($last_action_sec > 0) + { + $totTIME_H = ($last_action_sec / 3600); + $totTIME_H_int = round($totTIME_H, 2); + $totTIME_H_int = intval("$totTIME_H"); + $totTIME_M = ($totTIME_H - $totTIME_H_int); + $totTIME_M = ($totTIME_M * 60); + $totTIME_M_int = round($totTIME_M, 2); + $totTIME_M_int = intval("$totTIME_M"); + $totTIME_S = ($totTIME_M - $totTIME_M_int); + $totTIME_S = ($totTIME_S * 60); + $totTIME_S = round($totTIME_S, 0); + if (strlen($totTIME_H_int) < 1) {$totTIME_H_int = "0";} + if ($totTIME_M_int < 10) {$totTIME_M_int = "0$totTIME_M_int";} + if ($totTIME_S < 10) {$totTIME_S = "0$totTIME_S";} + $totTIME_HMS = "$totTIME_H_int:$totTIME_M_int:$totTIME_S"; + } + else + { + $totTIME_HMS='0:00:00'; + } + + print "\n"; + } + else + { + ### No vicidial_timeclock_status record found, insert one + $stmt="INSERT INTO vicidial_timeclock_status set status='START', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $status='START'; + $totTIME_HMS='0:00:00'; + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + if ( ($last_action_sec < 30) and ($status != 'START') ) + { + ### You cannot log in or out within 30 seconds of your last login/logout + $VDdisplayMESSAGE = "You cannot log in or out within 30 seconds of your last login or logout"; + + echo"\n"; + echo"VICIDIAL: Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
User Login:
User Password:
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + if ($commit == 'YES') + { + if ( ( ($status=='AUTO_LOGOUT') or ($status=='START') or ($status=='LOGOUT') ) and ($stage=='login') ) + { + $VDdisplayMESSAGE = "You have now logged-in"; + $LOGtimeMESSAGE = "You logged in at $NOW_TIME"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='LOGIN', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGIN', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ($status=='LOGIN') and ($stage=='logout') ) + { + $VDdisplayMESSAGE = "You have now logged-out"; + $LOGtimeMESSAGE = "You logged out at $NOW_TIME
Amount of time you were logged-in: $totTIME_HMS"; + + ### Add a record to the timeclock log + $stmt="INSERT INTO vicidial_timeclock_log set event='LOGOUT', user='$user', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip', login_sec='$last_action_sec';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update last login record in the timeclock log + $stmt="UPDATE vicidial_timeclock_log set login_sec='$last_action_sec' where event='LOGIN' and user='$user' order by timeclock_id desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + + ### Update the user's timeclock status record + $stmt="UPDATE vicidial_timeclock_status set status='LOGOUT', user_group='$user_group', event_epoch='$StarTtimE', ip_address='$ip';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + print "\n"; + } + + if ( ( ( ($status=='AUTO_LOGOUT') 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') + {$BACKlink = "BACK to Agent Login Screen";} + if ($referrer=='admin') + {$BACKlink = "BACK to Administration";} + if ($referrer=='welcome') + {$BACKlink = "BACK to Welcome Screen";} + + echo"\n"; + echo"VICIDIAL: Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
$BACKlink
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + + if ( ($status=='AUTO_LOGOUT') or ($status=='START') or ($status=='LOGOUT') ) + { + $VDdisplayMESSAGE = "Time since you were last logged-in: $totTIME_HMS"; + $log_action = 'login'; + $button_name = 'LOGIN'; + $LOGtimeMESSAGE = "You last logged-out at: $last_action_date

Click LOGIN below to log-in"; + } + if ($status=='LOGIN') + { + $VDdisplayMESSAGE = "Amount of time you have been logged-in: $totTIME_HMS"; + $log_action = 'logout'; + $button_name = 'LOGOUT'; + $LOGtimeMESSAGE = "You logged-in at: $last_action_date
Amount of time you have been logged-in: $totTIME_HMS

Click LOGOUT below to log-out"; + } + + echo"\n"; + echo"VICIDIAL: Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
$LOGtimeMESSAGE
 
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + + exit; + } + + + + } + +else + { + echo"\n"; + echo"VICIDIAL: Timeclock\n"; + echo"\n"; + echo"\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

$VDdisplayMESSAGE

"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo ""; + echo "\n"; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Timeclock
 
User Login:
User Password:
 

VERSION: $version       BUILD: $build
\n"; + echo "\n\n"; + echo "\n\n"; + echo "\n\n"; + } + +exit; + +?> diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php index 736e40a9..1853f36c 100644 --- a/www/agc/vicidial.php +++ b/www/agc/vicidial.php @@ -6,6 +6,7 @@ # Other scripts that this application depends on: # - vdc_db_query.php: Updates information in the database # - manager_send.php: Sends manager actions to the DB for execution +# - conf_exten_check.php: time sync and status updater, calls in queue # # CHANGELOG # 50607-1426 - First Build of VICIDIAL web client basic login process finished @@ -176,10 +177,11 @@ # 80505-0054 - Added multi-phones load-balanced alias option # 80507-0932 - Fixed Script display bug (+ instead of space) # 80519-1425 - Added calls in queue display +# 80523-1630 - Added Tiemclock links # -$version = '2.0.5-155'; -$build = '80519-1425'; +$version = '2.0.5-156'; +$build = '80523-1630'; require("dbconnect.php"); @@ -469,6 +471,7 @@ if ($relogin == 'YES') echo "VICIDIAL web client: Re-Login\n"; echo "\n"; echo "\n"; +echo " Timeclock
\n"; echo "\n"; echo "\n"; echo "
\n"; @@ -505,6 +508,7 @@ if ($user_login_first == 1) echo "VICIDIAL web client: Campaign Login\n"; echo "\n"; echo "\n"; + echo " Timeclock
\n"; echo "\n"; echo "\n"; echo "
\n"; @@ -547,6 +551,7 @@ if ($user_login_first == 1) echo "VICIDIAL web client: Login\n"; echo "\n"; echo "\n"; + echo " Timeclock
\n"; echo "\n"; echo "\n"; echo "
\n"; @@ -585,6 +590,7 @@ if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) echo "VICIDIAL web client: Phone Login\n"; echo "\n"; echo "\n"; +echo " Timeclock
\n"; echo "\n"; echo "\n"; echo "
\n"; @@ -666,6 +672,7 @@ $VDloginDISPLAY=0; echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; echo "\n"; echo "\n"; + echo " Timeclock
\n"; echo "\n"; echo "\n"; echo "
\n"; @@ -918,6 +925,7 @@ $VDloginDISPLAY=0; echo "VICIDIAL web client: Campaign Login\n"; echo "\n"; echo "\n"; + echo " Timeclock
\n"; echo "\n"; echo "\n"; echo "
\n"; @@ -1002,6 +1010,7 @@ if (!$authphone) echo "VICIDIAL web client: Phone Login Error\n"; echo "\n"; echo "\n"; + echo " Timeclock
\n"; echo "\n"; echo "\n"; echo "
\n"; @@ -1280,7 +1289,8 @@ else } - $stmt="UPDATE vicidial_list set status='N', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; + ### mark leads that were not dispositioned during previous calls as ERI + $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -1445,6 +1455,7 @@ else echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; echo "\n"; echo "\n"; + echo " Timeclock
\n"; echo "\n"; echo "\n"; echo "
\n"; @@ -1468,6 +1479,7 @@ else echo "VICIDIAL web client: VICIDIAL Campaign Login\n"; echo "\n"; echo "\n"; + echo " Timeclock
\n"; echo "\n"; echo "\n"; echo "
\n"; diff --git a/www/agc/vicidial_redirect.php b/www/agc/vicidial_redirect.php new file mode 100644 index 00000000..ff921c72 --- /dev/null +++ b/www/agc/vicidial_redirect.php @@ -0,0 +1,46 @@ + LICENSE: AGPLv2 +# +# CHANGELOG +# 71202-1546 - First Build +# + +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} +if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} + elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} + +if (!isset($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } + +$URL = "http://192.168.1.60/agc/vicidial.php?phone_login=$phone_login&phone_pass=$phone_pass&DB=$DB&VD_login=$VD_login&VD_pass=$VD_pass&VD_campaign=$VD_campaign&relogin=$relogin"; + +echo"VICIDIAL\n"; +echo"\n"; +echo"\n"; +echo"\n"; +echo"\n"; +echo"click here to continue. . .\n"; +exit; + +?> diff --git a/www/vicidial/AST_CLOSER_service_level.php b/www/vicidial/AST_CLOSER_service_level.php index c9ac1974..06051584 100644 --- a/www/vicidial/AST_CLOSER_service_level.php +++ b/www/vicidial/AST_CLOSER_service_level.php @@ -455,7 +455,7 @@ while ($d < $DURATIONday) $totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]); $totTIME_M = ($totCALLSsecDATE[$d] / 60); - $totTIME_M = round($totTIME_M, 2); + $totTIME_M_int = round($totTIME_M, 2); $totTIME_M_int = intval("$totTIME_M"); $totTIME_S = ($totTIME_M - $totTIME_M_int); $totTIME_S = ($totTIME_S * 60); @@ -508,7 +508,7 @@ if ($totCALLSsec > 0) $totCALLSavg = ($totCALLSsec / $totCALLS); $totTIME_M = ($totCALLSsec / 60); - $totTIME_M = round($totTIME_M, 2); + $totTIME_M_int = round($totTIME_M, 2); $totTIME_M_int = intval("$totTIME_M"); $totTIME_S = ($totTIME_M - $totTIME_M_int); $totTIME_S = ($totTIME_S * 60); diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 61d58e22..9965ca19 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -4332,7 +4332,7 @@ $admin_home_url_LU = $row[0]; ?>
- BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0> +
  VICIDIAL ADMIN - HOME | Logout  
BGCOLOR=#D9E6FE cellpadding=2 cellspacing=0> diff --git a/www/vicidial/welcome.php b/www/vicidial/welcome.php index 06a7c447..4836c2c0 100644 --- a/www/vicidial/welcome.php +++ b/www/vicidial/welcome.php @@ -14,6 +14,8 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; echo "\n"; echo "\n"; echo "
  VICIDIAL ADMIN - HOME | Timeclock | Logout  
> SIZE=> Users
 
Agent Login
 
Timeclock
 
Administration
 
\n";