From d5c599275e988cab7e504cb4d5bd9af4cbc7ad00 Mon Sep 17 00:00:00 2001 From: mattf Date: Sat, 24 Nov 2012 20:56:14 +0000 Subject: [PATCH] Added call time inbound holiday functions git-svn-id: svn://192.168.202.10@1880 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 2 + agi/agi-VDAD_ALL_inbound.agi | 52 +- agi/agi-VDAD_inbound_calltime_check.agi | 51 +- bin/ADMIN_keepalive_ALL.pl | 17 +- extras/MySQL_AST_CREATE_tables.sql | 17 +- extras/upgrade_2.6.sql | 17 + .../TO_BE_TRANSLATED_2.6.txt | 37 ++ www/vicidial/admin.php | 590 +++++++++++++++++- www/vicidial/admin_header.php | 3 +- 9 files changed, 768 insertions(+), 18 deletions(-) diff --git a/UPGRADE b/UPGRADE index 45f18fa6..5e7b86e5 100644 --- a/UPGRADE +++ b/UPGRADE @@ -120,6 +120,8 @@ OTHER CHANGES: 26. Added QM Socket-Send functionality for custom queue_log record sending. +27. Added inbound call time holiday functions. + diff --git a/agi/agi-VDAD_ALL_inbound.agi b/agi/agi-VDAD_ALL_inbound.agi index dd10b102..33f61924 100644 --- a/agi/agi-VDAD_ALL_inbound.agi +++ b/agi/agi-VDAD_ALL_inbound.agi @@ -179,6 +179,7 @@ # 121025-2210 - If AGENTDIRECT and no agent defined, set drop call seconds to 1 # 121114-1936 - Added INGROUP recording option # 121120-0921 - Added QM socket-send functionality +# 121124-1345 - Added call times holidays function # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -802,7 +803,7 @@ if ($wday==6) } ### Grab call_times values from the database -$stmtA = "SELECT ct_default_start,ct_default_stop,default_afterhours_filename_override $daySQL $yestSQL FROM vicidial_call_times where call_time_id = '$call_time_id';"; +$stmtA = "SELECT ct_default_start,ct_default_stop,default_afterhours_filename_override $daySQL $yestSQL,ct_holidays FROM vicidial_call_times where call_time_id = '$call_time_id';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -816,6 +817,7 @@ $ct_day_stop = $aryA[4]; $day_afterhours_filename_override = $aryA[5]; $ct_yest_start = $aryA[6]; $ct_yest_stop = $aryA[7]; +$ct_holidays = $aryA[8]; $sthA->finish(); if ( ($ct_yest_start < 1) && ($ct_yest_stop < 1) ) @@ -829,10 +831,58 @@ if ( ($ct_day_start > 0) || ($ct_day_stop > 0) ) $ct_default_stop = $ct_day_stop; } +if (length($ct_holidays) > 2) + { + $stmtA = "SELECT count(*) from vicidial_call_time_holidays where holiday_date='$YMD' and holiday_status='ACTIVE';"; + if ($DBX) {print " |$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + @aryA = $sthA->fetchrow_array; + $holiday_today_count = $aryA[0]; + if ($AGILOG) {$agi_string = "Holiday check: |$holiday_today_count|$stmtA|$ct_holidays|"; &agi_output;} + + $ct_hrs=0; + $b=0; + if ($holiday_today_count > 0) + { + @holiday_rules = split(/\|/,$ct_holidays); + $ct_hrs = ($#holiday_rules - 0); + while($ct_hrs >= $b) + { + if (length($holiday_rules[$b])>1) + { + $stmtA = "SELECT holiday_id,holiday_date,holiday_name,ct_default_start,ct_default_stop,default_afterhours_filename_override from vicidial_call_time_holidays where holiday_id='$holiday_rules[$b]' and holiday_status='ACTIVE' and holiday_date='$YMD';"; + if ($DBX) {print " |$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $holiday_id = $aryA[0]; + $holiday_date = $aryA[1]; + $holiday_name = $aryA[2]; + $ct_default_start = $aryA[3]; + $ct_default_stop = $aryA[4]; + $default_afterhours_filename_override = $aryA[5]; + $holiday_afterhours_filename_override = $aryA[5]; + + if ($AGILOG) {$agi_string = "Active Holiday found! |$holiday_id|$holiday_date|$holiday_name|$ct_default_start|$ct_default_stop|$default_afterhours_filename_override|"; &agi_output;} + } + $sthA->finish(); + } + $b++; + } + } + } + + if ( (length($deafult_afterhours_filename_override) > 0) && ($deafult_afterhours_filename_override !~ /---NONE---/) ) {$after_hours_message_filename = $deafult_afterhours_filename_override;} if ( (length($day_afterhours_filename_override) > 0) && ($day_afterhours_filename_override !~ /---NONE---/) ) {$after_hours_message_filename = $day_afterhours_filename_override;} +if ( (length($holiday_afterhours_filename_override) > 0) && ($holiday_afterhours_filename_override !~ /---NONE---/) ) + {$after_hours_message_filename = $holiday_afterhours_filename_override;} # send call to after hours action if in-group is set to inactive if ($ingroup_active !~ /Y/) diff --git a/agi/agi-VDAD_inbound_calltime_check.agi b/agi/agi-VDAD_inbound_calltime_check.agi index a656159b..51e2f461 100644 --- a/agi/agi-VDAD_inbound_calltime_check.agi +++ b/agi/agi-VDAD_inbound_calltime_check.agi @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# agi-VDAD_inbound_calltime_check.agi version 2.4 +# agi-VDAD_inbound_calltime_check.agi version 2.6 # # Runs when a call comes in from an inbound call. This script will check the # settings of the defined calltime scheme in VICIDIAL and either send the call @@ -48,6 +48,7 @@ # 120706-1659 - Added Qualify SQL option # 120719-1411 - Fixed issue with inbound IVR calls not showing up in real-time screen # 120730-0727 - Fixed issue with non-populating phone number +# 121124-1414 - Added call times holidays function # $script = 'agi-VDAD_inbound_calltime_check.agi'; @@ -67,6 +68,7 @@ $hm = ($hm + 0); $now_date_epoch = time(); $now_date = "$year-$mon-$mday $hour:$min:$sec"; $CLInow_date = "$year-$mon-$mday\\ $hour:$min:$sec"; +$YMD = "$year-$mon-$mday"; $start_time=$now_date; $CIDdate = "$mon$mday$hour$min$sec"; $tsSQLdate = "$year$mon$mday$hour$min$sec"; @@ -437,7 +439,7 @@ $ct_default_start = '0'; $ct_default_stop = '9999'; ### Grab call_times values from the database -$stmtA = "SELECT ct_default_start,ct_default_stop $daySQL $yestSQL FROM vicidial_call_times where call_time_id = '$call_time_id';"; +$stmtA = "SELECT ct_default_start,ct_default_stop $daySQL $yestSQL,ct_holidays FROM vicidial_call_times where call_time_id = '$call_time_id';"; $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; $sthArows=$sthA->rows; @@ -450,6 +452,7 @@ if ($sthArows > 0) $ct_day_stop = $aryA[3]; $ct_yest_start = $aryA[4]; $ct_yest_stop = $aryA[5]; + $ct_holidays = $aryA[6]; $sthA->finish(); if ( ($ct_yest_start < 1) && ($ct_yest_stop < 1) ) @@ -464,6 +467,50 @@ if ($sthArows > 0) } } +if (length($ct_holidays) > 2) + { + $stmtA = "SELECT count(*) from vicidial_call_time_holidays where holiday_date='$YMD' and holiday_status='ACTIVE';"; + if ($DBX) {print " |$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + @aryA = $sthA->fetchrow_array; + $holiday_today_count = $aryA[0]; + if ($AGILOG) {$agi_string = "Holiday check: |$holiday_today_count|$stmtA|$ct_holidays|"; &agi_output;} + + $ct_hrs=0; + $b=0; + if ($holiday_today_count > 0) + { + @holiday_rules = split(/\|/,$ct_holidays); + $ct_hrs = ($#holiday_rules - 0); + while($ct_hrs >= $b) + { + if (length($holiday_rules[$b])>1) + { + $stmtA = "SELECT holiday_id,holiday_date,holiday_name,ct_default_start,ct_default_stop,default_afterhours_filename_override from vicidial_call_time_holidays where holiday_id='$holiday_rules[$b]' and holiday_status='ACTIVE' and holiday_date='$YMD';"; + if ($DBX) {print " |$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $holiday_id = $aryA[0]; + $holiday_date = $aryA[1]; + $holiday_name = $aryA[2]; + $ct_default_start = $aryA[3]; + $ct_default_stop = $aryA[4]; + $default_afterhours_filename_override = $aryA[5]; + + if ($AGILOG) {$agi_string = "Active Holiday found! |$holiday_id|$holiday_date|$holiday_name|$ct_default_start|$ct_default_stop|$default_afterhours_filename_override|"; &agi_output;} + } + $sthA->finish(); + } + $b++; + } + } + } + $AGI->stream_file('sip-silence'); $AGI->stream_file('sip-silence'); diff --git a/bin/ADMIN_keepalive_ALL.pl b/bin/ADMIN_keepalive_ALL.pl index d7f9be11..d6c3c4cf 100644 --- a/bin/ADMIN_keepalive_ALL.pl +++ b/bin/ADMIN_keepalive_ALL.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# ADMIN_keepalive_ALL.pl version 2.4 +# ADMIN_keepalive_ALL.pl version 2.6 # # Designed to keep the astGUIclient processes alive and check every minute # Replaces all other ADMIN_keepalive scripts @@ -75,6 +75,7 @@ # 120706-1325 - Added Call Menu qualify SQL option # 120820-1026 - Added clearing of vicidial_session_data table at end of day # 121019-1021 - Added voicemail greeting option +# 121124-1440 - Added holiday expiration function # $DB=0; # Debug flag @@ -639,7 +640,7 @@ $sthArows=$sthA->rows; if ($sthArows > 0) { @aryA = $sthA->fetchrow_array; - $timeclock_end_of_day_NOW = "$aryA[0]"; + $timeclock_end_of_day_NOW = $aryA[0]; } $sthA->finish(); @@ -935,8 +936,7 @@ if ($timeclock_end_of_day_NOW > 0) if ($DB) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";} $sthA->finish(); - - ##### BEGIN max stats end of day process ##### + ### calculate the date and time for 24 hours ago $secX = time(); $RMtarget = ($secX - 86400); # 24 hours ago ($RMsec,$RMmin,$RMhour,$RMmday,$RMmon,$RMyear,$RMwday,$RMyday,$RMisdst) = localtime($RMtarget); @@ -948,7 +948,16 @@ if ($timeclock_end_of_day_NOW > 0) if ($RMmin < 10) {$RMmin = "0$RMmin";} if ($RMsec < 10) {$RMsec = "0$RMsec";} $RMSQLdate = "$RMyear-$RMmon-$RMmday $RMhour:$RMmin:$RMsec"; + $RMdate = "$RMyear-$RMmon-$RMmday"; + # set past holidays to EXPIRED status + $stmtA = "UPDATE vicidial_call_time_holidays SET holiday_status='EXPIRED' where holiday_date < \"$RMdate\" and holiday_status!='EXPIRED';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $affected_rows = $dbhA->do($stmtA); + if($DB){print STDERR "\n|$affected_rows Holidays set to expired|\n";} + + + ##### BEGIN max stats end of day process ##### # set OPEN max stats records to CLOSING for processing $stmtA = "UPDATE vicidial_daily_max_stats SET stats_flag='CLOSING' where stats_flag='OPEN';"; if($DBX){print STDERR "\n|$stmtA|\n";} diff --git a/extras/MySQL_AST_CREATE_tables.sql b/extras/MySQL_AST_CREATE_tables.sql index 5d9592da..1752750a 100644 --- a/extras/MySQL_AST_CREATE_tables.sql +++ b/extras/MySQL_AST_CREATE_tables.sql @@ -1252,7 +1252,8 @@ wednesday_afterhours_filename_override VARCHAR(255) default '', thursday_afterhours_filename_override VARCHAR(255) default '', friday_afterhours_filename_override VARCHAR(255) default '', saturday_afterhours_filename_override VARCHAR(255) default '', -user_group VARCHAR(20) default '---ALL---' +user_group VARCHAR(20) default '---ALL---', +ct_holidays TEXT default '' ); CREATE TABLE vicidial_state_call_times ( @@ -2754,6 +2755,18 @@ audit_comments_enabled TINYINT(1) DEFAULT NULL COMMENT 'invisible', PRIMARY KEY (list_id) ); +CREATE TABLE vicidial_call_time_holidays ( +holiday_id VARCHAR(30) PRIMARY KEY NOT NULL, +holiday_name VARCHAR(100) NOT NULL, +holiday_comments VARCHAR(255) default '', +holiday_date DATE, +holiday_status ENUM('ACTIVE','INACTIVE','EXPIRED') default 'INACTIVE', +ct_default_start SMALLINT(4) unsigned NOT NULL default '900', +ct_default_stop SMALLINT(4) unsigned NOT NULL default '2100', +default_afterhours_filename_override VARCHAR(255) default '', +user_group VARCHAR(20) default '---ALL---' +); + ALTER TABLE vicidial_qc_codes ADD qc_result_type ENUM( 'PASS', 'FAIL', 'CANCEL', 'COMMIT' ) NOT NULL; @@ -2987,4 +3000,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version'; UPDATE system_settings set vdc_agent_api_active='1'; -UPDATE system_settings SET db_schema_version='1332',db_schema_update_date=NOW(); +UPDATE system_settings SET db_schema_version='1333',db_schema_update_date=NOW(); diff --git a/extras/upgrade_2.6.sql b/extras/upgrade_2.6.sql index 84f8259f..cd9ce38a 100644 --- a/extras/upgrade_2.6.sql +++ b/extras/upgrade_2.6.sql @@ -166,3 +166,20 @@ ALTER TABLE system_settings ADD queuemetrics_socket VARCHAR(20) default 'NONE'; ALTER TABLE system_settings ADD queuemetrics_socket_url TEXT; UPDATE system_settings SET db_schema_version='1332',db_schema_update_date=NOW() where db_schema_version < 1332; + +CREATE TABLE vicidial_call_time_holidays ( +holiday_id VARCHAR(30) PRIMARY KEY NOT NULL, +holiday_name VARCHAR(100) NOT NULL, +holiday_comments VARCHAR(255) default '', +holiday_date DATE, +holiday_status ENUM('ACTIVE','INACTIVE','EXPIRED') default 'INACTIVE', +ct_default_start SMALLINT(4) unsigned NOT NULL default '900', +ct_default_stop SMALLINT(4) unsigned NOT NULL default '2100', +default_afterhours_filename_override VARCHAR(255) default '', +user_group VARCHAR(20) default '---ALL---' +); + +ALTER TABLE vicidial_call_times ADD ct_holidays TEXT default ''; +UPDATE vicidial_call_times SET ct_holidays='' where ct_holidays is NULL; + +UPDATE system_settings SET db_schema_version='1333',db_schema_update_date=NOW() where db_schema_version < 1333; diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt index 0b35f81f..ec17f382 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt @@ -35,6 +35,43 @@ QueueMetrics Socket Send|| This option, if enabled, will send QM data to a web page that will send it through a socket for logging. The CONNECT_COMPLETE option will send CONNECT, COMPLETEAGENT and COMPLETECALLER events to the url defined below. Default is NONE for disabled|| QueueMetrics Socket Send URL|| If Socket Send is enabled above, this is the URL that is used to send the data to. Default is EMPTY for disabled|| +Add Holiday|| +Modify Holiday|| +Delete Holiday|| +New Holiday Addition|| +Holidays|| +Holiday ID|| +This is the short name of a Holiday Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 30 characters, minimum of 2 characters|| +Holiday Name|| +This is a more descriptive name of the Holiday Definition. This is a short summary of the Holiday definition. max 100 characters, minimum of 2 characters|| +Holiday Comments|| +This is where you can place comments for a Holiday Definition such as -10am to 4pm boxing day restrictions-. max 255 characters|| +Holiday Date|| +This is the date of the holiday|| +Holiday Status|| +This is the status of the holiday entry. ACTIVE status means that the holiday will be enabled on the holiday date. INACTIVE status means that the holiday will be ignored even on the holiday date. EXPIRED means that the holiday has passed it's holiday date. Default is INACTIVE|| +short description of the holiday|| +Day and time options will appear once you have created the Holiday Definition|| +HOLIDAY DEFINITION NOT ADDED|| +there is already a holiday entry with this ID|| +Holiday ID, name and date must be populated|| +HOLIDAY ADDED|| +HOLIDAY NOT MODIFIED|| +HOLIDAY MODIFIED|| +HOLIDAY NOT DELETED|| +Holiday ID must be at least 2 characters in length|| +HOLIDAY DELETION CONFIRMATION|| +Click here to delete holiday|| +HOLIDAY DELETION COMPLETED|| +Holiday Rule Removed|| +MODIFY A HOLIDAY|| +CALL TIMES USING THIS HOLIDAY|| +DELETE THIS HOLIDAY DEFINITION|| +Active Inbound Holiday Definitions for this Record|| +Add inbound holiday rule|| +Holiday Rule Added|| +Holiday Rule Removed|| +Click here to see Admin changes to this holiday|| ############################################################ CLIENT diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index a729f17b..14da3622 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -1766,6 +1766,18 @@ if (isset($_GET["queuemetrics_socket"])) {$queuemetrics_socket=$_GET["queuemet elseif (isset($_POST["queuemetrics_socket"])) {$queuemetrics_socket=$_POST["queuemetrics_socket"];} if (isset($_GET["queuemetrics_socket_url"])) {$queuemetrics_socket_url=$_GET["queuemetrics_socket_url"];} elseif (isset($_POST["queuemetrics_socket_url"])) {$queuemetrics_socket_url=$_POST["queuemetrics_socket_url"];} +if (isset($_GET["holiday_id"])) {$holiday_id=$_GET["holiday_id"];} + elseif (isset($_POST["holiday_id"])) {$holiday_id=$_POST["holiday_id"];} +if (isset($_GET["holiday_name"])) {$holiday_name=$_GET["holiday_name"];} + elseif (isset($_POST["holiday_name"])) {$holiday_name=$_POST["holiday_name"];} +if (isset($_GET["holiday_comments"])) {$holiday_comments=$_GET["holiday_comments"];} + elseif (isset($_POST["holiday_comments"])) {$holiday_comments=$_POST["holiday_comments"];} +if (isset($_GET["holiday_date"])) {$holiday_date=$_GET["holiday_date"];} + elseif (isset($_POST["holiday_date"])) {$holiday_date=$_POST["holiday_date"];} +if (isset($_GET["holiday_status"])) {$holiday_status=$_GET["holiday_status"];} + elseif (isset($_POST["holiday_status"])) {$holiday_status=$_POST["holiday_status"];} +if (isset($_GET["holiday_rule"])) {$holiday_rule=$_GET["holiday_rule"];} + elseif (isset($_POST["holiday_rule"])) {$holiday_rule=$_POST["holiday_rule"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} @@ -2356,6 +2368,7 @@ if ($non_latin < 1) $server_id = ereg_replace("[^-_0-9a-zA-Z]","",$server_id); $stage = ereg_replace("[^-_0-9a-zA-Z]","",$stage); $state_rule = ereg_replace("[^-_0-9a-zA-Z]","",$state_rule); + $holiday_rule = ereg_replace("[^-_0-9a-zA-Z]","",$holiday_rule); $trunk_restriction = ereg_replace("[^-_0-9a-zA-Z]","",$trunk_restriction); $user = ereg_replace("[^-_0-9a-zA-Z]","",$user); $user_group = ereg_replace("[^-_0-9a-zA-Z]","",$user_group); @@ -2505,6 +2518,9 @@ if ($non_latin < 1) $in_group_dial = ereg_replace("[^-_0-9a-zA-Z]","",$in_group_dial); $in_group_dial_select = ereg_replace("[^-_0-9a-zA-Z]","",$in_group_dial_select); $queuemetrics_socket = ereg_replace("[^-_0-9a-zA-Z]","",$queuemetrics_socket); + $holiday_id = ereg_replace("[^-_0-9a-zA-Z]","",$holiday_id); + $holiday_date = ereg_replace("[^-_0-9a-zA-Z]","",$holiday_date); + $holiday_status = ereg_replace("[^-_0-9a-zA-Z]","",$holiday_status); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); @@ -2659,6 +2675,8 @@ if ($non_latin < 1) $group = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$group); $job_title = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$job_title); $location = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$location); + $holiday_name = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$holiday_name); + $holiday_comments = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$holiday_comments); ### ALPHA-NUMERIC and underscore and dash and slash and at and dot $call_out_number_group = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$call_out_number_group); @@ -3177,12 +3195,13 @@ else # 121114-1923 - Added Basic Lead Management page link. Added INGROUP as a recording filename option # 121116-1410 - Added QC functionality # 121120-0824 - Added queuemetrics_socket functionality to system settings +# 121123-1208 - Added inbound holiday functions # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.6-383a'; -$build = '121120-0824'; +$admin_version = '2.6-384a'; +$build = '121123-1208'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -3510,6 +3529,7 @@ if ($ADD==11111111) {$hh='filters'; echo "Add New Filter";} if ($ADD==111111111) {$hh='admin'; $sh='times'; echo "Add New Call Time";} if ($ADD==131111111) {$hh='admin'; $sh='shifts'; echo "Add New Shift";} if ($ADD==1111111111) {$hh='admin'; $sh='times'; echo "Add New State Call Time";} +if ($ADD==1211111111) {$hh='admin'; $sh='times'; echo "Add Holiday";} if ($ADD==11111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW PHONE";} if ($ADD==12111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW PHONE ALIAS";} if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "ADD NEW GROUP ALIAS";} @@ -3553,6 +3573,7 @@ if ($ADD==21111111) {$hh='filters'; echo "New Filter Addition";} if ($ADD==211111111) {$hh='admin'; $sh='times'; echo "New Call Time Addition";} if ($ADD==231111111) {$hh='admin'; $sh='shifts'; echo "New Shift Addition";} if ($ADD==2111111111) {$hh='admin'; $sh='times'; echo "New State Call Time Addition";} +if ($ADD==2211111111) {$hh='admin'; $sh='times'; echo "New Holiday Addition";} if ($ADD==21111111111) {$hh='admin'; $sh='phones'; echo "ADDING NEW PHONE";} if ($ADD==22111111111) {$hh='admin'; $sh='phones'; echo "ADDING NEW PHONE ALIAS";} if ($ADD==23111111111) {$hh='admin'; $sh='phones'; echo "ADDING NEW GROUP ALIAS";} @@ -3625,6 +3646,7 @@ if ($ADD==311111111) {$hh='admin'; $sh='times'; echo "Modify Call Time";} if ($ADD==321111111) {$hh='admin'; $sh='times'; echo "Modify Call Time State Definitions List";} if ($ADD==331111111) {$hh='admin'; $sh='shifts'; echo "Modify Shift";} if ($ADD==3111111111) {$hh='admin'; $sh='times'; echo "Modify State Call Time";} +if ($ADD==3211111111) {$hh='admin'; $sh='times'; echo "Modify Holiday";} if ($ADD==31111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE";} if ($ADD==32111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE ALIAS";} if ($ADD==33111111111) {$hh='admin'; $sh='phones'; echo "MODIFY GROUP ALIAS";} @@ -3668,6 +3690,7 @@ if ($ADD==41111111) {$hh='filters'; echo "Modify Filter";} if ($ADD==411111111) {$hh='admin'; $sh='times'; echo "Modify Call Time";} if ($ADD==431111111) {$hh='admin'; $sh='shifts'; echo "Modify Shift";} if ($ADD==4111111111) {$hh='admin'; $sh='times'; echo "Modify State Call Time";} +if ($ADD==4211111111) {$hh='admin'; $sh='times'; echo "Modify Holiday";} if ($ADD==41111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE";} if ($ADD==42111111111) {$hh='admin'; $sh='phones'; echo "MODIFY PHONE ALIAS";} if ($ADD==43111111111) {$hh='admin'; $sh='phones'; echo "MODIFY GROUP ALIAS";} @@ -3703,6 +3726,7 @@ if ($ADD==51111111) {$hh='filters'; echo "Delete Filter";} if ($ADD==511111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";} if ($ADD==531111111) {$hh='admin'; $sh='shifts'; echo "Delete Shift";} if ($ADD==5111111111) {$hh='admin'; $sh='times'; echo "Delete State Call Time";} +if ($ADD==5211111111) {$hh='admin'; $sh='times'; echo "Delete Holiday";} if ($ADD==51111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} if ($ADD==52111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";} if ($ADD==53111111111) {$hh='admin'; $sh='phones'; echo "DELETE GROUP ALIAS";} @@ -3739,6 +3763,7 @@ if ($ADD==61111111) {$hh='filters'; echo "Delete Filter";} if ($ADD==611111111) {$hh='admin'; $sh='times'; echo "Delete Call Time";} if ($ADD==631111111) {$hh='admin'; $sh='shifts'; echo "Delete Shift";} if ($ADD==6111111111) {$hh='admin'; $sh='times'; echo "Delete State Call Time";} +if ($ADD==6211111111) {$hh='admin'; $sh='times'; echo "Delete Holiday";} if ($ADD==61111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE";} if ($ADD==62111111111) {$hh='admin'; $sh='phones'; echo "DELETE PHONE ALIAS";} if ($ADD==63111111111) {$hh='admin'; $sh='phones'; echo "DELETE GROUP ALIAS";} @@ -3779,6 +3804,7 @@ if ($ADD==10000000) {$hh='filters'; echo "Filters";} if ($ADD==100000000) {$hh='admin'; $sh='times'; echo "Call Times";} if ($ADD==130000000) {$hh='admin'; $sh='shifts'; echo "Shifts";} if ($ADD==1000000000) {$hh='admin'; $sh='times'; echo "State Call Times";} +if ($ADD==1200000000) {$hh='admin'; $sh='times'; echo "Holidays";} if ($ADD==10000000000) {$hh='admin'; $sh='phones'; echo "PHONE LIST";} if ($ADD==12000000000) {$hh='admin'; $sh='phones'; echo "PHONE ALIAS LIST";} if ($ADD==13000000000) {$hh='admin'; $sh='phones'; echo "GROUP ALIAS LIST";} @@ -7144,6 +7170,26 @@ if ($ADD==99999) State Call Time State - This is the two letter code for the state that this calling time definition is for. For this to be in effect the local call time that is set in the campaign must have this state call time record in it as well as all of the leads having two letter state codes in them. + +
+ Holiday ID - This is the short name of a Holiday Definition. This needs to be a unique identifier. Do not use any spaces or punctuation for this field. max 30 characters, minimum of 2 characters. + +
+
+ Holiday Name - This is a more descriptive name of the Holiday Definition. This is a short summary of the Holiday definition. max 100 characters, minimum of 2 characters. + +
+
+ Holiday Comments - This is where you can place comments for a Holiday Definition such as -10am to 4pm boxing day restrictions-. max 255 characters. + +
+
+ Holiday Date - This is the date of the holiday. + +
+
+ Holiday Status - This is the status of the holiday entry. ACTIVE status means that the holiday will be enabled on the holiday date. INACTIVE status means that the holiday will be ignored even on the holiday date. EXPIRED means that the holiday has passed it's holiday date. Default is INACTIVE. + @@ -9339,6 +9385,7 @@ if ($ADD==11) echo "Local Call Time: $NWB#vicidial_campaigns-local_call_time$NWE\n"; + if ($SSoutbound_autodial_active > 0) { echo "Voicemail: $NWB#vicidial_campaigns-voicemail_ext$NWE\n"; @@ -10485,6 +10532,53 @@ if ($ADD==1111111111) } +###################### +# ADD=1211111111 display the ADD NEW HOLIDAY SCREEN +###################### + +if ($ADD==1211111111) + { + if ($LOGmodify_call_times==1) + { + echo "\n"; + echo "\n"; + if ($SSoutbound_autodial_active > 0) { echo "\n"; @@ -25490,6 +25765,23 @@ if ($ADD==3111) echo "\n"; echo "$NWB#vicidial_inbound_groups-call_time_id$NWE\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -26799,7 +27091,22 @@ if ($ADD==3511) echo "\n"; + echo "$NWB#vicidial_call_menu-call_time_id$NWE "; + $stmt="SELECT ct_holidays from vicidial_call_times where call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + $call_times_to_print = mysql_num_rows($rslt); + if ($call_times_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $ct_holidays = $rowx[0]; + $holiday_rules = explode('|',$ct_holidays); + $ct_hrs = ((count($holiday_rules)) - 2); + if ($ct_hrs < 0) {$ct_hrs=0;} + echo "   Holidays defined for this call time: $ct_hrs\n"; + } + else + {echo "Call time not found!\n";} + echo "\n"; echo "
\n"; + echo ""; + + echo "
ADD NEW STATE CALL TIME
\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "
Holiday ID: (no spaces or punctuation)$NWB#vicidial_call_times-holiday_id$NWE
Holiday Name: (short description of the holiday)$NWB#vicidial_call_times-holiday_name$NWE
Holiday Comments: $NWB#vicidial_call_times-holiday_comments$NWE
Holiday Date: $NWB#vicidial_call_times-holiday_date$NWE\n"; + echo "
Admin User Group: $NWB#vicidial_call_times-user_group$NWE
Day and time options will appear once you have created the Holiday Definition
\n"; + } + else + { + echo "You do not have permission to view this page\n"; + exit; + } + } + + ###################### # ADD=131111111 display the ADD NEW SHIFT SCREEN ###################### @@ -13150,7 +13244,7 @@ if ($ADD==211111111) } else { - $stmt="INSERT INTO vicidial_call_times SET call_time_id='$call_time_id',call_time_name='$call_time_name',call_time_comments='$call_time_comments',user_group='$user_group';"; + $stmt="INSERT INTO vicidial_call_times SET call_time_id='$call_time_id',call_time_name='$call_time_name',call_time_comments='$call_time_comments',user_group='$user_group',ct_state_call_times='',ct_holidays='';"; $rslt=mysql_query($stmt, $link); if ($DB > 0) {echo "|$stmt|";} @@ -13209,6 +13303,46 @@ if ($ADD==2111111111) } +###################### +# ADD=2211111111 adds new holiday definition to the system +###################### + +if ($ADD==2211111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_call_time_holidays where holiday_id='$holiday_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
HOLIDAY DEFINITION NOT ADDED - there is already a holiday entry with this ID\n";} + else + { + if ( (strlen($holiday_id) < 2) or (strlen($holiday_name) < 2) or (strlen($holiday_date) < 10) ) + { + echo "
HOLIDAY DEFINITION NOT ADDED - Please go back and look at the data you entered\n"; + echo "
Holiday ID, name and date must be populated\n"; + } + else + { + $stmt="INSERT INTO vicidial_call_time_holidays SET holiday_id='$holiday_id',holiday_name='$holiday_name',holiday_comments='$holiday_comments',holiday_date='$holiday_date',holiday_status='INACTIVE',user_group='$user_group';"; + $rslt=mysql_query($stmt, $link); + if ($DB > 0) {echo "|$stmt|";} + + echo "
HOLIDAY ADDED: $holiday_id\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='HOLIDAYS', event_type='ADD', record_id='$holiday_id', event_code='ADMIN ADD HOLIDAY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=3211111111; + } + + ###################### # ADD=231111111 adds new shift definition to the system ###################### @@ -16776,7 +16910,7 @@ if ($ADD==4111111111) $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLTIMES', event_type='MODIFY', record_id='$call_time_id', event_code='ADMIN MODIFY STATE CALL TIME', event_sql=\"$SQL_log\", event_notes='';"; + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLTIMES_STATE', event_type='MODIFY', record_id='$call_time_id', event_code='ADMIN MODIFY STATE CALL TIME', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -16790,6 +16924,48 @@ if ($ADD==4111111111) } +###################### +# ADD=4211111111 modify holiday in the system +###################### + +if ($ADD==4211111111) + { + if ($LOGmodify_call_times==1) + { + echo ""; + + if ( (strlen($holiday_id) < 2) or (strlen($holiday_name) < 2) or (strlen($holiday_date) < 10) ) + { + echo "
HOLIDAY NOT MODIFIED - Please go back and look at the data you entered\n"; + echo "
Holiday ID, name and date must be populated\n"; + } + else + { + $ct_default_start = preg_replace('/\D/', '', $ct_default_start); + $ct_default_stop = preg_replace('/\D/', '', $ct_default_stop); + $stmt="UPDATE vicidial_call_time_holidays set holiday_name='$holiday_name', holiday_comments='$holiday_comments', holiday_date='$holiday_date', holiday_status='$holiday_status', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop',user_group='$user_group', default_afterhours_filename_override='$default_afterhours_filename_override' where holiday_id='$holiday_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
HOLIDAY MODIFIED\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='HOLIDAYS', event_type='MODIFY', record_id='$holiday_id', event_code='ADMIN MODIFY HOLIDAY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "You do not have permission to view this page\n"; + exit; + } + $ADD=3211111111; # go to holiday modification form below + } + + ###################### # ADD=431111111 modify shift in the system ###################### @@ -18137,6 +18313,30 @@ if ($ADD==5111111111) $ADD='3111111111'; # go to state call time modification below } + +###################### +# ADD=5211111111 confirmation before deletion of holiday record +###################### + +if ($ADD==5211111111) + { + echo ""; + + if ( (strlen($holiday_id) < 2) or ($LOGdelete_call_times < 1) ) + { + echo "
HOLIDAY NOT DELETED - Please go back and look at the data you entered\n"; + echo "
Holiday ID must be at least 2 characters in length\n"; + } + else + { + echo "
HOLIDAY DELETION CONFIRMATION: $holiday_id\n"; + echo "

