From 47106b8d7aeba0d8ae8bf3c75d6ad4e9b4b18e8a Mon Sep 17 00:00:00 2001 From: mattf Date: Sat, 20 Feb 2010 17:16:32 +0000 Subject: [PATCH] Added agent call log view and dispo log file entry option git-svn-id: svn://192.168.202.10@1341 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/UPGRADE | 3 + .../trunk/bin/VICIDIAL_IN_new_leads_file.pl | 121 ++++++++- .../trunk/extras/MySQL_AST_CREATE_tables.sql | 13 +- agc_2-X/trunk/extras/upgrade_2.4.sql | 10 + .../TO_BE_TRANSLATED_2.4.txt | 13 +- agc_2-X/trunk/www/agc/vdc_db_query.php | 248 +++++++++++++++++- agc_2-X/trunk/www/agc/vicidial.php | 158 ++++++++++- agc_2-X/trunk/www/vicidial/admin.php | 58 +++- 8 files changed, 581 insertions(+), 43 deletions(-) diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 6ac622c2..871c64c8 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -40,6 +40,9 @@ OTHER CHANGES: 5. Added vdc_script_notes.php for call notes and appointment taking, read comments for more information. +6. Added Call Log View options to the Agent screen, can be enabled in the + User Group screen or the User screen in Administration + diff --git a/agc_2-X/trunk/bin/VICIDIAL_IN_new_leads_file.pl b/agc_2-X/trunk/bin/VICIDIAL_IN_new_leads_file.pl index 1b623bfa..e76a8fea 100644 --- a/agc_2-X/trunk/bin/VICIDIAL_IN_new_leads_file.pl +++ b/agc_2-X/trunk/bin/VICIDIAL_IN_new_leads_file.pl @@ -152,10 +152,10 @@ if (length($ARGV[0])>1) print "\n"; print "This script takes in lead files in the following order when they are placed in the $PATHhome/LEADS_IN directory to be imported into the vicidial_list table (examples):\n\n"; print "standard:\n"; - print "vendor_lead_code|source_code|list_id|phone_code|phone_number|title|first_name|middle|last_name|address1|address2|address3|city|state|province|postal_code|country|gender|date_of_birth|alt_phone|email|security_phrase|COMMENTS|called_count|status|entry_date|multi-alt-entries\n"; + print "vendor_lead_code|source_id|list_id|phone_code|phone_number|title|first_name|middle|last_name|address1|address2|address3|city|state|province|postal_code|country|gender|date_of_birth|alt_phone|email|security_phrase|COMMENTS|called_count|status|entry_date|multi-alt-entries\n"; print "3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS|2|B|2007-08-09 00:00:00|7275551212_1_work!7275551213_61_sister house!7275551214_44_neighbor\n\n"; print "stdrankowner:\n"; - print "vendor_lead_code|source_code|list_id|phone_code|phone_number|title|first_name|middle|last_name|address1|address2|address3|city|state|province|postal_code|country|gender|date_of_birth|alt_phone|email|security_phrase|COMMENTS|called_count|status|entry_date|rank|owner|multi-alt-entries\n"; + print "vendor_lead_code|source_id|list_id|phone_code|phone_number|title|first_name|middle|last_name|address1|address2|address3|city|state|province|postal_code|country|gender|date_of_birth|alt_phone|email|security_phrase|COMMENTS|called_count|status|entry_date|rank|owner|multi-alt-entries\n"; print "3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS|2|B|2007-08-09 00:00:00|99|6666|7275551212_1_work!7275551213_61_sister house!7275551214_44_neighbor\n\n"; print "minicsv:\n"; print "address1,city,name,phone_number,state,postal_code\n"; @@ -526,7 +526,7 @@ foreach(@FILES) { @name=@MT; $vendor_lead_code = ''; - $source_code = ''; + $source_id = ''; $list_id = '995'; $phone_code = '1'; $phone_number = $m[5]; chomp($phone_number); $phone_number =~ s/\D//gi; @@ -562,7 +562,7 @@ foreach(@FILES) { @name=@MT; $vendor_lead_code = ''; - $source_code = ''; + $source_id = ''; $list_id = '995'; $phone_code = '1'; $phone_number = $m[3]; chomp($phone_number); $phone_number =~ s/\D//gi; @@ -610,7 +610,7 @@ foreach(@FILES) $vendor_lead_code = substr($raw_number, 173, 8); $vendor_lead_code =~ s/^\s+//gi; $security_phrase = substr($raw_number, 181, 4); - $source_code = ''; + $source_id = ''; $list_id = '995'; $country = 'USA'; $gender = 'U'; @@ -631,7 +631,7 @@ foreach(@FILES) { @name=@MT; $vendor_lead_code = ''; - $source_code = ''; + $source_id = ''; $list_id = '995'; $phone_code = '1'; $phone_number = $m[2]; chomp($phone_number); $phone_number =~ s/\D//gi; @@ -750,7 +750,7 @@ foreach(@FILES) } $comments =~ s/\"|\)|\(|;//gi; - $source_code = ''; + $source_id = ''; $list_id = '995'; $phone_code = '1'; $title = ''; @@ -771,7 +771,7 @@ foreach(@FILES) if ( ($format =~ /stdrankowner/) && ($format_set < 1) ) { $vendor_lead_code = $m[0]; chomp($vendor_lead_code); - $source_code = $m[1]; chomp($source_code); $source_id = $source_code; + $source_id = $m[1]; chomp($source_id); $list_id = $m[2]; chomp($list_id); $phone_code = $m[3]; chomp($phone_code); $phone_code =~ s/\D//gi; $phone_number = $m[4]; chomp($phone_number); $phone_number =~ s/\D//gi; @@ -859,7 +859,7 @@ foreach(@FILES) @m = split(/\|/, $number); $vendor_lead_code = $m[0]; chomp($vendor_lead_code); - $source_code = ''; + $source_id = ''; $list_id = '929'; $phone_code = '1'; $first_name = $m[1]; chomp($first_name); $first_name =~ s/\s+$//gi; @@ -919,12 +919,111 @@ foreach(@FILES) $format_set++; } + # This is the format for the dccsv26 lead files +#"BFRAME","RECORD_TYPE","LAST_NAME","FIRST_NAME","4ADDR1","5ADDR2","6CITY","STATE","ZIP","9ZIP4","ADDR_STATUS","DATE_PLACED","DATE_ADDED","DOB","LAST_LETTER","LAST_LETTER_DATE","LAST_WORKED","NEXT_ACTION_DATE","CAPTURE_CODE","CUR_CATEGORY","TIMES_DIALED","LAST_DIALED","TOTAL_PAID","DATE_LAST_PAID","NMBR_CALLS","NMBR_CONTACTS","NMBR_TIMES_WRKD","NMBR_LETTERS","STATUS_CODE","STATUS_DATE","SCORE","TIMES_TO_SERVICER","1ST-PMT-DEFAULT","TIME_ZONE","ORIG_CREDITOR","BALANCE","HOME_PHONE","WORK_PHONE","OTHER_PHONE","ACCT_OTHTEL2","ACCT_OTHTEL3","ACCT_OTHTEL4","ACCT_OTHTEL5" +#"","RECORD_TYPE","2","3","4","5","6","7","8","9","10ADDR_STATUS","DATE_PLACED","DATE_ADDED","13","14LAST_LETTER","15LAST_LETTER_DATE","16LAST_WORKED","17NEXT_ACTION_DATE","18CAPTURE_CODE","19CUR_CATEGORY","20TIMES_DIALED","21LAST_DIALED","22TOTAL_PAID","23DATE_LAST_PAID","24NMBR_CALLS","25NMBR_CONTACTS","26NMBR_TIMES_WRKD","27NMBR_LETTERS","28STATUS_CODE","29STATUS_DATE","30SCORE","31TIMES_TO_SERVICER","321ST-PMT-DEFAULT","","34ORIG_CREDITOR","35BALANCE","","","","39","","","" +#"II ACCT/1103521789 ","P","STRAYER "," SHERYL K","7575 W 106TH ST APT 57 "," ","OVERLAND PARK ","KS","66212","0000","G","20091110","20091110","19661216","NOLTTR","00000000","20091214","20091219","1000","03","000","00000000","000000000.00 ","00000000","0004","0003","0004","000","ACTIVE","20091110","0648","00"," ","C","HSBC ","000000692.09 ","9139635053","0000000000","0000000000","0000000000","0000000000","0000000000","0000000000" + + if ( ($format =~ /dccsv26/) && ($format_set < 1) ) + { + $raw_number = $number; + chomp($number); + $number =~ s/,"0"//gi; + $number =~ s/,"0000000000"//gi; + $number =~ s/\t/\|/gi; + $number =~ s/\'|\t|\r|\n|\l//gi; + $number =~ s/\'|\t|\r|\n|\l//gi; + $number =~ s/\",,,,,,,\"/\|\|\|\|\|\|\|/gi; + $number =~ s/\",,,,,,\"/\|\|\|\|\|\|/gi; + $number =~ s/\",,,,,\"/\|\|\|\|\|/gi; + $number =~ s/\",,,,\"/\|\|\|\|/gi; + $number =~ s/\",,,\"/\|\|\|/gi; + $number =~ s/\",,\"/\|\|/gi; + $number =~ s/\",\"/\|/gi; + $number =~ s/\"//gi; + @m=@MT; + @m = split(/\|/, $number); + + $vendor_lead_code = $m[0]; chomp($vendor_lead_code); + $vendor_lead_code =~s/II ACCT\///gi; + $vendor_lead_code =~s/WDRF //gi; + while (length($vendor_lead_code) > 10) {chop($vendor_lead_code);} + $source_id = $m[0]; chomp($source_id); + $list_id = '929'; + $phone_code = '1'; + $first_name = $m[3]; chomp($first_name); $first_name =~ s/\s+$//gi; + $middle_initial = ''; + $last_name = $m[2]; chomp($last_name); $last_name =~ s/\s+$//gi; + $phone_number = $m[36]; + $USarea = substr($phone_number, 0, 3); + $title = ''; + $address1 = $m[4]; + $address2 = $m[5]; + $address3 = ''; + $city = $m[6]; + $state = $m[7]; + $province = ''; + $postal_code = "$m[8]$m[9]"; + $country = $m[5]; + $gender = ''; + $date_of_birth = $m[13]; + $dobYYYY = substr($date_of_birth, 0, 4); + $dobMM = substr($date_of_birth, 4, 2); + $dobDD = substr($date_of_birth, 6, 2); + $date_of_birth = "$dobYYYY-$dobMM-$dobDD"; + $alt_phone = $m[37]; chomp($alt_phone); $alt_phone =~ s/\D//gi; + $email = ''; + $security_phrase = ''; + $comments = ''; + $called_count = '0'; + $status = 'NEW'; + $insert_date = $pulldate0; + $rank = ''; + $owner = ''; + $multi_alt_phones = ''; + + $r=0; + $map_count=0; + if (length($m[38]) > 9) + { + $ALTm_phone_number[$r] = $m[38]; + $ALTm_phone_code[$r] = '1'; + $r++; $map_count++; + } + if (length($m[39]) > 9) + { + $ALTm_phone_number[$r] = $m[39]; + $ALTm_phone_code[$r] = '1'; + $r++; $map_count++; + } + if (length($m[40]) > 9) + { + $ALTm_phone_number[$r] = $m[40]; + $ALTm_phone_code[$r] = '1'; + $r++; $map_count++; + } + if (length($m[41]) > 9) + { + $ALTm_phone_number[$r] = $m[41]; + $ALTm_phone_code[$r] = '1'; + $r++; $map_count++; + } + if (length($m[42]) > 9) + { + $ALTm_phone_number[$r] = $m[42]; + $ALTm_phone_code[$r] = '1'; + $r++; $map_count++; + } + + $format_set++; + } + # This is the format for the standard lead files #3857822|31022|105|01144|1625551212|MRS|B||BURTON|249 MUNDON ROAD|MALDON|ESSEX||||CM9 6PW|UK||||||COMMENTS if ($format_set < 1) { $vendor_lead_code = $m[0]; chomp($vendor_lead_code); - $source_code = $m[1]; chomp($source_code); $source_id = $source_code; + $source_id = $m[1]; chomp($source_id); $list_id = $m[2]; chomp($list_id); $phone_code = $m[3]; chomp($phone_code); $phone_code =~ s/\D//gi; $phone_number = $m[4]; chomp($phone_number); $phone_number =~ s/\D//gi; @@ -965,7 +1064,7 @@ foreach(@FILES) @map=@MT; @ALTm_phone_code=@MT; @ALTm_phone_number=@MT; @ALTm_phone_note=@MT; @map = split(/\!/, $multi_alt_phones); $map_count = ($#map +1); - if ($DBX) {print "multi-al-entry: $a|$map_count|$multi_alt_phones\n";} + if ($DBX) {print "multi-alt-entry: $a|$map_count|$multi_alt_phones\n";} $g++; $r=0; while ($r < $map_count) diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index cb404bd2..8a7f3714 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -541,7 +541,8 @@ custom_two VARCHAR(100) default '', custom_three VARCHAR(100) default '', custom_four VARCHAR(100) default '', custom_five VARCHAR(100) default '', -voicemail_id VARCHAR(10) +voicemail_id VARCHAR(10), +agent_call_log_view_override ENUM('DISABLED','Y','N') default 'DISABLED' ); @@ -568,7 +569,8 @@ group_shifts TEXT, forced_timeclock_login ENUM('Y','N','ADMIN_EXEMPT') default 'N', shift_enforcement ENUM('OFF','START','ALL') default 'OFF', agent_status_viewable_groups TEXT, -agent_status_view_time ENUM('Y','N') default 'N' +agent_status_view_time ENUM('Y','N') default 'N', +agent_call_log_view ENUM('Y','N') default 'N' ); CREATE TABLE vicidial_campaigns ( @@ -1205,7 +1207,8 @@ default_webphone ENUM('1','0') default '0', default_external_server_ip ENUM('1','0') default '0', webphone_url VARCHAR(255) default '', static_agent_url VARCHAR(255) default '', -default_phone_code VARCHAR(8) default '1' +default_phone_code VARCHAR(8) default '1', +enable_agc_dispo_log ENUM('0','1') default '0' ); CREATE TABLE vicidial_campaigns_list_mix ( @@ -2027,6 +2030,8 @@ INSERT INTO vicidial_call_menu SET menu_id='defaultlog',menu_name='logging of al INSERT INTO vicidial_call_menu_options SET menu_id='defaultlog',option_value='TIMEOUT',option_description='hangup',option_route='HANGUP',option_route_value='vm-goodbye',option_route_value_context=''; +INSERT INTO vicidial_scripts (script_id,script_name,script_comments,active,script_text) values('CALLNOTES','Call Notes and Appointment Setting','','Y',''); + UPDATE system_settings SET qc_last_pull_time=NOW(); CREATE INDEX country_postal_code on vicidial_postal_codes (country_code,postal_code); @@ -2056,7 +2061,7 @@ ALTER TABLE vicidial_agent_log_archive MODIFY agent_log_id INT(9) UNSIGNED NOT N CREATE TABLE vicidial_carrier_log_archive LIKE vicidial_carrier_log; -UPDATE system_settings SET db_schema_version='1200',db_schema_update_date=NOW(); +UPDATE system_settings SET db_schema_version='1201',db_schema_update_date=NOW(); GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/agc_2-X/trunk/extras/upgrade_2.4.sql b/agc_2-X/trunk/extras/upgrade_2.4.sql index 5c4a249d..112d8296 100644 --- a/agc_2-X/trunk/extras/upgrade_2.4.sql +++ b/agc_2-X/trunk/extras/upgrade_2.4.sql @@ -56,3 +56,13 @@ ALTER TABLE system_settings ADD static_agent_url VARCHAR(255) default ''; ALTER TABLE system_settings ADD default_phone_code VARCHAR(8) default '1'; UPDATE system_settings SET db_schema_version='1200',db_schema_update_date=NOW(); + +INSERT INTO vicidial_scripts (script_id,script_name,script_comments,active,script_text) values('CALLNOTES','Call Notes and Appointment Setting','','Y',''); + +ALTER TABLE system_settings ADD enable_agc_dispo_log ENUM('0','1') default '0'; + +ALTER TABLE vicidial_user_groups ADD agent_call_log_view ENUM('Y','N') default 'N'; + +ALTER TABLE vicidial_users ADD agent_call_log_view_override ENUM('DISABLED','Y','N') default 'DISABLED'; + +UPDATE system_settings SET db_schema_version='1201',db_schema_update_date=NOW(); diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt index a7fd9db6..0e4b977f 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.4.txt @@ -23,10 +23,21 @@ Webphone URL|| This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty|| AGENT ACTIVITY FOR THIS TIME PERIOD|| these fields are in seconds|| +Enable Agent Disposition Logfile|| +This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled|| +Agent Call Log View|| +This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled|| +Agent Call Log View Override|| +This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED|| ############################################################ CLIENT - +VIEW CALL LOG|| +click to dial|| +Close Call Log|| +YOU MUST BE PAUSED TO VIEW YOUR CALL LOG|| +Close Info Box|| +No calls on this day|| ############################################################ MANAGER Manual diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index 839f6c92..61352ded 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -12,7 +12,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','regTERRITORY','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCaLL','manDiaLlogCALL','userLOGout','updateDISPO','updateLEAD','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl','AGENTSview','CALLSINQUEUEview','CALLSINQUEUEgrab','DiaLableLeaDsCounT','UpdateFields') +# - $ACTION - ('regCLOSER','regTERRITORY','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCaLL','manDiaLlogCALL','userLOGout','updateDISPO','updateLEAD','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl','AGENTSview','CALLSINQUEUEview','CALLSINQUEUEgrab','DiaLableLeaDsCounT','UpdateFields','CALLLOGview','LEADINFOview') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -87,6 +87,7 @@ # - $agent_territories - ('ABC001','ABC002'...) # - $alt_num_status - ('0','1') # - $DiaL_SecondS - ('0','1','2',...) +# - $date - ('2010-02-19') # # CHANGELOG: # 50629-1044 - First build of script @@ -234,12 +235,14 @@ # 100122-0757 - Added NOT-LOGGED-IN-AGENTS option for sidebar view and transfer view # 100202-2305 - Fixed logging issues related to INBOUND_MAN dial_method # 100207-1104 - Changed Pause Codes function to allow for multiple pause codes per pause period +# 100219-1437 - Added agent_dispo_log file option +# 100220-1041 - Added CALLLOGview and LEADINFOview functions # -$version = '2.4-142'; -$build = '100207-1104'; +$version = '2.4-144'; +$build = '100220-1041'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=310; +$mysql_log_count=312; $one_mysql_log=0; require("dbconnect.php"); @@ -419,6 +422,8 @@ if (isset($_GET["alt_num_status"])) {$alt_num_status=$_GET["alt_num_status"]; elseif (isset($_POST["alt_num_status"])) {$alt_num_status=$_POST["alt_num_status"];} if (isset($_GET["DiaL_SecondS"])) {$DiaL_SecondS=$_GET["DiaL_SecondS"];} elseif (isset($_POST["DiaL_SecondS"])) {$DiaL_SecondS=$_POST["DiaL_SecondS"];} +if (isset($_GET["date"])) {$date=$_GET["date"];} + elseif (isset($_POST["date"])) {$date=$_POST["date"];} header ("Content-type: text/html; charset=utf-8"); @@ -5788,6 +5793,46 @@ if ($ACTION == 'updateDISPO') fclose($fp); } } + + ##### check if system is set to generate logfile for dispos + $stmt="SELECT enable_agc_dispo_log FROM system_settings;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00311',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $enable_agc_dispo_log_ct = mysql_num_rows($rslt); + if ($enable_agc_dispo_log_ct > 0) + { + $row=mysql_fetch_row($rslt); + $enable_agc_dispo_log =$row[0]; + } + + if ( ($WeBRooTWritablE > 0) and ($enable_agc_dispo_log > 0) ) + { + $talk_time = 0; + $stmt = "select talk_sec,dead_sec from vicidial_agent_log where lead_id='$lead_id' and agent_log_id='$CALL_agent_log_id';"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00312',$user,$server_ip,$session_name,$one_mysql_log);} + $VAL_talk_ct = mysql_num_rows($rslt); + if ($VAL_talk_ct > 0) + { + $row=mysql_fetch_row($rslt); + $talk_sec = $row[0]; + $dead_sec = $row[1]; + $talk_time = ($talk_sec - $dead_sec); + if ($talk_time < 1) + { + $talk_time = 0; + } + } + + # DATETIME|campaign|lead_id|phone_number|user|type|Call_ID||province|talk_sec| + # 2010-02-19 11:11:11|TESTCAMP|65432|3125551212|1234|D|Y09876543210987654||note|123| + $fp = fopen ("./xfer_log.txt", "a"); + fwrite ($fp, "$NOW_TIME|$campaign|$lead_id|$phone_number|$user|D|$MDnextCID||$province|$talk_sec|\n"); + fclose($fp); + } + echo 'Lead ' . $lead_id . ' has been changed to ' . $dispo_choice . " Status\nNext agent_log_id:\n" . $agent_log_id . "\n"; } @@ -6642,6 +6687,201 @@ if ($ACTION == 'CALLSINQUEUEview') } +################################################################################ +### CALLLOGview - display one day calls for an agent +################################################################################ +if ($ACTION == 'CALLLOGview') + { + if (strlen($date) < 10) + {$date = $NOW_DATE;} + if (strlen($stage) < 3) + {$stage = '670';} + + $date_array = explode("-",$date); + $day_next = mktime(7, 0, 0, $date_array[1], ($date_array[2] + 1), $date_array[0]); + $next_day_date = date("Y-m-d",$day_next); + $day_old = mktime(7, 0, 0, $date_array[1], ($date_array[2] - 1), $date_array[0]); + $past_day_date = date("Y-m-d",$day_old); + $week_old = mktime(7, 0, 0, $date_array[1], ($date_array[2] - 7), $date_array[0]); + $past_week_date = date("Y-m-d",$week_old); + + echo "
\n"; + echo ""; + echo " << $past_week_date     "; + echo " < $past_day_date     "; + if ($NOW_DATE != $date) + {echo " $next_day_date >     ";} + echo " "; + echo "GO       "; + echo "close"; + echo "\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + $stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,alt_dial,comments from vicidial_log where user='$user' and call_date >= '$date 0:00:00' and call_date <= '$date 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $out_logs_to_print = mysql_num_rows($rslt); + if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";} + + $g=0; + $u=0; + while ($out_logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $ALLsort[$g] = "$row[0]-----$g"; + $ALLstart_epoch[$g] = $row[0]; + $ALLcall_date[$g] = $row[1]; + $ALLcampaign_id[$g] = $row[2]; + $ALLlength_in_sec[$g] = $row[3]; + $ALLstatus[$g] = $row[4]; + $ALLphone_code[$g] = $row[5]; + $ALLphone_number[$g] = $row[6]; + $ALLlead_id[$g] = $row[7]; + $ALLhangup_reason[$g] = $row[8]; + $ALLalt_dial[$g] = $row[9]; + $ALLin_out[$g] = "OUT-AUTO"; + if ($row[10] == 'MANUAL') {$ALLin_out[$g] = "OUT-MANUAL";} + $g++; + $u++; + } + + $stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,queue_seconds from vicidial_closer_log where user='$user' and call_date >= '$date 0:00:00' and call_date <= '$date 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $in_logs_to_print = mysql_num_rows($rslt); + if ($format=='debug') {echo "|$in_logs_to_print|$stmt|";} + + $u=0; + while ($in_logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $ALLsort[$g] = "$row[0]-----$g"; + $ALLstart_epoch[$g] = $row[0]; + $ALLcall_date[$g] = $row[1]; + $ALLcampaign_id[$g] = $row[2]; + $ALLlength_in_sec[$g] = ($row[3] - $row[9]); + if ($ALLlength_in_sec[$g] < 0) {$ALLlength_in_sec[$g]=0;} + $ALLstatus[$g] = $row[4]; + $ALLphone_code[$g] = $row[5]; + $ALLphone_number[$g] = $row[6]; + $ALLlead_id[$g] = $row[7]; + $ALLhangup_reason[$g] = $row[8]; + $ALLalt_dial[$g] = "MAIN"; + $ALLin_out[$g] = "IN"; + $g++; + $u++; + } + + if ($g > 0) + {sort($ALLsort, SORT_NUMERIC);} + else + {echo "";} + + $u=0; + while ($g > $u) + { + $sort_split = explode("-----",$ALLsort[$u]); + $i = $sort_split[1]; + + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
  #     DATE/TIME     LENGTH     STATUS     PHONE     CAMPAIGN     IN/OUT     ALT     HANGUP     INFO     DIAL  
No calls on this day
$u$ALLcall_date[$i] $ALLlength_in_sec[$i] $ALLstatus[$i] $ALLphone_code[$i] $ALLphone_number[$i] $ALLcampaign_id[$i] $ALLin_out[$i] $ALLalt_dial[$i] $ALLhangup_reason[$i] INFO DIAL
"; + echo "
"; + echo "Close Call Log"; + echo "
"; + } + + +################################################################################ +### LEADINFOview - display the information for a lead +################################################################################ +if ($ACTION == 'LEADINFOview') + { + if (strlen($lead_id) < 1) + {echo "ERROR: no Lead ID";} + else + { + echo "
\n"; + echo ""; + + $stmt="select status,vendor_lead_code,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='$lead_id'limit 1;"; + $rslt=mysql_query($stmt, $link); + $info_to_print = mysql_num_rows($rslt); + if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";} + + if ($info_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + # echo ""; + # echo ""; + } + + echo "
Status:   $row[0]
Vendor ID:   $row[1]
List ID:   $row[2]
Timezone:   $row[3]
Called SInce Last Reset:   $row[4]
Phone Code:   $row[5]
Phone Number:   $row[6] -         DIAL
Title:   $row[7]
First Name:   $row[8]
MI:   $row[9]
Last Name:   $row[10]
Address 1:   $row[11]
Address 2:   $row[12]
Address 3:   $row[13]
City:   $row[14]
State:   $row[15]
Province:   $row[16]
Postal Code:   $row[17]
Country:   $row[18]
Gender:   $row[19]
Alt. Phone:   $row[20] -         DIAL
Email:   $row[21]
Show:   $row[22]
Comments:   $row[23]
Called Count:   $row[24]
Last Local Call Time:   $row[25]
Rank:   $row[26]
Owner:   $row[27]
"; + echo "
"; + echo "Close Info Box"; + echo "
"; + } + } + + ################################################################################ ### CALLSINQUEUEgrab - grab a call in queue and reserve it for that agent ################################################################################ diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index da0f2515..5dacc790 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -276,10 +276,11 @@ # 100131-2233 - Added functions to allow for a webphone loaded in a separate IFRAME # 100203-0639 - Fixed logging issues related to INBOUND_MAN dial method # 100207-1103 - Changed Pause Codes function to allow for multiple pause codes per pause period +# 100220-1040 - Added Call Log View and Customer Info View and fixed HotKeys position # -$version = '2.4-254'; -$build = '100207-1103'; +$version = '2.4-255'; +$build = '100220-1040'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=64; $one_mysql_log=0; @@ -840,7 +841,7 @@ else $login=strtoupper($VD_login); $password=strtoupper($VD_pass); ##### grab the full name of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$VD_login' and pass='$VD_pass'"; + $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,agent_call_log_view_override from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); @@ -868,13 +869,14 @@ else $VU_custom_three = $row[21]; $VU_custom_four = $row[22]; $VU_custom_five = $row[23]; + $VU_agent_call_log_view_override = $row[23]; if ( ($VU_alert_enabled > 0) and ($VU_allow_alerts > 0) ) {$VU_alert_enabled = 'ON';} else {$VU_alert_enabled = 'OFF';} $AgentAlert_allowed = $VU_allow_alerts; ### Gather timeclock and shift enforcement restriction settings - $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts,agent_status_viewable_groups,agent_status_view_time from vicidial_user_groups where user_group='$VU_user_group';"; + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view from vicidial_user_groups where user_group='$VU_user_group';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); @@ -893,6 +895,12 @@ else $agent_status_view_time=0; if ($row[4] == 'Y') {$agent_status_view_time=1;} + if ($row[5] == 'Y') + {$agent_call_log_view=1;} + if ($VU_agent_call_log_view_override == 'Y') + {$agent_call_log_view=1;} + if ($VU_agent_call_log_view_override == 'N') + {$agent_call_log_view=0;} ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) @@ -2797,6 +2805,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var timer_action_seconds=''; var is_webphone=''; var pause_code_counter=1; + var agent_call_log_view=''; var DiaLControl_auto_HTML = "\"\"Resume\""; var DiaLControl_auto_HTML_ready = "\"\"Resume\""; var DiaLControl_auto_HTML_OFF = "\"\"Resume\""; @@ -4463,7 +4472,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // ################################################################################ // Open page to enter details for a new manual dial lead - function NeWManuaLDiaLCalL(TVfast) + function NeWManuaLDiaLCalL(TVfast,TVphone_code,TVphone_number) { if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) { @@ -4477,6 +4486,13 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { + if (TVfast=='CALLLOG') + { + hideDiv('CalLLoGDisplaYBox'); + hideDiv('LeaDInfOBox'); + document.vicidial_form.MDDiaLCodE.value = TVphone_code; + document.vicidial_form.MDPhonENumbeR.value = TVphone_number; + } if (agent_allow_group_alias == 'Y') { document.getElementById("ManuaLDiaLGrouPSelecteD").innerHTML = "Group Alias: " + active_group_alias + ""; @@ -9544,6 +9560,104 @@ function phone_number_format(formatphone) { } +// ################################################################################ +// View Customer lead information + function VieWLeaDInfO(VLI_lead_id) + { + showDiv('LeaDInfOBox'); + + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + RAview_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=LEADINFOview&format=text&user=" + user + "&pass=" + pass + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&lead_id=" + VLI_lead_id + "&campaign=" + campaign + "&stage="; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(RAview_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + document.getElementById('LeaDInfOSpan').innerHTML = xmlhttp.responseText + "\n"; + } + } + delete xmlhttp; + } + } + + +// ################################################################################ +// Refresh the call log display + function VieWCalLLoG(logdate,formdate) + { + if ( (AutoDialWaiting == 1) || (VD_live_customer_call==1) || (alt_dial_active==1) || (MD_channel_look==1) ) + { + alert("YOU MUST BE PAUSED TO VIEW YOUR CALL LOG"); + } + else + { + showDiv('CalLLoGDisplaYBox'); + + if (formdate=='form') + {logdate = document.vicidial_form.calllogdate.value;} + + var xmlhttp=false; + /*@cc_on @*/ + /*@if (@_jscript_version >= 5) + // JScript gives us Conditional compilation, we can cope with old IE versions. + // and security blocked creation of the objects. + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + @end @*/ + if (!xmlhttp && typeof XMLHttpRequest!='undefined') + { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) + { + RAview_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=CALLLOGview&format=text&user=" + user + "&pass=" + pass + "&conf_exten=" + session_id + "&extension=" + extension + "&protocol=" + protocol + "&date=" + logdate + "&campaign=" + campaign + "&stage="; + xmlhttp.open('POST', 'vdc_db_query.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(RAview_query); + xmlhttp.onreadystatechange = function() + { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) + { + // alert(xmlhttp.responseText); + document.getElementById('CallLogSpan').innerHTML = xmlhttp.responseText + "\n"; + } + } + delete xmlhttp; + } + } + } + + // ################################################################################ // Move the Dispo frame out of the way and change the link to maximize function DispoMinimize() @@ -9844,6 +9958,8 @@ else hideDiv('AgentViewSpan'); hideDiv('AgentXferViewSpan'); hideDiv('TimerSpan'); + hideDiv('CalLLoGDisplaYBox'); + hideDiv('LeaDInfOBox'); if (is_webphone!='Y') {hideDiv('webphoneSpan');} if (view_calls_in_queue_launch != '1') @@ -9855,6 +9971,8 @@ else // if ( (agentcall_manual != '1') && (starting_dial_level > 0) ) if (agentcall_manual != '1') {hideDiv('ManuaLDiaLButtons');} + if (agent_call_log_view != '1') + {hideDiv('CallLogButtons');} if (callholdstatus != '1') {hideDiv('AgentStatusCalls');} if (agentcallsstatus != '1') @@ -10605,6 +10723,7 @@ else