Added admin web interface to allow for easy linking and display of custom
reports that are not included in Vicidial Added Status Groups and the ability to override Campaign Statuses on a per-In-Group or per-List basis Added Minimum and Maximum Seconds options for all status settings. This allows you to prevent the use of a status by an agent if they have talked to a customer less than X seconds or more than Y seconds. Fixed issue with email Customer Gone message in agent screen Added Asterisk 1.8 and higher voicemail.conf sample file Added listed support in install.pl for Asterisk 11 git-svn-id: svn://192.168.202.10@2403 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -165,6 +165,16 @@ OTHER CHANGES:
|
||||
|
||||
39. Changed AC-CID to be able to use areacodes from 2 to 5 digits in length
|
||||
|
||||
40. Added admin web interface to allow for easy linking and display of custom
|
||||
reports that are not included in Vicidial
|
||||
|
||||
41. Added Status Groups and the ability to override Campaign Statuses on a
|
||||
per-In-Group or per-List basis
|
||||
|
||||
42. Added Minimum and Maximum Seconds options for all status settings. This
|
||||
allows you to prevent the use of a status by an agent if they have
|
||||
talked to a customer less than X seconds or more than Y seconds.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
; WARNING- THIS FILE IS AUTO-GENERATED BY VICIDIAL, ANY EDITS YOU MAKE WILL BE LOST
|
||||
; ONLY VOICEMAIL BOXES DEFINED IN VICIDIAL WILL BE ALLOWED IN THIS FILE
|
||||
; IF YOU WANT TO ADD NON-VICIDIAL VOICEMAIL BOXES, ADD THEM IN A NEW
|
||||
; CONTEXT BEFORE THE DEFAULT CONTEXT
|
||||
|
||||
[general]
|
||||
format=wav49|gsm|wav
|
||||
serveremail=asterisk
|
||||
attach=yes
|
||||
skipms=3000
|
||||
maxsilence=10
|
||||
silencethreshold=128
|
||||
maxlogins=3
|
||||
maxmsg=500
|
||||
maxsec=300
|
||||
emailbody=Dear ${VM_NAME}:\n\n\tJust wanted to let you know you were just left a ${VM_DUR} long message (number ${VM_MSGNUM})\nin mailbox ${VM_MAILBOX} from ${VM_CIDNAME} ${VM_CIDNUM}, on ${VM_DATE}, so you might\nwant to check it when you get a chance. Thanks!\n\n\t\t\t\t--PBX\n
|
||||
|
||||
[zonemessages]
|
||||
newzealand=Pacific/Auckland|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
australiaeast=Australia/Sydney|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
australiacentral=Australia/Adelaide|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
australiawest=Australia/Perth|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
japan=Asia/Tokyo|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
philippines=Asia/Manila|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
china=Asia/Shanghai|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
malaysia=Asia/Kuala_Lumpur|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
thailand=Asia/Bangkok|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
india=Asia/Calcutta|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
pakistan=Asia/Karachi|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
russiaeast=Europe/Moscow|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
kenya=Africa/Nairobi|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
europeaneast=Europe/Kiev|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
southafrica=Africa/Johannesburg|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
european=Europe/Copenhagen|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
nigeria=Africa/Lagos|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
uk=Europe/London|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
brazil=America/Sao_Paulo|'vm-received' Q 'digits/at' IMp
|
||||
newfoundland=Canada/Newfoundland|'vm-received' Q 'digits/at' IMp
|
||||
carribeaneast=America/Santo_Domingo|'vm-received' Q 'digits/at' IMp
|
||||
atlantic=Canada/Atlantic|'vm-received' Q 'digits/at' IMp
|
||||
chile=America/Santiago|'vm-received' Q 'digits/at' IMp
|
||||
eastern=America/New_York|'vm-received' Q 'digits/at' IMp
|
||||
peru=America/Lima|'vm-received' Q 'digits/at' IMp
|
||||
central=America/Chicago|'vm-received' Q 'digits/at' IMp
|
||||
mexicocity=America/Mexico_City|'vm-received' Q 'digits/at' IMp
|
||||
mountain=America/Denver|'vm-received' Q 'digits/at' IMp
|
||||
arizona=America/Phoenix|'vm-received' Q 'digits/at' IMp
|
||||
saskatchewan=America/Saskatchewan|'vm-received' Q 'digits/at' IMp
|
||||
pacific=America/Los_Angeles|'vm-received' Q 'digits/at' IMp
|
||||
alaska=America/Anchorage|'vm-received' Q 'digits/at' IMp
|
||||
hawaii=Pacific/Honolulu|'vm-received' Q 'digits/at' IMp
|
||||
eastern24=America/New_York|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
central24=America/Chicago|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
mountain24=America/Denver|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
pacific24=America/Los_Angeles|'vm-received' q 'digits/at' H 'digits/hundred' M 'hours'
|
||||
military=Zulu|'vm-received' q 'digits/at' H N 'hours' 'phonetic/z_p'
|
||||
|
||||
[default]
|
||||
; mailboxes go here
|
||||
@@ -686,7 +686,8 @@ webphone_url_override VARCHAR(255) default '',
|
||||
webphone_systemkey_override VARCHAR(100) default '',
|
||||
webphone_dialpad_override ENUM('DISABLED','Y','N','TOGGLE','TOGGLE_OFF') default 'DISABLED',
|
||||
admin_viewable_groups TEXT,
|
||||
admin_viewable_call_times TEXT
|
||||
admin_viewable_call_times TEXT,
|
||||
allowed_custom_reports VARCHAR(2000) default ''
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_campaigns (
|
||||
@@ -961,7 +962,8 @@ inventory_report ENUM('Y','N') default 'Y',
|
||||
expiration_date DATE default '2099-12-31',
|
||||
na_call_url TEXT,
|
||||
local_call_time VARCHAR(10) NOT NULL DEFAULT 'campaign',
|
||||
web_form_address_three TEXT
|
||||
web_form_address_three TEXT,
|
||||
status_group_id VARCHAR(20) default ''
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_statuses (
|
||||
@@ -976,14 +978,16 @@ customer_contact ENUM('Y','N') default 'N',
|
||||
not_interested ENUM('Y','N') default 'N',
|
||||
unworkable ENUM('Y','N') default 'N',
|
||||
scheduled_callback ENUM('Y','N') default 'N',
|
||||
completed ENUM('Y','N') default 'N'
|
||||
completed ENUM('Y','N') default 'N',
|
||||
min_sec INT(5) UNSIGNED default '0',
|
||||
max_sec INT(5) UNSIGNED default '0'
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_campaign_statuses (
|
||||
status VARCHAR(6) NOT NULL,
|
||||
status_name VARCHAR(30),
|
||||
selectable ENUM('Y','N'),
|
||||
campaign_id VARCHAR(8),
|
||||
campaign_id VARCHAR(20),
|
||||
human_answered ENUM('Y','N') default 'N',
|
||||
category VARCHAR(20) default 'UNDEFINED',
|
||||
sale ENUM('Y','N') default 'N',
|
||||
@@ -993,6 +997,8 @@ not_interested ENUM('Y','N') default 'N',
|
||||
unworkable ENUM('Y','N') default 'N',
|
||||
scheduled_callback ENUM('Y','N') default 'N',
|
||||
completed ENUM('Y','N') default 'N',
|
||||
min_sec INT(5) UNSIGNED default '0',
|
||||
max_sec INT(5) UNSIGNED default '0',
|
||||
index (campaign_id)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
@@ -1148,7 +1154,8 @@ drop_lead_reset ENUM('Y','N') default 'N',
|
||||
after_hours_lead_reset ENUM('Y','N') default 'N',
|
||||
nanq_lead_reset ENUM('Y','N') default 'N',
|
||||
wait_time_lead_reset ENUM('Y','N') default 'N',
|
||||
hold_time_lead_reset ENUM('Y','N') default 'N'
|
||||
hold_time_lead_reset ENUM('Y','N') default 'N',
|
||||
status_group_id VARCHAR(20) default ''
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_stations (
|
||||
@@ -1612,7 +1619,8 @@ chat_timeout INT(3) unsigned DEFAULT NULL,
|
||||
agent_debug_logging VARCHAR(20) default '0',
|
||||
default_language VARCHAR(100) default 'default English',
|
||||
agent_whisper_enabled ENUM('0','1') default '0',
|
||||
user_hide_realtime_enabled ENUM('0','1') default '0'
|
||||
user_hide_realtime_enabled ENUM('0','1') default '0',
|
||||
custom_reports_use_slave_db VARCHAR(2000) default ''
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE vicidial_campaigns_list_mix (
|
||||
@@ -3327,6 +3335,25 @@ user VARCHAR(20) default '',
|
||||
index (phone_number)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
CREATE TABLE vicidial_status_groups (
|
||||
status_group_id VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||
status_group_notes VARCHAR(255) default '',
|
||||
user_group VARCHAR(20) default '---ALL---'
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
CREATE TABLE vicidial_custom_reports (
|
||||
custom_report_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
report_name VARCHAR(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
date_added DATETIME DEFAULT NULL,
|
||||
user VARCHAR(20) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
domain VARCHAR(70) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
path_name VARCHAR(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
date_modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
user_modify VARCHAR(20) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
PRIMARY KEY (custom_report_id),
|
||||
UNIQUE KEY custom_report_name_key (report_name)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
|
||||
ALTER TABLE vicidial_email_list MODIFY message text character set utf8;
|
||||
|
||||
@@ -3576,4 +3603,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='1432',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1433',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -303,3 +303,40 @@ index (phone_number)
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1432',db_schema_update_date=NOW() where db_schema_version < 1432;
|
||||
|
||||
CREATE TABLE vicidial_status_groups (
|
||||
status_group_id VARCHAR(20) PRIMARY KEY NOT NULL,
|
||||
status_group_notes VARCHAR(255) default '',
|
||||
user_group VARCHAR(20) default '---ALL---'
|
||||
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
ALTER TABLE vicidial_campaign_statuses MODIFY campaign_id VARCHAR(20);
|
||||
|
||||
ALTER TABLE vicidial_lists ADD status_group_id VARCHAR(20) default '';
|
||||
|
||||
ALTER TABLE vicidial_inbound_groups ADD status_group_id VARCHAR(20) default '';
|
||||
|
||||
ALTER TABLE vicidial_campaign_statuses ADD min_sec INT(5) UNSIGNED default '0';
|
||||
ALTER TABLE vicidial_campaign_statuses ADD max_sec INT(5) UNSIGNED default '0';
|
||||
|
||||
ALTER TABLE vicidial_statuses ADD min_sec INT(5) UNSIGNED default '0';
|
||||
ALTER TABLE vicidial_statuses ADD max_sec INT(5) UNSIGNED default '0';
|
||||
|
||||
ALTER TABLE system_settings ADD custom_reports_use_slave_db VARCHAR(2000) default '';
|
||||
|
||||
ALTER TABLE vicidial_user_groups ADD allowed_custom_reports VARCHAR(2000) default '';
|
||||
|
||||
CREATE TABLE vicidial_custom_reports (
|
||||
custom_report_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
report_name VARCHAR(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
date_added DATETIME DEFAULT NULL,
|
||||
user VARCHAR(20) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
domain VARCHAR(70) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
path_name VARCHAR(100) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
date_modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
user_modify VARCHAR(20) COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||
PRIMARY KEY (custom_report_id),
|
||||
UNIQUE KEY custom_report_name_key (report_name)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1433',db_schema_update_date=NOW() where db_schema_version < 1433;
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
# 150302-0706 - Removed path changes for non-English languages
|
||||
# 150312-0942 - Added ExpectedDBSchema value in astguiclient.conf
|
||||
# 150911-1808 - Added creation of GPG directory for encrypted recordings
|
||||
# 151029-0650 - Added Asterisk 11 as listed option, added new sample voicemail.conf for 1.8 and higher
|
||||
#
|
||||
|
||||
############################################
|
||||
@@ -1841,6 +1842,7 @@ else
|
||||
print " 1.2\n";
|
||||
print " 1.4\n";
|
||||
print " 1.8\n";
|
||||
print " 11.X\n";
|
||||
print "Enter asterisk version or press enter for default: [$VARasterisk_version] ";
|
||||
$PROMPTasterisk_version = <STDIN>;
|
||||
chomp($PROMPTasterisk_version);
|
||||
@@ -2700,15 +2702,17 @@ if ( ($PROMPTcopy_conf_files =~ /y/i) || ($CLIcopy_conf_files =~ /y/i) )
|
||||
`cp -f ./docs/conf_examples/iax.conf.sample /etc/asterisk/iax.conf`;
|
||||
`cp -f ./docs/conf_examples/sip.conf.sample /etc/asterisk/sip.conf`;
|
||||
`cp -f ./docs/conf_examples/manager.conf.sample /etc/asterisk/manager.conf`;
|
||||
`cp -f ./docs/conf_examples/voicemail.conf.sample /etc/asterisk/voicemail.conf`;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($VARasterisk_version =~ /^1.8/)
|
||||
if ($VARasterisk_version =~ /^1.8|^11/)
|
||||
{
|
||||
`cp -f ./docs/conf_examples/extensions.conf.sample-1.8 /etc/asterisk/extensions.conf`;
|
||||
`cp -f ./docs/conf_examples/iax.conf.sample-1.4 /etc/asterisk/iax.conf`;
|
||||
`cp -f ./docs/conf_examples/sip.conf.sample-1.4 /etc/asterisk/sip.conf`;
|
||||
`cp -f ./docs/conf_examples/manager.conf.sample-1.8 /etc/asterisk/manager.conf`;
|
||||
`cp -f ./docs/conf_examples/voicemail.conf.sample-1.8 /etc/asterisk/voicemail.conf`;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2716,11 +2720,11 @@ if ( ($PROMPTcopy_conf_files =~ /y/i) || ($CLIcopy_conf_files =~ /y/i) )
|
||||
`cp -f ./docs/conf_examples/iax.conf.sample-1.4 /etc/asterisk/iax.conf`;
|
||||
`cp -f ./docs/conf_examples/sip.conf.sample-1.4 /etc/asterisk/sip.conf`;
|
||||
`cp -f ./docs/conf_examples/manager.conf.sample /etc/asterisk/manager.conf`;
|
||||
`cp -f ./docs/conf_examples/voicemail.conf.sample /etc/asterisk/voicemail.conf`;
|
||||
}
|
||||
}
|
||||
`cp -f ./docs/conf_examples/meetme.conf.sample /etc/asterisk/meetme.conf`;
|
||||
`cp -f ./docs/conf_examples/musiconhold.conf.sample /etc/asterisk/musiconhold.conf`;
|
||||
`cp -f ./docs/conf_examples/voicemail.conf.sample /etc/asterisk/voicemail.conf`;
|
||||
`cp -f ./docs/conf_examples/logger.conf.sample /etc/asterisk/logger.conf`;
|
||||
`cp -f ./docs/conf_examples/dnsmgr.conf.sample /etc/asterisk/dnsmgr.conf`;
|
||||
`cp -f ./docs/conf_examples/features.conf.sample /etc/asterisk/features.conf`;
|
||||
|
||||
@@ -391,10 +391,11 @@
|
||||
# 150923-2013 - Added DID custom variables to call data transmission
|
||||
# 150928-1818 - Added dnc logging
|
||||
# 151006-0939 - Changed campaign_cid_areacodes to operate with 2-5 digit areacodes
|
||||
# 151026-1710 - Added function for Status Groups lookups and delivery to agent screen
|
||||
#
|
||||
|
||||
$version = '2.12-286';
|
||||
$build = '151006-0939';
|
||||
$version = '2.12-287';
|
||||
$build = '151026-1710';
|
||||
$php_script = 'vdc_db_query.php';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=635;
|
||||
@@ -4076,7 +4077,7 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
### Look for number preset override settings from list
|
||||
if (strlen($list_id)>0)
|
||||
{
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,list_name,list_description from vicidial_lists where list_id='$list_id';";
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,list_name,list_description,status_group_id from vicidial_lists where list_id='$list_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00278',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -4097,8 +4098,9 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
if (strlen($row[5]) > 0)
|
||||
{$list_name = $row[5];}
|
||||
$list_description = $row[6];
|
||||
$status_group_gather_data = status_group_gather($row[7],'LIST');
|
||||
}
|
||||
|
||||
|
||||
$custom_field_names='|';
|
||||
$custom_field_names_SQL='';
|
||||
$custom_field_values='----------';
|
||||
@@ -4221,6 +4223,7 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
$LeaD_InfO .= $VDCL_ingroup_script_color . "\n";
|
||||
$LeaD_InfO .= $list_description . "\n";
|
||||
$LeaD_InfO .= $entry_date . "\n";
|
||||
$LeaD_InfO .= $status_group_gather_data . "\n";
|
||||
|
||||
echo $LeaD_InfO;
|
||||
}
|
||||
@@ -6888,7 +6891,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
### Check for List ID override settings
|
||||
if (strlen($list_id)>0)
|
||||
{
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,list_name,web_form_address_three,list_description from vicidial_lists where list_id='$list_id';";
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,list_name,web_form_address_three,list_description,status_group_id from vicidial_lists where list_id='$list_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00281',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -6915,6 +6918,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
if (strlen($row[8]) > 5)
|
||||
{$VDCL_group_web_three = $row[8];}
|
||||
$list_description = $row[9];
|
||||
$status_group_gather_data = status_group_gather($row[10],'LIST');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6994,7 +6998,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
$script_recording_delay = $row[0];
|
||||
}
|
||||
|
||||
$stmt = "SELECT group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,uniqueid_status_display,uniqueid_status_prefix,timer_action_destination,web_form_address_three from vicidial_inbound_groups where group_id='$VDADchannel_group';";
|
||||
$stmt = "SELECT group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,uniqueid_status_display,uniqueid_status_prefix,timer_action_destination,web_form_address_three,status_group_id from vicidial_inbound_groups where group_id='$VDADchannel_group';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -7030,6 +7034,8 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
$VDCL_timer_action_destination = $row[25];
|
||||
$VDCL_group_web_three = stripslashes($row[26]);
|
||||
|
||||
$status_group_gather_data = status_group_gather($row[27],'INGROUP');
|
||||
|
||||
$stmt = "SELECT campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination from vicidial_campaigns where campaign_id='$campaign';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
@@ -7110,6 +7116,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
### update the comments in vicidial_live_agents record
|
||||
$stmt = "UPDATE vicidial_live_agents set comments='INBOUND',last_inbound_call_time='$NOW_TIME' where user='$user' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -7204,7 +7211,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
### Check for List ID override settings
|
||||
if (strlen($list_id)>0)
|
||||
{
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,list_name,web_form_address_three,list_description from vicidial_lists where list_id='$list_id';";
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,list_name,web_form_address_three,list_description,status_group_id from vicidial_lists where list_id='$list_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00282',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -7231,6 +7238,10 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
if (strlen($row[8]) > 5)
|
||||
{$VDCL_group_web_three = $row[8];}
|
||||
$list_description = $row[9];
|
||||
if (strlen($status_group_gather_data)<5)
|
||||
{
|
||||
$status_group_gather_data = status_group_gather($row[10],'LIST');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7421,6 +7432,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
$LeaD_InfO .= $DID_custom_three . "\n";
|
||||
$LeaD_InfO .= $DID_custom_four . "\n";
|
||||
$LeaD_InfO .= $DID_custom_five . "\n";
|
||||
$LeaD_InfO .= $status_group_gather_data . "\n";
|
||||
|
||||
echo $LeaD_InfO;
|
||||
|
||||
@@ -8105,7 +8117,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$VDCL_front_VDlog =$row[0];
|
||||
}
|
||||
$stmt = "SELECT group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,uniqueid_status_display,uniqueid_status_prefix,timer_action_destination,web_form_address_three from vicidial_inbound_groups where group_id='$VDADchannel_group';";
|
||||
$stmt = "SELECT group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,uniqueid_status_display,uniqueid_status_prefix,timer_action_destination,web_form_address_three,status_group_id from vicidial_inbound_groups where group_id='$VDADchannel_group';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00500',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -8141,6 +8153,8 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
|
||||
$VDCL_timer_action_destination = $row[25];
|
||||
$VDCL_group_web_three = stripslashes($row[26]);
|
||||
|
||||
$status_group_gather_data = status_group_gather($row[27],'INGROUP');
|
||||
|
||||
$stmt = "SELECT campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination from vicidial_campaigns where campaign_id='$campaign';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
@@ -8284,7 +8298,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
|
||||
### Check for List ID override settings
|
||||
if (strlen($list_id)>0)
|
||||
{
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,list_name,web_form_address_three,list_description from vicidial_lists where list_id='$list_id';";
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,list_name,web_form_address_three,list_description,status_group_id from vicidial_lists where list_id='$list_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00508',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -8311,6 +8325,10 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
|
||||
if (strlen($row[8]) > 5)
|
||||
{$VDCL_group_web_three = $row[8];}
|
||||
$list_description = $row[9];
|
||||
if (strlen($status_group_gather_data)<5)
|
||||
{
|
||||
$status_group_gather_data = status_group_gather($row[10],'LIST');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8470,6 +8488,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
|
||||
$LeaD_InfO .= $DID_custom_three . "\n";
|
||||
$LeaD_InfO .= $DID_custom_four . "\n";
|
||||
$LeaD_InfO .= $DID_custom_five . "\n";
|
||||
$LeaD_InfO .= $status_group_gather_data . "\n";
|
||||
|
||||
echo $LeaD_InfO;
|
||||
|
||||
@@ -9192,7 +9211,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
|
||||
$script_recording_delay = $row[0];
|
||||
}
|
||||
|
||||
$stmt = "SELECT group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,uniqueid_status_display,uniqueid_status_prefix,timer_action_destination,web_form_address_three from vicidial_inbound_groups where group_id='$VDADchannel_group';";
|
||||
$stmt = "SELECT group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,uniqueid_status_display,uniqueid_status_prefix,timer_action_destination,web_form_address_three,status_group_id from vicidial_inbound_groups where group_id='$VDADchannel_group';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00468',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -9228,6 +9247,8 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
|
||||
$VDCL_timer_action_destination = $row[25];
|
||||
$VDCL_group_web_three = stripslashes($row[26]);
|
||||
|
||||
$status_group_gather_data = status_group_gather($row[27],'INGROUP');
|
||||
|
||||
$stmt = "SELECT campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination from vicidial_campaigns where campaign_id='$campaign';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
@@ -9330,7 +9351,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
|
||||
### Check for List ID override settings
|
||||
if (strlen($list_id)>0)
|
||||
{
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,list_name,web_form_address_three,list_description from vicidial_lists where list_id='$list_id';";
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,list_name,web_form_address_three,list_description,status_group_id from vicidial_lists where list_id='$list_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00473',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -9357,6 +9378,10 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
|
||||
if (strlen($row[8]) > 5)
|
||||
{$VDCL_group_web_three = $row[8];}
|
||||
$list_description = $row[9];
|
||||
if (strlen($status_group_gather_data)<5)
|
||||
{
|
||||
$status_group_gather_data = status_group_gather($row[10],'LIST');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9558,6 +9583,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
|
||||
$LeaD_InfO .= $DID_custom_three . "\n";
|
||||
$LeaD_InfO .= $DID_custom_four . "\n";
|
||||
$LeaD_InfO .= $DID_custom_five . "\n";
|
||||
$LeaD_InfO .= $status_group_gather_data . "\n";
|
||||
|
||||
echo $LeaD_InfO;
|
||||
|
||||
@@ -14449,4 +14475,39 @@ function sip_hangup_cause_description($sip_code)
|
||||
else { return _QXZ("Unidentified SIP Hangup Cause Code."); }
|
||||
}
|
||||
|
||||
|
||||
##### Gather custom list/in-group status group statuses #####
|
||||
function status_group_gather($status_group_id,$record_type)
|
||||
{
|
||||
global $NOW_TIME,$link,$mel,$user,$server_ip,$session_name,$one_mysql_log;
|
||||
|
||||
$status_group_statuses='';
|
||||
$cs_ct=0;
|
||||
|
||||
if ( (strlen($status_group_id)>0) and ($status_group_id != 'NONE') )
|
||||
{
|
||||
$stmt = "SELECT status,status_name,scheduled_callback,min_sec,max_sec from vicidial_campaign_statuses where campaign_id='$status_group_id' and selectable='Y';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($rslt) {$cs_ct = mysqli_num_rows($rslt);}
|
||||
$i=0;
|
||||
while ($cs_ct > $i)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$status = $row[0];
|
||||
$status_name = $row[1];
|
||||
$scheduled_callback = $row[2];
|
||||
$min_sec = $row[3];
|
||||
$max_sec = $row[4];
|
||||
$status_group_statuses .= "$status|$status_name|$scheduled_callback|$min_sec|$max_sec,";
|
||||
|
||||
$i++;
|
||||
}
|
||||
if (strlen($status_group_statuses)>0)
|
||||
{$status_group_statuses = substr("$status_group_statuses", 0, -1);}
|
||||
}
|
||||
return $status_group_statuses;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+690
-137
File diff suppressed because it is too large
Load Diff
+1141
-443
File diff suppressed because one or more lines are too long
@@ -53,6 +53,7 @@
|
||||
# 150307-0915 - Fixes for QXZ
|
||||
# 150806-1023 - Added code for Admin -> Settings Containers
|
||||
# 150808-2043 - Added compatibility for custom fields data option
|
||||
# 151020-0654 - Added Status Groups
|
||||
#
|
||||
|
||||
|
||||
@@ -1515,6 +1516,8 @@ $SSenable_languages = $row[7];
|
||||
else {$cts_sh=''; $cts_fc='BLACK';}
|
||||
if ($sh=='sc') {$sc_sh="bgcolor=\"$sc_color\""; $sc_fc="$cc_font";}
|
||||
else {$sc_sh=''; $sc_fc='BLACK';}
|
||||
if ($sh=='sg') {$sg_sh="bgcolor=\"$sg_color\""; $sg_fc="$cc_font";}
|
||||
else {$sg_sh=''; $sg_fc='BLACK';}
|
||||
if ($sh=='emails') {$emails_sh="bgcolor=\"$subcamp_color\""; $emails_fc="$subcamp_font";}
|
||||
else {$emails_sh=''; $emails_fc='BLACK';}
|
||||
|
||||
@@ -1541,6 +1544,8 @@ $SSenable_languages = $row[7];
|
||||
<a href="<?php echo $ADMIN ?>?ADD=180000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $label_fc ?> SIZE=<?php echo $header_font_size ?>> <?php echo _QXZ("Screen Labels"); ?> </a></TD>
|
||||
</TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $status_sh ?>>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $status_fc ?> SIZE=<?php echo $header_font_size ?>> <?php echo _QXZ("System Statuses"); ?> </a></TD>
|
||||
</TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $sg_sh ?>>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=193000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $status_fc ?> SIZE=<?php echo $header_font_size ?>> <?php echo _QXZ("Status Groups"); ?> </a></TD>
|
||||
</TR><TR BGCOLOR=<?php echo $admin_color ?>><TD ALIGN=LEFT <?php echo $vm_sh ?>>
|
||||
<a href="<?php echo $ADMIN ?>?ADD=170000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=<?php echo $vm_fc ?> SIZE=<?php echo $header_font_size ?>> <?php echo _QXZ("Voicemail"); ?> </a></TD>
|
||||
</TR>
|
||||
@@ -1769,6 +1774,10 @@ if ($SSenable_languages == '1')
|
||||
?>
|
||||
<TR BGCOLOR=<?php echo $sc_color ?>><TD ALIGN=LEFT COLSPAN=2> <a href="<?php echo $ADMIN ?>?ADD=192000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo _QXZ("Settings Containers"); ?> </a> |<?php if ($add_copy_disabled < 1) { ?> <a href="<?php echo $ADMIN ?>?ADD=192111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo _QXZ("Add A Settings Container"); ?> </a><?php } ?></TD></TR>
|
||||
<?php }
|
||||
if (strlen($sg_sh) > 1) {
|
||||
?>
|
||||
<TR BGCOLOR=<?php echo $sg_color ?>><TD ALIGN=LEFT COLSPAN=2> <a href="<?php echo $ADMIN ?>?ADD=193000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo _QXZ("Status Groups"); ?> </a> |<?php if ($add_copy_disabled < 1) { ?> <a href="<?php echo $ADMIN ?>?ADD=193111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo _QXZ("Add A Status Group"); ?> </a><?php } ?></TD></TR>
|
||||
<?php }
|
||||
if ( (strlen($status_sh) > 1) and (!preg_match('/campaign/i',$hh) ) ) {
|
||||
?>
|
||||
<TR BGCOLOR=<?php echo $status_color ?>><TD ALIGN=LEFT COLSPAN=2> <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo _QXZ("System Statuses"); ?> </a> | <a href="<?php echo $ADMIN ?>?ADD=331111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo _QXZ("Status Categories"); ?> </a> | <a href="<?php echo $ADMIN ?>?ADD=341111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> <?php echo _QXZ("QC Status Codes"); ?> </a></TD></TR>
|
||||
|
||||
@@ -63,8 +63,10 @@
|
||||
# 150925-2235 - Added user_hide_realtime and user lead filter options
|
||||
# 150926-1058 - Added did_carrier_description
|
||||
# 151006-0935 - Updated campaign_cid_areacodes entry
|
||||
# 151020-0704 - Added Status Groups and Custom Reports entries
|
||||
#
|
||||
|
||||
|
||||
require("dbconnect_mysqli.php");
|
||||
require("functions.php");
|
||||
|
||||
@@ -1991,6 +1993,11 @@ if ($SSqc_features_active > 0)
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Drop Inbound Group Override"); ?> -</B><?php echo _QXZ("If this field is set, this in-group will be used for outbound calls within this list that drop from the outbound campaign instead of the drop in-group set in the campaign detail screen. Default is not set."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="lists-status_group_id">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Status Group Override"); ?> -</B><?php echo _QXZ("If this field is set, this Status Group will be used instead of the campaign statuses for calls handled by agents from this list. This does not affect System Statuses which will always be shown. Statuses defined within this status group will not be available with Campaign HotKeys unless they are defined in Campaign Statuses. Default is not set."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="lists-web_form_address">
|
||||
<BR>
|
||||
@@ -2210,6 +2217,11 @@ if ($SSqc_features_active > 0)
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Ignore List Script Override-</B> This option allows you to ignore the list ID Script Override option for calls coming into this In-Group. Setting this to Y will ignore any List ID script settings. Default is N."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="inbound_groups-status_group_id">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Status Group Override"); ?> -</B><?php echo _QXZ("If this field is set, this Status Group will be used instead of the campaign statuses for calls handled by agents from this inbound group. This does not affect System Statuses which will always be shown. Statuses defined within this status group will not be available with Campaign HotKeys unless they are defined in Campaign Statuses. Default is not set."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="inbound_groups-get_call_launch">
|
||||
<BR>
|
||||
@@ -3169,7 +3181,7 @@ if ($SSqc_features_active > 0)
|
||||
<B><FONT SIZE=3>CAMPAIGN_STATUSES TABLE</FONT></B><BR><BR>
|
||||
<A NAME="campaign_statuses">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in the system as a disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a catogy that can be used for statistical analysis.")."</B>";
|
||||
<B><?php echo _QXZ("Through the use of custom campaign statuses, you can have statuses that only exist for a specific campaign. The Status must be 1-8 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in the system as a disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a catagory that can be used for statistical analysis. There are also 7 additional settings that will define the kind of status: sale, dnc, customer contact, not interested, unworkable, scheduled callback, completed. The MIN SEC and MAX SEC fields for each status will determine whether an agent can select that status at the end of their call based upon the length of the call. If the call is 10 seconds and the MIN SEC for a status is set to 20 seconds, then the agent will not be able to select that status. Also, if a call is 40 seconds and the MAX SEC for a status is set to 30 seconds, then the agent will not be able to select that status.")."</B>";
|
||||
|
||||
|
||||
|
||||
@@ -3308,6 +3320,11 @@ if ($SSoutbound_autodial_active > 0)
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Allowed Reports"); ?> -</B><?php echo _QXZ("If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the reports that the users can view. Default is ALL. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="user_groups-allowed_custom_reports">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Allowed Custom Reports"); ?> -</B><?php echo _QXZ("If a user in this group is set to user level 7 or higher, then this feature can be used to restrict the custom reports that the users can view. Access is determined as reports are added from the custom reports admin page, for example, ALL is not the default. If you want to select more than one report then press the Ctrl key on your keyboard as you select the reports."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="user_groups-admin_viewable_groups">
|
||||
<BR>
|
||||
@@ -4947,6 +4964,12 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Reports to use Slave DB"); ?> -</B><?php echo _QXZ("This option allows you to select the reports that you want to have use the MySQL slave database as defined in the option above instead of the master database that your live system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled."); ?>
|
||||
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-custom_reports_use_slave_db">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Custom Reports to use Slave DB"); ?> -</B><?php echo _QXZ("This option allows you to select the custom reports that you want to have use the MySQL slave database as defined in the option above instead of the master database that your live system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="settings-default_field_labels">
|
||||
<BR>
|
||||
@@ -5141,7 +5164,19 @@ FR_SPAC 00 00 00 00 00 - <?php echo _QXZ("France space separated phone number");
|
||||
<B><FONT SIZE=3>STATUSES TABLE</FONT></B><BR><BR>
|
||||
<A NAME="system_statuses">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Through the use of system statuses, you can have statuses that exist for all campaigns and in-groups. The Status must be 1-6 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in the system as an agent disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a category that can be used for statistical analysis. There are also 5 additional settings that will define the kind of status: sale, dnc, customer contact, not interested, unworkable, scheduled callback."); ?></B>
|
||||
<B><?php echo _QXZ("Through the use of system statuses, you can have statuses that exist for all campaigns and in-groups. The Status must be 1-6 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in the system as an agent disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a category that can be used for statistical analysis. There are also 7 additional settings that will define the kind of status: sale, dnc, customer contact, not interested, unworkable, scheduled callback, completed. The MIN SEC and MAX SEC fields for each status will determine whether an agent can select that status at the end of their call based upon the length of the call. If the call is 10 seconds and the MIN SEC for a status is set to 20 seconds, then the agent will not be able to select that status. Also, if a call is 40 seconds and the MAX SEC for a status is set to 30 seconds, then the agent will not be able to select that status."); ?></B>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<BR><BR><BR><BR>
|
||||
|
||||
<B><FONT SIZE=3>STATUS_GROUPS TABLE</FONT></B><BR><BR>
|
||||
<A NAME="status_groups">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Through the use of status groups, you can have statuses that exist for lists or in-groups specifically. The Status must be 1-6 characters in length, the description must be 2-30 characters in length and Selectable defines whether it shows up in the system as an agent disposition. The human_answered field is used when calculating the drop percentage, or abandon rate. Setting human_answered to Y will use this status when counting the human-answered calls. The Category option allows you to group several statuses into a category that can be used for statistical analysis. There are also 7 additional settings that will define the kind of status: sale, dnc, customer contact, not interested, unworkable, scheduled callback, completed. The MIN SEC and MAX SEC fields for each status will determine whether an agent can select that status at the end of their call based upon the length of the call. If the call is 10 seconds and the MIN SEC for a status is set to 20 seconds, then the agent will not be able to select that status. Also, if a call is 40 seconds and the MAX SEC for a status is set to 30 seconds, then the agent will not be able to select that status. The Status Group ID field must be between 2 and 20 characters in length, must not match a current campaign ID, and cannot contain spaces or other special characters."); ?></B>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -5555,6 +5590,33 @@ if ($SSqc_features_active > 0)
|
||||
<?php echo _QXZ("This page allows you to define Alternate URLs with conditions in place of the simple URL option for Dispo, Start, Add Lead or No Agent URLs. The RANK field will define the order in which the URLs are requested, this is important because if you have a URL that may take a few seconds to run ranked as 1, that will mean that any URLs ranked after it will have to wait to be run until that first URL request receives a response. The ACTIVE field will determine whether the specific URL is run. The STATUSES field only works for the Dispo URLs and will determine which disposition statuses will trigger the URL being run, if you want to run the entry for all statuses just fill in ---ALL--- in this field. The URL field works the same as it would in the URL option in campaigns, in-groups and lists, and it is also limited to 2000 characters in length. If you want to delete a URL, it must first be set to not active, then you can click on the DELETE link below the SUBMIT button for that URL entry."); ?>
|
||||
|
||||
|
||||
<BR><BR><BR><BR>
|
||||
|
||||
<A NAME="custom_reports_admin">
|
||||
<B><FONT SIZE=3>Custom Reports Admin</FONT></B><BR><BR>
|
||||
<BR>
|
||||
|
||||
|
||||
<BR>
|
||||
<A NAME="custom_reports_admin-report_name">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Report Name"); ?> -</B><?php echo _QXZ("The report name that the report will be referred to as in the system for purposes of user group access and slave server use in the system settings. The report name may not be the same as any other custom report, nor may it be the same name as one of the standard system reports."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="custom_reports_admin-domain">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Domain"); ?> -</B><?php echo _QXZ("The domain that the report is located at. This will be combined with the path name to make a complete URL to use as a link from the reports page. You may leave this blank when the report is located on the same server as the web admin and just use the path name field to make a local URL."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="custom_reports_admin-path_name">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("Path name"); ?> -</B><?php echo _QXZ("The path on the domain where the report is located. When the domain is blank it is assumed that the report is housed on the local web server."); ?>
|
||||
|
||||
<BR>
|
||||
<A NAME="custom_reports_admin-custom_reports_user_groups">
|
||||
<BR>
|
||||
<B><?php echo _QXZ("User groups"); ?> -</B><?php echo _QXZ("The user groups that will be allowed to view this report. When a user goes to the reports page, if they belong to a user group that has access to any of the custom reports, they can see a Custom Reports section on this page with links to every custom report they can view."); ?>
|
||||
|
||||
|
||||
|
||||
<BR><BR><BR><BR><BR><BR><BR><BR><BR>
|
||||
|
||||
@@ -0,0 +1,472 @@
|
||||
<?php
|
||||
# vicidial_custom_reports_admin.php
|
||||
#
|
||||
# Allows admin level users to add access to their own
|
||||
# custom reports and make them available to user groups
|
||||
# of their choosing
|
||||
#
|
||||
# Copyright (C) 2015 Joseph Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 151023-0106 - First build
|
||||
|
||||
$startMS = microtime();
|
||||
|
||||
require("dbconnect_mysqli.php");
|
||||
require("functions.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["report_name"])) {$report_name=$_GET["report_name"];}
|
||||
elseif (isset($_POST["report_name"])) {$report_name=$_POST["report_name"];}
|
||||
if (isset($_GET["domain"])) {$domain=$_GET["domain"];}
|
||||
elseif (isset($_POST["domain"])) {$domain=$_POST["domain"];}
|
||||
if (isset($_GET["path_name"])) {$path_name=$_GET["path_name"];}
|
||||
elseif (isset($_POST["path_name"])) {$path_name=$_POST["path_name"];}
|
||||
if (isset($_GET["slave"])) {$slave=$_GET["slave"];}
|
||||
elseif (isset($_POST["slave"])) {$slave=$_POST["slave"];}
|
||||
if (isset($_GET["custom_reports_user_groups"])) {$custom_reports_user_groups=$_GET["custom_reports_user_groups"];}
|
||||
elseif (isset($_POST["custom_reports_user_groups"])) {$custom_reports_user_groups=$_POST["custom_reports_user_groups"];}
|
||||
if (isset($_GET["add_custom_report"])) {$add_custom_report=$_GET["add_custom_report"];}
|
||||
elseif (isset($_POST["add_custom_report"])) {$add_custom_report=$_POST["add_custom_report"];}
|
||||
if (isset($_GET["delete_custom_report"])) {$delete_custom_report=$_GET["delete_custom_report"];}
|
||||
elseif (isset($_POST["delete_custom_report"])) {$delete_custom_report=$_POST["delete_custom_report"];}
|
||||
if (isset($_GET["update_custom_report"])) {$update_custom_report=$_GET["update_custom_report"];}
|
||||
elseif (isset($_POST["update_custom_report"])) {$update_custom_report=$_POST["update_custom_report"];}
|
||||
if (isset($_GET["upd_custom_report_id"])) {$upd_custom_report_id=$_GET["upd_custom_report_id"];}
|
||||
elseif (isset($_POST["upd_custom_report_id"])) {$upd_custom_report_id=$_POST["upd_custom_report_id"];}
|
||||
if (isset($_GET["upd_report_name"])) {$upd_report_name=$_GET["upd_report_name"];}
|
||||
elseif (isset($_POST["upd_report_name"])) {$upd_report_name=$_POST["upd_report_name"];}
|
||||
if (isset($_GET["upd_path_name"])) {$upd_path_name=$_GET["upd_path_name"];}
|
||||
elseif (isset($_POST["upd_path_name"])) {$upd_path_name=$_POST["upd_path_name"];}
|
||||
if (isset($_GET["upd_slave"])) {$upd_slave=$_GET["upd_slave"];}
|
||||
elseif (isset($_POST["upd_slave"])) {$upd_slave=$_POST["upd_slave"];}
|
||||
if (isset($_GET["upd_domain"])) {$upd_domain=$_GET["upd_domain"];}
|
||||
elseif (isset($_POST["upd_domain"])) {$upd_domain=$_POST["upd_domain"];}
|
||||
if (isset($_GET["upd_custom_reports_user_groups"])) {$upd_custom_reports_user_groups=$_GET["upd_custom_reports_user_groups"];}
|
||||
elseif (isset($_POST["upd_custom_reports_user_groups"])) {$upd_custom_reports_user_groups=$_POST["upd_custom_reports_user_groups"];}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled,enable_languages,language_method,active_modules FROM system_settings;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysqli_num_rows($rslt);
|
||||
if ($qm_conf_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$outbound_autodial_active = $row[1];
|
||||
$slave_db_server = $row[2];
|
||||
$reports_use_slave_db = $row[3];
|
||||
$custom_fields_enabled = $row[4];
|
||||
$SSenable_languages = $row[5];
|
||||
$SSlanguage_method = $row[6];
|
||||
$active_modules = $row[7];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_PW);
|
||||
}
|
||||
else
|
||||
{
|
||||
$PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
|
||||
$PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
|
||||
}
|
||||
|
||||
$stmt="SELECT selected_language from vicidial_users where user='$PHP_AUTH_USER';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$sl_ct = mysqli_num_rows($rslt);
|
||||
if ($sl_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$VUselected_language = $row[0];
|
||||
}
|
||||
|
||||
$auth=0;
|
||||
$reports_auth=0;
|
||||
$admin_auth=0;
|
||||
$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1);
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
if ($auth > 0)
|
||||
{
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 7 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$admin_auth=$row[0];
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$reports_auth=$row[0];
|
||||
|
||||
if ($reports_auth < 1)
|
||||
{
|
||||
$VDdisplayMESSAGE = _QXZ("You are not allowed to view reports");
|
||||
Header ("Content-type: text/html; charset=utf-8");
|
||||
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n";
|
||||
exit;
|
||||
}
|
||||
if ( ($reports_auth > 0) and ($admin_auth < 1) )
|
||||
{
|
||||
$ADD=999999;
|
||||
$reports_only_user=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$VDdisplayMESSAGE = _QXZ("Login incorrect, please try again");
|
||||
if ($auth_message == 'LOCK')
|
||||
{
|
||||
$VDdisplayMESSAGE = _QXZ("Too many login attempts, try again in 15 minutes");
|
||||
Header ("Content-type: text/html; charset=utf-8");
|
||||
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n";
|
||||
exit;
|
||||
}
|
||||
Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$PHP_AUTH_PW|$auth_message|\n";
|
||||
exit;
|
||||
}
|
||||
###############
|
||||
$stmt="SELECT export_reports,user_group,admin_hide_lead_data,admin_hide_phone_data,admin_cf_show_hidden from vicidial_users where user='$PHP_AUTH_USER';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$LOGexport_reports = $row[0];
|
||||
$LOGuser_group = $row[1];
|
||||
$LOGadmin_hide_lead_data = $row[2];
|
||||
$LOGadmin_hide_phone_data = $row[3];
|
||||
$LOGadmin_cf_show_hidden = $row[4];
|
||||
|
||||
|
||||
$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$LOGallowed_campaigns = $row[0];
|
||||
$LOGallowed_reports = $row[1];
|
||||
$LOGadmin_viewable_groups = $row[2];
|
||||
$LOGadmin_viewable_call_times = $row[3];
|
||||
|
||||
$LOGadmin_viewable_groupsSQL='';
|
||||
$whereLOGadmin_viewable_groupsSQL='';
|
||||
if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
|
||||
{
|
||||
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
|
||||
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
|
||||
$LOGadmin_viewable_groupsSQL = "and user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
$whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
|
||||
$allowedUGarray=explode(" ", $rawLOGadmin_viewable_groupsSQL);
|
||||
if (in_array('---ALL---',$custom_reports_user_groups))
|
||||
{
|
||||
$custom_reports_user_groups=$allowedUGarray;
|
||||
}
|
||||
}
|
||||
|
||||
# Need to do this just in case
|
||||
if (preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) {
|
||||
|
||||
$all_user_groups_stmt="select user_group from vicidial_user_groups";
|
||||
$all_user_groups_rslt=mysql_to_mysqli($all_user_groups_stmt, $link);
|
||||
|
||||
$allowedUGarray=array();
|
||||
while ($user_group_row=mysqli_fetch_row($all_user_groups_rslt))
|
||||
{
|
||||
array_push($allowedUGarray, $user_group_row[0]);
|
||||
}
|
||||
|
||||
if (in_array('---ALL---',$custom_reports_user_groups))
|
||||
{
|
||||
$custom_reports_user_groups=$allowedUGarray;
|
||||
}
|
||||
}
|
||||
|
||||
# From system settings
|
||||
$Vreports = array("Real-Time Main Report", " Real-Time Campaign Summary", " Inbound Report", " Inbound Service Level Report", " Inbound Summary Hourly Report", " Inbound Daily Report", " Inbound DID Report", " Inbound IVR Report", " Outbound Calling Report", " Outbound Summary Interval Report", " Outbound IVR Report", " Fronter - Closer Report", " Lists Campaign Statuses Report", " Campaign Status List Report", " Export Calls Report", " Export Leads Report", " Agent Time Detail", " Agent Status Detail", " Agent Performance Detail", " Team Performance Detail", " Performance Comparison Report", " Single Agent Daily", " Single Agent Daily Time", " User Group Login Report", " User Timeclock Report", " User Group Timeclock Status Report", " User Timeclock Detail Report", " Server Performance Report", " Administration Change Log", " List Update Stats", " User Stats", " User Time Sheet", " Download List", " Dialer Inventory Report", " Maximum System Stats", " Maximum Stats Detail", " Search Leads Logs", " Email Log Report", " Carrier Log Report", " Campaign Debug", " Hangup Cause Report", " Lists Pass Report", " Called Counts List IDs Report");
|
||||
|
||||
|
||||
if ($add_custom_report=="ADD REPORT") {
|
||||
if (!$report_name || !$path_name) {
|
||||
$error_msg="<BR><B>"._QXZ("CANNOT ADD REPORT, SOME FIELDS ARE MISSING")."</B><BR>";
|
||||
} else {
|
||||
if (in_array($report_name, $Vreports)) {
|
||||
$error_msg="<BR><B>"._QXZ("CANNOT ADD REPORT, REPORT NAME ALREADY IN USE FOR STANDARD VICIDIAL REPORT")."</B><BR>";
|
||||
} else {
|
||||
$ins_stmt="insert into vicidial_custom_reports(report_name, date_added, user, domain, path_name) VALUES('$report_name', now(), '$PHP_AUTH_USER', '$domain', '$path_name')";
|
||||
$ins_rslt=mysql_to_mysqli($ins_stmt, $link);
|
||||
if (mysqli_affected_rows($link)<1) {
|
||||
$error_msg="<BR><B>"._QXZ("INSERT FAILED")."</B><BR>";
|
||||
} else {
|
||||
$user_group_stmt="select user_group, allowed_custom_reports from vicidial_user_groups where user_group in ('".implode("','", $custom_reports_user_groups)."') $LOGadmin_viewable_groupsSQL";
|
||||
# echo $user_group_stmt."<BR>\n";
|
||||
$user_group_rslt=mysql_to_mysqli($user_group_stmt, $link);
|
||||
while ($user_group_row=mysqli_fetch_array($user_group_rslt)) {
|
||||
$user_group=$user_group_row["user_group"];
|
||||
$allowed_custom_reports=$user_group_row["allowed_custom_reports"];
|
||||
if (!preg_match('/^$report_name\||\|$report_name\|/i', $allowed_custom_reports)) {
|
||||
$allowed_custom_reports=$allowed_custom_reports."$report_name|";
|
||||
$upd_stmt="update vicidial_user_groups set allowed_custom_reports='$allowed_custom_reports' where user_group='$user_group'";
|
||||
# echo $upd_stmt."<BR>\n";
|
||||
$upd_rslt=mysql_to_mysqli($upd_stmt, $link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ($upd_custom_report_id) {
|
||||
if (preg_match('/\-\-ALL\-\-/i',$upd_custom_reports_user_groups)) {
|
||||
$update_UG_array=$allowedUGarray; # All allowed user groups for user
|
||||
} else {
|
||||
$update_UG_array=explode("|", $upd_custom_reports_user_groups);
|
||||
}
|
||||
|
||||
if (!$upd_report_name || !$upd_path_name) {
|
||||
$error_msg="<BR><B>"._QXZ("CANNOT UPDATE REPORT, SOME FIELDS ARE MISSING")."</B><BR>";
|
||||
} else {
|
||||
if (in_array($upd_report_name, $Vreports)) {
|
||||
$error_msg="<BR><B>"._QXZ("CANNOT UPDATE REPORT, NEW CUSTOM REPORT NAME ALREADY IN USE FOR STANDARD VICIDIAL REPORT")."</B><BR>";
|
||||
} else {
|
||||
$old_rpt_stmt="select report_name from vicidial_custom_reports from vicidial_custom_reports where custom_report_id='$upd_custom_report_id'";
|
||||
$old_rpt_rslt=mysql_to_mysqli($old_rpt_stmt, $link);
|
||||
$old_rpt_row=mysqli_fetch_row($old_rpt_rslt);
|
||||
$old_rpt_name=$old_rpt_row[0];
|
||||
|
||||
$upd_stmt="update vicidial_custom_reports set report_name='$upd_report_name', date_added=now(), user='$PHP_AUTH_USER', domain='$upd_domain', path_name='$upd_path_name' where custom_report_id='$upd_custom_report_id'";
|
||||
$upd_rslt=mysql_to_mysqli($upd_stmt, $link);
|
||||
if (mysqli_affected_rows($link)<1) {
|
||||
$error_msg="<BR><B>"._QXZ("UPDATE FAILED")."</B><BR>";
|
||||
} else {
|
||||
$user_group_stmt="select user_group, allowed_custom_reports from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL";
|
||||
$user_group_rslt=mysql_to_mysqli($user_group_stmt, $link);
|
||||
while ($user_group_row=mysqli_fetch_array($user_group_rslt)) {
|
||||
$user_group=$user_group_row["user_group"];
|
||||
$allowed_custom_reports=$user_group_row["allowed_custom_reports"];
|
||||
|
||||
if (in_array($user_group, $update_UG_array)) {
|
||||
if (!preg_match("/^$upd_report_name\||\|$upd_report_name\|/i", $allowed_custom_reports)) {
|
||||
$allowed_custom_reports=$allowed_custom_reports."$upd_report_name|";
|
||||
$upd_stmt="update vicidial_user_groups set allowed_custom_reports='$allowed_custom_reports' where user_group='$user_group'";
|
||||
$upd_rslt=mysql_to_mysqli($upd_stmt, $link);
|
||||
}
|
||||
} else {
|
||||
if (preg_match("/^$upd_report_name\||\|$upd_report_name\|/i", $allowed_custom_reports)) {
|
||||
$allowed_custom_reports=preg_replace("/^$upd_report_name\||\|$upd_report_name\|/i", '', $allowed_custom_reports);
|
||||
$upd_stmt="update vicidial_user_groups set allowed_custom_reports='$allowed_custom_reports' where user_group='$user_group'";
|
||||
$upd_rslt=mysql_to_mysqli($upd_stmt, $link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ($delete_custom_report) {
|
||||
$old_rpt_stmt="select report_name from vicidial_custom_reports from vicidial_custom_reports where custom_report_id='$upd_custom_report_id'";
|
||||
$old_rpt_rslt=mysql_to_mysqli($old_rpt_stmt, $link);
|
||||
$old_rpt_row=mysqli_fetch_row($old_rpt_rslt);
|
||||
$old_rpt_name=$old_rpt_row[0];
|
||||
|
||||
$del_stmt="delete from vicidial_custom_reports where custom_report_id='$delete_custom_report'";
|
||||
$del_rslt=mysql_to_mysqli($del_stmt, $link);
|
||||
if (mysqli_affected_rows($link)<1) {
|
||||
$error_msg="<BR><B>"._QXZ("DELETE FAILED")."</B><BR>";
|
||||
} else {
|
||||
$user_group_stmt="select user_group, allowed_custom_reports from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL";
|
||||
$user_group_rslt=mysql_to_mysqli($user_group_stmt, $link);
|
||||
while ($user_group_row=mysqli_fetch_array($user_group_rslt)) {
|
||||
$user_group=$user_group_row["user_group"];
|
||||
$allowed_custom_reports=$user_group_row["allowed_custom_reports"];
|
||||
$old_report_removed=preg_replace("/^$old_rpt_name\||\|$old_rpt_name\|/i", $allowed_custom_reports);
|
||||
$upd_stmt="update vicidial_user_groups set allowed_custom_reports='$old_report_removed' where user_group='$user_group'";
|
||||
# echo $upd_stmt." - $allowed_custom_reports<BR>\n";
|
||||
$upd_rslt=mysql_to_mysqli($upd_stmt, $link);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$NWB = " <a href=\"javascript:openNewWindow('help.php";
|
||||
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
|
||||
|
||||
echo "<HTML><HEAD>\n";
|
||||
|
||||
?>
|
||||
<script language="Javascript">
|
||||
function SubmitIDValues(id_no) {
|
||||
RNfieldName="report_name"+id_no;
|
||||
// SLfieldName="slave"+id_no;
|
||||
DMfieldName="domain"+id_no;
|
||||
PNfieldName="path_name"+id_no;
|
||||
UGfieldName="custom_reports_user_groups"+id_no;
|
||||
|
||||
var selectedUGstr = "";
|
||||
|
||||
|
||||
document.getElementById("upd_custom_report_id").value=id_no;
|
||||
document.getElementById("upd_report_name").value=document.getElementById(RNfieldName).value;
|
||||
document.getElementById("upd_domain").value=document.getElementById(DMfieldName).value;
|
||||
// document.getElementById("upd_slave").value=document.getElementById(SLfieldName).value;
|
||||
document.getElementById("upd_path_name").value=document.getElementById(PNfieldName).value;
|
||||
|
||||
//for (i=0;i<document.getElementById(SLfieldName).length;i++) {
|
||||
// if (document.getElementById(SLfieldName)[i].selected) {
|
||||
// document.getElementById("upd_slave").value = document.getElementById(SLfieldName)[i].value;
|
||||
// }
|
||||
//}
|
||||
for (x=0;x<document.getElementById(UGfieldName).length;x++) {
|
||||
if (document.getElementById(UGfieldName)[x].selected) {
|
||||
selectedUGstr = selectedUGstr + "|" + document.getElementById(UGfieldName)[x].value;
|
||||
}
|
||||
}
|
||||
document.getElementById("upd_custom_reports_user_groups").value=selectedUGstr.substring(1);
|
||||
|
||||
document.getElementById("updateForm").submit();
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
echo "<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>"._QXZ("ADMINISTRATION").": "._QXZ("Custom Reports");
|
||||
if ($ivr_export == 'YES')
|
||||
{echo " "._QXZ("IVR");}
|
||||
|
||||
##### BEGIN Set variables to make header show properly #####
|
||||
$ADD = '100';
|
||||
$hh = 'lists';
|
||||
$LOGast_admin_access = '1';
|
||||
$SSoutbound_autodial_active = '1';
|
||||
$ADMIN = 'admin.php';
|
||||
$page_width='770';
|
||||
$section_width='750';
|
||||
$header_font_size='3';
|
||||
$subheader_font_size='2';
|
||||
$subcamp_font_size='2';
|
||||
$header_selected_bold='<b>';
|
||||
$header_nonselected_bold='';
|
||||
$lists_color = '#FFFF99';
|
||||
$lists_font = 'BLACK';
|
||||
$lists_color = '#E6E6E6';
|
||||
$subcamp_color = '#C6C6C6';
|
||||
##### END Set variables to make header show properly #####
|
||||
|
||||
require("admin_header.php");
|
||||
|
||||
|
||||
echo "<CENTER><BR>\n";
|
||||
echo "<FONT SIZE=3 FACE=\"Arial,Helvetica\"><B>"._QXZ("Vicidial Custom Reports");
|
||||
echo "</B></FONT><BR>\n";
|
||||
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
echo "$error_msg";
|
||||
|
||||
echo "<br><B>"._QXZ("ADD A NEW CUSTOM REPORT")."</B><form action=$PHP_SELF method=GET>\n";
|
||||
|
||||
echo "<center><TABLE width=$section_width cellspacing=3>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Report Name").": </td><td align=left><input type=text name=report_name size=20 maxlength=100>$NWB#custom_reports_admin-report_name$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Domain").": </td><td align=left><input type=text name=domain size=20 maxlength=70> (leave blank if on same server as dialer admin)$NWB#custom_reports_admin-domain$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Path Name").": </td><td align=left><input type=text name=path_name size=20 maxlength=100>$NWB#custom_reports_admin-path_name$NWE</td></tr>\n";
|
||||
# echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("Use slave").": </td><td align=left><select size=1 name=slave><option value='Y'>"._QXZ("Y")."</option><option value='N' selected>"._QXZ("N")."</option></select>$NWB#custom_reports_admin-use_slave$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>"._QXZ("User groups").": </td><td align=left><select size=5 name=custom_reports_user_groups[] multiple><option value='---ALL---'>"._QXZ("ALL USER GROUPS")."</option>";
|
||||
|
||||
$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$usergroups_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i<$usergroups_to_print) {
|
||||
$ug_row=mysqli_fetch_row($rslt);
|
||||
echo "<option value='$ug_row[0]'>$ug_row[1]</option>";
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo "</select>$NWB#custom_reports_admin-custom_reports_user_groups$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align='center' colspan='2'><input type='submit' name='add_custom_report' id='add_custom_report' value='"._QXZ("ADD REPORT")."'></td></tr>\n";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
|
||||
echo "<BR><BR><BR>";
|
||||
|
||||
|
||||
$rpt_stmt="select * from vicidial_custom_reports";
|
||||
$rpt_rslt=mysql_to_mysqli($rpt_stmt, $link);
|
||||
echo "<form action=$PHP_SELF method=GET id='updateForm'>";
|
||||
|
||||
if (mysqli_num_rows($rpt_rslt)>0) {
|
||||
echo "<br><B>"._QXZ("UPDATE EXISTING CUSTOM REPORTS")."</B>\n";
|
||||
echo "<center><TABLE width=$section_width cellpadding=3>\n";
|
||||
|
||||
echo "<tr bgcolor='#000000'>";
|
||||
echo "<td><font size=1 color=white align=left>"._QXZ("REPORT NAME")."</font></td>";
|
||||
echo "<td><font size=1 color=white align=left>"._QXZ("DOMAIN")."</font></td>";
|
||||
echo "<td><font size=1 color=white align=left>"._QXZ("PATH NAME")."</font></td>";
|
||||
echo "<td> </td>";
|
||||
# echo "<td><font size=1 color=white align=left>"._QXZ("SLAVE")."</font></td>";
|
||||
echo "<td><font size=1 color=white align=left>"._QXZ("USER GROUPS")."</font></td>";
|
||||
echo "<td> </td>";
|
||||
echo "</tr>";
|
||||
|
||||
while($rpt_row=mysqli_fetch_array($rpt_rslt)) {
|
||||
$id=$rpt_row["custom_report_id"];
|
||||
$current_rpt_name=$rpt_row["report_name"];
|
||||
|
||||
if ($bgcolor=="#ccffff") {$bgcolor="#99ffcc";} else {$bgcolor="#ccffff";}
|
||||
echo "<tr bgcolor='".$bgcolor."'>";
|
||||
|
||||
$UGarray=array();
|
||||
$UGstmt="select user_group from vicidial_user_groups where allowed_custom_reports like '%$current_rpt_name%' $LOGadmin_viewable_groupsSQL";
|
||||
$UGrslt=mysql_to_mysqli($UGstmt, $link);
|
||||
while($UGrow=mysqli_fetch_row($UGrslt)) {
|
||||
array_push($UGarray, $UGrow[0]);
|
||||
}
|
||||
|
||||
|
||||
echo "<td align=left><input type=text id=report_name".$id." name=report_name".$id." size=20 maxlength=100 value='".$rpt_row["report_name"]."'></td>\n";
|
||||
echo "<td align=left><input type=text id=domain".$id." name=domain".$id." size=20 maxlength=70 value='".$rpt_row["domain"]."'></td>\n";
|
||||
echo "<td align=left><input type=text id=path_name".$id." name=path_name".$id." size=20 maxlength=100 value='".$rpt_row["path_name"]."'></td>\n";
|
||||
echo "<td align=center nowrap><a href='".$rpt_row["domain"].$rpt_row["path_name"]."' target='_blank'>TEST LINK</a></td>";
|
||||
# echo "<td align=left><select size=1 id=slave".$id." name=slave".$id."><option value='Y'>"._QXZ("Y")."</option><option value='N'>"._QXZ("N")."</option><option value='".$rpt_row["use_slave_server"]."' selected>"._QXZ($rpt_row["use_slave_server"])."</option></select></td>\n";
|
||||
echo "<td align=left><select size=5 id=custom_reports_user_groups".$id." name=custom_reports_user_groups".$id." multiple><option value='---ALL---'>"._QXZ("ALL USER GROUPS")."</option>";
|
||||
|
||||
$stmt="SELECT user_group,group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$usergroups_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i<$usergroups_to_print) {
|
||||
$ug_row=mysqli_fetch_row($rslt);
|
||||
if (in_array("$ug_row[0]", $UGarray)) {$x="selected";} else {$x="";}
|
||||
echo "<option value='$ug_row[0]' $x>$ug_row[1]</option>";
|
||||
$i++;
|
||||
}
|
||||
echo "<td align='center'><input type='button' value='"._QXZ("UPDATE")."' onClick=\"SubmitIDValues($id)\"><BR><BR><a href='vicidial_custom_reports_admin.php?delete_custom_report=".$id."'>"._QXZ("DELETE")."</a></td>";
|
||||
echo "</tr>\n";
|
||||
|
||||
}
|
||||
}
|
||||
echo "</table>";
|
||||
echo "<input type=hidden name='upd_custom_report_id' id='upd_custom_report_id'>";
|
||||
echo "<input type=hidden name='upd_report_name' id='upd_report_name'>";
|
||||
echo "<input type=hidden name='upd_domain' id='upd_domain'>";
|
||||
# echo "<input type=hidden name='upd_slave' id='upd_slave'>";
|
||||
echo "<input type=hidden name='upd_path_name' id='upd_path_name'>";
|
||||
echo "<input type=hidden name='upd_custom_reports_user_groups' id='upd_custom_reports_user_groups'>";
|
||||
echo "</form>";
|
||||
|
||||
echo "</TD></TR></TABLE>\n";
|
||||
echo "</BODY></HTML>";
|
||||
?>
|
||||
|
||||
|
||||
@@ -72,3 +72,8 @@ textarea.chat_box {
|
||||
padding: 2px;
|
||||
border: solid 1px #000066;
|
||||
}
|
||||
.cust_form {
|
||||
font-family: Sans-Serif;
|
||||
font-size: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user