Click here to delete holiday $holiday_id


\n"; + } + + $ADD='3211111111'; # go to holiday modification below + } + + ###################### # ADD=531111111 confirmation before deletion of shift record ###################### @@ -19616,6 +19816,64 @@ if ($ADD==6111111111) } +###################### +# ADD=6211111111 delete holiday record +###################### + +if ($ADD==6211111111) + { + echo ""; + + if ( (strlen($holiday_id) < 2) or ($LOGdelete_call_times < 1) ) + { + echo "
HOLIDAY NOT DELETED - Please go back and look at the data you entered\n"; + echo "
Holiday ID must be at least 2 characters in length\n"; + } + else + { + $stmtA="DELETE from vicidial_call_time_holidays where holiday_id='$holiday_id' $LOGadmin_viewable_groupsSQL limit 1;"; + $rslt=mysql_query($stmtA, $link); + + $stmt="SELECT call_time_id,ct_holidays from vicidial_call_times where ct_holidays LIKE \"%|$holiday_id|%\" order by call_time_id;"; + $rslt=mysql_query($stmt, $link); + $hct_to_print = mysql_num_rows($rslt); + $hct_list=''; + + $o=0; + while ($hct_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $hct_ids[$o] = "$rowx[0]"; + $hct_holidays[$o] = "$rowx[1]"; + $o++; + } + $o=0; + while ($hct_to_print > $o) + { + $hct_holidays[$o] = eregi_replace("\|$holiday_id\|",'|',$hct_holidays[$o]); + $stmt="UPDATE vicidial_call_times set ct_holidays='$hct_holidays[$o]' where call_time_id='$hct_ids[$o]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "|$stmt|\n";} + echo "Holiday Rule Removed: $hct_ids[$o]
\n"; + $o++; + } + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|"; + $SQL_log = ereg_replace(';','',$SQL_log); + $SQL_log = addslashes($SQL_log); + $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='HOLIDAYS', event_type='DELETE', record_id='$holiday_id', event_code='ADMIN DELETE HOLIDAY', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
HOLIDAY DELETION COMPLETED: $holiday_id\n"; + echo "

\n"; + } + + $ADD='1200000000'; # go to holidays list + } + + ###################### # ADD=631111111 delete shift record ###################### @@ -21504,6 +21762,23 @@ if ($ADD==31) echo "\n"; echo "$NWB#vicidial_campaigns-local_call_time$NWE
\n"; + $stmt="SELECT ct_state_call_times from vicidial_call_times where call_time_id='$local_call_time';"; + $rslt=mysql_query($stmt, $link); + $call_times_to_print = mysql_num_rows($rslt); + if ($call_times_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $ct_state_call_times = $rowx[0]; + $state_rules = explode('|',$ct_state_call_times); + $ct_srs = ((count($state_rules)) - 2); + if ($ct_srs < 0) {$ct_hrs=0;} + echo "State rules defined for this call time: $ct_srs\n"; + } + else + {echo "Call time not found!: $local_call_time\n";} + echo "
Dial Timeout: in seconds$NWB#vicidial_campaigns-dial_timeout$NWE
\n"; + $stmt="SELECT ct_holidays from vicidial_call_times where call_time_id='$call_time_id';"; + $rslt=mysql_query($stmt, $link); + $call_times_to_print = mysql_num_rows($rslt); + if ($call_times_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $ct_holidays = $rowx[0]; + $holiday_rules = explode('|',$ct_holidays); + $ct_hrs = ((count($holiday_rules)) - 2); + if ($ct_hrs < 0) {$ct_hrs=0;} + echo "Holidays defined for this call time: $ct_hrs\n"; + } + else + {echo "Call time not found!: $call_time_id\n";} + echo "
Action Transfer CID: $NWB#vicidial_inbound_groups-action_xfer_cid$NWE
After Hours Action: $NWB#vicidial_inbound_groups-after_hours_action$NWE
Call Time: $NWB#vicidial_call_menu-call_time_id$NWE
Track Calls in Real-Time Report: \n"; echo "\n"; echo "\n"; - echo "\n"; @@ -28139,6 +28512,60 @@ if ($ADD==311111111) echo "\n"; echo "\n"; + + $ct_hrs=1; + $b=0; + $hrs_SQL =''; + if (strlen($ct_holidays)>2) + { + $holiday_rules = explode('|',$ct_holidays); + $ct_hrs = ((count($holiday_rules)) - 1); + } + echo "\n"; + echo "\n"; + while($ct_hrs >= $b) + { + if (strlen($holiday_rules[$b])>0) + { + $stmt="SELECT holiday_date,holiday_name from vicidial_call_time_holidays where holiday_id='$holiday_rules[$b]';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + echo "\n"; + $hrs_SQL .= "'$holiday_rules[$b]',"; + $hrs_holiday_SQL .= "'$row[0]',"; + } + $b++; + } + if (strlen($hrs_SQL)>2) + { + $hrs_SQL = "$hrs_SQL''"; + $hrs_holiday_SQL = "$hrs_holiday_SQL''"; + $hrs_SQL = "where holiday_id NOT IN($hrs_SQL) and holiday_date NOT IN($hrs_holiday_SQL) $LOGadmin_viewable_groupsSQL"; + } + else + {$hrs_SQL="$whereLOGadmin_viewable_groupsSQL";} + $stmt="SELECT holiday_id,holiday_date from vicidial_call_time_holidays $hrs_SQL order by holiday_date;"; + $rslt=mysql_query($stmt, $link); + $hct_to_print = mysql_num_rows($rslt); + $hct_list=''; + + $o=0; + while ($hct_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $hct_list .= "\n"; + $o++; + } + echo "\n"; + echo "\n"; + + echo "
\n"; echo ""; - $stmt="SELECT call_time_id,call_time_name,call_time_comments,ct_default_start,ct_default_stop,ct_sunday_start,ct_sunday_stop,ct_monday_start,ct_monday_stop,ct_tuesday_start,ct_tuesday_stop,ct_wednesday_start,ct_wednesday_stop,ct_thursday_start,ct_thursday_stop,ct_friday_start,ct_friday_stop,ct_saturday_start,ct_saturday_stop,ct_state_call_times,default_afterhours_filename_override,sunday_afterhours_filename_override,monday_afterhours_filename_override,tuesday_afterhours_filename_override,wednesday_afterhours_filename_override,thursday_afterhours_filename_override,friday_afterhours_filename_override,saturday_afterhours_filename_override,user_group from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; + $stmt="SELECT call_time_id,call_time_name,call_time_comments,ct_default_start,ct_default_stop,ct_sunday_start,ct_sunday_stop,ct_monday_start,ct_monday_stop,ct_tuesday_start,ct_tuesday_stop,ct_wednesday_start,ct_wednesday_stop,ct_thursday_start,ct_thursday_stop,ct_friday_start,ct_friday_stop,ct_saturday_start,ct_saturday_stop,ct_state_call_times,default_afterhours_filename_override,sunday_afterhours_filename_override,monday_afterhours_filename_override,tuesday_afterhours_filename_override,wednesday_afterhours_filename_override,thursday_afterhours_filename_override,friday_afterhours_filename_override,saturday_afterhours_filename_override,user_group,ct_holidays from vicidial_call_times where call_time_id='$call_time_id' $LOGadmin_viewable_groupsSQL;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $call_time_name = $row[1]; @@ -28062,6 +28434,7 @@ if ($ADD==311111111) $friday_afterhours_filename_override = $row[26]; $saturday_afterhours_filename_override = $row[27]; $user_group = $row[28]; + $ct_holidays = $row[29]; echo ""; @@ -28073,7 +28446,7 @@ if ($ADD==311111111) echo "
Call Time ID: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Admin User Group:
Admin User Group: $NWB#vicidial_call_times-user_group$NWE
Active Inbound Holiday Definitions for this Record:  
$holiday_rules[$b] - REMOVE $row[0] - $row[1]
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "Add inbound holiday rule:


\n"; echo "CAMPAIGNS USING THIS CALL TIME:
\n"; echo "\n"; @@ -28240,7 +28667,7 @@ if ($ADD==3111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; @@ -28276,6 +28703,105 @@ if ($ADD==3111111111) { echo "

DELETE THIS STATE CALL TIME DEFINITION\n"; } + if ($LOGuser_level >= 9) + { + echo "

Click here to see Admin changes to this call time\n"; + } + } + else + { + echo "You are not authorized to view this page. Please go back."; + } + } + + +###################### +# ADD=3211111111 modify holiday definition info in the system +###################### + +if ($ADD==3211111111) + { + if ($LOGmodify_call_times==1) + { + if ( ($SSadmin_modify_refresh > 1) and ($modify_refresh_set < 1) ) + { + $modify_url = "$PHP_SELF?ADD=3211111111&holiday_id=$holiday_id"; + $modify_footer_refresh=1; + } + echo "
State Call Time State: $NWB#vicidial_call_times-state_call_time_state$NWE
State Call Time Name: (short description of the call time)$NWB#vicidial_call_times-call_time_name$NWE
State Call Time Comments: $NWB#vicidial_call_times-call_time_comments$NWE
Admin User Group:
Admin User Group: $NWB#vicidial_call_times-user_group$NWE
\n"; + echo ""; + + $stmt="SELECT holiday_id,holiday_date,holiday_name,holiday_comments,holiday_status,ct_default_start,ct_default_stop,user_group,default_afterhours_filename_override from vicidial_call_time_holidays where holiday_id='$holiday_id' $LOGadmin_viewable_groupsSQL;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $holiday_date = $row[1]; + $holiday_name = $row[2]; + $holiday_comments = $row[3]; + $holiday_status = $row[4]; + $ct_default_start = $row[5]; + $ct_default_stop = $row[6]; + $user_group = $row[7]; + $default_afterhours_filename_override = $row[8]; + + echo ""; + + echo "
MODIFY A HOLIDAY
\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 "
Holiday ID: $holiday_id$NWB#vicidial_call_times-holiday_id$NWE
Holiday Name: (short description of the holiday)$NWB#vicidial_call_times-holiday_name$NWE
Holiday Comments: $NWB#vicidial_call_times-holiday_comments$NWE
Admin User Group: $NWB#vicidial_call_times-user_group$NWE
Default Start: Default Stop: $NWB#vicidial_call_times-ct_default_start$NWE
AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Holiday Date: \n"; + echo " $NWB#vicidial_call_times-holiday_date$NWE
Holiday Status: $NWB#vicidial_call_times-holiday_status$NWE


\n"; + echo "CALL TIMES USING THIS HOLIDAY:
\n"; + echo "\n"; + + $stmt="SELECT call_time_id,call_time_name from vicidial_call_times where ct_holidays LIKE \"%|$holiday_id|%\" $whereLOGadmin_viewable_call_timesSQL;"; + $rslt=mysql_query($stmt, $link); + $camps_to_print = mysql_num_rows($rslt); + $o=0; + while ($camps_to_print > $o) + { + $row=mysql_fetch_row($rslt); + echo "\n"; + $o++; + } + + echo "
$row[0] $row[1]
\n"; + echo "


\n"; + + if ($LOGdelete_call_times > 0) + { + echo "

DELETE THIS HOLIDAY DEFINITION\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Click here to see Admin changes to this holiday
\n"; + } } else { @@ -31682,6 +32208,52 @@ if ($ADD==1000000000) echo "
\n"; } +###################### +# ADD=1200000000 display all holidays +###################### +if ($ADD==1200000000) + { + echo "> + > 1) { ?>
\n"; + echo ""; + + $stmt="SELECT holiday_id,holiday_date,holiday_name,holiday_status,ct_default_start,ct_default_stop,user_group from vicidial_call_time_holidays $whereLOGadmin_viewable_groupsSQL order by holiday_date,holiday_id;"; + $rslt=mysql_query($stmt, $link); + $holidays_to_print = mysql_num_rows($rslt); + + echo "
HOLIDAY LISTINGS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($holidays_to_print > $o) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
HOLIDAY IDDATENAMESTATUSSTARTSTOPADMIN GROUPMODIFY
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] MODIFY
\n"; + } + ###################### # ADD=130000000 display all shifts ###################### @@ -32561,6 +33133,8 @@ if ($ADD==720000000000000) if (eregi('REMOTEAGENT',$row[4])) {$record_link = "$PHP_SELF?ADD=31111&remote_agent_id=$row[6]";} if (eregi('PHONE',$row[4])) {$record_link = "$PHP_SELF?ADD=10000000000";} if (eregi('CALLTIME',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111&call_time_id=$row[6]";} + if (eregi('CALLTIMES_STATE',$row[4])) {$record_link = "$PHP_SELF?ADD=3111111111&call_time_id=$row[6]";} + if (eregi('HOLIDAY',$row[4])) {$record_link = "$PHP_SELF?ADD=3211111111&holiday_id=$row[6]";} if (eregi('SHIFT',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111&shift_id=$row[6]";} if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111&template_id=$row[6]";} if (eregi('CARRIER',$row[4])) {$record_link = "$PHP_SELF?ADD=341111111111&carrier_id=$row[6]";} diff --git a/www/vicidial/admin_header.php b/www/vicidial/admin_header.php index f137802a..75266186 100644 --- a/www/vicidial/admin_header.php +++ b/www/vicidial/admin_header.php @@ -38,6 +38,7 @@ # 111116-0208 - Added ALT and ADDR3 in-group handle methods # 120402-2134 - Changed lead loader link to fourth gen # 121116-1412 - Added QC functionality +# 121123-0911 - Added Call Times Holidays Inbound functionality # @@ -1463,7 +1464,7 @@ $SScustom_fields_enabled = $row[3]; if (strlen($times_sh) > 1) { ?> -
  > Show Call Times  | > Add A New Call Time  | > Show State Call Times  | > Add A New State Call Time
  > Show Call Times  | > Add A New Call Time  | > Show State Call Times  | > Add A New State Call Time  | > Holidays  | > Add Holiday