From d30a2666e33d145831b29072ed3caab56893b323 Mon Sep 17 00:00:00 2001 From: mattf Date: Thu, 28 Oct 2010 02:44:41 +0000 Subject: [PATCH] update of Spanish and Italian language builds git-svn-id: svn://192.168.202.10@1541 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../LANG_www/agc_es/conf_exten_check.php | 2 + agc_2-X/trunk/LANG_www/agc_es/functions.php | 30 +- .../trunk/LANG_www/agc_es/manager_send.php | 192 +- .../trunk/LANG_www/agc_es/vdc_db_query.php | 392 +- .../LANG_www/agc_es/vdc_form_display.php | 105 +- .../LANG_www/agc_es/vdc_script_display.php | 63 +- agc_2-X/trunk/LANG_www/agc_es/vicidial.php | 1911 +++--- .../LANG_www/agc_it/conf_exten_check.php | 2 + agc_2-X/trunk/LANG_www/agc_it/functions.php | 30 +- .../trunk/LANG_www/agc_it/manager_send.php | 192 +- .../trunk/LANG_www/agc_it/vdc_db_query.php | 392 +- .../LANG_www/agc_it/vdc_form_display.php | 105 +- .../LANG_www/agc_it/vdc_script_display.php | 63 +- agc_2-X/trunk/LANG_www/agc_it/vicidial.php | 1911 +++--- .../vicidial_es/AST_CLOSER_service_level.php | 52 +- .../LANG_www/vicidial_es/AST_CLOSERstats.php | 287 +- .../vicidial_es/AST_CLOSERsummary_hourly.php | 53 +- .../LANG_www/vicidial_es/AST_IVRstats.php | 53 +- .../AST_OUTBOUNDsummary_interval.php | 74 +- .../LANG_www/vicidial_es/AST_VDADstats.php | 134 +- .../vicidial_es/AST_VICIDIAL_hopperlist.php | 18 +- .../vicidial_es/AST_agent_days_detail.php | 90 +- .../AST_agent_performance_detail.php | 89 +- .../vicidial_es/AST_agent_status_detail.php | 96 +- .../vicidial_es/AST_agent_time_detail.php | 123 +- .../vicidial_es/AST_agent_time_sheet.php | 66 +- .../AST_agent_timeclock_detail.php | 58 +- .../vicidial_es/AST_server_performance.php | 66 +- .../vicidial_es/AST_timeonVDADall.php | 611 +- .../vicidial_es/AST_timeonVDADallSUMMARY.php | 91 +- agc_2-X/trunk/LANG_www/vicidial_es/admin.php | 5237 ++++++++++++++--- .../LANG_www/vicidial_es/admin_header.php | 267 +- .../vicidial_es/admin_modify_lead.php | 679 ++- .../vicidial_es/admin_search_lead.php | 270 +- .../LANG_www/vicidial_es/audio_store.php | 41 +- .../vicidial_es/call_report_export.php | 230 +- .../trunk/LANG_www/vicidial_es/dbconnect.php | 85 +- .../trunk/LANG_www/vicidial_es/fcstats.php | 66 +- .../LANG_www/vicidial_es/list_download.php | 419 +- .../trunk/LANG_www/vicidial_es/listloader.pl | 56 +- .../LANG_www/vicidial_es/listloader_super.pl | 56 +- .../vicidial_es/new_listloader_superL.php | 558 +- .../LANG_www/vicidial_es/non_agent_api.php | 738 ++- .../LANG_www/vicidial_es/timeclock_report.php | 69 +- .../LANG_www/vicidial_es/timeclock_status.php | 82 +- .../trunk/LANG_www/vicidial_es/user_stats.php | 962 +-- .../LANG_www/vicidial_es/user_status.php | 15 +- .../LANG_www/vicidial_es/vtiger_search.php | 6 +- .../LANG_www/vicidial_es/vtiger_user.php | 23 +- .../LANG_www/vicidial_es/welcome_demo.php | 8 +- .../vicidial_es/welcome_languages.php | 10 +- .../vicidial_it/AST_CLOSER_service_level.php | 52 +- .../LANG_www/vicidial_it/AST_CLOSERstats.php | 287 +- .../vicidial_it/AST_CLOSERsummary_hourly.php | 53 +- .../LANG_www/vicidial_it/AST_IVRstats.php | 53 +- .../AST_OUTBOUNDsummary_interval.php | 74 +- .../LANG_www/vicidial_it/AST_VDADstats.php | 134 +- .../vicidial_it/AST_VICIDIAL_hopperlist.php | 18 +- .../vicidial_it/AST_agent_days_detail.php | 90 +- .../AST_agent_performance_detail.php | 89 +- .../vicidial_it/AST_agent_status_detail.php | 96 +- .../vicidial_it/AST_agent_time_detail.php | 123 +- .../vicidial_it/AST_agent_time_sheet.php | 66 +- .../AST_agent_timeclock_detail.php | 58 +- .../vicidial_it/AST_server_performance.php | 66 +- .../vicidial_it/AST_timeonVDADall.php | 611 +- .../vicidial_it/AST_timeonVDADallSUMMARY.php | 91 +- agc_2-X/trunk/LANG_www/vicidial_it/admin.php | 5237 ++++++++++++++--- .../LANG_www/vicidial_it/admin_header.php | 267 +- .../vicidial_it/admin_modify_lead.php | 679 ++- .../vicidial_it/admin_search_lead.php | 270 +- .../LANG_www/vicidial_it/audio_store.php | 41 +- .../vicidial_it/call_report_export.php | 230 +- .../trunk/LANG_www/vicidial_it/dbconnect.php | 85 +- .../trunk/LANG_www/vicidial_it/fcstats.php | 66 +- .../LANG_www/vicidial_it/list_download.php | 419 +- .../trunk/LANG_www/vicidial_it/listloader.pl | 56 +- .../LANG_www/vicidial_it/listloader_super.pl | 56 +- .../vicidial_it/new_listloader_superL.php | 558 +- .../LANG_www/vicidial_it/non_agent_api.php | 738 ++- .../LANG_www/vicidial_it/timeclock_report.php | 69 +- .../LANG_www/vicidial_it/timeclock_status.php | 82 +- .../trunk/LANG_www/vicidial_it/user_stats.php | 962 +-- .../LANG_www/vicidial_it/user_status.php | 15 +- .../LANG_www/vicidial_it/vtiger_search.php | 6 +- .../LANG_www/vicidial_it/vtiger_user.php | 23 +- .../LANG_www/vicidial_it/welcome_demo.php | 8 +- .../vicidial_it/welcome_languages.php | 10 +- 88 files changed, 22514 insertions(+), 6552 deletions(-) diff --git a/agc_2-X/trunk/LANG_www/agc_es/conf_exten_check.php b/agc_2-X/trunk/LANG_www/agc_es/conf_exten_check.php index 63f46fab..e0bd50ec 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/conf_exten_check.php +++ b/agc_2-X/trunk/LANG_www/agc_es/conf_exten_check.php @@ -202,6 +202,8 @@ echo " $Aagent_log_id=''; $Acallerid=''; $DEADcustomer=0; + $Astatus=''; + $Acampaign_id=''; ### see if the agent has a record in the vicidial_live_agents table $stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; diff --git a/agc_2-X/trunk/LANG_www/agc_es/functions.php b/agc_2-X/trunk/LANG_www/agc_es/functions.php index 376b2f01..9af6831b 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/functions.php +++ b/agc_2-X/trunk/LANG_www/agc_es/functions.php @@ -96,12 +96,16 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user) $last_rank = $o; $select_SQL = preg_replace("/.$/",'',$select_SQL); - ##### BEGIN grab the data from custom table for the lead_id - $stmt="SELECT $select_SQL FROM custom_$list_id where lead_id='$lead_id' LIMIT 1;"; - $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05005',$user,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $list_lead_ct = mysql_num_rows($rslt); + $list_lead_ct=0; + if (strlen($select_SQL)>0) + { + ##### BEGIN grab the data from custom table for the lead_id + $stmt="SELECT $select_SQL FROM custom_$list_id where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05005',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysql_num_rows($rslt); + } if ($list_lead_ct > 0) { $row=mysql_fetch_row($rslt); @@ -457,6 +461,20 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user) $CFoutput = eregi_replace('--A--user_custom_three--B--',"$user_custom_three",$CFoutput); $CFoutput = eregi_replace('--A--user_custom_four--B--',"$user_custom_four",$CFoutput); $CFoutput = eregi_replace('--A--user_custom_five--B--',"$user_custom_five",$CFoutput); + $CFoutput = eregi_replace('--A--preset_number_a--B--',"$preset_number_a",$CFoutput); + $CFoutput = eregi_replace('--A--preset_number_b--B--',"$preset_number_b",$CFoutput); + $CFoutput = eregi_replace('--A--preset_number_c--B--',"$preset_number_c",$CFoutput); + $CFoutput = eregi_replace('--A--preset_number_d--B--',"$preset_number_d",$CFoutput); + $CFoutput = eregi_replace('--A--preset_number_e--B--',"$preset_number_e",$CFoutput); + $CFoutput = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$CFoutput); + $CFoutput = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$CFoutput); + $CFoutput = eregi_replace('--A--did_id--B--',"$did_id",$CFoutput); + $CFoutput = eregi_replace('--A--did_extension--B--',"$did_extension",$CFoutput); + $CFoutput = eregi_replace('--A--did_pattern--B--',"$did_pattern",$CFoutput); + $CFoutput = eregi_replace('--A--did_description--B--',"$did_description",$CFoutput); + $CFoutput = eregi_replace('--A--closecallid--B--',"$closecallid",$CFoutput); + $CFoutput = eregi_replace('--A--xfercallid--B--',"$xfercallid",$CFoutput); + $CFoutput = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$CFoutput); # custom fields replacement $o=0; diff --git a/agc_2-X/trunk/LANG_www/agc_es/manager_send.php b/agc_2-X/trunk/LANG_www/agc_es/manager_send.php index 03ba1c97..952beb0d 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/manager_send.php +++ b/agc_2-X/trunk/LANG_www/agc_es/manager_send.php @@ -42,6 +42,7 @@ # - $agent_dialed_type - ('MANUAL_OVERRIDE','MANUAL_DIALNOW','MANUAL_PREVIEW',...) # - $nodeletevdac - ('0','1') # - $alertCID - ('0','1') +# - $preset_name = ('TESTING PRESET',...) # # CHANGELOG: # 50401-1002 - First build of script, Hangup function only @@ -98,12 +99,15 @@ # 100327-0846 - Fix for list_id override answering machine message # 100423-2304 - Added alertCID # 100527-1014 - Added SysCIDdtmfOriginate function +# 100813-0833 - Added preset_name variable and logging +# 101004-1345 - Added Ivr park functions +# 101024-1638 - Added park_log logging for parked calls # -$version = '2.4-49'; -$build = '100527-1014'; +$version = '2.4-52'; +$build = '101024-1638'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=85; +$mysql_log_count=97; $one_mysql_log=0; require("dbconnect.php"); @@ -191,6 +195,9 @@ if (isset($_GET["nodeletevdac"])) {$nodeletevdac=$_GET["nodeletevdac"];} elseif (isset($_POST["nodeletevdac"])) {$nodeletevdac=$_POST["nodeletevdac"];} if (isset($_GET["alertCID"])) {$alertCID=$_GET["alertCID"];} elseif (isset($_POST["alertCID"])) {$alertCID=$_POST["alertCID"];} +if (isset($_GET["preset_name"])) {$preset_name=$_GET["preset_name"];} + elseif (isset($_POST["preset_name"])) {$preset_name=$_POST["preset_name"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -303,7 +310,7 @@ if ($ACTION=="SysCIDdtmfOriginate") $stmt="UPDATE vicidial_live_agents SET external_dtmf='' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02092',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="SysCIDOriginate"; } @@ -442,10 +449,34 @@ if ($ACTION=="Originate") if ($agent_dialed_number > 0) { - $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$exten','$channel','0','$outbound_cid','$RAWaccount')"; + if (strlen($lead_id)<1) {$lead_id='0';} + $customer_hungup=''; + if ( ($stage > 0) and (preg_match("/3WAY/",$agent_dialed_type)) ) + {$customer_hungup = 'BEFORE_CALL';} + $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id,preset_name,campaign_id,customer_hungup) values('$user','$NOW_TIME','$agent_dialed_type','$server_ip','$exten','$channel','$lead_id','$outbound_cid','$RAWaccount','$preset_name','$campaign','$customer_hungup')"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00192',$user,$server_ip,$session_name,$one_mysql_log);} + + if (strlen($preset_name) > 0) + { + $stmt = "SELECT count(*) from vicidial_xfer_stats where campaign_id='$campaign' and preset_name='$preset_name';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02093',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt = "UPDATE vicidial_xfer_stats SET xfer_count=(xfer_count+1) where campaign_id='$campaign' and preset_name='$preset_name';"; + } + else + { + $stmt = "INSERT INTO vicidial_xfer_stats SET campaign_id='$campaign',preset_name='$preset_name',xfer_count='1';"; + } + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02094',$user,$server_ip,$session_name,$one_mysql_log);} + } } } } @@ -754,6 +785,32 @@ if ($ACTION=="RedirectVD") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02024',$user,$server_ip,$session_name,$one_mysql_log);} } + + if (strlen($preset_name) > 0) + { + $stmt = "INSERT INTO user_call_log (user,call_date,call_type,server_ip,phone_number,number_dialed,lead_id,preset_name,campaign_id) values('$user','$NOW_TIME','BLIND_XFER','$server_ip','$exten','$channel','$lead_id','$preset_name','$campaign')"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02095',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "SELECT count(*) from vicidial_xfer_stats where campaign_id='$campaign' and preset_name='$preset_name';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02096',$user,$server_ip,$session_name,$one_mysql_log);} + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + { + $stmt = "UPDATE vicidial_xfer_stats SET xfer_count=(xfer_count+1) where campaign_id='$campaign' and preset_name='$preset_name';"; + } + else + { + $stmt = "INSERT INTO vicidial_xfer_stats SET campaign_id='$campaign',preset_name='$preset_name',xfer_count='1';"; + } + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02097',$user,$server_ip,$session_name,$one_mysql_log);} + } + $ACTION="Redirect"; } } @@ -782,6 +839,11 @@ if ($ACTION=="RedirectToPark") if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; + $stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='PARKINGED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + # $fp = fopen ("./vicidial_debug.txt", "a"); # fwrite ($fp, "$NOW_TIME|MS_LOG_0|$queryCID|$stmt|\n"); # fclose($fp); @@ -790,7 +852,7 @@ if ($ACTION=="RedirectToPark") $stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02086',$user,$server_ip,$session_name,$one_mysql_log);} } if ($ACTION=="RedirectFromPark") @@ -814,14 +876,126 @@ if ($ACTION=="RedirectFromPark") $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} $ACTION="Redirect"; + + $parked_sec=0; + $stmt = "SELECT UNIX_TIMESTAMP(parked_time) FROM park_log where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' and (parked_sec < 1 or grab_time is NULL) order by parked_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_pl_ct = mysql_num_rows($rslt); + if ($VAC_pl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $parked_sec = ($StarTtime - $row[0]); + + $stmt = "UPDATE park_log SET status='GRABBED',grab_time='$NOW_TIME',parked_sec='$parked_sec' where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' order by parked_time desc limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } } $stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02087',$user,$server_ip,$session_name,$one_mysql_log);} } +if ($ACTION=="RedirectToParkIVR") + { + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($parkedby)<1) ) + { + $channel_live=0; + echo "Una de estas variables No es válido:\n"; + echo "Channel $channel debe ser mayor de 2 caracteres\n"; + echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; + echo "exten $exten debe ser fijado\n"; + echo "extenName $extenName debe ser fijado\n"; + echo "ext_context $ext_context debe ser fijado\n"; + echo "ext_priority $ext_priority debe ser fijado\n"; + echo "parkedby $parkedby debe ser fijado\n"; + echo "\nRedirectToPark Action no enviado\n"; + } + else + { + if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} + $stmt = "INSERT INTO parked_channels values('$channel','$server_ip','$CalLCID','$extenName','$parkedby','$NOW_TIME');"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02025',$user,$server_ip,$session_name,$one_mysql_log);} + $ACTION="Redirect"; + + $stmt = "UPDATE vicidial_auto_calls SET extension='PARKING_IVR' where callerid='$CalLCID' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02088',$user,$server_ip,$session_name,$one_mysql_log);} + + $stmt = "INSERT INTO park_log SET uniqueid='$uniqueid',status='IVRPARKINGED',channel='$channel',channel_group='$campaign',server_ip='$server_ip',parked_time='$NOW_TIME',parked_sec=0,extension='$CalLCID',user='$user',lead_id='$lead_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + + # $fp = fopen ("./vicidial_debug.txt", "a"); + # fwrite ($fp, "$NOW_TIME|MS_LOG_0|$queryCID|$stmt|\n"); + # fclose($fp); + } + + $stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02089',$user,$server_ip,$session_name,$one_mysql_log);} + } + +if ($ACTION=="RedirectFromParkIVR") + { + if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($exten)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) + { + $channel_live=0; + echo "Una de estas variables No es válido:\n"; + echo "Channel $channel debe ser mayor de 2 caracteres\n"; + echo "queryCID $queryCID debe ser mayor de 14 caracteres\n"; + echo "exten $exten debe ser fijado\n"; + echo "ext_context $ext_context debe ser fijado\n"; + echo "ext_priority $ext_priority debe ser fijado\n"; + echo "\nRedirectFromPark Action no enviado\n"; + } + else + { + if (strlen($call_server_ip)>6) {$server_ip = $call_server_ip;} + $stmt = "DELETE FROM parked_channels where server_ip='$server_ip' and channel='$channel';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02026',$user,$server_ip,$session_name,$one_mysql_log);} + $ACTION="Redirect"; + + $stmt = "UPDATE vicidial_auto_calls SET extension='' where callerid='$CalLCID' limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02090',$user,$server_ip,$session_name,$one_mysql_log);} + + $parked_sec=0; + $stmt = "SELECT UNIX_TIMESTAMP(parked_time) FROM park_log where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' and (parked_sec < 1 or grab_time is NULL) order by parked_time desc limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $VAC_pl_ct = mysql_num_rows($rslt); + if ($VAC_pl_ct > 0) + { + $row=mysql_fetch_row($rslt); + $parked_sec = ($StarTtime - $row[0]); + + $stmt = "UPDATE park_log SET status='GRABBEDIVR',grab_time='$NOW_TIME',parked_sec='$parked_sec' where uniqueid='$uniqueid' and server_ip='$server_ip' and extension='$CalLCID' order by parked_time desc limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02XXX',$user,$server_ip,$session_name,$one_mysql_log);} + } + } + + $stmt="UPDATE vicidial_live_agents SET external_park='' where user='$user';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02091',$user,$server_ip,$session_name,$one_mysql_log);} + } + + if ($ACTION=="RedirectName") { if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($extenName)<1) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) ) @@ -1135,7 +1309,7 @@ if ($ACTION=="RedirectXtraNeW") if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n"); + fwrite ($fp, "$NOW_TIME|RDX|$filename|$user|$campaign|$channel|$extrachannel|$queryCID|$exten|$ext_context|ext_priority|$session_id|\n"); fclose($fp); } } @@ -1680,7 +1854,7 @@ exit; function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) { $NOW_TIME = date("Y-m-d H:i:s"); - # mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); + # mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$user,$server_ip,$session_name,$one_mysql_log); $errno=''; $error=''; if ( ($mel > 0) or ($one_mysql_log > 0) ) { diff --git a/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php b/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php index 90c3c3a8..50f0c962 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vdc_db_query.php @@ -12,7 +12,7 @@ # - $pass # optional variables: # - $format - ('text','debug') -# - $ACTION - ('regCLOSER','regTERRITORY','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCaLL','manDiaLlogCALL','userLOGout','updateDISPO','updateLEAD','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl','AGENTSview','CALLSINQUEUEview','CALLSINQUEUEgrab','DiaLableLeaDsCounT','UpdateFields','CALLLOGview','LEADINFOview') +# - $ACTION - ('regCLOSER','regTERRITORY','manDiaLnextCALL','manDiaLskip','manDiaLonly','manDiaLlookCaLL','manDiaLlogCALL','userLOGout','updateDISPO','updateLEAD','VDADpause','VDADready','VDADcheckINCOMING','UpdatEFavoritEs','CalLBacKLisT','CalLBacKCounT','PauseCodeSubmit','LogiNCamPaigns','alt_phone_change','AlertControl','AGENTSview','CALLSINQUEUEview','CALLSINQUEUEgrab','DiaLableLeaDsCounT','UpdateFields','CALLLOGview','LEADINFOview','customer_3way_hangup_process') # - $stage - ('start','finish','lookup','new') # - $closer_choice - ('CL_TESTCAMP_L CL_OUT123_L -') # - $conf_exten - ('8600011',...) @@ -88,6 +88,7 @@ # - $alt_num_status - ('0','1') # - $DiaL_SecondS - ('0','1','2',...) # - $date - ('2010-02-19') +# - $custom_field_names - ('|start_date|finish_date|favorite_color|') # # CHANGELOG: # 50629-1044 - First build of script @@ -250,13 +251,21 @@ # 100624-1401 - Fix for dispo call url bug related to dialed number and label # 100625-0915 - Fix for auto-dial bug for presets and timer actions # 100712-1447 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any -# 100803-0822 - Added CAMPLISTS_ALL for manual_dial_filter(issue #369 +# 100803-0822 - Added CAMPLISTS_ALL for manual_dial_filter(issue #369) +# 100823-1612 - Added DID variables on inbound calls +# 100902-1348 - Added closecallid and xfercallid variables +# 100903-0041 - Changed lead_id max length to 10 digits +# 100908-1102 - Added customer_3way_hangup_process function +# 100916-2144 - Added custom list names export with lead data +# 100927-1618 - Added ability to use custom fields in web form and dispo_call_url +# 101001-1451 - Added full name display to Call Log functionality +# 101022-1243 - Fixed missing variables from start and dispo call urls # -$version = '2.4-158'; -$build = '100803-0822'; +$version = '2.4-166'; +$build = '101022-1243'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=333; +$mysql_log_count=345; $one_mysql_log=0; require("dbconnect.php"); @@ -438,6 +447,8 @@ if (isset($_GET["DiaL_SecondS"])) {$DiaL_SecondS=$_GET["DiaL_SecondS"];} elseif (isset($_POST["DiaL_SecondS"])) {$DiaL_SecondS=$_POST["DiaL_SecondS"];} if (isset($_GET["date"])) {$date=$_GET["date"];} elseif (isset($_POST["date"])) {$date=$_POST["date"];} +if (isset($_GET["custom_field_names"])) {$FORMcustom_field_names=$_GET["custom_field_names"];} + elseif (isset($_POST["custom_field_names"])) {$FORMcustom_field_names=$_POST["custom_field_names"];} header ("Content-type: text/html; charset=utf-8"); @@ -453,7 +464,7 @@ $ENTRYdate = date("YmdHis"); $MT[0]=''; $agents='@agents'; $US='_'; - +while (strlen($CIDdate) > 9) {$CIDdate = substr("$CIDdate", 1);} ##### Hangup Cause Dictionary ##### $hangup_cause_dictionary = array( @@ -1772,6 +1783,7 @@ if ($ACTION == 'manDiaLnextCaLL') $rank = trim("$row[32]"); $owner = trim("$row[33]"); $entry_list_id = trim("$row[34]"); + if ($entry_list_id < 100) {$entry_list_id = $list_id;} } $called_count++; @@ -1791,8 +1803,8 @@ if ($ACTION == 'manDiaLnextCaLL') if ( ($WeBRooTWritablE > 0) and ($enable_agc_xfer_log > 0) ) { # generate callerID for unique identifier in xfer_log file - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + $PADlead_id = sprintf("%010s", $lead_id); + while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL $MqueryCID = "M$CIDdate$PADlead_id"; @@ -1917,8 +1929,8 @@ if ($ACTION == 'manDiaLnextCaLL') } if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';} - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + $PADlead_id = sprintf("%010s", $lead_id); + while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} ### check for extension append in campaign $use_eac=0; @@ -2152,6 +2164,50 @@ if ($ACTION == 'manDiaLnextCaLL') if (strlen($row[4]) > 0) {$VDCL_xferconf_e_number = $row[4];} } + + $custom_field_names='|'; + $custom_field_names_SQL=''; + $custom_field_values='----------'; + $custom_field_types='|'; + ### find the names of all custom fields, if any + $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('vendor_lead_code','source_id','list_id','gmt_offset_now','called_since_last_reset','phone_code','phone_number','title','first_name','middle_initial','last_name','address1','address2','address3','city','state','province','postal_code','country_code','gender','date_of_birth','alt_phone','email','security_phrase','comments','called_count','last_local_call_time','rank','owner');"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00334',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $cffn_ct = mysql_num_rows($rslt); + $d=0; + while ($cffn_ct > $d) + { + $row=mysql_fetch_row($rslt); + $custom_field_names .= "$row[0]|"; + $custom_field_names_SQL .= "$row[0],"; + $custom_field_types .= "$row[1]|"; + $custom_field_values .= "----------"; + $d++; + } + if ($cffn_ct > 0) + { + $custom_field_names_SQL = eregi_replace(".$","",$custom_field_names_SQL); + ### find the values of the named custom fields + $stmt = "SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00335',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $cffv_ct = mysql_num_rows($rslt); + if ($cffv_ct > 0) + { + $custom_field_values='----------'; + $row=mysql_fetch_row($rslt); + $d=0; + while ($cffn_ct > $d) + { + $custom_field_values .= "$row[$d]----------"; + $d++; + } + $custom_field_values = preg_replace("/\n/"," ",$custom_field_values); + $custom_field_values = preg_replace("/\r/","",$custom_field_values); + } + } } @@ -2203,6 +2259,9 @@ if ($ACTION == 'manDiaLnextCaLL') $LeaD_InfO .= $VDCL_xferconf_d_number . "\n"; $LeaD_InfO .= $VDCL_xferconf_e_number . "\n"; $LeaD_InfO .= $entry_list_id . "\n"; + $LeaD_InfO .= $custom_field_names . "\n"; + $LeaD_InfO .= $custom_field_values . "\n"; + $LeaD_InfO .= $custom_field_types . "\n"; echo $LeaD_InfO; } @@ -2410,8 +2469,8 @@ if ($ACTION == 'manDiaLonly') {$CCID = "$temp_CID"; $CCID_on++;} } - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + $PADlead_id = sprintf("%010s", $lead_id); + while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} # Create unique calleridname to track the call: MmmddhhmmssLLLLLLLLL $MqueryCID = "M$CIDdate$PADlead_id"; @@ -2751,9 +2810,12 @@ if ($stage == "start") { if ( (strlen($uniqueid)<1) || (strlen($lead_id)<1) || (strlen($list_id)<1) || (strlen($phone_number)<1) || (strlen($campaign)<1) ) { - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|VL_LOG_0|$uniqueid|$lead_id|$user|$list_id|$campaign|$start_epoch|$phone_number|$agent_log_id|\n"); + fclose($fp); + } echo "REGISTRO NO ENTRADO\n"; echo "uniqueid $uniqueid or lead_id: $lead_id or list_id: $list_id or phone_number: $phone_number or campaign: $campaign No es válido\n"; @@ -3709,7 +3771,9 @@ if ($stage == "end") { if (strlen($hangup_channels[$loop_count])>5) { - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','CH12346$StarTtime$loop_count','Channel: $hangup_channels[$loop_count]','','','','','','','','','');"; + $variable = "Variable: ctuserserverconfleadphone=$loop_count$US$user$US$server_ip$US$conf_exten$US$lead_id$US$phone_number"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','CH12346$StarTtime$loop_count','Channel: $hangup_channels[$loop_count]','$variable','','','','','','','','');"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00096',$user,$server_ip,$session_name,$one_mysql_log);} @@ -3772,9 +3836,12 @@ if ($stage == "end") if (!ereg('.',$VDvicidial_id)) {$vidSQL = ",vicidial_id='$VDvicidial_id'";} - $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|INBND_LOG_3|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|\n"); - fclose($fp); + if ($WeBRooTWritablE > 0) + { + $fp = fopen ("./vicidial_debug.txt", "a"); + fwrite ($fp, "$NOW_TIME|INBND_LOG_3|$uniqueid|$lead_id|$user|$inOUT|$VLA_inOUT|$length_in_sec|$VDterm_reason|$VDvicidial_id|$vicidial_id|$start_epoch|$recording_id|\n"); + fclose($fp); + } } } $length_in_sec = ($StarTtime - $start_time); @@ -3913,6 +3980,8 @@ if ($ACTION == 'VDADcheckINCOMING') $alt_phone_note=''; $alt_phone_active=''; $alt_phone_count=''; + $INclosecallid=''; + $INxfercallid=''; if ( (strlen($campaign)<1) || (strlen($server_ip)<1) ) { @@ -4018,6 +4087,7 @@ if ($ACTION == 'VDADcheckINCOMING') $rank = trim("$row[32]"); $owner = trim("$row[33]"); $entry_list_id = trim("$row[34]"); + if ($entry_list_id < 100) {$entry_list_id = $list_id;} } ##### if lead is a callback, grab the callback comments @@ -4140,7 +4210,7 @@ if ($ACTION == 'VDADcheckINCOMING') else { $call_type = 'IN'; - $stmt = "SELECT campaign_id from vicidial_closer_log where lead_id = '$lead_id' order by call_date desc limit 1;"; + $stmt = "SELECT campaign_id,closecallid,xfercallid from vicidial_closer_log where lead_id = '$lead_id' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00183',$user,$server_ip,$session_name,$one_mysql_log);} @@ -4148,13 +4218,15 @@ if ($ACTION == 'VDADcheckINCOMING') if ($VDCL_mvac_ct > 0) { $row=mysql_fetch_row($rslt); - $VDADchannel_group =$row[0]; + $VDADchannel_group = $row[0]; + $INclosecallid = $row[1]; + $INxfercallid = $row[2]; } } if ($WeBRooTWritablE > 0) { $fp = fopen ("./vicidial_debug.txt", "a"); - fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|$VDADchannel_group|$call_type|$dialed_number|$dialed_label\n"); + fwrite ($fp, "$NOW_TIME|INBND|$callerid|$user|$user_group|$list_id|$lead_id|$phone_number|$uniqueid|$VDADchannel_group|$call_type|$dialed_number|$dialed_label|$INclosecallid|$INxfercallid|\n"); fclose($fp); } } @@ -4230,7 +4302,7 @@ if ($ACTION == 'VDADcheckINCOMING') } } - echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X|||||$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number||||$VDCL_timer_action_destination|\n|\n"; + echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X|||||$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number||||$VDCL_timer_action_destination||||||\n|\n"; if (ereg('X',$dialed_label)) { @@ -4267,6 +4339,21 @@ if ($ACTION == 'VDADcheckINCOMING') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00117',$user,$server_ip,$session_name,$one_mysql_log);} + if (strlen($closecallid)<1) + { + $stmt = "SELECT closecallid,xfercallid from vicidial_closer_log where lead_id='$lead_id' and user='$user' and list_id='$list_id' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00336',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_mvac_ct = mysql_num_rows($rslt); + if ($VDCL_mvac_ct > 0) + { + $row=mysql_fetch_row($rslt); + $INclosecallid = $row[0]; + $INxfercallid = $row[1]; + } + } + $stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); @@ -4506,9 +4593,38 @@ if ($ACTION == 'VDADcheckINCOMING') } } + $DID_id=''; + $DID_extension=''; + $DID_pattern=''; + $DID_description=''; + + $stmt = "SELECT did_id,extension from vicidial_did_log where uniqueid='$uniqueid' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00337',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIDL_ct = mysql_num_rows($rslt); + if ($VDIDL_ct > 0) + { + $row=mysql_fetch_row($rslt); + $DID_id = $row[0]; + $DID_extension = $row[1]; + + $stmt = "SELECT did_pattern,did_description from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00338',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIDL_ct = mysql_num_rows($rslt); + if ($VDIDL_ct > 0) + { + $row=mysql_fetch_row($rslt); + $DID_pattern = $row[0]; + $DID_description = $row[1]; + } + } + ### if web form is set then send en to vicidial.php for override of WEB_FORM address - if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|\n";} - else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|\n";} + if ( (strlen($VDCL_group_web)>5) or (strlen($VDCL_group_name)>0) ) {echo "$VDCL_group_web|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|\n";} + else {echo "X|$VDCL_group_name|$VDCL_group_color|$VDCL_fronter_display|$VDADchannel_group|$VDCL_ingroup_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|$VDCL_ingroup_recording_override|$VDCL_ingroup_rec_filename|$VDCL_default_group_alias|$VDCL_caller_id_number|$VDCL_group_web_vars|$VDCL_group_web_two|$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number|$VDCL_uniqueid_status_display|$custom_call_id|$VDCL_uniqueid_status_prefix|$VDCL_timer_action_destination|$DID_id|$DID_extension|$DID_pattern|$DID_description|$INclosecallid|$INxfercallid|\n";} $stmt = "SELECT full_name from vicidial_users where user='$tsr';"; if ($DB) {echo "$stmt\n";} @@ -4550,6 +4666,51 @@ if ($ACTION == 'VDADcheckINCOMING') } } + $custom_field_names='|'; + $custom_field_names_SQL=''; + $custom_field_values='----------'; + $custom_field_types='|'; + ### find the names of all custom fields, if any + $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('vendor_lead_code','source_id','list_id','gmt_offset_now','called_since_last_reset','phone_code','phone_number','title','first_name','middle_initial','last_name','address1','address2','address3','city','state','province','postal_code','country_code','gender','date_of_birth','alt_phone','email','security_phrase','comments','called_count','last_local_call_time','rank','owner');"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00339',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $cffn_ct = mysql_num_rows($rslt); + $d=0; + while ($cffn_ct > $d) + { + $row=mysql_fetch_row($rslt); + $custom_field_names .= "$row[0]|"; + $custom_field_names_SQL .= "$row[0],"; + $custom_field_types .= "$row[1]|"; + $custom_field_values .= "----------"; + $d++; + } + if ($cffn_ct > 0) + { + $custom_field_names_SQL = eregi_replace(".$","",$custom_field_names_SQL); + ### find the values of the named custom fields + $stmt = "SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00340',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $cffv_ct = mysql_num_rows($rslt); + if ($cffv_ct > 0) + { + $custom_field_values='----------'; + $row=mysql_fetch_row($rslt); + $d=0; + while ($cffn_ct > $d) + { + $custom_field_values .= "$row[$d]----------"; + $d++; + } + $custom_field_values = preg_replace("/\n/"," ",$custom_field_values); + $custom_field_values = preg_replace("/\r/","",$custom_field_values); + } + } + + $comments = eregi_replace("\r",'',$comments); $comments = eregi_replace("\n",'!N',$comments); @@ -4597,6 +4758,9 @@ if ($ACTION == 'VDADcheckINCOMING') $LeaD_InfO .= $owner . "\n"; $LeaD_InfO .= $script_recording_delay . "\n"; $LeaD_InfO .= $entry_list_id . "\n"; + $LeaD_InfO .= $custom_field_names . "\n"; + $LeaD_InfO .= $custom_field_values . "\n"; + $LeaD_InfO .= $custom_field_types . "\n"; echo $LeaD_InfO; @@ -4703,8 +4867,8 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_start_call_url = eregi_replace('--A--phone_pass--B--',urlencode(trim($phone_pass)),$VDCL_start_call_url); $VDCL_start_call_url = eregi_replace('--A--fronter--B--',urlencode(trim($fronter)),$VDCL_start_call_url); $VDCL_start_call_url = eregi_replace('--A--closer--B--',urlencode(trim($closer)),$VDCL_start_call_url); - $VDCL_start_call_url = eregi_replace('--A--group--B--',urlencode(trim($group)),$VDCL_start_call_url); - $VDCL_start_call_url = eregi_replace('--A--channel_group--B--',urlencode(trim($channel_group)),$VDCL_start_call_url); + $VDCL_start_call_url = eregi_replace('--A--group--B--',urlencode(trim($VDADchannel_group)),$VDCL_start_call_url); + $VDCL_start_call_url = eregi_replace('--A--channel_group--B--',urlencode(trim($VDADchannel_group)),$VDCL_start_call_url); $VDCL_start_call_url = eregi_replace('--A--SQLdate--B--',urlencode(trim($SQLdate)),$VDCL_start_call_url); $VDCL_start_call_url = eregi_replace('--A--epoch--B--',urlencode(trim($epoch)),$VDCL_start_call_url); $VDCL_start_call_url = eregi_replace('--A--uniqueid--B--',urlencode(trim($uniqueid)),$VDCL_start_call_url); @@ -4731,6 +4895,44 @@ if ($ACTION == 'VDADcheckINCOMING') $VDCL_start_call_url = eregi_replace('--A--user_custom_five--B--',urlencode(trim($user_custom_five)),$VDCL_start_call_url); $VDCL_start_call_url = eregi_replace('--A--talk_time--B--',"0",$VDCL_start_call_url); $VDCL_start_call_url = eregi_replace('--A--talk_time_min--B--',"0",$VDCL_start_call_url); + $VDCL_start_call_url = eregi_replace('--A--entry_list_id--B--',urlencode(trim($entry_list_id)),$VDCL_start_call_url); + $VDCL_start_call_url = eregi_replace('--A--did_id--B--',urlencode(trim($DID_id)),$VDCL_start_call_url); + $VDCL_start_call_url = eregi_replace('--A--did_extension--B--',urlencode(trim($DID_extension)),$VDCL_start_call_url); + $VDCL_start_call_url = eregi_replace('--A--did_pattern--B--',urlencode(trim($DID_pattern)),$VDCL_start_call_url); + $VDCL_start_call_url = eregi_replace('--A--did_description--B--',urlencode(trim($DID_description)),$VDCL_start_call_url); + $VDCL_start_call_url = eregi_replace('--A--closecallid--B--',urlencode(trim($INclosecallid)),$VDCL_start_call_url); + $VDCL_start_call_url = eregi_replace('--A--xfercallid--B--',urlencode(trim($INxfercallid)),$VDCL_start_call_url); + $VDCL_start_call_url = eregi_replace('--A--agent_log_id--B--',urlencode(trim($agent_log_id)),$VDCL_start_call_url); + + if (strlen($custom_field_names)>2) + { + $custom_field_names = preg_replace("/^\||\|$/",'',$custom_field_names); + $custom_field_names = preg_replace("/\|/",",",$custom_field_names); + $custom_field_names_ARY = explode(',',$custom_field_names); + $custom_field_names_ct = count($custom_field_names_ARY); + $custom_field_names_SQL = $custom_field_names; + + ##### BEGIN grab the data from custom table for the lead_id + $stmt="SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00344',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysql_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysql_fetch_row($rslt); + $o=0; + while ($custom_field_names_ct > $o) + { + $form_field_value = trim("$row[$o]"); + $field_name_id = $custom_field_names_ARY[$o]; + $field_name_tag = "--A--" . $field_name_id . "--B--"; + $VDCL_start_call_url = eregi_replace("$field_name_tag","$form_field_value",$VDCL_start_call_url); + $o++; + } + } + } + if ($DB > 0) {echo "$VDCL_start_call_url
\n";} $SCUfile = file("$VDCL_start_call_url"); if ($DB > 0) {echo "$SCUfile[0]
\n";} @@ -5219,8 +5421,8 @@ if ($ACTION == 'updateDISPO') {$VLphone_code = "$phone_code";} } - $PADlead_id = sprintf("%09s", $lead_id); - while (strlen($PADlead_id) > 9) {$PADlead_id = substr("$PADlead_id", 0, -1);} + $PADlead_id = sprintf("%010s", $lead_id); + while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);} $FAKEcall_id = "$StarTtime.$PADlead_id"; $stmt = "INSERT INTO vicidial_log set uniqueid='$FAKEcall_id',lead_id='$lead_id',list_id='$VLlist_id',campaign_id='$campaign',call_date='$NOW_TIME',start_epoch='$StarTtime',end_epoch='$StarTtime',length_in_sec='0',status='$dispo_choice',phone_code='$VLphone_code',phone_number='$VLphone_number',user='$user',comments='MANUAL',processed='N',user_group='$user_group',term_reason='AGENT',alt_dial='$VLalt';"; if ($DB) {echo "$stmt\n";} @@ -5285,7 +5487,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00146',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_dnc (phone_number) values('$row[0]');"; + $stmt="INSERT IGNORE INTO vicidial_dnc (phone_number) values('$row[0]');"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00147',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -5298,7 +5500,7 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00148',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); - $stmt="INSERT INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$row[0]','$campaign');"; + $stmt="INSERT IGNORE INTO vicidial_campaign_dnc (phone_number,campaign_id) values('$row[0]','$campaign');"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00149',$user,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -6019,7 +6221,7 @@ if ($ACTION == 'updateDISPO') $stmt = "SELECT phone_number,alt_dial from vicidial_log where uniqueid='$uniqueid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00341',$user,$server_ip,$session_name,$one_mysql_log);} $vl_dialed_ct = mysql_num_rows($rslt); if ($vl_dialed_ct > 0) { @@ -6030,7 +6232,56 @@ if ($ACTION == 'updateDISPO') } } + if (eregi('--A--did_',$dispo_call_url)) + { + $DID_id=''; + $DID_extension=''; + $DID_pattern=''; + $DID_description=''; + $stmt = "SELECT did_id,extension from vicidial_did_log where uniqueid='$uniqueid' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIDL_ct = mysql_num_rows($rslt); + if ($VDIDL_ct > 0) + { + $row=mysql_fetch_row($rslt); + $DID_id = $row[0]; + $DID_extension = $row[1]; + + $stmt = "SELECT did_pattern,did_description from vicidial_inbound_dids where did_id='$DID_id' limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $VDIDL_ct = mysql_num_rows($rslt); + if ($VDIDL_ct > 0) + { + $row=mysql_fetch_row($rslt); + $DID_pattern = $row[0]; + $DID_description = $row[1]; + } + } + } + + if ((eregi('callid--B--',$dispo_call_url)) or (eregi('group--B--',$dispo_call_url))) + { + $INclosecallid=''; + $INxfercallid=''; + $VDADchannel_group=$campaign; + $stmt = "SELECT campaign_id,closecallid,xfercallid from vicidial_closer_log where uniqueid='$uniqueid' and user='$user' order by call_date desc limit 1;"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + $VDCL_mvac_ct = mysql_num_rows($rslt); + if ($VDCL_mvac_ct > 0) + { + $row=mysql_fetch_row($rslt); + $VDADchannel_group = $row[0]; + $INclosecallid = $row[1]; + $INxfercallid = $row[2]; + } + } ##### grab the data from vicidial_list for the lead_id $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id FROM vicidial_list where lead_id='$lead_id' LIMIT 1;"; @@ -6107,9 +6358,9 @@ if ($ACTION == 'updateDISPO') $dispo_call_url = eregi_replace('--A--original_phone_login--B--',"$original_phone_login",$dispo_call_url); $dispo_call_url = eregi_replace('--A--phone_pass--B--',"$phone_pass",$dispo_call_url); $dispo_call_url = eregi_replace('--A--fronter--B--',"$fronter",$dispo_call_url); - $dispo_call_url = eregi_replace('--A--closer--B--',"$closer",$dispo_call_url); - $dispo_call_url = eregi_replace('--A--group--B--',"$group",$dispo_call_url); - $dispo_call_url = eregi_replace('--A--channel_group--B--',"$channel_group",$dispo_call_url); + $dispo_call_url = eregi_replace('--A--closer--B--',"$user",$dispo_call_url); + $dispo_call_url = eregi_replace('--A--group--B--',"$VDADchannel_group",$dispo_call_url); + $dispo_call_url = eregi_replace('--A--channel_group--B--',"$VDADchannel_group",$dispo_call_url); $dispo_call_url = eregi_replace('--A--SQLdate--B--',"$SQLdate",$dispo_call_url); $dispo_call_url = eregi_replace('--A--epoch--B--',"$epoch",$dispo_call_url); $dispo_call_url = eregi_replace('--A--uniqueid--B--',"$uniqueid",$dispo_call_url); @@ -6139,6 +6390,43 @@ if ($ACTION == 'updateDISPO') $dispo_call_url = eregi_replace('--A--talk_time_ms--B--',"$talk_time_ms",$dispo_call_url); $dispo_call_url = eregi_replace('--A--talk_time_min--B--',"$talk_time_min",$dispo_call_url); $dispo_call_url = eregi_replace('--A--agent_log_id--B--',"$CALL_agent_log_id",$dispo_call_url); + $dispo_call_url = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$dispo_call_url); + $dispo_call_url = eregi_replace('--A--did_id--B--',urlencode(trim($DID_id)),$dispo_call_url); + $dispo_call_url = eregi_replace('--A--did_extension--B--',urlencode(trim($DID_extension)),$dispo_call_url); + $dispo_call_url = eregi_replace('--A--did_pattern--B--',urlencode(trim($DID_pattern)),$dispo_call_url); + $dispo_call_url = eregi_replace('--A--did_description--B--',urlencode(trim($DID_description)),$dispo_call_url); + $dispo_call_url = eregi_replace('--A--closecallid--B--',urlencode(trim($INclosecallid)),$dispo_call_url); + $dispo_call_url = eregi_replace('--A--xfercallid--B--',urlencode(trim($INxfercallid)),$dispo_call_url); + + if (strlen($FORMcustom_field_names)>2) + { + $custom_field_names = preg_replace("/^\||\|$/",'',$FORMcustom_field_names); + $custom_field_names = preg_replace("/\|/",",",$custom_field_names); + $custom_field_names_ARY = explode(',',$custom_field_names); + $custom_field_names_ct = count($custom_field_names_ARY); + $custom_field_names_SQL = $custom_field_names; + + ##### BEGIN grab the data from custom table for the lead_id + $stmt="SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00345',$user,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $list_lead_ct = mysql_num_rows($rslt); + if ($list_lead_ct > 0) + { + $row=mysql_fetch_row($rslt); + $o=0; + while ($custom_field_names_ct > $o) + { + $form_field_value = trim("$row[$o]"); + $field_name_id = $custom_field_names_ARY[$o]; + $field_name_tag = "--A--" . $field_name_id . "--B--"; + $dispo_call_url = eregi_replace("$field_name_tag","$form_field_value",$dispo_call_url); + $o++; + } + } + } + if ($DB > 0) {echo "$dispo_call_url
\n";} $SCUfile = file("$dispo_call_url"); if ($DB > 0) {echo "$SCUfile[0]
\n";} @@ -7135,6 +7423,7 @@ if ($ACTION == 'CALLLOGview') echo "   LENGTH   "; echo "   ESTADO   "; echo "   PHONE   "; + echo "   FULL NAME   "; echo "   CAMPAIGN   "; echo "   IN/OUT   "; echo "   ALT   "; @@ -7167,6 +7456,13 @@ if ($ACTION == 'CALLLOGview') $ALLalt_dial[$g] = $row[9]; $ALLin_out[$g] = "OUT-AUTO"; if ($row[10] == 'MANUAL') {$ALLin_out[$g] = "OUT-MANUAL";} + + $stmtA="SELECT first_name,last_name FROM vicidial_list WHERE lead_id='$ALLlead_id[$g]';"; + $rsltA=mysql_query($stmtA, $link); + $rowA=mysql_fetch_row($rsltA); + $Allfirst_name[$g] = $rowA[0]; + $Alllast_name[$g] = $rowA[1]; + $g++; $u++; } @@ -7193,6 +7489,13 @@ if ($ACTION == 'CALLLOGview') $ALLhangup_reason[$g] = $row[8]; $ALLalt_dial[$g] = "MAIN"; $ALLin_out[$g] = "IN"; + + $stmtA="SELECT first_name,last_name FROM vicidial_list WHERE lead_id='$ALLlead_id[$g]';"; + $rsltA=mysql_query($stmtA, $link); + $rowA=mysql_fetch_row($rsltA); + $Allfirst_name[$g] = $rowA[0]; + $Alllast_name[$g] = $rowA[1]; + $g++; $u++; } @@ -7220,6 +7523,7 @@ if ($ACTION == 'CALLLOGview') echo " $ALLlength_in_sec[$i]\n"; echo " $ALLstatus[$i]\n"; echo " $ALLphone_code[$i] $ALLphone_number[$i] \n"; + echo " $Allfirst_name[$i] $Alllast_name[$i] \n"; echo " $ALLcampaign_id[$i] \n"; echo " $ALLin_out[$i] \n"; echo " $ALLalt_dial[$i] \n"; @@ -7488,6 +7792,22 @@ if ($ACTION == 'CalLBacKCounT') +################################################################################ +### customer_3way_hangup_process - send the count of the USERONLY callbacks for an agent +################################################################################ +if ($ACTION == 'customer_3way_hangup_process') + { + $stmt="UPDATE user_call_log SET customer_hungup='$status',customer_hungup_seconds='$stage' where lead_id='$lead_id' and user='$user' and call_type LIKE \"%3WAY%\" order by user_call_log_id desc limit 1;"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00342',$user,$server_ip,$session_name,$one_mysql_log);} + + echo "DONE: $stage|$lead_id|$status"; + } + + + + ################################################################################ ### DiaLableLeaDsCounT - send the count of the dialable leads in this campaign ################################################################################ @@ -7516,7 +7836,7 @@ if ($ACTION == 'Clear_API_Field') $stmt="UPDATE vicidial_live_agents SET $comments='' where user='$user';"; if ($format=='debug') {echo "\n";} $rslt=mysql_query($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);} + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00343',$user,$server_ip,$session_name,$one_mysql_log);} echo "DONE: $comments"; } diff --git a/agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php b/agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php index 3f0e6ca7..dc51eb31 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vdc_form_display.php @@ -11,10 +11,11 @@ # 100630-1119 - First build of script # 100703-1124 - Added submit_button,admin_submit fields, which will log to admin log # 100712-2322 - Added code to log vicidial_list.entry_list_id field if data altered +# 100916-1749 - Added non-lead variable parsing # -$version = '2.4-3'; -$build = '100712-2322'; +$version = '2.4-4'; +$build = '100916-1749'; require("dbconnect.php"); require("functions.php"); @@ -43,10 +44,108 @@ if (isset($_GET["admin_submit"])) {$admin_submit=$_GET["admin_submit"];} if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} +if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} + elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];} + elseif (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];} +if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} +if (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];} + elseif (isset($_POST["fronter"])) {$fronter=$_POST["fronter"];} +if (isset($_GET["closer"])) {$closer=$_GET["closer"];} + elseif (isset($_POST["closer"])) {$closer=$_POST["closer"];} +if (isset($_GET["group"])) {$group=$_GET["group"];} + elseif (isset($_POST["group"])) {$group=$_POST["group"];} +if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} + elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} +if (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];} + elseif (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];} +if (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];} + elseif (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];} +if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} + elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} +if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} + elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} +if (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];} + elseif (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} +if (isset($_GET["SIPexten"])) {$SIPexten=$_GET["SIPexten"];} + elseif (isset($_POST["SIPexten"])) {$SIPexten=$_POST["SIPexten"];} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} +if (isset($_GET["phone"])) {$phone=$_GET["phone"];} + elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} +if (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} + elseif (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} +if (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];} + elseif (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];} +if (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];} + elseif (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];} +if (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];} + elseif (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];} +if (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];} + elseif (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];} +if (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];} + elseif (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];} +if (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];} + elseif (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];} +if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} + elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} +if (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];} + elseif (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];} +if (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];} + elseif (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];} +if (isset($_GET["user_custom_one"])) {$user_custom_one=$_GET["user_custom_one"];} + elseif (isset($_POST["user_custom_one"])) {$user_custom_one=$_POST["user_custom_one"];} +if (isset($_GET["user_custom_two"])) {$user_custom_two=$_GET["user_custom_two"];} + elseif (isset($_POST["user_custom_two"])) {$user_custom_two=$_POST["user_custom_two"];} +if (isset($_GET["user_custom_three"])) {$user_custom_three=$_GET["user_custom_three"];} + elseif (isset($_POST["user_custom_three"])) {$user_custom_three=$_POST["user_custom_three"];} +if (isset($_GET["user_custom_four"])) {$user_custom_four=$_GET["user_custom_four"];} + elseif (isset($_POST["user_custom_four"])) {$user_custom_four=$_POST["user_custom_four"];} +if (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];} + elseif (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];} +if (isset($_GET["preset_number_a"])) {$preset_number_a=$_GET["preset_number_a"];} + elseif (isset($_POST["preset_number_a"])) {$preset_number_a=$_POST["preset_number_a"];} +if (isset($_GET["preset_number_b"])) {$preset_number_b=$_GET["preset_number_b"];} + elseif (isset($_POST["preset_number_b"])) {$preset_number_b=$_POST["preset_number_b"];} +if (isset($_GET["preset_number_c"])) {$preset_number_c=$_GET["preset_number_c"];} + elseif (isset($_POST["preset_number_c"])) {$preset_number_c=$_POST["preset_number_c"];} +if (isset($_GET["preset_number_d"])) {$preset_number_d=$_GET["preset_number_d"];} + elseif (isset($_POST["preset_number_d"])) {$preset_number_d=$_POST["preset_number_d"];} +if (isset($_GET["preset_number_e"])) {$preset_number_e=$_GET["preset_number_e"];} + elseif (isset($_POST["preset_number_e"])) {$preset_number_e=$_POST["preset_number_e"];} +if (isset($_GET["preset_number_f"])) {$preset_number_f=$_GET["preset_number_f"];} + elseif (isset($_POST["preset_number_f"])) {$preset_number_f=$_POST["preset_number_f"];} +if (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];} + elseif (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];} +if (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];} + elseif (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];} +if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} + elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} +if (isset($_GET["did_extension"])) {$did_extension=$_GET["did_extension"];} + elseif (isset($_POST["did_extension"])) {$did_extension=$_POST["did_extension"];} +if (isset($_GET["did_pattern"])) {$did_pattern=$_GET["did_pattern"];} + elseif (isset($_POST["did_pattern"])) {$did_pattern=$_POST["did_pattern"];} +if (isset($_GET["did_description"])) {$did_description=$_GET["did_description"];} + elseif (isset($_POST["did_description"])) {$did_description=$_POST["did_description"];} +if (isset($_GET["closecallid"])) {$closecallid=$_GET["closecallid"];} + elseif (isset($_POST["closecallid"])) {$closecallid=$_POST["closecallid"];} +if (isset($_GET["xfercallid"])) {$xfercallid=$_GET["xfercallid"];} + elseif (isset($_POST["xfercallid"])) {$xfercallid=$_POST["xfercallid"];} +if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} + elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 +if ($stage=='WELCOME') + {echo "FORM"; exit;} + $txt = '.txt'; $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); @@ -328,7 +427,7 @@ else echo " \n"; echo " \n"; echo "\n"; - echo ''; + echo ""; echo "\n"; echo "
\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php b/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php index 9af96d86..fb63caf6 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vdc_script_display.php @@ -12,10 +12,12 @@ # 91211-1103 - Added user_custom_... variables # 100116-0702 - Added preset variables # 100127-1611 - Added ignore_list_script_override option +# 100823-1644 - Added DID variables +# 100902-1344 - Added closecallid, xfercallid, agent_log_id variables # -$version = '2.2.0-6'; -$build = '100127-1611'; +$version = '2.4-8'; +$build = '100902-1344'; require("dbconnect.php"); @@ -161,10 +163,29 @@ if (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];} elseif (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];} if (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];} elseif (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];} -if (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];} +if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} + elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} +if (isset($_GET["did_extension"])) {$did_extension=$_GET["did_extension"];} + elseif (isset($_POST["did_extension"])) {$did_extension=$_POST["did_extension"];} +if (isset($_GET["did_pattern"])) {$did_pattern=$_GET["did_pattern"];} + elseif (isset($_POST["did_pattern"])) {$did_pattern=$_POST["did_pattern"];} +if (isset($_GET["did_description"])) {$did_description=$_GET["did_description"];} + elseif (isset($_POST["did_description"])) {$did_description=$_POST["did_description"];} +if (isset($_GET["closecallid"])) {$closecallid=$_GET["closecallid"];} + elseif (isset($_POST["closecallid"])) {$closecallid=$_POST["closecallid"];} +if (isset($_GET["xfercallid"])) {$xfercallid=$_GET["xfercallid"];} + elseif (isset($_POST["xfercallid"])) {$xfercallid=$_POST["xfercallid"];} +if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} + elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} +if (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];} elseif (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];} -if (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];} +if (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];} elseif (isset($_POST["ignore_list_script"])) {$ignore_list_script=$_POST["ignore_list_script"];} +if (isset($_GET["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_GET["CF_uses_custom_fields"];} + elseif (isset($_POST["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_POST["CF_uses_custom_fields"];} +if (isset($_GET["entry_list_id"])) {$entry_list_id=$_GET["entry_list_id"];} + elseif (isset($_POST["entry_list_id"])) {$entry_list_id=$_POST["entry_list_id"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -363,6 +384,10 @@ if (eregi("iframe src",$script_text)) $preset_number_f = eregi_replace(' ','+',$preset_number_f); $preset_dtmf_a = eregi_replace(' ','+',$preset_dtmf_a); $preset_dtmf_b = eregi_replace(' ','+',$preset_dtmf_b); + $did_id = eregi_replace(' ','+',$did_id); + $did_extension = eregi_replace(' ','+',$did_extension); + $did_pattern = eregi_replace(' ','+',$did_pattern); + $did_description = eregi_replace(' ','+',$did_description); } $script_text = eregi_replace('--A--lead_id--B--',"$lead_id",$script_text); @@ -438,6 +463,36 @@ $script_text = eregi_replace('--A--preset_number_e--B--',"$preset_number_e",$scr $script_text = eregi_replace('--A--preset_number_f--B--',"$preset_number_f",$script_text); $script_text = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$script_text); $script_text = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$script_text); +$script_text = eregi_replace('--A--did_id--B--',"$did_id",$script_text); +$script_text = eregi_replace('--A--did_extension--B--',"$did_extension",$script_text); +$script_text = eregi_replace('--A--did_pattern--B--',"$did_pattern",$script_text); +$script_text = eregi_replace('--A--did_description--B--',"$did_description",$script_text); +$script_text = eregi_replace('--A--closecallid--B--',"$closecallid",$script_text); +$script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text); +$script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text); +$script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text); + +if ($CF_uses_custom_fields=='Y') + { + ### find the names of all custom fields, if any + $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('vendor_lead_code','source_id','list_id','gmt_offset_now','called_since_last_reset','phone_code','phone_number','title','first_name','middle_initial','last_name','address1','address2','address3','city','state','province','postal_code','country_code','gender','date_of_birth','alt_phone','email','security_phrase','comments','called_count','last_local_call_time','rank','owner');"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $cffn_ct = mysql_num_rows($rslt); + $d=0; + while ($cffn_ct > $d) + { + $row=mysql_fetch_row($rslt); + $field_name_id = $row[0]; + $field_name_tag = "--A--" . $field_name_id . "--B--"; + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + $script_text = eregi_replace("$field_name_tag","$form_field_value",$script_text); + if ($DB) {echo "$d|$field_name_id|$field_name_tag|$form_field_value|
\n";} + $d++; + } + } + $script_text = eregi_replace("\n","
",$script_text); $script_text = stripslashes($script_text); diff --git a/agc_2-X/trunk/LANG_www/agc_es/vicidial.php b/agc_2-X/trunk/LANG_www/agc_es/vicidial.php index 195c62f8..33ca8677 100644 --- a/agc_2-X/trunk/LANG_www/agc_es/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_es/vicidial.php @@ -8,6 +8,7 @@ # - manager_send.php: Sends manager actions to the DB for execution # - conf_exten_check.php: time sync and status updater, calls in queue # - vdc_script_display.php: displays script with variables +# - vdc_form_display.php: display custom fields form # # CHANGELOG # 50607-1426 - First Build of VICIDIAL web client basic login process finished @@ -304,12 +305,27 @@ # 100723-1522 - Added LOCKED options for quick transfer button feature # 100726-1233 - Added HANGUP, CALLMENU, EXTENSION, IN_GROUP timer actions # 100803-2324 - Cleanup of URLDecode (issue #375) +# 100811-0810 - Added webphone_url_override option from user Groups +# 100813-0554 - Added Campaign presets +# 100815-1015 - Added manual_dial_prefix campaign option +# 100823-1605 - Added DID variables for webform and scripting +# 100827-1436 - Added webphone dialpad options +# 100902-0046 - Added initial loading screen +# 100902-1349 - Added closecallid, xfercallid, agent_log_id as webform and script variables +# 100908-0955 - Added customer 3way hangup +# 100912-1304 - Changed Dispo screen phone number display to dialed_number +# 100927-1616 - Added custom fields ability to web forms and optimized related code +# 101004-1322 - Added "IVR Park Call" button in agent interface +# 101006-1358 - Raised limits on several dynamic items from the database +# 101008-0356 - Added manual_preview_dial and two new variables for recording filenames +# 101012-1656 - Added scroll command at dispo submission to for scrolling to the top of the screen +# 101024-1639 - Added parked call counter # -$version = '2.4-282'; -$build = '100803-2324'; +$version = '2.4-297'; +$build = '101024-1639'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=66; +$mysql_log_count=68; $one_mysql_log=0; require("dbconnect.php"); @@ -966,7 +982,7 @@ else $AgentAlert_allowed = $VU_allow_alerts; ### Gather timeclock and shift enforcement restriction settings - $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial,agent_fullscreen from vicidial_user_groups where user_group='$VU_user_group';"; + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial,agent_fullscreen,webphone_url_override,webphone_dialpad_override,webphone_systemkey_override from vicidial_user_groups where user_group='$VU_user_group';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); @@ -1004,6 +1020,11 @@ else if ($VU_agent_call_log_view_override == 'N') {$agent_call_log_view=0;} $agent_fullscreen = $row[12]; + $webphone_url = $row[13]; + $webphone_dialpad_override = $row[14]; + $system_key = $row[15]; + if ( ($webphone_dialpad_override != 'DISABLED') and (strlen($webphone_dialpad_override) > 0) ) + {$webphone_dialpad = $webphone_dialpad_override;} ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) @@ -1179,7 +1200,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1196,7 +1217,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1248,7 +1269,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1327,7 +1348,18 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01067',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VD_presets = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_presets) + { + $row=mysql_fetch_row($rslt); + $preset_names[$j] = $row[0]; + $preset_numbers[$j] = $row[1]; + $preset_dtmfs[$j] = $row[2]; + $preset_hide_numbers[$j] = $row[3]; + $VARpreset_names = "$VARpreset_names'$preset_names[$j]',"; + $VARpreset_numbers = "$VARpreset_numbers'$preset_numbers[$j]',"; + $VARpreset_dtmfs = "$VARpreset_dtmfs'$preset_dtmfs[$j]',"; + $VARpreset_hide_numbers = "$VARpreset_hide_numbers'$preset_hide_numbers[$j]',"; + $j++; + } + $VARpreset_names = substr("$VARpreset_names", 0, -1); + $VARpreset_numbers = substr("$VARpreset_numbers", 0, -1); + $VARpreset_dtmfs = substr("$VARpreset_dtmfs", 0, -1); + $VARpreset_hide_numbers = substr("$VARpreset_hide_numbers", 0, -1); + $VD_preset_names_ct = $j; + if ($j < 1) + {$enable_xfer_presets='DISABLED';} + } + $default_group_alias_cid=''; if (strlen($default_group_alias)>1) { @@ -1428,8 +1495,10 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1475,7 +1544,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1522,7 +1591,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1780,7 +1849,7 @@ echo "\n"; } echo "Agent web client\n"; - $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list,webphone_dialpad from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} @@ -1851,6 +1920,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01066',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $wu_ct = mysql_num_rows($rslt); - if ($wu_ct > 0) + if (strlen($webphone_url) < 6) { - $row=mysql_fetch_row($rslt); - $webphone_url =$row[0]; + ##### find webphone_url in system_settings and generate IFRAME code for it ##### + $stmt="SELECT webphone_url FROM system_settings LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01066',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $wu_ct = mysql_num_rows($rslt); + if ($wu_ct > 0) + { + $row=mysql_fetch_row($rslt); + $webphone_url =$row[0]; + } } + if (strlen($system_key) < 1) + { + ##### find system_key in system_settings if populated ##### + $stmt="SELECT webphone_systemkey FROM system_settings LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01068',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $wsk_ct = mysql_num_rows($rslt); + if ($wsk_ct > 0) + { + $row=mysql_fetch_row($rslt); + $system_key =$row[0]; + } + } + $webphone_options='INITIAL_LOAD'; + if ($webphone_dialpad == 'Y') {$webphone_options .= "--DIALPAD_Y";} + if ($webphone_dialpad == 'TOGGLE') {$webphone_options .= "--DIALPAD_TOGGLE";} ### base64 encode variables $b64_phone_login = base64_encode($extension); @@ -2134,8 +2224,10 @@ echo " "; } @@ -2443,6 +2535,7 @@ $SSwidth = ($MASTERwidth + 176); # 606 - scroll script $SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session $HKwidth = ($MASTERwidth + 20); # 450 - Hotkeys button $HSwidth = ($MASTERwidth + 1); # 431 - Header spacer +$PBwidth = ($MASTERwidth + 0); # 430 - Presets list $CLwidth = ($MASTERwidth - 160); # 270 - Calls in queue link $WRheight = ($MASTERheight + 160); # 460 - Warning boxes @@ -2589,7 +2682,8 @@ $CCAL_OUT .= ""; ?> - \n"; echo " \n"; echo "\n"; - echo ''; + echo ""; echo "\n"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/agc_it/vdc_script_display.php b/agc_2-X/trunk/LANG_www/agc_it/vdc_script_display.php index 9af96d86..fb63caf6 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/vdc_script_display.php +++ b/agc_2-X/trunk/LANG_www/agc_it/vdc_script_display.php @@ -12,10 +12,12 @@ # 91211-1103 - Added user_custom_... variables # 100116-0702 - Added preset variables # 100127-1611 - Added ignore_list_script_override option +# 100823-1644 - Added DID variables +# 100902-1344 - Added closecallid, xfercallid, agent_log_id variables # -$version = '2.2.0-6'; -$build = '100127-1611'; +$version = '2.4-8'; +$build = '100902-1344'; require("dbconnect.php"); @@ -161,10 +163,29 @@ if (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];} elseif (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];} if (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];} elseif (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];} -if (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];} +if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} + elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} +if (isset($_GET["did_extension"])) {$did_extension=$_GET["did_extension"];} + elseif (isset($_POST["did_extension"])) {$did_extension=$_POST["did_extension"];} +if (isset($_GET["did_pattern"])) {$did_pattern=$_GET["did_pattern"];} + elseif (isset($_POST["did_pattern"])) {$did_pattern=$_POST["did_pattern"];} +if (isset($_GET["did_description"])) {$did_description=$_GET["did_description"];} + elseif (isset($_POST["did_description"])) {$did_description=$_POST["did_description"];} +if (isset($_GET["closecallid"])) {$closecallid=$_GET["closecallid"];} + elseif (isset($_POST["closecallid"])) {$closecallid=$_POST["closecallid"];} +if (isset($_GET["xfercallid"])) {$xfercallid=$_GET["xfercallid"];} + elseif (isset($_POST["xfercallid"])) {$xfercallid=$_POST["xfercallid"];} +if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} + elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} +if (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];} elseif (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];} -if (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];} +if (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];} elseif (isset($_POST["ignore_list_script"])) {$ignore_list_script=$_POST["ignore_list_script"];} +if (isset($_GET["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_GET["CF_uses_custom_fields"];} + elseif (isset($_POST["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_POST["CF_uses_custom_fields"];} +if (isset($_GET["entry_list_id"])) {$entry_list_id=$_GET["entry_list_id"];} + elseif (isset($_POST["entry_list_id"])) {$entry_list_id=$_POST["entry_list_id"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -363,6 +384,10 @@ if (eregi("iframe src",$script_text)) $preset_number_f = eregi_replace(' ','+',$preset_number_f); $preset_dtmf_a = eregi_replace(' ','+',$preset_dtmf_a); $preset_dtmf_b = eregi_replace(' ','+',$preset_dtmf_b); + $did_id = eregi_replace(' ','+',$did_id); + $did_extension = eregi_replace(' ','+',$did_extension); + $did_pattern = eregi_replace(' ','+',$did_pattern); + $did_description = eregi_replace(' ','+',$did_description); } $script_text = eregi_replace('--A--lead_id--B--',"$lead_id",$script_text); @@ -438,6 +463,36 @@ $script_text = eregi_replace('--A--preset_number_e--B--',"$preset_number_e",$scr $script_text = eregi_replace('--A--preset_number_f--B--',"$preset_number_f",$script_text); $script_text = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$script_text); $script_text = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$script_text); +$script_text = eregi_replace('--A--did_id--B--',"$did_id",$script_text); +$script_text = eregi_replace('--A--did_extension--B--',"$did_extension",$script_text); +$script_text = eregi_replace('--A--did_pattern--B--',"$did_pattern",$script_text); +$script_text = eregi_replace('--A--did_description--B--',"$did_description",$script_text); +$script_text = eregi_replace('--A--closecallid--B--',"$closecallid",$script_text); +$script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text); +$script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text); +$script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text); + +if ($CF_uses_custom_fields=='Y') + { + ### find the names of all custom fields, if any + $stmt = "SELECT field_label,field_type FROM vicidial_lists_fields where list_id='$entry_list_id' and field_type NOT IN('SCRIPT','DISPLAY') and field_label NOT IN('vendor_lead_code','source_id','list_id','gmt_offset_now','called_since_last_reset','phone_code','phone_number','title','first_name','middle_initial','last_name','address1','address2','address3','city','state','province','postal_code','country_code','gender','date_of_birth','alt_phone','email','security_phrase','comments','called_count','last_local_call_time','rank','owner');"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $cffn_ct = mysql_num_rows($rslt); + $d=0; + while ($cffn_ct > $d) + { + $row=mysql_fetch_row($rslt); + $field_name_id = $row[0]; + $field_name_tag = "--A--" . $field_name_id . "--B--"; + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + $script_text = eregi_replace("$field_name_tag","$form_field_value",$script_text); + if ($DB) {echo "$d|$field_name_id|$field_name_tag|$form_field_value|
\n";} + $d++; + } + } + $script_text = eregi_replace("\n","
",$script_text); $script_text = stripslashes($script_text); diff --git a/agc_2-X/trunk/LANG_www/agc_it/vicidial.php b/agc_2-X/trunk/LANG_www/agc_it/vicidial.php index 711e89ca..40498dc8 100644 --- a/agc_2-X/trunk/LANG_www/agc_it/vicidial.php +++ b/agc_2-X/trunk/LANG_www/agc_it/vicidial.php @@ -8,6 +8,7 @@ # - manager_send.php: Sends manager actions to the DB for execution # - conf_exten_check.php: time sync and status updater, calls in queue # - vdc_script_display.php: displays script with variables +# - vdc_form_display.php: display custom fields form # # CHANGELOG # 50607-1426 - First Build of VICIDIAL web client basic login process finished @@ -304,12 +305,27 @@ # 100723-1522 - Added LOCKED options for quick transfer button feature # 100726-1233 - Added HANGUP, CALLMENU, EXTENSION, IN_GROUP timer actions # 100803-2324 - Cleanup of URLDecode (issue #375) +# 100811-0810 - Added webphone_url_override option from user Groups +# 100813-0554 - Added Campaign presets +# 100815-1015 - Added manual_dial_prefix campaign option +# 100823-1605 - Added DID variables for webform and scripting +# 100827-1436 - Added webphone dialpad options +# 100902-0046 - Added initial loading screen +# 100902-1349 - Added closecallid, xfercallid, agent_log_id as webform and script variables +# 100908-0955 - Added customer 3way hangup +# 100912-1304 - Changed Dispo screen phone number display to dialed_number +# 100927-1616 - Added custom fields ability to web forms and optimized related code +# 101004-1322 - Added "IVR Park Call" button in agent interface +# 101006-1358 - Raised limits on several dynamic items from the database +# 101008-0356 - Added manual_preview_dial and two new variables for recording filenames +# 101012-1656 - Added scroll command at dispo submission to for scrolling to the top of the screen +# 101024-1639 - Added parked call counter # -$version = '2.4-282'; -$build = '100803-2324'; +$version = '2.4-297'; +$build = '101024-1639'; $mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=66; +$mysql_log_count=68; $one_mysql_log=0; require("dbconnect.php"); @@ -966,7 +982,7 @@ else $AgentAlert_allowed = $VU_allow_alerts; ### Gather timeclock and shift enforcement restriction settings - $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial,agent_fullscreen from vicidial_user_groups where user_group='$VU_user_group';"; + $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial,agent_fullscreen,webphone_url_override,webphone_dialpad_override,webphone_systemkey_override from vicidial_user_groups where user_group='$VU_user_group';"; $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} $row=mysql_fetch_row($rslt); @@ -1004,6 +1020,11 @@ else if ($VU_agent_call_log_view_override == 'N') {$agent_call_log_view=0;} $agent_fullscreen = $row[12]; + $webphone_url = $row[13]; + $webphone_dialpad_override = $row[14]; + $system_key = $row[15]; + if ( ($webphone_dialpad_override != 'DISABLED') and (strlen($webphone_dialpad_override) > 0) ) + {$webphone_dialpad = $webphone_dialpad_override;} ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) @@ -1179,7 +1200,7 @@ echo "
0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1196,7 +1217,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1248,7 +1269,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1327,7 +1348,18 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01067',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $VD_presets = mysql_num_rows($rslt); + $j=0; + while ($j < $VD_presets) + { + $row=mysql_fetch_row($rslt); + $preset_names[$j] = $row[0]; + $preset_numbers[$j] = $row[1]; + $preset_dtmfs[$j] = $row[2]; + $preset_hide_numbers[$j] = $row[3]; + $VARpreset_names = "$VARpreset_names'$preset_names[$j]',"; + $VARpreset_numbers = "$VARpreset_numbers'$preset_numbers[$j]',"; + $VARpreset_dtmfs = "$VARpreset_dtmfs'$preset_dtmfs[$j]',"; + $VARpreset_hide_numbers = "$VARpreset_hide_numbers'$preset_hide_numbers[$j]',"; + $j++; + } + $VARpreset_names = substr("$VARpreset_names", 0, -1); + $VARpreset_numbers = substr("$VARpreset_numbers", 0, -1); + $VARpreset_dtmfs = substr("$VARpreset_dtmfs", 0, -1); + $VARpreset_hide_numbers = substr("$VARpreset_hide_numbers", 0, -1); + $VD_preset_names_ct = $j; + if ($j < 1) + {$enable_xfer_presets='DISABLED';} + } + $default_group_alias_cid=''; if (strlen($default_group_alias)>1) { @@ -1428,8 +1495,10 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1475,7 +1544,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1522,7 +1591,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($DB) {echo "$stmt\n";} @@ -1780,7 +1849,7 @@ echo "\n"; } echo "Agent web client\n"; - $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; + $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list,webphone_dialpad from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} @@ -1851,6 +1920,7 @@ echo " 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01066',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $wu_ct = mysql_num_rows($rslt); - if ($wu_ct > 0) + if (strlen($webphone_url) < 6) { - $row=mysql_fetch_row($rslt); - $webphone_url =$row[0]; + ##### find webphone_url in system_settings and generate IFRAME code for it ##### + $stmt="SELECT webphone_url FROM system_settings LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01066',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $wu_ct = mysql_num_rows($rslt); + if ($wu_ct > 0) + { + $row=mysql_fetch_row($rslt); + $webphone_url =$row[0]; + } } + if (strlen($system_key) < 1) + { + ##### find system_key in system_settings if populated ##### + $stmt="SELECT webphone_systemkey FROM system_settings LIMIT 1;"; + $rslt=mysql_query($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01068',$VD_login,$server_ip,$session_name,$one_mysql_log);} + if ($DB) {echo "$stmt\n";} + $wsk_ct = mysql_num_rows($rslt); + if ($wsk_ct > 0) + { + $row=mysql_fetch_row($rslt); + $system_key =$row[0]; + } + } + $webphone_options='INITIAL_LOAD'; + if ($webphone_dialpad == 'Y') {$webphone_options .= "--DIALPAD_Y";} + if ($webphone_dialpad == 'TOGGLE') {$webphone_options .= "--DIALPAD_TOGGLE";} ### base64 encode variables $b64_phone_login = base64_encode($extension); @@ -2134,8 +2224,10 @@ echo " "; } @@ -2443,6 +2535,7 @@ $SSwidth = ($MASTERwidth + 176); # 606 - scroll script $SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session $HKwidth = ($MASTERwidth + 20); # 450 - Hotkeys button $HSwidth = ($MASTERwidth + 1); # 431 - Header spacer +$PBwidth = ($MASTERwidth + 0); # 430 - Presets list $CLwidth = ($MASTERwidth - 160); # 270 - Calls in queue link $WRheight = ($MASTERheight + 160); # 460 - Warning boxes @@ -2589,7 +2682,8 @@ $CCAL_OUT .= ""; ?> - \n"; echo "\n"; echo "\n"; -echo "Inbound Service Level Report\n"; +echo "$report_name\n"; $short_header=1; @@ -979,7 +1023,7 @@ echo "+-------------+-------+-----------------------------------------+ +------+ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds\n"; +echo "\nRun Time: $RUNtime seconds|$db_source\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERstats.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERstats.php index cc6790f8..2478d017 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERstats.php @@ -27,6 +27,10 @@ # 100206-1454 - Fixed TMR(service level) calculation # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100709-1809 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100913-1634 - Added DID option to select by DIDs instead of In-groups +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -47,6 +51,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["DID"])) {$DID=$_GET["DID"];} + elseif (isset($_POST["DID"])) {$DID=$_POST["DID"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} @@ -56,9 +62,12 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Inbound Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -66,10 +75,23 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -82,13 +104,18 @@ if ($gmt_conf_ct > 0) $epoch_offset = (($local_gmt + $dst) * 3600); } -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { @@ -98,6 +125,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -105,7 +153,9 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name,8 from vicidial_inbound_groups order by group_id;"; +if ($DID=='Y') + {$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids order by did_pattern;";} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -118,6 +168,7 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $LISTgroup_ids[$i] = $row[2]; $i++; } @@ -175,7 +226,7 @@ echo "\n"; echo "\n"; echo "\n"; -echo "Inbound Stats\n"; +echo "$report_name\n"; $short_header=1; @@ -195,6 +246,7 @@ if ($DB > 0) echo "\n"; echo "\n"; @@ -274,10 +332,13 @@ echo "
\n\n";
 
 
 if ($groups_to_print < 1)
-{
-echo "\n\n";
-echo "POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";
-}
+	{
+	echo "\n\n";
+	if ($DID=='Y')
+		{echo "PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK ENVIAR\n";}
+	else
+		{echo "POR FAVOR SELECCIONE UN GRUPO EN EL PÁRRAFO ANTERIOR Y FECHA DE RANGO y haga clic en Enviar\n";}
+	}
 
 else
 {
@@ -310,30 +371,111 @@ echo "Inbound Call Stats: $group_string          $NOW_TIME\n";
 
 
 
+if ($DID=='Y')
+	{
+	$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL);";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$dids_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $dids_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$did_id[$i] = $row[0];
+		$did_SQL .= "'$row[0]',";
+		$i++;
+		}
+	$did_SQL = eregi_replace(",$",'',$did_SQL);
+	if (strlen($did_SQL)<3) {$did_SQL="''";}
 
+	$stmt="select uniqueid from vicidial_did_log where did_id IN($did_SQL);";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {echo "$stmt\n";}
+	$unids_to_print = mysql_num_rows($rslt);
+	$i=0;
+	while ($i < $unids_to_print)
+		{
+		$row=mysql_fetch_row($rslt);
+		$unid_SQL .= "'$row[0]',";
+		$i++;
+		}
+	$unid_SQL = eregi_replace(",$",'',$unid_SQL);
+	if (strlen($unid_SQL)<3) {$unid_SQL="''";}
+
+	if ($DB > 0)
+		{echo "|$did_SQL|$unid_SQL|\n";}
+
+	}
 
 if ($group_ct > 1)
 	{
 	echo "\n";
 	echo "---------- MULTI-GROUP BREAKDOWN:\n";
-	echo "+----------------------+---------+---------+---------+---------+\n";
-	echo "| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
-	echo "+----------------------+---------+---------+---------+---------+\n";
+	if ($DID=='Y')
+		{
+		echo "+----------------------+---------+---------+---------+---------+\n";
+		echo "| DID                  | CALLS   | DROPS   | DROP %  | IVR     |\n";
+		echo "+----------------------+---------+---------+---------+---------+\n";
+		}
+	else
+		{
+		echo "+----------------------+---------+---------+---------+---------+\n";
+		echo "| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
+		echo "+----------------------+---------+---------+---------+---------+\n";
+		}
 
 	$i=0;
 	while($i < $group_ct)
 		{
+		$did_id[$i]='0';
+		$DIDunid_SQL='';
+		$stmt="select did_id from vicidial_inbound_dids where did_pattern='$group[$i]';";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$Sdids_to_print = mysql_num_rows($rslt);
+		if ($Sdids_to_print > 0)
+			{
+			$row=mysql_fetch_row($rslt);
+			$did_id[$i] = $row[0];
+			}
+
+		$stmt="select uniqueid from vicidial_did_log where did_id='$did_id[$i]';";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$DIDunids_to_print = mysql_num_rows($rslt);
+		$k=0;
+		while ($k < $DIDunids_to_print)
+			{
+			$row=mysql_fetch_row($rslt);
+			$DIDunid_SQL .= "'$row[0]',";
+			$k++;
+			}
+		$DIDunid_SQL = eregi_replace(",$",'',$DIDunid_SQL);
+		if (strlen($DIDunid_SQL)<3) {$DIDunid_SQL="''";}
+
 		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
+		if ($DID=='Y')
+			{
+			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
+			}
 		$rslt=mysql_query($stmt, $link);
 		if ($DB) {echo "$stmt\n";}
 		$row=mysql_fetch_row($rslt);
 
 		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
+		if ($DID=='Y')
+			{
+			$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
+			}
 		$rslt=mysql_query($stmt, $link);
 		if ($DB) {echo "$stmt\n";}
 		$rowx=mysql_fetch_row($rslt);
 
 		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
+		if ($DID=='Y')
+			{
+			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($DIDunid_SQL);";
+			}
 		$rslt=mysql_query($stmt, $link);
 		if ($DB) {echo "$stmt\n";}
 		$rowy=mysql_fetch_row($rslt);
@@ -364,17 +506,30 @@ echo "\n";
 echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
 echo "---------- TOTALS\n";
 
+
 $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);";
+if ($DID=='Y')
+	{
+	$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
 
 $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
+if ($DID=='Y')
+	{
+	$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') and uniqueid IN($unid_SQL);";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $rowy=mysql_fetch_row($rslt);
 
 $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';";
+if ($DID=='Y')
+	{
+	$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($unid_SQL);";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $rowx=mysql_fetch_row($rslt);
@@ -419,6 +574,10 @@ echo "\n";
 echo "---------- DROPS\n";
 
 $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
+if ($DID=='Y')
+	{
+	$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($unid_SQL);";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -458,41 +617,47 @@ echo "Average hold time for DROP Calls:             $average_hold_seconds second
 
 if (strlen($group_SQL)>3)
 	{
-	$stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$Sanswer_sec_pct_rt_stat_one = $row[0];
-	$Sanswer_sec_pct_rt_stat_two = $row[1];
-
-	$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$answer_sec_pct_rt_stat_one = $row[0];
-
-	$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
-	$rslt=mysql_query($stmt, $link);
-	if ($DB) {echo "$stmt\n";}
-	$row=mysql_fetch_row($rslt);
-	$answer_sec_pct_rt_stat_two = $row[0];
-
-	if ( ($RESPUESTAEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) )
+	if ($DID!='Y')
 		{
-		$PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $RESPUESTAEDcalls) * 100);
-		$PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0);
-		#$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one);
-		$PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $RESPUESTAEDcalls) * 100);
-		$PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0);
-		#$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two);
+		$stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$row=mysql_fetch_row($rslt);
+		$Sanswer_sec_pct_rt_stat_one = $row[0];
+		$Sanswer_sec_pct_rt_stat_two = $row[1];
+
+		$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$row=mysql_fetch_row($rslt);
+		$answer_sec_pct_rt_stat_one = $row[0];
+
+		$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {echo "$stmt\n";}
+		$row=mysql_fetch_row($rslt);
+		$answer_sec_pct_rt_stat_two = $row[0];
+
+		if ( ($RESPUESTAEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) )
+			{
+			$PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $RESPUESTAEDcalls) * 100);
+			$PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0);
+			#$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one);
+			$PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $RESPUESTAEDcalls) * 100);
+			$PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0);
+			#$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two);
+			}
 		}
 	}
 echo "\n";
 echo "---------- CUSTOM INDICATORS\n";
 echo "GDE (Answered/Llamadas totales tomadas in to this In-Group):  $RESPUESTAEDpercent%\n";
 echo "ACR (Dropped/Answered):                                $DROP_RESPUESTAEDpercent%\n";
-echo "TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):            $PCTanswer_sec_pct_rt_stat_one%\n";
-echo "TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):            $PCTanswer_sec_pct_rt_stat_two%\n";
+if ($DID!='Y')
+	{
+	echo "TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):            $PCTanswer_sec_pct_rt_stat_one%\n";
+	echo "TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):            $PCTanswer_sec_pct_rt_stat_two%\n";
+	}
 
 
 # GET LIST OF ALL STATUSES and create SQL from human_answered statuses
@@ -538,6 +703,10 @@ echo "\n";
 echo "---------- QUEUE STATS\n";
 
 $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);";
+if ($DID=='Y')
+	{
+	$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and (queue_seconds > 0) and uniqueid IN($unid_SQL);";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $row=mysql_fetch_row($rslt);
@@ -587,6 +756,10 @@ echo "|     0     5    10    15    20    25    30    35    40    45    50    55
 echo "+-------------------------------------------------------------------------------------------+------------+\n";
 
 $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by queue_seconds;";
+if ($DID=='Y')
+	{
+	$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds;";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $reasons_to_print = mysql_num_rows($rslt);
@@ -650,6 +823,10 @@ echo "|     0     5    10    15    20    25    30    35    40    45    50    55
 echo "+-------------------------------------------------------------------------------------------+------------+\n";
 
 $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;";
+if ($DID=='Y')
+	{
+	$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds;";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $reasons_to_print = mysql_num_rows($rslt);
@@ -714,6 +891,10 @@ echo "          |     0     5    10    15    20    25    30    35    40    45
 echo "----------+-------------------------------------------------------------------------------------------+------------+\n";
 
 $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;";
+if ($DID=='Y')
+	{
+	$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $reasons_to_print = mysql_num_rows($rslt);
@@ -922,6 +1103,10 @@ echo "| HANGUP REASON        | CALLS      |\n";
 echo "+----------------------+------------+\n";
 
 $stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by term_reason;";
+if ($DID=='Y')
+	{
+	$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason;";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $reasons_to_print = mysql_num_rows($rslt);
@@ -964,6 +1149,10 @@ echo "+--------+----------------------+----------------------+------------+-----
 
 ## get counts and time totals for all statuses in this campaign
 $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by status;";
+if ($DID=='Y')
+	{
+	$stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by status;";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $statuses_to_print = mysql_num_rows($rslt);
@@ -1095,6 +1284,10 @@ echo "|     1     2     3     4     5     6     7     8     9    10    15    20
 echo "+-------------------------------------------------------------------------------------+------------+\n";
 
 $stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by queue_position;";
+if ($DID=='Y')
+	{
+	$stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position;";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $positions_to_print = mysql_num_rows($rslt);
@@ -1159,6 +1352,10 @@ echo "| AGENTE                    | CALLS      | TIME H:M:S |AVERAGE |\n";
 echo "+--------------------------+------------+------------+--------+\n";
 
 $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
+if ($DID=='Y')
+	{
+	$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $users_to_print = mysql_num_rows($rslt);
@@ -1228,6 +1425,10 @@ echo "\n";
 #########  15-minute increment breakdowns of total calls and drops, then answered table
 $BDansweredCALLS = 0;
 $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);";
+if ($DID=='Y')
+	{
+	$stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);";
+	}
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $calls_to_print = mysql_num_rows($rslt);
@@ -1524,7 +1725,7 @@ echo "+------+------------------------------------------------------------------
 
 $ENDtime = date("U");
 $RUNtime = ($ENDtime - $STARTtime);
-echo "\nRun Time: $RUNtime seconds\n";
+echo "\nRun Time: $RUNtime seconds|$db_source\n";
 }
 
 
diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERsummary_hourly.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERsummary_hourly.php
index 2c5f60dc..b2a1da18 100644
--- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERsummary_hourly.php
+++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_CLOSERsummary_hourly.php
@@ -9,6 +9,9 @@
 # 90809-0216 - Added Exclude Outbound Drop Group option
 # 100214-1421 - Sort menu alphabetically
 # 100216-0042 - Added popup date selector
+# 100712-1324 - Added system setting slave server option
+# 100802-2347 - Added User Group Allowed Reports option validation
+# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
 #
 
 require("dbconnect.php");
@@ -52,9 +55,12 @@ $MT[0]='0';
 if (strlen($shift)<2) {$shift='ALL';}
 if (strlen($exclude_rollover)<2) {$exclude_rollover='NO';}
 
+$report_name = 'Inbound Summary Hourly Report';
+$db_source = 'M';
+
 #############################################
 ##### START SYSTEM_SETTINGS LOOKUP #####
-$stmt = "SELECT use_non_latin FROM system_settings;";
+$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $qm_conf_ct = mysql_num_rows($rslt);
@@ -62,10 +68,22 @@ if ($qm_conf_ct > 0)
 	{
 	$row=mysql_fetch_row($rslt);
 	$non_latin =					$row[0];
+	$outbound_autodial_active =		$row[1];
+	$slave_db_server =				$row[2];
+	$reports_use_slave_db =			$row[3];
 	}
 ##### END SETTINGS LOOKUP #####
 ###########################################
 
+if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
+	{
+	mysql_close($link);
+	$use_slave_server=1;
+	$db_source = 'S';
+	require("dbconnect.php");
+	echo "\n";
+	}
+
 $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
@@ -78,13 +96,19 @@ if ($gmt_conf_ct > 0)
 	$epoch_offset =		(($local_gmt + $dst) * 3600);
 	}
 
-$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
 if ($DB) {echo "|$stmt|\n";}
 if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 $row=mysql_fetch_row($rslt);
 $auth=$row[0];
 
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$reports_only_user=$row[0];
+
 if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
@@ -93,6 +117,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
     exit;
 	}
 
+$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$LOGuser_group =			$row[0];
+
+$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$LOGallowed_campaigns = $row[0];
+$LOGallowed_reports =	$row[1];
+
+if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
+	{
+    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
+    Header("HTTP/1.0 401 Unauthorized");
+    echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
+    exit;
+	}
+
 $NOW_DATE = date("Y-m-d");
 $NOW_TIME = date("Y-m-d H:i:s");
 $STARTtime = date("U");
@@ -187,7 +232,7 @@ echo "\n";
 echo "\n";
 
 echo "\n";
-echo "Inbound Summary Hourly Report\n";
+echo "$report_name\n";
 
 if ($bareformat < 1)
 	{
@@ -676,7 +721,7 @@ else
 
 	$ENDtime = date("U");
 	$RUNtime = ($ENDtime - $STARTtime);
-	echo "\n\nRun Time: $RUNtime seconds\n";
+	echo "\n\nRun Time: $RUNtime seconds|$db_source\n";
 	}
 
 
diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRstats.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRstats.php
index 109f02b1..110d3138 100644
--- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRstats.php
+++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_IVRstats.php
@@ -13,6 +13,9 @@
 # 91112-0719 - Added in-group names to select list
 # 100214-1421 - Sort menu alphabetically
 # 100301-1401 - Added popup date selector
+# 100712-1324 - Added system setting slave server option
+# 100802-2347 - Added User Group Allowed Reports option validation
+# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
 #
 
 require("dbconnect.php");
@@ -40,9 +43,12 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 
 if (strlen($shift)<2) {$shift='ALL';}
 
+$report_name = 'Inbound IVR Report';
+$db_source = 'M';
+
 #############################################
 ##### START SYSTEM_SETTINGS LOOKUP #####
-$stmt = "SELECT use_non_latin FROM system_settings;";
+$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $qm_conf_ct = mysql_num_rows($rslt);
@@ -50,17 +56,34 @@ if ($qm_conf_ct > 0)
 	{
 	$row=mysql_fetch_row($rslt);
 	$non_latin =					$row[0];
+	$outbound_autodial_active =		$row[1];
+	$slave_db_server =				$row[2];
+	$reports_use_slave_db =			$row[3];
 	}
 ##### END SETTINGS LOOKUP #####
 ###########################################
 
-$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
+if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
+	{
+	mysql_close($link);
+	$use_slave_server=1;
+	$db_source = 'S';
+	require("dbconnect.php");
+	echo "\n";
+	}
+
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
 if ($DB) {echo "|$stmt|\n";}
 if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 $row=mysql_fetch_row($rslt);
 $auth=$row[0];
 
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$reports_only_user=$row[0];
 
 if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
 	{
@@ -70,6 +93,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
     exit;
 	}
 
+$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$LOGuser_group =			$row[0];
+
+$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$LOGallowed_campaigns = $row[0];
+$LOGallowed_reports =	$row[1];
+
+if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) )
+	{
+    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
+    Header("HTTP/1.0 401 Unauthorized");
+    echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
+    exit;
+	}
+
 $NOW_DATE = date("Y-m-d");
 $NOW_TIME = date("Y-m-d H:i:s");
 $STARTtime = date("U");
@@ -85,6 +129,7 @@ $i=0;
 	$LISTgroups[$i]='CALLMENU';
 	$LISTgroups_names[$i]='IVR';
 	$i++;
+	$groups_to_print++;
 	$LISTgroups[$i]='XMLPULL';
 	$LISTgroups_names[$i]='Dynamic Application';
 	$i++;
@@ -197,7 +242,7 @@ $end_date_T = $end_dateARRAY[1];
 \n";
-echo "IVR Stats Report\n";
+echo "$report_name\n";
 
 	$short_header=1;
 
@@ -720,7 +765,7 @@ else
 
 	$ENDtime = date("U");
 	$RUNtime = ($ENDtime - $STARTtime);
-	echo "\nRun Time: $RUNtime seconds\n";
+	echo "\nRun Time: $RUNtime seconds|$db_source\n";
 	}
 
 
diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_OUTBOUNDsummary_interval.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_OUTBOUNDsummary_interval.php
index 4ce1906b..bfe26cb6 100644
--- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_OUTBOUNDsummary_interval.php
+++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_OUTBOUNDsummary_interval.php
@@ -9,6 +9,9 @@
 # 091129-0017 - Added Sales-type and DNC-type tallies
 # 100214-1421 - Sort menu alphabetically
 # 100216-0042 - Added popup date selector
+# 100712-1324 - Added system setting slave server option
+# 100802-2347 - Added User Group Allowed Reports option validation
+# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
 #
 
 require("dbconnect.php");
@@ -50,9 +53,12 @@ $MT[0]='0';
 if (strlen($shift)<2) {$shift='ALL';}
 if (strlen($include_rollover)<2) {$include_rollover='NO';}
 
+$report_name = 'Outbound Summary Interval Report';
+$db_source = 'M';
+
 #############################################
 ##### START SYSTEM_SETTINGS LOOKUP #####
-$stmt = "SELECT use_non_latin FROM system_settings;";
+$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $qm_conf_ct = mysql_num_rows($rslt);
@@ -60,10 +66,22 @@ if ($qm_conf_ct > 0)
 	{
 	$row=mysql_fetch_row($rslt);
 	$non_latin =					$row[0];
+	$outbound_autodial_active =		$row[1];
+	$slave_db_server =				$row[2];
+	$reports_use_slave_db =			$row[3];
 	}
 ##### END SETTINGS LOOKUP #####
 ###########################################
 
+if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
+	{
+	mysql_close($link);
+	$use_slave_server=1;
+	$db_source = 'S';
+	require("dbconnect.php");
+	echo "\n";
+	}
+
 $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
@@ -91,6 +109,12 @@ if ($records_to_print > 0)
 	$auth++;
 	}
 
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$reports_only_user=$row[0];
+
 if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
@@ -101,28 +125,31 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
 
 $LOGallowed_campaignsSQL='';
 $whereLOGallowed_campaignsSQL='';
-if ($user_level < 9)
+$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$user_group';";
+$rslt=mysql_query($stmt, $link);
+$records_to_print = mysql_num_rows($rslt);
+if ($records_to_print > 0)
 	{
-	$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$user_group';";
-	$rslt=mysql_query($stmt, $link);
-	$records_to_print = mysql_num_rows($rslt);
-	if ($records_to_print > 0)
+	$row=mysql_fetch_row($rslt);
+	$LOGallowed_reports =	$row[1];
+	if ( (!eregi("ALL-CAMPAIGNS",$row[0])) )
 		{
-		$row=mysql_fetch_row($rslt);
-		if ( (!eregi("ALL-CAMPAIGNS",$row[0])) )
-			{
-			$rawLOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]);
-			$rawLOGallowed_campaignsSQL = eregi_replace(' ',"','",$rawLOGallowed_campaignsSQL);
-			$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
-			$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
-			}
+		$rawLOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]);
+		$rawLOGallowed_campaignsSQL = eregi_replace(' ',"','",$rawLOGallowed_campaignsSQL);
+		$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
+		$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
 		}
-	else
+	if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
 		{
-		echo "Campaigns Permissions Error: |$PHP_AUTH_USER|$user_group|\n";
+		echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
 		exit;
 		}
 	}
+else
+	{
+	echo "Campaigns Permissions Error: |$PHP_AUTH_USER|$user_group|\n";
+	exit;
+	}
 
 $NOW_DATE = date("Y-m-d");
 $NOW_TIME = date("Y-m-d H:i:s");
@@ -163,10 +190,6 @@ $group_string='|';
 $group_ct = count($group);
 while($i < $group_ct)
 	{
-	$group_string .= "$group[$i]|";
-	$group_SQL .= "'$group[$i]',";
-	$groupQS .= "&group[]=$group[$i]";
-
 	$stmt="select campaign_name from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL;";
 	$rslt=mysql_query($stmt, $link);
 	$campaign_names_to_print = mysql_num_rows($rslt);
@@ -174,6 +197,9 @@ while($i < $group_ct)
 		{
 		$row=mysql_fetch_row($rslt);
 		$group_cname[$i] =	$row[0];
+		$group_string .= "$group[$i]|";
+		$group_SQL .= "'$group[$i]',";
+		$groupQS .= "&group[]=$group[$i]";
 		}
 
 	if (eregi("YES",$include_rollover))
@@ -336,7 +362,7 @@ echo "\n";
 echo "\n";
 
 echo "\n";
-echo "Outbound Summary Interval Report\n";
+echo "$report_name\n";
 
 if ($bareformat < 1)
 	{
@@ -1167,8 +1193,8 @@ else
 			$hTOTcalls_count =			sprintf("%6s", $hTOTcalls_count);
 			$hTOTsystem_count =			sprintf("%6s", $hTOTsystem_count);
 			$hTOTagent_count =			sprintf("%6s", $hTOTagent_count);
-			$hTOTptp_count =			sprintf("%6s", $hTOTrtp_count);
-			$hTOTrtp_count =			sprintf("%6s", $hTOTptp_count);
+			$hTOTptp_count =			sprintf("%6s", $hTOTptp_count);
+			$hTOTrtp_count =			sprintf("%6s", $hTOTrtp_count);
 			if ( ($hTOTcalls_count < 1) or ($hTOTna_count < 1) )
 				{$hTOTna_percent=0;}
 			else
@@ -1268,7 +1294,7 @@ else
 
 	$ENDtime = date("U");
 	$RUNtime = ($ENDtime - $STARTtime);
-	echo "\n\nRun Time: $RUNtime seconds\n";
+	echo "\n\nRun Time: $RUNtime seconds|$db_source\n";
 	}
 
 
diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_VDADstats.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_VDADstats.php
index 263a1479..89041995 100644
--- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_VDADstats.php
+++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_VDADstats.php
@@ -26,6 +26,10 @@
 # 100202-1034 - Added statuses to no-answer section
 # 100214-1421 - Sort menu alphabetically
 # 100216-0042 - Added popup date selector
+# 100712-1324 - Added system setting slave server option
+# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
+# 100814-2307 - Added display of preset dials if presets are enabled in the campaign
+# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
 #
 
 header ("Content-type: text/html; charset=utf-8");
@@ -73,10 +77,12 @@ if (strlen($bottom_graph)<2) {$bottom_graph='NO';}
 if (strlen($carrier_stats)<2) {$carrier_stats='NO';}
 if (strlen($include_rollover)<2) {$include_rollover='NO';}
 
+$report_name = 'Outbound Calling Report';
+$db_source = 'M';
 
 #############################################
 ##### START SYSTEM_SETTINGS LOOKUP #####
-$stmt = "SELECT use_non_latin FROM system_settings;";
+$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $qm_conf_ct = mysql_num_rows($rslt);
@@ -84,10 +90,22 @@ if ($qm_conf_ct > 0)
 	{
 	$row=mysql_fetch_row($rslt);
 	$non_latin =					$row[0];
+	$outbound_autodial_active =		$row[1];
+	$slave_db_server =				$row[2];
+	$reports_use_slave_db =			$row[3];
 	}
 ##### END SETTINGS LOOKUP #####
 ###########################################
 
+if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
+	{
+	mysql_close($link);
+	$use_slave_server=1;
+	$db_source = 'S';
+	require("dbconnect.php");
+	echo "\n";
+	}
+
 ##### SERVER CARRIER LOGGING LOOKUP #####
 $stmt = "SELECT count(*) FROM servers where carrier_logging_active='Y' and max_vicidial_trunks > 0;";
 $rslt=mysql_query($stmt, $link);
@@ -99,13 +117,19 @@ if ($srv_conf_ct > 0)
 	$carrier_logging_active =		$row[0];
 	}
 
-$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
 if ($DB) {echo "|$stmt|\n";}
 if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
 $rslt=mysql_query($stmt, $link);
 $row=mysql_fetch_row($rslt);
 $auth=$row[0];
 
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$reports_only_user=$row[0];
+
 if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
@@ -114,6 +138,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
     exit;
 	}
 
+$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$LOGuser_group =			$row[0];
+
+$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$LOGallowed_campaigns = $row[0];
+$LOGallowed_reports =	$row[1];
+
+if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) )
+	{
+    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
+    Header("HTTP/1.0 401 Unauthorized");
+    echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
+    exit;
+	}
+
 $NOW_DATE = date("Y-m-d");
 $NOW_TIME = date("Y-m-d H:i:s");
 $STARTtime = date("U");
@@ -130,7 +175,18 @@ while($i < $group_ct)
 	$i++;
 	}
 
-$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;";
+$LOGallowed_campaignsSQL='';
+$whereLOGallowed_campaignsSQL='';
+if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
+	{
+	$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
+	$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
+	$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
+	$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
+	}
+$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
+
+$stmt="select campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
 $rslt=mysql_query($stmt, $link);
 if ($DB) {echo "$stmt\n";}
 $campaigns_to_print = mysql_num_rows($rslt);
@@ -140,7 +196,7 @@ while ($i < $campaigns_to_print)
 	$row=mysql_fetch_row($rslt);
 	$groups[$i] =		$row[0];
 	$group_names[$i] =	$row[1];
-	if (ereg("--ALL",$group_string) )
+	if (ereg("-ALL",$group_string) )
 		{$group[$i] = $groups[$i];}
 	$i++;
 	}
@@ -151,13 +207,16 @@ $group_string='|';
 $group_ct = count($group);
 while($i < $group_ct)
 	{
-	$group_string .= "$group[$i]|";
-	$group_SQL .= "'$group[$i]',";
-	$groupQS .= "&group[]=$group[$i]";
+	if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) )
+		{
+		$group_string .= "$group[$i]|";
+		$group_SQL .= "'$group[$i]',";
+		$groupQS .= "&group[]=$group[$i]";
+		}
 
 	if (eregi("YES",$include_rollover))
 		{
-		$stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';";
+		$stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';";
 		$rslt=mysql_query($stmt, $link);
 		if ($DB) {echo "$stmt\n";}
 		$in_groups_to_print = mysql_num_rows($rslt);
@@ -174,9 +233,9 @@ while($i < $group_ct)
 	}
 if (strlen($group_drop_SQL) < 2)
 	{$group_drop_SQL = "''";}
-if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
+if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) or (strlen($group_string) < 2) )
 	{
-	$group_SQL = "";
+	$group_SQL = "$LOGallowed_campaignsSQL";
 	$group_drop_SQL = "";
 	}
 else
@@ -252,7 +311,7 @@ echo "\n";
 echo "\n";
 
 echo "\n";
-echo "Outbound Stats\n";
+echo "$report_name\n";
 
 $short_header=1;
 
@@ -981,7 +1040,7 @@ else
 	if ( ($carrier_logging_active > 0) and ($carrier_stats == 'YES') )
 		{
 		##############################
-		#########  STATUS CATEGORÍA STATS
+		#########  CARRIER STATS
 
 		$OUToutput .= "\n";
 		$OUToutput .= "---------- CARRIER CALL STATUSES\n";
@@ -1016,6 +1075,55 @@ else
 		}
 
 
+	## find if any selected campaigns have presets enabled
+	$presets_enabled=0;
+	$stmt="select count(*) from vicidial_campaigns where enable_xfer_presets='ENABLED' $group_SQLand;";
+	$rslt=mysql_query($stmt, $link);
+	if ($DB) {$OUToutput .= "$stmt\n";}
+	$presets_enabled_count = mysql_num_rows($rslt);
+	if ($presets_enabled_count > 0)
+		{
+		$row=mysql_fetch_row($rslt);
+		$presets_enabled = $row[0];
+		}
+
+	if ($presets_enabled > 0)
+		{
+		##############################
+		#########  PRESET DIAL STATS
+
+		$OUToutput .= "\n";
+		$OUToutput .= "---------- AGENTE PRESET DIALS\n";
+		$OUToutput .= "+------------------------------------------+------------+\n";
+		$OUToutput .= "| PRESET NAME                              | CALLS      |\n";
+		$OUToutput .= "+------------------------------------------+------------+\n";
+
+		## get counts and time totals for all statuses in this campaign
+		$stmt="select preset_name,count(*) from user_call_log where call_date > \"$query_date_BEGIN\" and call_date < \"$query_date_END\" and preset_name!='' and preset_name is not NULL  $group_SQLand group by preset_name order by preset_name;";
+		$rslt=mysql_query($stmt, $link);
+		if ($DB) {$OUToutput .= "$stmt\n";}
+		$carrierstatuses_to_print = mysql_num_rows($rslt);
+		$i=0;
+		while ($i < $carrierstatuses_to_print)
+			{
+			$row=mysql_fetch_row($rslt);
+			$TOTPREcalls = ($TOTPREcalls + $row[1]);
+			$PREstatus =	sprintf("%-40s", $row[0]); while(strlen($PREstatus)>40) {$PREstatus = substr("$PREstatus", 0, -1);}
+			$PREcount =		sprintf("%10s", $row[1]); while(strlen($PREcount)>10) {$PREcount = substr("$PREcount", 0, -1);}
+
+			$OUToutput .= "| $PREstatus | $PREcount |\n";
+
+			$i++;
+			}
+
+		$TOTPREcalls =	sprintf("%10s", $TOTPREcalls); while(strlen($TOTPREcalls)>10) {$TOTPREcalls = substr("$TOTPREcalls", 0, -1);}
+
+		$OUToutput .= "+------------------------------------------+------------+\n";
+		$OUToutput .= "| TOTAL                                    | $TOTPREcalls |\n";
+		$OUToutput .= "+------------------------------------------+------------+\n";
+		}
+
+
 	##############################
 	#########  STATUS CATEGORÍA STATS
 
@@ -1446,7 +1554,7 @@ else
 
 	$ENDtime = date("U");
 	$RUNtime = ($ENDtime - $STARTtime);
-	echo "\nRun Time: $RUNtime seconds\n";
+	echo "\nRun Time: $RUNtime seconds|$db_source\n";
 	}
 
 
diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php
index 00642d72..5bbcb689 100644
--- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php
+++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_VICIDIAL_hopperlist.php
@@ -19,12 +19,14 @@ require("dbconnect.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["group"]))				{$group=$_GET["group"];}
 	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
 if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
-	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
+	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
 if (isset($_GET["ENVIAR"]))				{$ENVIAR=$_GET["ENVIAR"];}
-	elseif (isset($_POST["ENVIAR"]))		{$ENVIAR=$_POST["ENVIAR"];}
+	elseif (isset($_POST["ENVIAR"]))	{$ENVIAR=$_POST["ENVIAR"];}
 
 $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
 $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
@@ -77,10 +79,14 @@ while ($i < $campaigns_to_print)
 
 \n";
-echo "Lista De Hopper Report\n";
+echo "Lista De Hopper Report\n";
+
+	$short_header=1;
+
+	require("admin_header.php");
+
+echo "
\n"; echo "\n"; +echo "\n"; echo "Rango de Fecha:
\n"; echo ""; @@ -227,7 +279,10 @@ o_cal.a_tpl.yearscroll = false;
\n"; -echo "Grupos De entrada: \n"; +if ($DID=='Y') + {echo "Inbound DIDs: \n";} +else + {echo "Grupos De entrada: \n";} echo "\n"; echo "\n"; echo "\n"; echo "           "; -echo "MODIFICAR | "; +if ($DID!='Y') + { + echo "MODIFICAR | "; + echo "IVR REPORT | \n"; + } echo "INFORMES | "; -echo "IVR REPORT \n"; echo "\n"; echo "
"; echo "\n"; -#echo "\n"; -#echo "\n"; echo "
+ diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_days_detail.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_days_detail.php index 72660085..9cfff39c 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_days_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_days_detail.php @@ -11,6 +11,9 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # @@ -42,9 +45,12 @@ if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Single Agent Daily'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -52,20 +58,38 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -74,6 +98,38 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -82,7 +138,16 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns;"; +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -91,6 +156,8 @@ while ($i < $campaigns_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} $i++; } @@ -99,9 +166,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) @@ -164,7 +234,7 @@ if ($file_download < 1) echo "\n"; echo "\n"; - echo "Agent Situación días Report\n"; + echo "Single Agent Daily\n"; echo ""; $short_header=1; @@ -273,12 +343,12 @@ else { echo "LEAD STATS BREAKDOWN:\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "|
DATE | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| DATE | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "DATE,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } ### BEGIN loop through each user ### @@ -596,7 +666,7 @@ else echo "INFORMES \n"; echo ""; -echo "\n\n"; +echo "\n\n
$db_source"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_performance_detail.php index 360706b7..5df4e9e4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_performance_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_performance_detail.php @@ -23,6 +23,9 @@ # 100203-1131 - Added CUSTOMER time statistics # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -55,9 +58,12 @@ if (strlen($shift)<2) {$shift='ALL';} $LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date&group=$group&user_group=$user_group&shift=$shift&DB=$DB"; +$report_name = 'Agent Performance Detalle'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -65,20 +71,38 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -87,6 +111,38 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -95,7 +151,17 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -104,6 +170,8 @@ while ($i < $campaigns_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} $i++; } $stmt="select user_group from vicidial_user_groups order by user_group;"; @@ -123,9 +191,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) @@ -174,7 +245,7 @@ echo "\n"; echo "\n"; echo "\n"; -echo "Agent Performance Detalle\n"; +echo "$report_name\n"; $short_header=1; @@ -364,7 +435,7 @@ while ($i < $rows_to_print) echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | LEADS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; @@ -863,7 +934,7 @@ echo "+-----------------+----------+----------+----------+----------+ +$sub_sta echo "| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; echo "+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "\n\n"; +echo "\n\n
$db_source"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_status_detail.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_status_detail.php index 18b2f016..8ffeb09e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_status_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_status_detail.php @@ -12,6 +12,9 @@ # 100119-0935 - Fixed bug 291 # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # @@ -43,9 +46,12 @@ if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Agent Status Detalle'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -53,20 +59,38 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -75,6 +99,39 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -83,7 +140,17 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -92,6 +159,8 @@ while ($i < $campaigns_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} $i++; } $stmt="select user_group from vicidial_user_groups order by user_group;"; @@ -111,9 +180,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) @@ -210,7 +282,7 @@ if ($file_download < 1) echo "\n"; echo "\n"; - echo "Agent Status Detalle Report\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -319,14 +391,14 @@ else if ($file_download < 1) { - echo "LEADS STATS BREAKDOWN:\n"; + echo "CALLS STATS BREAKDOWN:\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } @@ -338,7 +410,7 @@ else { $Suser=$usersARY[$m]; $Sfull_name=$user_namesARY[$m]; - $Scalls=$calls[$m]; + $Scalls=0; $SstatusesHTML=''; $SstatusesFILE=''; $CIScount=0; @@ -663,7 +735,7 @@ echo " INFORMES
\n"; echo "
\n"; echo ""; -echo "\n\n"; +echo "\n\n
$db_source"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_detail.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_detail.php index 3f3edb50..9bca0328 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_detail.php @@ -12,6 +12,9 @@ # 100203-1147 - Added CUSTOMER time statistics # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -44,9 +47,12 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($stage)<2) {$stage='NAME';} +$report_name = 'Agent Time Detail'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -54,20 +60,38 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -76,6 +100,38 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -84,7 +140,18 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -93,8 +160,32 @@ while ($i < $campaigns_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} $i++; } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and campaign_id IN($group_SQL)"; + } + $stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -107,24 +198,6 @@ while ($i < $user_groups_to_print) $i++; } -$i=0; -$group_string='|'; -$group_ct = count($group); -while($i < $group_ct) - { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; - $i++; - } -if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) - {$group_SQL = "";} -else - { - $group_SQL = eregi_replace(",$",'',$group_SQL); - $group_SQL = "and campaign_id IN($group_SQL)"; - } - $i=0; $user_group_string='|'; $user_group_ct = count($user_group); @@ -183,7 +256,7 @@ if ($file_download < 1) echo "\n"; echo "\n"; - echo "Agent Time Detail\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -421,12 +494,12 @@ else { echo "AGENT TIME BREAKDOWN:\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + echo "| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable @@ -861,7 +934,7 @@ echo " REPORTS
\n"; echo "
\n"; echo ""; -echo "\n\n"; +echo "\n\n
$db_source"; ############################################################################ ##### END HTML form section ############################################################################ diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_sheet.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_sheet.php index f2c0cb95..89eee30b 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_sheet.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_time_sheet.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -11,27 +11,44 @@ # 90310-0745 - Added admin header # 90508-0644 - Changed to PHP long tags # 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); require("functions.php"); +$report_name = 'Usuario Hoja de tiempo'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -51,14 +68,20 @@ $user=$agent; $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -66,6 +89,27 @@ $auth=$row[0]; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -86,7 +130,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} \n"; -echo "Agent Hoja de tiempo"; +echo "<TITLE>$report_name"; ##### BEGIN Set variables to make header show properly ##### @@ -298,7 +342,7 @@ echo "<td align=right><font size=2> </td>\n"; echo "<td align=right colspan=2><font size=2><font size=2>TOTAL </td>\n"; echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; -echo "</TABLE>\n"; +echo "</TABLE><BR>$db_source\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_timeclock_detail.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_timeclock_detail.php index e8d0b8b8..6b03fb37 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_timeclock_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_agent_timeclock_detail.php @@ -8,6 +8,9 @@ # CHANGES # 90602-2244 - First build # 100301-1401 - Added popup date selector +# 100712-1324 - Added system setting slave server option and added user stats link dates +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # @@ -41,9 +44,12 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($stage)<2) {$stage='ID';} +$report_name = 'User Timeclock Detail Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -51,20 +57,38 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -73,6 +97,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -145,6 +190,7 @@ if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) {$user_group_SQL = "";} else { + $TCuser_group_SQL = $user_group_SQL; $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL); @@ -188,7 +234,7 @@ if ($file_download < 1) <?php echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; - echo "<TITLE>User Time-Clock Detail\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -428,7 +474,7 @@ else if ($file_download < 1) { - $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; } else { @@ -636,7 +682,7 @@ else $o=0; while ($user_groups_to_print > $o) { - if (eregi("$user_groups[$o]\|",$user_group_string)) {echo "\n";} + if (eregi("\|$user_groups[$o]\|",$user_group_string)) {echo "\n";} else {echo "\n";} $o++; } @@ -684,7 +730,7 @@ echo "\n\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "$RUNtime\n"; +echo "$RUNtime|$db_source\n"; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_server_performance.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_server_performance.php index 1d6bb3cf..98763450 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_server_performance.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_server_performance.php @@ -13,6 +13,9 @@ # 90310-2151 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -36,12 +39,47 @@ if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';"; +$report_name = 'Server Performance Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -50,6 +88,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + # path from root to where ploticus files will be stored $PLOTroot = "vicidial/ploticus"; $DOCroot = "$WeBServeRRooT/$PLOTroot/"; @@ -88,7 +147,7 @@ while ($i < $servers_to_print) \n"; -echo "Server Performance Report\n"; +echo "$report_name\n"; $short_header=1; @@ -343,5 +402,6 @@ echo ""; ?> - +
+ \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php index c2c01342..b2e1c4af 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADall.php @@ -60,10 +60,19 @@ # 91204-1548 - Added ability to change agent in-groups and blended # 100214-1127 - Added no-dialable-leads alert and in-groups stats option # 100301-1229 - Added 3-WAY status for consultative transfer agents +# 100303-0930 - Added carrier stats display option +# 100424-0943 - Added realtime_block_user_info option +# 100709-1054 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100805-0704 - Fixed minor bug in campaigns restrictions +# 100815-0002 - Added optional display of preset dials if presets are enabled in the campaign +# 100912-0839 - Changed several stats to limit to 2 or 3 decimal spaces +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101024-0832 - Added Agent time stats option and agents-in-dispo counter # -$version = '2.2.0-51'; -$build = '100301-1229'; +$version = '2.4-60'; +$build = '101024-0832'; header ("Content-type: text/html; charset=utf-8"); @@ -123,11 +132,19 @@ if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"]; elseif (isset($_POST["monitor_active"])) {$monitor_active=$_POST["monitor_active"];} if (isset($_GET["monitor_phone"])) {$monitor_phone=$_GET["monitor_phone"];} elseif (isset($_POST["monitor_phone"])) {$monitor_phone=$_POST["monitor_phone"];} +if (isset($_GET["CARRIERstats"])) {$CARRIERstats=$_GET["CARRIERstats"];} + elseif (isset($_POST["CARRIERstats"])) {$CARRIERstats=$_POST["CARRIERstats"];} +if (isset($_GET["PRESETstats"])) {$PRESETstats=$_GET["PRESETstats"];} + elseif (isset($_POST["PRESETstats"])) {$PRESETstats=$_POST["PRESETstats"];} +if (isset($_GET["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_GET["AGENTtimeSTATS"];} + elseif (isset($_POST["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_POST["AGENTtimeSTATS"];} +$report_name = 'Tiempo Real Main Report'; +$db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -136,13 +153,24 @@ if ($qm_conf_ct > 0) $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + if (!isset($DB)) {$DB=0;} if (!isset($RR)) {$RR=40;} -if (!isset($group)) {$group='';} +if (!isset($group)) {$group='ALL-ACTIVE';} if (!isset($usergroup)) {$usergroup='';} if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name @@ -155,13 +183,13 @@ if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes if (!isset($with_inbound)) { if ($outbound_autodial_active > 0) - {$with_inbound='N';} # N=no, Y=yes, O=only + {$with_inbound='Y';} # N=no, Y=yes, O=only else {$with_inbound='O';} # N=no, Y=yes, O=only } $ingroup_detail=''; -if (strlen($group)>1) {$groups[0] = $group; $RR=40;} +if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group; $RR=40;} else {$group = $groups[0];} function get_server_load($windows = false) @@ -216,8 +244,18 @@ $NOW_TIME = date("Y-m-d H:i:s"); $NOW_DAY = date("Y-m-d"); $NOW_HOUR = date("H:i:s"); $STARTtime = date("U"); +$epochONEminuteAGO = ($STARTtime - 60); +$timeONEminuteAGO = date("Y-m-d H:i:s",$epochONEminuteAGO); +$epochFIVEminutesAGO = ($STARTtime - 300); +$timeFIVEminutesAGO = date("Y-m-d H:i:s",$epochFIVEminutesAGO); +$epochFIFTEENminutesAGO = ($STARTtime - 900); +$timeFIFTEENminutesAGO = date("Y-m-d H:i:s",$epochFIFTEENminutesAGO); +$epochONEhourAGO = ($STARTtime - 3600); +$timeONEhourAGO = date("Y-m-d H:i:s",$epochONEhourAGO); $epochSIXhoursAGO = ($STARTtime - 21600); $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); +$epochTWENTYFOURhoursAGO = ($STARTtime - 86400); +$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -230,7 +268,13 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -247,7 +291,41 @@ if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) $monitor_phone = $row[0]; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; +$stmt="SELECT realtime_block_user_info,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$realtime_block_user_info = $row[0]; +$LOGuser_group = $row[1]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$allactivecampaigns=''; +$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -260,26 +338,32 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] =$row[0]; $LISTnames[$i] =$row[1]; + $allactivecampaigns .= "'$LISTgroups[$i]',"; $i++; } +$allactivecampaigns .= "''"; $i=0; $group_string='|'; $group_ct = count($groups); while($i < $group_ct) { - $group_string .= "$groups[$i]|"; - $group_SQL .= "'$groups[$i]',"; - $groupQS .= "&groups[]=$groups[$i]"; + if ( (preg_match("/ $groups[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $group_string .= "$groups[$i]|"; + $group_SQL .= "'$groups[$i]',"; + $groupQS .= "&groups[]=$groups[$i]"; + } + $i++; } $group_SQL = eregi_replace(",$",'',$group_SQL); ### if no campaigns selected, display all -if ($group_ct < 1) +if ( ($group_ct < 1) or (strlen($group_string) < 2) ) { $groups[0] = 'ALL-ACTIVE'; - $group_string = 'ALL-ACTIVE'; + $group_string = '|ALL-ACTIVE|'; $group = 'ALL-ACTIVE'; $groupQS .= "&groups[]=ALL-ACTIVE"; } @@ -294,9 +378,9 @@ if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) elseif ( eregi('ALL-ACTIVE',$group_string) ) { $all_active = 1; - $group_SQL = "''"; - $group_SQLand = ""; - $group_SQLwhere = ""; + $group_SQL = $allactivecampaigns; + $group_SQLand = "and campaign_id IN($allactivecampaigns)"; + $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; } else { @@ -325,7 +409,7 @@ $NFB = ''; $NFE = ''; $F=''; $FG=''; $B=''; $BG=''; -$select_list = "\n"; + echo "\n"; } - echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; } - echo "\n"; + + echo "\n"; + echo "\n"; if ($LOGuser_level==9) {$levelMAX=10;} @@ -6531,6 +7737,7 @@ if ($ADD==11) echo "
NUEVA CAMPAÑA\n"; echo "\n"; + echo "\n"; echo "
Select Campañas:
"; +$select_list = "
Select Campañas:
"; $select_list .= ""; $select_list .= "
(Para seleccionar más de 1 campaña, mantenga pulsada la tecla Ctrl y haga clic en)"; $select_list .= "
"; $select_list .= "Panel de Cierre

"; +$select_list .= ""; -if ($UGdisplay > 0) - { - $select_list .= "Select Grupo Del Usuario:
"; - $select_list .= "

"; - } - -$select_list .= "   Inbound: "; +$select_list .= ""; -$select_list .= "   Dialable Leads Alert:
"; + } + +$select_list .= ""; $select_list .= ""; -$select_list .= "
"; +$select_list .= "Inbound:
 
"; + $select_list .= "Select Grupo Del Usuario: "; + $select_list .= "
"; +$select_list .= "Dialable Leads Alert:
"; + $select_list .= "Show Presets Stats:
"; $select_list .= "   "; $select_list .= ""; +$select_list .= ""; $select_list .= "VERSIÓN: $version   CONSTRUCCION: $build"; $select_list .= "
"; @@ -707,8 +843,8 @@ $rslt=mysql_query($stmt, $link); $campaign_allow_inbound = $row[0]; echo "\n"; -echo"\n"; -echo "Tiempo Real Report: $group\n"; +echo"\n"; +echo "$report_name: $group\n"; $short_header=1; @@ -734,6 +870,9 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "Tiempo Real Report                                                                               \n"; echo "\n"; echo ""; + } + + +##### PRESET STATS TOTALS ### +$PRESETstatsHTML=''; +if ($PRESETstats > 0) + { + $PRESETstatsHTML .= ""; + } + + +# http://server/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1 + ##### INBOUND ONLY ### if (ereg('O',$with_inbound)) { @@ -974,10 +1307,8 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $non_inboundSQL=''; - if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} - $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $non_inboundSQL;"; + $inboundSQL = "where campaign_id IN ($closer_campaignsSQL)"; + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $inboundSQL;"; } $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; @@ -1100,11 +1431,13 @@ else { $non_inboundSQL=''; if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} + {$non_inboundSQL = "and campaign_id NOT IN($ALLcloser_campaignsSQL)";} + else + {$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";} $multi_drop++; - $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y';"; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y' $group_SQLand;"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats $non_inboundSQL;"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where calls_today > -1 $non_inboundSQL;"; } else { @@ -1117,13 +1450,13 @@ else $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; } else { $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where campaign_id IN($group_SQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; } } if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";} @@ -1187,6 +1520,11 @@ else $VSCcat3tally = $row[13]; $VSCcat4 = $row[14]; $VSCcat4tally = $row[15]; + $VSCagentcalls = $row[16]; + $VSCagentwait = $row[17]; + $VSCagentcust = $row[18]; + $VSCagentacw = $row[19]; + $VSCagentpause = $row[20]; if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { @@ -1207,7 +1545,7 @@ else } else { - $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $groupSQLand limit 1;"; + $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $group_SQLand limit 1;"; $rslt=mysql_query($stmt, $link); $Lmix_to_print = mysql_num_rows($rslt); if ($Lmix_to_print > 0) @@ -1217,6 +1555,10 @@ else $DIALorder = "Mezcla lista: $row[0]"; } } + $DIALlev = sprintf("%01.3f", $DIALlev); + $agentsONEMIN = sprintf("%01.2f", $agentsONEMIN); + $diffONEMIN = sprintf("%01.2f", $diffONEMIN); + echo "
\n"; @@ -743,9 +882,9 @@ echo "\n"; echo "\n"; echo "   "; echo "\n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; if (eregi('ALL-ACTIVE',$group_string)) { echo "       MODIFICAR | \n"; @@ -798,10 +937,9 @@ if ( ( ereg('Y',$with_inbound) or ereg('O',$with_inbound) ) and ($campaign_allow } $closer_campaignsSQL = preg_replace("/,$/","",$closer_campaignsSQL); } -else - { - $closer_campaignsSQL = "''"; - } +if (strlen($closer_campaignsSQL)<2) + {$closer_campaignsSQL="''";} + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} @@ -936,6 +1074,7 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) $dtp++; } $DIGcampaigns = preg_replace("/,$/",'',$DIGcampaigns); + if (strlen($DIGcampaigns) < 2) {$DIGcampaigns = "''";} $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today) from vicidial_campaign_stats where campaign_id IN($DIGcampaigns);"; if ($DB > 0) {echo "\n|$stmtB|\n";} @@ -963,6 +1102,200 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) } +##### CARRIER STATS TOTALS ### +$CARRIERstatsHTML=''; +if ($CARRIERstats > 0) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeTWENTYFOURhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $car_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($car_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $TFhour_status[$ctp] = $row[0]; + $TFhour_count[$ctp] = $row[1]; + $dialstatuses .= "'$row[0]',"; + $ctp++; + } + $dialstatuses = preg_replace("/,$/",'',$dialstatuses); + + $CARRIERstatsHTML .= "
"; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + + if (strlen($dialstatuses) > 1) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeSIXhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$SIXhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEhourAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIFTEENminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FTminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIVEminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FIVEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEminuteAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + + $print_ctp=0; + while ($print_ctp < $ctp) + { + if (strlen($TFhour_count[$print_ctp])<1) {$TFhour_count[$print_ctp]=0;} + if (strlen($SIXhour_count[$print_ctp])<1) {$SIXhour_count[$print_ctp]=0;} + if (strlen($ONEhour_count[$print_ctp])<1) {$ONEhour_count[$print_ctp]=0;} + if (strlen($FTminute_count[$print_ctp])<1) {$FTminute_count[$print_ctp]=0;} + if (strlen($FIVEminute_count[$print_ctp])<1) {$FIVEminute_count[$print_ctp]=0;} + if (strlen($ONEminute_count[$print_ctp])<1) {$ONEminute_count[$print_ctp]=0;} + + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $print_ctp++; + } + } + else + { + $CARRIERstatsHTML .= ""; + } + $CARRIERstatsHTML .= "
CARRIER STATS:                 HANGUP STATUS     24 HOURS     6 HOURS     1 HOUR     15 MIN     5 MIN     1 MIN  
     $TFhour_status[$print_ctp] $TFhour_count[$print_ctp] $SIXhour_count[$print_ctp] $ONEhour_count[$print_ctp] $FTminute_count[$print_ctp] $FIVEminute_count[$print_ctp] $ONEminute_count[$print_ctp]
no log entries
"; + $CARRIERstatsHTML .= "
"; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $stmtB="select preset_name,xfer_count from vicidial_xfer_stats where preset_name!='' and preset_name is not NULL $group_SQLand order by preset_name;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $pre_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($pre_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $ctp++; + } + if ($ctp < 1) + { + $PRESETstatsHTML .= ""; + } + $PRESETstatsHTML .= "
  AGENTE DIAL PRESETS:     PRESET NAMES                 CALLS  
            $row[0]     $row[1]  
no log entries
"; + $PRESETstatsHTML .= "
"; echo ""; @@ -1271,7 +1613,55 @@ else echo ""; echo ""; + if ($AGENTtimeSTATS>0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "$DROPINGROUPstatsHTML\n"; + echo "$CARRIERstatsHTML\n"; + echo "$PRESETstatsHTML\n"; } echo ""; @@ -1292,60 +1682,60 @@ echo "$ingroup_detail"; if ($adastats<2) { - echo "+ VIEW MORE"; + echo "+ VIEW MORE"; } else { - echo "+ VIEW LESS"; + echo "+ VIEW LESS"; } if ($UGdisplay>0) { - echo "       PIEL GRUPO DE USUARIOS"; + echo "       PIEL GRUPO DE USUARIOS"; } else { - echo "       VIEW GRUPO DE USUARIOS"; + echo "       VIEW GRUPO DE USUARIOS"; } if ($SERVdisplay>0) { - echo "       PIEL SERVIDOR INFO"; + echo "       PIEL SERVIDOR INFO"; } else { - echo "       DEMOSTRACIÓN SERVIDOR INFO"; + echo "       DEMOSTRACIÓN SERVIDOR INFO"; } if ($CALLSdisplay>0) { - echo "       PIEL WAITING CALLS"; + echo "       PIEL WAITING CALLS"; } else { - echo "       DEMOSTRACIÓN WAITING CALLS"; + echo "       DEMOSTRACIÓN WAITING CALLS"; } if ($ALLINGROUPstats>0) { - echo "       PIEL IN-GROUP STATS"; + echo "       PIEL IN-GROUP STATS"; } else { - echo "       DEMOSTRACIÓN IN-GROUP STATS"; + echo "       DEMOSTRACIÓN IN-GROUP STATS"; } if ($PHONEdisplay>0) { - echo "       PIEL PHONES"; + echo "       PIEL PHONES"; } else { - echo "       DEMOSTRACIÓN PHONES"; + echo "       DEMOSTRACIÓN PHONES"; } if ($CUSTPHONEdisplay>0) { - echo "       PIEL CUSTPHONES"; + echo "       PIEL CUSTPHONES"; } else { - echo "       DEMOSTRACIÓN CUSTPHONES"; + echo "       DEMOSTRACIÓN CUSTPHONES"; } echo ""; echo ""; @@ -1390,6 +1780,20 @@ if ( ($with_inbound != 'O') and ($NOLEADSalert == 'YES') ) ################################################################################### if ($campaign_allow_inbound > 0) { + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand"; + $rslt=mysql_query($stmt, $link); + $closer_campaigns=""; + while ($row=mysql_fetch_row($rslt)) + { + $closer_campaigns.="$row[0]"; + } + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL = "'$closer_campaigns'"; + } $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;"; } else @@ -1515,15 +1919,15 @@ if ($agentonlycount > 0) {$agentonlyheader = 'AGENTONLY';} $Cecho = ''; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; -$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORIDAD | $agentonlyheader\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORIDAD | $agentonlyheader\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $p=0; while($p<$k) { $Cstatus = sprintf("%-6s", $CDstatus[$p]); - $Ccampaign_id = sprintf("%-12s", $CDcampaign_id[$p]); + $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); @@ -1548,7 +1952,7 @@ while($p<$k) $p++; } -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; if ($p<1) {$Cecho='';} @@ -1560,6 +1964,7 @@ if ($p<1) $agent_incall=0; $agent_ready=0; $agent_paused=0; +$agent_dispo=0; $agent_dead=0; $agent_total=0; @@ -1589,25 +1994,25 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; $HDuser = "------------------------+"; -$HTuser = " USER "; +$HTuser = " USER "; if ($UidORname>0) { - $HTuser .= "DEMOSTRACIÓN ID "; + $HTuser .= "DEMOSTRACIÓN ID "; } else { - $HTuser .= "DEMOSTRACIÓN NAME"; + $HTuser .= "DEMOSTRACIÓN NAME"; } $HTuser .= " INFO |"; $HDusergroup = "--------------+"; -$HTusergroup = " GRUPO DE USUARIOS |"; +$HTusergroup = " GRUPO DE USUARIOS |"; $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -1621,9 +2026,9 @@ $HTserver_ip = " SERVIDOR IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVIDOR IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; $HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; +$HTcampaign = " CAMPAIGN |"; $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; @@ -1672,9 +2077,16 @@ if ($SERVdisplay < 1) } - -$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; -$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; +if ($realtime_block_user_info > 0) + { + $Aline = "$HDbegin$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } +else + { + $Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } $Aecho .= "$Aline"; $Aecho .= "$Bline"; $Aecho .= "$Aline"; @@ -1698,7 +2110,7 @@ else if ($orderby=='userdown') {$orderSQL='vicidial_live_agents.user desc';} } -if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} +if ( (eregi('ALL-ACTIVE',$group_string)) and (strlen($group_SQL) < 3) ) {$UgroupSQL = '';} else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";} if (strlen($usergroup)<1) {$usergroupSQL = '';} else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} @@ -2000,7 +2412,7 @@ $calls_to_list = mysql_num_rows($rslt); {$j++; continue;} else { - $agent_paused++; $agent_total++; + $agent_dispo++; $agent_total++; $G=''; $EG=''; if ($call_time_S >= 10) {$G=''; $EG='';} if ($call_time_S >= 60) {$G=''; $EG='';} @@ -2088,14 +2500,20 @@ $calls_to_list = mysql_num_rows($rslt); $agentcount++; - $Aecho .= "| $G$extension$EG |$phoneD$G$user$EG+ |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; - + if ($realtime_block_user_info > 0) + { + $Aecho .= "|$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } + if ($realtime_block_user_info < 1) + { + $Aecho .= "| $G$extension$EG |$phoneD$G$user$EG+ |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } $j++; } $Aecho .= "$Aline"; $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " Sistema de carga Average: $load_ave\n\n"; + $Aecho .= " Sistema de carga Average: $load_ave   $db_source\n\n"; # $Aecho .= " - Balanced call\n"; $Aecho .= " - Agent waiting for call\n"; @@ -2123,6 +2541,7 @@ $calls_to_list = mysql_num_rows($rslt); echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; echo "$NFB$agent_paused$NFE paused agents       \n"; echo "$NFB$agent_dead$NFE agentes muertos en las llamadas      \n"; + echo "$NFB$agent_dispo$NFE agents in dispo      \n"; echo "
";
 		echo "";
diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php
index ae7f61b1..df4a6c5e 100644
--- a/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php
+++ b/agc_2-X/trunk/LANG_www/vicidial_es/AST_timeonVDADallSUMMARY.php
@@ -1,7 +1,7 @@
     LICENSE: AGPLv2
+# Copyright (C) 2010  Matt Florell     LICENSE: AGPLv2
 #
 # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers
 #
@@ -16,6 +16,9 @@
 # 80525-1040 - Added IVR status summary display for inbound calls
 # 90310-2119 - Added admin header
 # 90508-0644 - Changed to PHP long tags
+# 100709-1806 - Added system setting slave server option
+# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
+# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
 #
 
 header ("Content-type: text/html; charset=utf-8");
@@ -38,17 +41,52 @@ if (isset($_GET["ENVIAR"]))				{$ENVIAR=$_GET["ENVIAR"];}
 
 if (!isset($RR))			{$gRRroup=4;}
 
+$report_name = 'Tiempo Real Campaña Summary';
+$db_source = 'M';
+
+#############################################
+##### START SYSTEM_SETTINGS LOOKUP #####
+$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
+$rslt=mysql_query($stmt, $link);
+if ($DB) {echo "$stmt\n";}
+$qm_conf_ct = mysql_num_rows($rslt);
+if ($qm_conf_ct > 0)
+	{
+	$row=mysql_fetch_row($rslt);
+	$non_latin =					$row[0];
+	$outbound_autodial_active =		$row[1];
+	$slave_db_server =				$row[2];
+	$reports_use_slave_db =			$row[3];
+	}
+##### END SETTINGS LOOKUP #####
+###########################################
+
+if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
+	{
+	mysql_close($link);
+	$use_slave_server=1;
+	$db_source = 'S';
+	require("dbconnect.php");
+	echo "\n";
+	}
+
 
 $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
 $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
 
-	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
-	if ($DB) {echo "|$stmt|\n";}
-	$rslt=mysql_query($stmt, $link);
-	$row=mysql_fetch_row($rslt);
-	$auth=$row[0];
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$auth=$row[0];
 
-  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
+$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$reports_only_user=$row[0];
+
+if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
 	{
     Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
     Header("HTTP/1.0 401 Unauthorized");
@@ -56,10 +94,41 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
     exit;
 	}
 
+$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$LOGuser_group =			$row[0];
+
+$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$LOGallowed_campaigns = $row[0];
+$LOGallowed_reports =	$row[1];
+
+if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) )
+	{
+    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
+    Header("HTTP/1.0 401 Unauthorized");
+    echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
+    exit;
+	}
+
 $NOW_TIME = date("Y-m-d H:i:s");
 $STARTtime = date("U");
 
-$stmt="select campaign_id from vicidial_campaigns where active='Y';";
+$LOGallowed_campaignsSQL='';
+$whereLOGallowed_campaignsSQL='';
+if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
+	{
+	$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
+	$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
+	$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
+	$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
+	}
+
+$stmt="select campaign_id from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;";
 $rslt=mysql_query($stmt, $link);
 if (!isset($DB))   {$DB=0;}
 if ($DB) {echo "$stmt\n";}
@@ -107,7 +176,7 @@ if (!isset($RR))   {$RR=4;}
 \n";
-echo "Tiempo Real All Campañas Summary\n";
+echo "$report_name\n";
 
 	$short_header=1;
 
@@ -446,10 +515,12 @@ echo "";
 echo "";
 echo "
DIAL NIVEL:  $DIALlev    ORDER:  $DIALorder    
AGENTE AVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
"; -echo "\n\n"; +echo "\n\n
"; $k++; } + +echo "$db_source\n"; ?>
diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin.php index 0d099554..c0b271ad 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin.php @@ -94,6 +94,10 @@ $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +$Vreports = 'NONE, Tiempo Real Main Report, Tiempo Real Campaña Summary , Inbound Report, Inbound Service Level Report, Resumen horario de entrada Informe, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Listas Estados De la Campaña Report, Pide Informe exportación , Agente Tiempo Detalle, Agent Status Detalle, Agent Performance Detalle, Single Agent Daily , UsuarioReloj de tiempo Report, Grupo Del UsuarioReloj de tiempo Status Report, UsuarioReloj de tiempo Detalle Informe , Server Performance Report, Administration Change Log, List Update Stats, Estadísticas de usuario, Usuario Hoja de tiempo, Download List'; + +$UGreports = 'ALL INFORMES, NONE, Tiempo Real Main Report, Tiempo Real Campaña Summary , Inbound Report, Inbound Service Level Report, Resumen horario de entrada Informe, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Listas Estados De la Campaña Report, Pide Informe exportación , Agente Tiempo Detalle, Agent Status Detalle, Agent Performance Detalle, Single Agent Daily , UsuarioReloj de tiempo Report, Grupo Del UsuarioReloj de tiempo Status Report, UsuarioReloj de tiempo Detalle Informe , Server Performance Report, Administration Change Log, List Update Stats, Estadísticas de usuario, Usuario Hoja de tiempo, Download List, Custom Informes Links, CallCard Search'; + ###################################################################################################### ###################################################################################################### ####### Form variable declaration @@ -1167,9 +1171,314 @@ if (isset($_GET["xferconf_d_number"])) {$xferconf_d_number=$_GET["xferconf_d_n elseif (isset($_POST["xferconf_d_number"])) {$xferconf_d_number=$_POST["xferconf_d_number"];} if (isset($_GET["xferconf_e_number"])) {$xferconf_e_number=$_GET["xferconf_e_number"];} elseif (isset($_POST["xferconf_e_number"])) {$xferconf_e_number=$_POST["xferconf_e_number"];} +if (isset($_GET["record_call"])) {$record_call=$_GET["record_call"];} + elseif (isset($_POST["record_call"])) {$record_call=$_POST["record_call"];} +if (isset($_GET["ignore_list_script_override"])) {$ignore_list_script_override=$_GET["ignore_list_script_override"];} + elseif (isset($_POST["ignore_list_script_override"])) {$ignore_list_script_override=$_POST["ignore_list_script_override"];} +if (isset($_GET["external_server_ip"])) {$external_server_ip=$_GET["external_server_ip"];} + elseif (isset($_POST["external_server_ip"])){$external_server_ip=$_POST["external_server_ip"];} +if (isset($_GET["is_webphone"])) {$is_webphone=$_GET["is_webphone"];} + elseif (isset($_POST["is_webphone"])) {$is_webphone=$_POST["is_webphone"];} +if (isset($_GET["use_external_server_ip"])) {$use_external_server_ip=$_GET["use_external_server_ip"];} + elseif (isset($_POST["use_external_server_ip"])){$use_external_server_ip=$_POST["use_external_server_ip"];} +if (isset($_GET["default_webphone"])) {$default_webphone=$_GET["default_webphone"];} + elseif (isset($_POST["default_webphone"])) {$default_webphone=$_POST["default_webphone"];} +if (isset($_GET["default_external_server_ip"])) {$default_external_server_ip=$_GET["default_external_server_ip"];} + elseif (isset($_POST["default_external_server_ip"])){$default_external_server_ip=$_POST["default_external_server_ip"];} +if (isset($_GET["webphone_url"])) {$webphone_url=$_GET["webphone_url"];} + elseif (isset($_POST["webphone_url"])) {$webphone_url=$_POST["webphone_url"];} +if (isset($_GET["enable_agc_dispo_log"])) {$enable_agc_dispo_log=$_GET["enable_agc_dispo_log"];} + elseif (isset($_POST["enable_agc_dispo_log"])) {$enable_agc_dispo_log=$_POST["enable_agc_dispo_log"];} +if (isset($_GET["agent_call_log_view"])) {$agent_call_log_view=$_GET["agent_call_log_view"];} + elseif (isset($_POST["agent_call_log_view"])) {$agent_call_log_view=$_POST["agent_call_log_view"];} +if (isset($_GET["agent_call_log_view_override"])) {$agent_call_log_view_override=$_GET["agent_call_log_view_override"];} + elseif (isset($_POST["agent_call_log_view_override"])) {$agent_call_log_view_override=$_POST["agent_call_log_view_override"];} +if (isset($_GET["use_custom_cid"])) {$use_custom_cid=$_GET["use_custom_cid"];} + elseif (isset($_POST["use_custom_cid"])) {$use_custom_cid=$_POST["use_custom_cid"];} +if (isset($_GET["scheduled_callbacks_alert"])) {$scheduled_callbacks_alert=$_GET["scheduled_callbacks_alert"];} + elseif (isset($_POST["scheduled_callbacks_alert"])) {$scheduled_callbacks_alert=$_POST["scheduled_callbacks_alert"];} +if (isset($_GET["queuemetrics_loginout"])) {$queuemetrics_loginout=$_GET["queuemetrics_loginout"];} + elseif (isset($_POST["queuemetrics_loginout"])) {$queuemetrics_loginout=$_POST["queuemetrics_loginout"];} +if (isset($_GET["callcard_enabled"])) {$callcard_enabled=$_GET["callcard_enabled"];} + elseif (isset($_POST["callcard_enabled"])) {$callcard_enabled=$_POST["callcard_enabled"];} +if (isset($_GET["callcard_admin"])) {$callcard_admin=$_GET["callcard_admin"];} + elseif (isset($_POST["callcard_admin"])) {$callcard_admin=$_POST["callcard_admin"];} +if (isset($_GET["agent_xfer_consultative"])) {$agent_xfer_consultative=$_GET["agent_xfer_consultative"];} + elseif (isset($_POST["agent_xfer_consultative"])) {$agent_xfer_consultative=$_POST["agent_xfer_consultative"];} +if (isset($_GET["agent_xfer_dial_override"])) {$agent_xfer_dial_override=$_GET["agent_xfer_dial_override"];} + elseif (isset($_POST["agent_xfer_dial_override"])) {$agent_xfer_dial_override=$_POST["agent_xfer_dial_override"];} +if (isset($_GET["agent_xfer_vm_transfer"])) {$agent_xfer_vm_transfer=$_GET["agent_xfer_vm_transfer"];} + elseif (isset($_POST["agent_xfer_vm_transfer"])) {$agent_xfer_vm_transfer=$_POST["agent_xfer_vm_transfer"];} +if (isset($_GET["agent_xfer_blind_transfer"])) {$agent_xfer_blind_transfer=$_GET["agent_xfer_blind_transfer"];} + elseif (isset($_POST["agent_xfer_blind_transfer"])) {$agent_xfer_blind_transfer=$_POST["agent_xfer_blind_transfer"];} +if (isset($_GET["agent_xfer_dial_with_customer"])) {$agent_xfer_dial_with_customer=$_GET["agent_xfer_dial_with_customer"];} + elseif (isset($_POST["agent_xfer_dial_with_customer"])) {$agent_xfer_dial_with_customer=$_POST["agent_xfer_dial_with_customer"];} +if (isset($_GET["agent_xfer_park_customer_dial"])) {$agent_xfer_park_customer_dial=$_GET["agent_xfer_park_customer_dial"];} + elseif (isset($_POST["agent_xfer_park_customer_dial"])) {$agent_xfer_park_customer_dial=$_POST["agent_xfer_park_customer_dial"];} +if (isset($_GET["agent_fullscreen"])) {$agent_fullscreen=$_GET["agent_fullscreen"];} + elseif (isset($_POST["agent_fullscreen"])) {$agent_fullscreen=$_POST["agent_fullscreen"];} +if (isset($_GET["extension_id"])) {$extension_id=$_GET["extension_id"];} + elseif (isset($_POST["extension_id"])) {$extension_id=$_POST["extension_id"];} +if (isset($_GET["extension_group_id"])) {$extension_group_id=$_GET["extension_group_id"];} + elseif (isset($_POST["extension_group_id"])) {$extension_group_id=$_POST["extension_group_id"];} +if (isset($_GET["campaign_groups"])) {$campaign_groups=$_GET["campaign_groups"];} + elseif (isset($_POST["campaign_groups"])) {$campaign_groups=$_POST["campaign_groups"];} +if (isset($_GET["extension_group"])) {$extension_group=$_GET["extension_group"];} + elseif (isset($_POST["extension_group"])) {$extension_group=$_POST["extension_group"];} +if (isset($_GET["agent_choose_blended"])) {$agent_choose_blended=$_GET["agent_choose_blended"];} + elseif (isset($_POST["agent_choose_blended"])) {$agent_choose_blended=$_POST["agent_choose_blended"];} +if (isset($_GET["queuemetrics_callstatus"])) {$queuemetrics_callstatus=$_GET["queuemetrics_callstatus"];} + elseif (isset($_POST["queuemetrics_callstatus"])) {$queuemetrics_callstatus=$_POST["queuemetrics_callstatus"];} +if (isset($_GET["extension_appended_cidname"])) {$extension_appended_cidname=$_GET["extension_appended_cidname"];} + elseif (isset($_POST["extension_appended_cidname"])) {$extension_appended_cidname=$_POST["extension_appended_cidname"];} +if (isset($_GET["scheduled_callbacks_count"])) {$scheduled_callbacks_count=$_GET["scheduled_callbacks_count"];} + elseif (isset($_POST["scheduled_callbacks_count"])) {$scheduled_callbacks_count=$_POST["scheduled_callbacks_count"];} +if (isset($_GET["realtime_block_user_info"])) {$realtime_block_user_info=$_GET["realtime_block_user_info"];} + elseif (isset($_POST["realtime_block_user_info"])) {$realtime_block_user_info=$_POST["realtime_block_user_info"];} +if (isset($_GET["manual_dial_override"])) {$manual_dial_override=$_GET["manual_dial_override"];} + elseif (isset($_POST["manual_dial_override"])) {$manual_dial_override=$_POST["manual_dial_override"];} +if (isset($_GET["blind_monitor_warning"])) {$blind_monitor_warning=$_GET["blind_monitor_warning"];} + elseif (isset($_POST["blind_monitor_warning"])) {$blind_monitor_warning=$_POST["blind_monitor_warning"];} +if (isset($_GET["blind_monitor_message"])) {$blind_monitor_message=$_GET["blind_monitor_message"];} + elseif (isset($_POST["blind_monitor_message"])) {$blind_monitor_message=$_POST["blind_monitor_message"];} +if (isset($_GET["blind_monitor_filename"])) {$blind_monitor_filename=$_GET["blind_monitor_filename"];} + elseif (isset($_POST["blind_monitor_filename"])) {$blind_monitor_filename=$_POST["blind_monitor_filename"];} +if (isset($_GET["uniqueid_status_display"])) {$uniqueid_status_display=$_GET["uniqueid_status_display"];} + elseif (isset($_POST["uniqueid_status_display"])) {$uniqueid_status_display=$_POST["uniqueid_status_display"];} +if (isset($_GET["uniqueid_status_prefix"])) {$uniqueid_status_prefix=$_GET["uniqueid_status_prefix"];} + elseif (isset($_POST["uniqueid_status_prefix"])) {$uniqueid_status_prefix=$_POST["uniqueid_status_prefix"];} +if (isset($_GET["default_codecs"])) {$default_codecs=$_GET["default_codecs"];} + elseif (isset($_POST["default_codecs"])) {$default_codecs=$_POST["default_codecs"];} +if (isset($_GET["codecs_list"])) {$codecs_list=$_GET["codecs_list"];} + elseif (isset($_POST["codecs_list"])) {$codecs_list=$_POST["codecs_list"];} +if (isset($_GET["codecs_with_template"])) {$codecs_with_template=$_GET["codecs_with_template"];} + elseif (isset($_POST["codecs_with_template"])) {$codecs_with_template=$_POST["codecs_with_template"];} +if (isset($_GET["custom_fields_modify"])) {$custom_fields_modify=$_GET["custom_fields_modify"];} + elseif (isset($_POST["custom_fields_modify"])) {$custom_fields_modify=$_POST["custom_fields_modify"];} +if (isset($_GET["hold_time_option_minimum"])) {$hold_time_option_minimum=$_GET["hold_time_option_minimum"];} + elseif (isset($_POST["hold_time_option_minimum"])) {$hold_time_option_minimum=$_POST["hold_time_option_minimum"];} +if (isset($_GET["source_carrier"])) {$source_carrier=$_GET["source_carrier"];} + elseif (isset($_POST["source_carrier"])) {$source_carrier=$_POST["source_carrier"];} +if (isset($_GET["hold_time_option_press_filename"])) {$hold_time_option_press_filename=$_GET["hold_time_option_press_filename"];} + elseif (isset($_POST["hold_time_option_press_filename"])) {$hold_time_option_press_filename=$_POST["hold_time_option_press_filename"];} +if (isset($_GET["hold_time_option_callmenu"])) {$hold_time_option_callmenu=$_GET["hold_time_option_callmenu"];} + elseif (isset($_POST["hold_time_option_callmenu"])) {$hold_time_option_callmenu=$_POST["hold_time_option_callmenu"];} +if (isset($_GET["inbound_queue_no_dial"])) {$inbound_queue_no_dial=$_GET["inbound_queue_no_dial"];} + elseif (isset($_POST["inbound_queue_no_dial"])) {$inbound_queue_no_dial=$_POST["inbound_queue_no_dial"];} +if (isset($_GET["default_afterhours_filename_override"])) {$default_afterhours_filename_override=$_GET["default_afterhours_filename_override"];} + elseif (isset($_POST["default_afterhours_filename_override"])) {$default_afterhours_filename_override=$_POST["default_afterhours_filename_override"];} +if (isset($_GET["sunday_afterhours_filename_override"])) {$sunday_afterhours_filename_override=$_GET["sunday_afterhours_filename_override"];} + elseif (isset($_POST["sunday_afterhours_filename_override"])) {$sunday_afterhours_filename_override=$_POST["sunday_afterhours_filename_override"];} +if (isset($_GET["monday_afterhours_filename_override"])) {$monday_afterhours_filename_override=$_GET["monday_afterhours_filename_override"];} + elseif (isset($_POST["monday_afterhours_filename_override"])) {$monday_afterhours_filename_override=$_POST["monday_afterhours_filename_override"];} +if (isset($_GET["tuesday_afterhours_filename_override"])) {$tuesday_afterhours_filename_override=$_GET["tuesday_afterhours_filename_override"];} + elseif (isset($_POST["tuesday_afterhours_filename_override"])) {$tuesday_afterhours_filename_override=$_POST["tuesday_afterhours_filename_override"];} +if (isset($_GET["wednesday_afterhours_filename_override"])) {$wednesday_afterhours_filename_override=$_GET["wednesday_afterhours_filename_override"];} + elseif (isset($_POST["wednesday_afterhours_filename_override"])) {$wednesday_afterhours_filename_override=$_POST["wednesday_afterhours_filename_override"];} +if (isset($_GET["thursday_afterhours_filename_override"])) {$thursday_afterhours_filename_override=$_GET["thursday_afterhours_filename_override"];} + elseif (isset($_POST["thursday_afterhours_filename_override"])) {$thursday_afterhours_filename_override=$_POST["thursday_afterhours_filename_override"];} +if (isset($_GET["friday_afterhours_filename_override"])) {$friday_afterhours_filename_override=$_GET["friday_afterhours_filename_override"];} + elseif (isset($_POST["friday_afterhours_filename_override"])) {$friday_afterhours_filename_override=$_POST["friday_afterhours_filename_override"];} +if (isset($_GET["saturday_afterhours_filename_override"])) {$saturday_afterhours_filename_override=$_GET["saturday_afterhours_filename_override"];} + elseif (isset($_POST["saturday_afterhours_filename_override"])) {$saturday_afterhours_filename_override=$_POST["saturday_afterhours_filename_override"];} +if (isset($_GET["onhold_prompt_no_block"])) {$onhold_prompt_no_block=$_GET["onhold_prompt_no_block"];} + elseif (isset($_POST["onhold_prompt_no_block"])) {$onhold_prompt_no_block=$_POST["onhold_prompt_no_block"];} +if (isset($_GET["onhold_prompt_seconds"])) {$onhold_prompt_seconds=$_GET["onhold_prompt_seconds"];} + elseif (isset($_POST["onhold_prompt_seconds"])) {$onhold_prompt_seconds=$_POST["onhold_prompt_seconds"];} +if (isset($_GET["hold_time_option_no_block"])) {$hold_time_option_no_block=$_GET["hold_time_option_no_block"];} + elseif (isset($_POST["hold_time_option_no_block"])) {$hold_time_option_no_block=$_POST["hold_time_option_no_block"];} +if (isset($_GET["hold_time_option_prompt_seconds"])) {$hold_time_option_prompt_seconds=$_GET["hold_time_option_prompt_seconds"];} + elseif (isset($_POST["hold_time_option_prompt_seconds"])) {$hold_time_option_prompt_seconds=$_POST["hold_time_option_prompt_seconds"];} +if (isset($_GET["admin_web_directory"])) {$admin_web_directory=$_GET["admin_web_directory"];} + elseif (isset($_POST["admin_web_directory"])) {$admin_web_directory=$_POST["admin_web_directory"];} +if (isset($_GET["tts_voice"])) {$tts_voice=$_GET["tts_voice"];} + elseif (isset($_POST["tts_voice"])) {$tts_voice=$_POST["tts_voice"];} +if (isset($_GET["label_title"])) {$label_title=$_GET["label_title"];} + elseif (isset($_POST["label_title"])) {$label_title=$_POST["label_title"];} +if (isset($_GET["label_first_name"])) {$label_first_name=$_GET["label_first_name"];} + elseif (isset($_POST["label_first_name"])) {$label_first_name=$_POST["label_first_name"];} +if (isset($_GET["label_middle_initial"])) {$label_middle_initial=$_GET["label_middle_initial"];} + elseif (isset($_POST["label_middle_initial"])) {$label_middle_initial=$_POST["label_middle_initial"];} +if (isset($_GET["label_last_name"])) {$label_last_name=$_GET["label_last_name"];} + elseif (isset($_POST["label_last_name"])) {$label_last_name=$_POST["label_last_name"];} +if (isset($_GET["label_address1"])) {$label_address1=$_GET["label_address1"];} + elseif (isset($_POST["label_address1"])) {$label_address1=$_POST["label_address1"];} +if (isset($_GET["label_address2"])) {$label_address2=$_GET["label_address2"];} + elseif (isset($_POST["label_address2"])) {$label_address2=$_POST["label_address2"];} +if (isset($_GET["label_address3"])) {$label_address3=$_GET["label_address3"];} + elseif (isset($_POST["label_address3"])) {$label_address3=$_POST["label_address3"];} +if (isset($_GET["label_city"])) {$label_city=$_GET["label_city"];} + elseif (isset($_POST["label_city"])) {$label_city=$_POST["label_city"];} +if (isset($_GET["label_state"])) {$label_state=$_GET["label_state"];} + elseif (isset($_POST["label_state"])) {$label_state=$_POST["label_state"];} +if (isset($_GET["label_province"])) {$label_province=$_GET["label_province"];} + elseif (isset($_POST["label_province"])) {$label_province=$_POST["label_province"];} +if (isset($_GET["label_postal_code"])) {$label_postal_code=$_GET["label_postal_code"];} + elseif (isset($_POST["label_postal_code"])) {$label_postal_code=$_POST["label_postal_code"];} +if (isset($_GET["label_vendor_lead_code"])) {$label_vendor_lead_code=$_GET["label_vendor_lead_code"];} + elseif (isset($_POST["label_vendor_lead_code"])){$label_vendor_lead_code=$_POST["label_vendor_lead_code"];} +if (isset($_GET["label_gender"])) {$label_gender=$_GET["label_gender"];} + elseif (isset($_POST["label_gender"])) {$label_gender=$_POST["label_gender"];} +if (isset($_GET["label_phone_number"])) {$label_phone_number=$_GET["label_phone_number"];} + elseif (isset($_POST["label_phone_number"])) {$label_phone_number=$_POST["label_phone_number"];} +if (isset($_GET["label_phone_code"])) {$label_phone_code=$_GET["label_phone_code"];} + elseif (isset($_POST["label_phone_code"])) {$label_phone_code=$_POST["label_phone_code"];} +if (isset($_GET["label_alt_phone"])) {$label_alt_phone=$_GET["label_alt_phone"];} + elseif (isset($_POST["label_alt_phone"])) {$label_alt_phone=$_POST["label_alt_phone"];} +if (isset($_GET["label_security_phrase"])) {$label_security_phrase=$_GET["label_security_phrase"];} + elseif (isset($_POST["label_security_phrase"])) {$label_security_phrase=$_POST["label_security_phrase"];} +if (isset($_GET["label_email"])) {$label_email=$_GET["label_email"];} + elseif (isset($_POST["label_email"])) {$label_email=$_POST["label_email"];} +if (isset($_GET["label_comments"])) {$label_comments=$_GET["label_comments"];} + elseif (isset($_POST["label_comments"])) {$label_comments=$_POST["label_comments"];} +if (isset($_GET["custom_fields_enabled"])) {$custom_fields_enabled=$_GET["custom_fields_enabled"];} + elseif (isset($_POST["custom_fields_enabled"])) {$custom_fields_enabled=$_POST["custom_fields_enabled"];} +if (isset($_GET["slave_db_server"])) {$slave_db_server=$_GET["slave_db_server"];} + elseif (isset($_POST["slave_db_server"])) {$slave_db_server=$_POST["slave_db_server"];} +if (isset($_GET["reports_use_slave_db"])) {$reports_use_slave_db=$_GET["reports_use_slave_db"];} + elseif (isset($_POST["reports_use_slave_db"])) {$reports_use_slave_db=$_POST["reports_use_slave_db"];} +if (isset($_GET["hold_time_second_option"])) {$hold_time_second_option=$_GET["hold_time_second_option"];} + elseif (isset($_POST["hold_time_second_option"])) {$hold_time_second_option=$_POST["hold_time_second_option"];} +if (isset($_GET["hold_time_third_option"])) {$hold_time_third_option=$_GET["hold_time_third_option"];} + elseif (isset($_POST["hold_time_third_option"])) {$hold_time_third_option=$_POST["hold_time_third_option"];} +if (isset($_GET["wait_hold_option_priority"])) {$wait_hold_option_priority=$_GET["wait_hold_option_priority"];} + elseif (isset($_POST["wait_hold_option_priority"])) {$wait_hold_option_priority=$_POST["wait_hold_option_priority"];} +if (isset($_GET["wait_time_option"])) {$wait_time_option=$_GET["wait_time_option"];} + elseif (isset($_POST["wait_time_option"])) {$wait_time_option=$_POST["wait_time_option"];} +if (isset($_GET["wait_time_second_option"])) {$wait_time_second_option=$_GET["wait_time_second_option"];} + elseif (isset($_POST["wait_time_second_option"])) {$wait_time_second_option=$_POST["wait_time_second_option"];} +if (isset($_GET["wait_time_third_option"])) {$wait_time_third_option=$_GET["wait_time_third_option"];} + elseif (isset($_POST["wait_time_third_option"])) {$wait_time_third_option=$_POST["wait_time_third_option"];} +if (isset($_GET["wait_time_option_seconds"])) {$wait_time_option_seconds=$_GET["wait_time_option_seconds"];} + elseif (isset($_POST["wait_time_option_seconds"])) {$wait_time_option_seconds=$_POST["wait_time_option_seconds"];} +if (isset($_GET["wait_time_option_exten"])) {$wait_time_option_exten=$_GET["wait_time_option_exten"];} + elseif (isset($_POST["wait_time_option_exten"])) {$wait_time_option_exten=$_POST["wait_time_option_exten"];} +if (isset($_GET["wait_time_option_voicemail"])) {$wait_time_option_voicemail=$_GET["wait_time_option_voicemail"];} + elseif (isset($_POST["wait_time_option_voicemail"])) {$wait_time_option_voicemail=$_POST["wait_time_option_voicemail"];} +if (isset($_GET["wait_time_option_xfer_group"])) {$wait_time_option_xfer_group=$_GET["wait_time_option_xfer_group"];} + elseif (isset($_POST["wait_time_option_xfer_group"])) {$wait_time_option_xfer_group=$_POST["wait_time_option_xfer_group"];} +if (isset($_GET["wait_time_option_callmenu"])) {$wait_time_option_callmenu=$_GET["wait_time_option_callmenu"];} + elseif (isset($_POST["wait_time_option_callmenu"])) {$wait_time_option_callmenu=$_POST["wait_time_option_callmenu"];} +if (isset($_GET["wait_time_option_callback_filename"])) {$wait_time_option_callback_filename=$_GET["wait_time_option_callback_filename"];} + elseif (isset($_POST["wait_time_option_callback_filename"])) {$wait_time_option_callback_filename=$_POST["wait_time_option_callback_filename"];} +if (isset($_GET["wait_time_option_callback_list_id"])) {$wait_time_option_callback_list_id=$_GET["wait_time_option_callback_list_id"];} + elseif (isset($_POST["wait_time_option_callback_list_id"])) {$wait_time_option_callback_list_id=$_POST["wait_time_option_callback_list_id"];} +if (isset($_GET["wait_time_option_press_filename"])) {$wait_time_option_press_filename=$_GET["wait_time_option_press_filename"];} + elseif (isset($_POST["wait_time_option_press_filename"])) {$wait_time_option_press_filename=$_POST["wait_time_option_press_filename"];} +if (isset($_GET["wait_time_option_no_block"])) {$wait_time_option_no_block=$_GET["wait_time_option_no_block"];} + elseif (isset($_POST["wait_time_option_no_block"])) {$wait_time_option_no_block=$_POST["wait_time_option_no_block"];} +if (isset($_GET["wait_time_option_prompt_seconds"])) {$wait_time_option_prompt_seconds=$_GET["wait_time_option_prompt_seconds"];} + elseif (isset($_POST["wait_time_option_prompt_seconds"])) {$wait_time_option_prompt_seconds=$_POST["wait_time_option_prompt_seconds"];} +if (isset($_GET["timer_action_destination"])) {$timer_action_destination=$_GET["timer_action_destination"];} + elseif (isset($_POST["timer_action_destination"])) {$timer_action_destination=$_POST["timer_action_destination"];} +if (isset($_GET["allowed_reports"])) {$allowed_reports=$_GET["allowed_reports"];} + elseif (isset($_POST["allowed_reports"])) {$allowed_reports=$_POST["allowed_reports"];} +if (isset($_GET["filter_phone_group_id"])) {$filter_phone_group_id=$_GET["filter_phone_group_id"];} + elseif (isset($_POST["filter_phone_group_id"])) {$filter_phone_group_id=$_POST["filter_phone_group_id"];} +if (isset($_GET["filter_phone_group_name"])) {$filter_phone_group_name=$_GET["filter_phone_group_name"];} + elseif (isset($_POST["filter_phone_group_name"])) {$filter_phone_group_name=$_POST["filter_phone_group_name"];} +if (isset($_GET["filter_phone_group_description"])) {$filter_phone_group_description=$_GET["filter_phone_group_description"];} + elseif (isset($_POST["filter_phone_group_description"])) {$filter_phone_group_description=$_POST["filter_phone_group_description"];} +if (isset($_GET["filter_inbound_number"])) {$filter_inbound_number=$_GET["filter_inbound_number"];} + elseif (isset($_POST["filter_inbound_number"])) {$filter_inbound_number=$_POST["filter_inbound_number"];} +if (isset($_GET["filter_url"])) {$filter_url=$_GET["filter_url"];} + elseif (isset($_POST["filter_url"])) {$filter_url=$_POST["filter_url"];} +if (isset($_GET["filter_action"])) {$filter_action=$_GET["filter_action"];} + elseif (isset($_POST["filter_action"])) {$filter_action=$_POST["filter_action"];} +if (isset($_GET["filter_extension"])) {$filter_extension=$_GET["filter_extension"];} + elseif (isset($_POST["filter_extension"])) {$filter_extension=$_POST["filter_extension"];} +if (isset($_GET["filter_exten_context"])) {$filter_exten_context=$_GET["filter_exten_context"];} + elseif (isset($_POST["filter_exten_context"])) {$filter_exten_context=$_POST["filter_exten_context"];} +if (isset($_GET["filter_voicemail_ext"])) {$filter_voicemail_ext=$_GET["filter_voicemail_ext"];} + elseif (isset($_POST["filter_voicemail_ext"])) {$filter_voicemail_ext=$_POST["filter_voicemail_ext"];} +if (isset($_GET["filter_phone"])) {$filter_phone=$_GET["filter_phone"];} + elseif (isset($_POST["filter_phone"])) {$filter_phone=$_POST["filter_phone"];} +if (isset($_GET["filter_server_ip"])) {$filter_server_ip=$_GET["filter_server_ip"];} + elseif (isset($_POST["filter_server_ip"])) {$filter_server_ip=$_POST["filter_server_ip"];} +if (isset($_GET["filter_user"])) {$filter_user=$_GET["filter_user"];} + elseif (isset($_POST["filter_user"])) {$filter_user=$_POST["filter_user"];} +if (isset($_GET["filter_user_unavailable_action"])) {$filter_user_unavailable_action=$_GET["filter_user_unavailable_action"];} + elseif (isset($_POST["filter_user_unavailable_action"])) {$filter_user_unavailable_action=$_POST["filter_user_unavailable_action"];} +if (isset($_GET["filter_user_route_settings_ingroup"])) {$filter_user_route_settings_ingroup=$_GET["filter_user_route_settings_ingroup"];} + elseif (isset($_POST["filter_user_route_settings_ingroup"])) {$filter_user_route_settings_ingroup=$_POST["filter_user_route_settings_ingroup"];} +if (isset($_GET["filter_group_id"])) {$filter_group_id=$_GET["filter_group_id"];} + elseif (isset($_POST["filter_group_id"])) {$filter_group_id=$_POST["filter_group_id"];} +if (isset($_GET["filter_call_handle_method"])) {$filter_call_handle_method=$_GET["filter_call_handle_method"];} + elseif (isset($_POST["filter_call_handle_method"])) {$filter_call_handle_method=$_POST["filter_call_handle_method"];} +if (isset($_GET["filter_agent_search_method"])) {$filter_agent_search_method=$_GET["filter_agent_search_method"];} + elseif (isset($_POST["filter_agent_search_method"])) {$filter_agent_search_method=$_POST["filter_agent_search_method"];} +if (isset($_GET["filter_list_id"])) {$filter_list_id=$_GET["filter_list_id"];} + elseif (isset($_POST["filter_list_id"])) {$filter_list_id=$_POST["filter_list_id"];} +if (isset($_GET["filter_campaign_id"])) {$filter_campaign_id=$_GET["filter_campaign_id"];} + elseif (isset($_POST["filter_campaign_id"])) {$filter_campaign_id=$_POST["filter_campaign_id"];} +if (isset($_GET["filter_phone_code"])) {$filter_phone_code=$_GET["filter_phone_code"];} + elseif (isset($_POST["filter_phone_code"])) {$filter_phone_code=$_POST["filter_phone_code"];} +if (isset($_GET["filter_menu_id"])) {$filter_menu_id=$_GET["filter_menu_id"];} + elseif (isset($_POST["filter_menu_id"])) {$filter_menu_id=$_POST["filter_menu_id"];} +if (isset($_GET["filter_clean_cid_number"])) {$filter_clean_cid_number=$_GET["filter_clean_cid_number"];} + elseif (isset($_POST["filter_clean_cid_number"])) {$filter_clean_cid_number=$_POST["filter_clean_cid_number"];} +if (isset($_GET["webphone_url_override"])) {$webphone_url_override=$_GET["webphone_url_override"];} + elseif (isset($_POST["webphone_url_override"])) {$webphone_url_override=$_POST["webphone_url_override"];} +if (isset($_GET["calculate_estimated_hold_seconds"])) {$calculate_estimated_hold_seconds=$_GET["calculate_estimated_hold_seconds"];} + elseif (isset($_POST["calculate_estimated_hold_seconds"])) {$calculate_estimated_hold_seconds=$_POST["calculate_estimated_hold_seconds"];} +if (isset($_GET["enable_xfer_presets"])) {$enable_xfer_presets=$_GET["enable_xfer_presets"];} + elseif (isset($_POST["enable_xfer_presets"])) {$enable_xfer_presets=$_POST["enable_xfer_presets"];} +if (isset($_GET["hide_xfer_number_to_dial"])) {$hide_xfer_number_to_dial=$_GET["hide_xfer_number_to_dial"];} + elseif (isset($_POST["hide_xfer_number_to_dial"])) {$hide_xfer_number_to_dial=$_POST["hide_xfer_number_to_dial"];} +if (isset($_GET["preset_name"])) {$preset_name=$_GET["preset_name"];} + elseif (isset($_POST["preset_name"])) {$preset_name=$_POST["preset_name"];} +if (isset($_GET["preset_number"])) {$preset_number=$_GET["preset_number"];} + elseif (isset($_POST["preset_number"])) {$preset_number=$_POST["preset_number"];} +if (isset($_GET["preset_dtmf"])) {$preset_dtmf=$_GET["preset_dtmf"];} + elseif (isset($_POST["preset_dtmf"])) {$preset_dtmf=$_POST["preset_dtmf"];} +if (isset($_GET["preset_hide_number"])) {$preset_hide_number=$_GET["preset_hide_number"];} + elseif (isset($_POST["preset_hide_number"])) {$preset_hide_number=$_POST["preset_hide_number"];} +if (isset($_GET["manual_dial_prefix"])) {$manual_dial_prefix=$_GET["manual_dial_prefix"];} + elseif (isset($_POST["manual_dial_prefix"])) {$manual_dial_prefix=$_POST["manual_dial_prefix"];} +if (isset($_GET["webphone_systemkey"])) {$webphone_systemkey=$_GET["webphone_systemkey"];} + elseif (isset($_POST["webphone_systemkey"])) {$webphone_systemkey=$_POST["webphone_systemkey"];} +if (isset($_GET["webphone_dialpad"])) {$webphone_dialpad=$_GET["webphone_dialpad"];} + elseif (isset($_POST["webphone_dialpad"])) {$webphone_dialpad=$_POST["webphone_dialpad"];} +if (isset($_GET["webphone_systemkey_override"])) {$webphone_systemkey_override=$_GET["webphone_systemkey_override"];} + elseif (isset($_POST["webphone_systemkey_override"])) {$webphone_systemkey_override=$_POST["webphone_systemkey_override"];} +if (isset($_GET["webphone_dialpad_override"])) {$webphone_dialpad_override=$_GET["webphone_dialpad_override"];} + elseif (isset($_POST["webphone_dialpad_override"])) {$webphone_dialpad_override=$_POST["webphone_dialpad_override"];} +if (isset($_GET["force_change_password"])) {$force_change_password=$_GET["force_change_password"];} + elseif (isset($_POST["force_change_password"])) {$force_change_password=$_POST["force_change_password"];} +if (isset($_GET["first_login_trigger"])) {$first_login_trigger=$_GET["first_login_trigger"];} + elseif (isset($_POST["first_login_trigger"])) {$first_login_trigger=$_POST["first_login_trigger"];} +if (isset($_GET["default_phone_registration_password"])) {$default_phone_registration_password=$_GET["default_phone_registration_password"];} + elseif (isset($_POST["default_phone_registration_password"])) {$default_phone_registration_password=$_POST["default_phone_registration_password"];} +if (isset($_GET["default_phone_login_password"])) {$default_phone_login_password=$_GET["default_phone_login_password"];} + elseif (isset($_POST["default_phone_login_password"])) {$default_phone_login_password=$_POST["default_phone_login_password"];} +if (isset($_GET["default_server_password"])) {$default_server_password=$_GET["default_server_password"];} + elseif (isset($_POST["default_server_password"])) {$default_server_password=$_POST["default_server_password"];} +if (isset($_GET["customer_3way_hangup_logging"])) {$customer_3way_hangup_logging=$_GET["customer_3way_hangup_logging"];} + elseif (isset($_POST["customer_3way_hangup_logging"])) {$customer_3way_hangup_logging=$_POST["customer_3way_hangup_logging"];} +if (isset($_GET["customer_3way_hangup_seconds"])) {$customer_3way_hangup_seconds=$_GET["customer_3way_hangup_seconds"];} + elseif (isset($_POST["customer_3way_hangup_seconds"])) {$customer_3way_hangup_seconds=$_POST["customer_3way_hangup_seconds"];} +if (isset($_GET["customer_3way_hangup_action"])) {$customer_3way_hangup_action=$_GET["customer_3way_hangup_action"];} + elseif (isset($_POST["customer_3way_hangup_action"])) {$customer_3way_hangup_action=$_POST["customer_3way_hangup_action"];} +if (isset($_GET["add_lead_url"])) {$add_lead_url=$_GET["add_lead_url"];} + elseif (isset($_POST["add_lead_url"])) {$add_lead_url=$_POST["add_lead_url"];} +if (isset($_GET["ivr_park_call"])) {$ivr_park_call=$_GET["ivr_park_call"];} + elseif (isset($_POST["ivr_park_call"])) {$ivr_park_call=$_POST["ivr_park_call"];} +if (isset($_GET["ivr_park_call_agi"])) {$ivr_park_call_agi=$_GET["ivr_park_call_agi"];} + elseif (isset($_POST["ivr_park_call_agi"])) {$ivr_park_call_agi=$_POST["ivr_park_call_agi"];} +if (isset($_GET["manual_preview_dial"])) {$manual_preview_dial=$_GET["manual_preview_dial"];} + elseif (isset($_POST["manual_preview_dial"])) {$manual_preview_dial=$_POST["manual_preview_dial"];} +if (isset($_GET["eht_minimum_prompt_filename"])) {$eht_minimum_prompt_filename=$_GET["eht_minimum_prompt_filename"];} + elseif (isset($_POST["eht_minimum_prompt_filename"])) {$eht_minimum_prompt_filename=$_POST["eht_minimum_prompt_filename"];} +if (isset($_GET["eht_minimum_prompt_no_block"])) {$eht_minimum_prompt_no_block=$_GET["eht_minimum_prompt_no_block"];} + elseif (isset($_POST["eht_minimum_prompt_no_block"])) {$eht_minimum_prompt_no_block=$_POST["eht_minimum_prompt_no_block"];} +if (isset($_GET["eht_minimum_prompt_seconds"])) {$eht_minimum_prompt_seconds=$_GET["eht_minimum_prompt_seconds"];} + elseif (isset($_POST["eht_minimum_prompt_seconds"])) {$eht_minimum_prompt_seconds=$_POST["eht_minimum_prompt_seconds"];} +if (isset($_GET["realtime_agent_time_stats"])) {$realtime_agent_time_stats=$_GET["realtime_agent_time_stats"];} + elseif (isset($_POST["realtime_agent_time_stats"])) {$realtime_agent_time_stats=$_POST["realtime_agent_time_stats"];} - if (isset($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} + +if (isset($script_id)) {$script_id= strtoupper($script_id);} +if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} if (strlen($dial_status) > 0) { @@ -1179,25 +1488,34 @@ if (strlen($dial_status) > 0) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSenable_queuemetrics_logging = $row[1]; - $SSenable_vtiger_integration = $row[2]; - $SSqc_features_active = $row[3]; - $SSoutbound_autodial_active = $row[4]; - $SSsounds_central_control_active = $row[5]; - $SSenable_second_webform = $row[6]; - $SSuser_territories_active = $row[7]; + $non_latin = $row[0]; + $SSenable_queuemetrics_logging = $row[1]; + $SSenable_vtiger_integration = $row[2]; + $SSqc_features_active = $row[3]; + $SSoutbound_autodial_active = $row[4]; + $SSsounds_central_control_active = $row[5]; + $SSenable_second_webform = $row[6]; + $SSuser_territories_active = $row[7]; + $SScustom_fields_enabled = $row[8]; + $SSadmin_web_directory = $row[9]; + $SSwebphone_url = $row[10]; + $SSfirst_login_trigger = $row[11]; + $SShosted_settings = $row[12]; + $SSdefault_phone_registration_password =$row[13]; + $SSdefault_phone_login_password = $row[14]; + $SSdefault_server_password = $row[15]; } ##### END SETTINGS LOOKUP ##### ########################################### + ###################################################################################################### ###################################################################################################### ####### Form variable filtering for security and data integrity @@ -1307,7 +1625,6 @@ if ($non_latin < 1) $vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); $voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); $voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); - $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); $voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); $use_non_latin = ereg_replace("[^0-9]","",$use_non_latin); @@ -1366,6 +1683,28 @@ if ($non_latin < 1) $campaign_cid_override = ereg_replace("[^0-9]","",$campaign_cid_override); $agent_choose_territories = ereg_replace("[^0-9]","",$agent_choose_territories); $timer_action_seconds = ereg_replace("[^0-9]","",$timer_action_seconds); + $default_webphone = ereg_replace("[^0-9]","",$default_webphone); + $default_external_server_ip = ereg_replace("[^0-9]","",$default_external_server_ip); + $enable_agc_xfer_log = ereg_replace("[^0-9]","",$enable_agc_xfer_log); + $enable_agc_dispo_log = ereg_replace("[^0-9]","",$enable_agc_dispo_log); + $callcard_enabled = ereg_replace("[^0-9]","",$callcard_enabled); + $callcard_admin = ereg_replace("[^0-9]","",$callcard_admin); + $extension_id = ereg_replace("[^0-9]","",$extension_id); + $agent_choose_blended = ereg_replace("[^0-9]","",$agent_choose_blended); + $realtime_block_user_info = ereg_replace("[^0-9]","",$realtime_block_user_info); + $codecs_with_template = ereg_replace("[^0-9]","",$codecs_with_template); + $custom_fields_modify = ereg_replace("[^0-9]","",$custom_fields_modify); + $hold_time_option_minimum = ereg_replace("[^0-9]","",$hold_time_option_minimum); + $onhold_prompt_seconds = ereg_replace("[^0-9]","",$onhold_prompt_seconds); + $hold_time_option_prompt_seconds = ereg_replace("[^0-9]","",$hold_time_option_prompt_seconds); + $custom_fields_enabled = ereg_replace("[^0-9]","",$custom_fields_enabled); + $wait_time_option_seconds = ereg_replace("[^0-9]","",$wait_time_option_seconds); + $wait_time_option_callback_list_id = ereg_replace("[^0-9]","",$wait_time_option_callback_list_id); + $wait_time_option_prompt_seconds = ereg_replace("[^0-9]","",$wait_time_option_prompt_seconds); + $filter_list_id = ereg_replace("[^0-9]","",$filter_list_id); + $calculate_estimated_hold_seconds = ereg_replace("[^0-9]","",$calculate_estimated_hold_seconds); + $customer_3way_hangup_seconds = ereg_replace("[^0-9]","",$customer_3way_hangup_seconds); + $eht_minimum_prompt_seconds = ereg_replace("[^0-9]","",$eht_minimum_prompt_seconds); $drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds); @@ -1433,6 +1772,25 @@ if ($non_latin < 1) $agent_select_territories = ereg_replace("[^NY]","",$agent_select_territories); $delete_vm_after_email = ereg_replace("[^NY]","",$delete_vm_after_email); $crm_popup_login = ereg_replace("[^NY]","",$crm_popup_login); + $ignore_list_script_override = ereg_replace("[^NY]","",$ignore_list_script_override); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $use_custom_cid = ereg_replace("[^NY]","",$use_custom_cid); + $agent_xfer_consultative = ereg_replace("[^NY]","",$agent_xfer_consultative); + $agent_xfer_dial_override = ereg_replace("[^NY]","",$agent_xfer_dial_override); + $agent_xfer_vm_transfer = ereg_replace("[^NY]","",$agent_xfer_vm_transfer); + $agent_xfer_blind_transfer = ereg_replace("[^NY]","",$agent_xfer_blind_transfer); + $agent_xfer_dial_with_customer = ereg_replace("[^NY]","",$agent_xfer_dial_with_customer); + $agent_xfer_park_customer_dial = ereg_replace("[^NY]","",$agent_xfer_park_customer_dial); + $agent_fullscreen = ereg_replace("[^NY]","",$agent_fullscreen); + $extension_appended_cidname = ereg_replace("[^NY]","",$extension_appended_cidname); + $onhold_prompt_no_block = ereg_replace("[^NY]","",$onhold_prompt_no_block); + $hold_time_option_no_block = ereg_replace("[^NY]","",$hold_time_option_no_block); + $wait_time_option_no_block = ereg_replace("[^NY]","",$wait_time_option_no_block); + $preset_hide_number = ereg_replace("[^NY]","",$preset_hide_number); + $force_change_password = ereg_replace("[^NY]","",$force_change_password); + $first_login_trigger = ereg_replace("[^NY]","",$first_login_trigger); + $eht_minimum_prompt_no_block = ereg_replace("[^NY]","",$eht_minimum_prompt_no_block); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); $active = ereg_replace("[^0-9NY]","",$active); @@ -1480,6 +1838,16 @@ if ($non_latin < 1) $use_campaign_dnc = ereg_replace("[^0-9a-zA-Z]","",$use_campaign_dnc); $voicemail_id = ereg_replace("[^0-9a-zA-Z]","",$voicemail_id); $status_id = ereg_replace("[^0-9a-zA-Z]","",$status_id); + $agent_call_log_view = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view); + $agent_call_log_view_override = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view_override); + $queuemetrics_loginout = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_loginout); + $queuemetrics_callstatus = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_callstatus); + $filter_inbound_number = ereg_replace("[^0-9a-zA-Z]","",$filter_inbound_number); + $enable_xfer_presets = ereg_replace("[^0-9a-zA-Z]","",$enable_xfer_presets); + $hide_xfer_number_to_dial = ereg_replace("[^0-9a-zA-Z]","",$hide_xfer_number_to_dial); + $manual_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$manual_dial_prefix); + $customer_3way_hangup_logging = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_logging); + $customer_3way_hangup_action = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_action); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -1494,6 +1862,7 @@ if ($non_latin < 1) $auto_dial_limit = ereg_replace("[^\.0-9]","",$auto_dial_limit); $adaptive_dropped_percentage = ereg_replace("[^\.0-9]","",$adaptive_dropped_percentage); $drop_lockout_time = ereg_replace("[^\.0-9]","",$drop_lockout_time); + $filter_server_ip = ereg_replace("[^\.0-9]","",$filter_server_ip); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -1505,6 +1874,8 @@ if ($non_latin < 1) $survey_fourth_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_digit); $survey_third_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_exten); $survey_fourth_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_exten); + $preset_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$preset_dtmf); + ### ALPHACAPS-NUMERIC $xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); @@ -1610,6 +1981,7 @@ if ($non_latin < 1) $cpd_amd_action = ereg_replace("[^-_0-9a-zA-Z]","",$cpd_amd_action); $template_id = ereg_replace("[^-_0-9a-zA-Z]","",$template_id); $carrier_id = ereg_replace("[^-_0-9a-zA-Z]","",$carrier_id); + $source_carrier = ereg_replace("[^-_0-9a-zA-Z]","",$source_carrier); $group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id); $default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias); $vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead); @@ -1632,6 +2004,46 @@ if ($non_latin < 1) $moh_id = ereg_replace("[^-_0-9a-zA-Z]","",$moh_id); $drop_inbound_group_override = ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group_override); $timer_action = ereg_replace("[^-_0-9a-zA-Z]","",$timer_action); + $record_call = ereg_replace("[^-_0-9a-zA-Z]","",$record_call); + $scheduled_callbacks_alert = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_alert); + $extension_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group_id); + $extension_group = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group); + $scheduled_callbacks_count = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_count); + $manual_dial_override = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_override); + $blind_monitor_warning = ereg_replace("[^-_0-9a-zA-Z]","",$blind_monitor_warning); + $uniqueid_status_display = ereg_replace("[^-_0-9a-zA-Z]","",$uniqueid_status_display); + $hold_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option_callmenu); + $inbound_queue_no_dial = ereg_replace("[^-_0-9a-zA-Z]","",$inbound_queue_no_dial); + $hold_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_second_option); + $hold_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_third_option); + $wait_hold_option_priority = ereg_replace("[^-_0-9a-zA-Z]","",$wait_hold_option_priority); + $wait_time_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option); + $wait_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_second_option); + $wait_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_third_option); + $wait_time_option_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_xfer_group); + $wait_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_callmenu); + $wait_time_option_voicemail = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_voicemail); + $filter_phone_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_phone_group_id); + $filter_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_action); + $filter_user_unavailable_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_unavailable_action); + $filter_user_route_settings_ingroup = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_route_settings_ingroup); + $filter_agent_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_agent_search_method); + $filter_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_campaign_id); + $filter_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_group_id); + $filter_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_menu_id); + $filter_call_handle_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_call_handle_method); + $filter_user = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user); + $filter_exten_context = ereg_replace("[^-_0-9a-zA-Z]","",$filter_exten_context); + $webphone_systemkey = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_systemkey_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey_override); + $webphone_dialpad_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad_override); + $default_phone_registration_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_registration_password); + $default_phone_login_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_login_password); + $default_server_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_server_password); + $ivr_park_call = ereg_replace("[^-_0-9a-zA-Z]","",$ivr_park_call); + $manual_preview_dial = ereg_replace("[^-_0-9a-zA-Z]","",$manual_preview_dial); + $realtime_agent_time_stats = ereg_replace("[^-_0-9a-zA-Z]","",$realtime_agent_time_stats); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); @@ -1645,15 +2057,35 @@ if ($non_latin < 1) $filename = ereg_replace("[^-\/\._0-9a-zA-Z]","",$filename); $am_message_exten = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten); $am_message_exten_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten_override); + $campaign_groups = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$campaign_groups); + $blind_monitor_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$blind_monitor_filename); + $hold_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$hold_time_option_press_filename); + $default_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$default_afterhours_filename_override); + $sunday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$sunday_afterhours_filename_override); + $monday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$monday_afterhours_filename_override); + $tuesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tuesday_afterhours_filename_override); + $wednesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wednesday_afterhours_filename_override); + $thursday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$thursday_afterhours_filename_override); + $friday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$friday_afterhours_filename_override); + $saturday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$saturday_afterhours_filename_override); + $admin_web_directory = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$admin_web_directory); + $tts_voice = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tts_voice); + $wait_time_option_callback_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_callback_filename); + $wait_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_press_filename); + $eht_minimum_prompt_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$eht_minimum_prompt_filename); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); $forced_timeclock_login = ereg_replace("[^-\,\_0-9a-zA-Z]","",$forced_timeclock_login); + $uniqueid_status_prefix = ereg_replace("[^-\,\_0-9a-zA-Z]","",$uniqueid_status_prefix); ### ALPHA-NUMERIC and dots $sounds_web_server = ereg_replace("[^\.0-9a-zA-Z]","",$sounds_web_server); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); + ### ALPHA-NUMERIC and spaces and dashes and underscores + $preset_name = ereg_replace("[^ -\_0-9a-zA-Z]","",$preset_name); + ### ALPHA-NUMERIC and hash $group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); ### ALPHA-NUMERIC and hash and star and dot and underscore @@ -1662,6 +2094,12 @@ if ($non_latin < 1) $voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$voicemail_ext); $phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone); $phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone_code); + $wait_time_option_exten = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$wait_time_option_exten); + $filter_voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_voicemail_ext); + $filter_phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone_code); + $filter_phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone); + $preset_number = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$preset_number); + ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores $adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); @@ -1709,6 +2147,32 @@ if ($non_latin < 1) $tts_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$tts_name); $moh_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$moh_name); $timer_action_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$timer_action_message); + $external_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$external_server_ip); + $default_codecs = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$default_codecs); + $codecs_list = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$codecs_list); + $label_title = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_title); + $label_first_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_first_name); + $label_middle_initial = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_middle_initial); + $label_last_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_last_name); + $label_address1 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address1); + $label_address2 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address2); + $label_address3 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address3); + $label_city = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_city); + $label_state = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_state); + $label_province = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_province); + $label_postal_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_postal_code); + $label_vendor_lead_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_vendor_lead_code); + $label_gender = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_gender); + $label_phone_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_number); + $label_phone_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_code); + $label_alt_phone = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_alt_phone); + $label_security_phrase = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_security_phrase); + $label_email = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_email); + $label_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_comments); + $slave_db_server = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$slave_db_server); + $filter_phone_group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_name); + $filter_phone_group_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_description); + $filter_clean_cid_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_clean_cid_number); ### 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); @@ -1716,7 +2180,6 @@ if ($non_latin < 1) $DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); $DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); $dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); - $extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); $install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); $old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); @@ -1733,6 +2196,14 @@ if ($non_latin < 1) $custom_four = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_four); $custom_five = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + ### ALPHA-NUMERIC and underscore and dash and slash and at and dot and pound and star + $extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$extension); + $timer_action_destination = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$timer_action_destination); + $filter_extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$filter_extension); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma + $ivr_park_call_agi = ereg_replace("[^ -\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); + ### NUMERIC and comma and pipe $waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options); @@ -1761,7 +2232,7 @@ if ($non_latin < 1) $dialplan_entry = ereg_replace(";","",$dialplan_entry); $dialplan_entry = ereg_replace("\r","",$dialplan_entry); $custom_dialplan_entry = ereg_replace("\\\\","",$custom_dialplan_entry); - $custom_dialplan_entry = ereg_replace(";","",$custom_dialplan_entry); + $custom_dialplan_entry = ereg_replace("'","",$custom_dialplan_entry); $custom_dialplan_entry = ereg_replace("\r","",$custom_dialplan_entry); $tts_text = ereg_replace("\\\\","",$tts_text); $tts_text = ereg_replace(";","",$tts_text); @@ -1771,7 +2242,10 @@ if ($non_latin < 1) $carrier_description = ereg_replace(";","",$carrier_description); $carrier_description = ereg_replace("\r","",$carrier_description); $carrier_description = ereg_replace("\"","",$carrier_description); - + $blind_monitor_message = ereg_replace("\\\\","",$blind_monitor_message); + $blind_monitor_message = ereg_replace(";","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\r","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\"","",$blind_monitor_message); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address @@ -1783,6 +2257,11 @@ if ($non_latin < 1) # $crm_login_address # $start_call_url # $dispo_call_url + # $add_lead_url + # $webphone_url + # $webphone_url_override + # $filter_url + ### VARIABLES not filtered at all ### # $script_text @@ -2046,11 +2525,63 @@ else # 100103-0727 - Added Start/Dispo call url, 3/4/5 conf number presets, Lists conf-number overrides # 100104-1454 - Fixed in-group/campaign copy duplication issue # 100116-0718 - Added presets to script select list +# 100122-0747 - Added NOT-LOGGED-IN-AGENTS option for User Groups +# 100123-1301 - Added DID record call option +# 100127-0601 - Added Vtiger ViciDial user_level role lookup +# 100127-1546 - Added ignore_list_script_override option for ingroups +# 100219-1309 - Added agent dispo log system settings option and user call_log options +# 100220-1411 - Added system settings and servers custom_dialplan_entry +# 100221-0924 - Added Custom CallerID capability in Campaign settings +# 100302-2133 - Added Scheduled Callbacks Alert option +# 100309-0510 - Added queuemetrics_loginout option +# 100311-2348 - Added CallCard links and settings +# 100313-0020 - Added User Group agent screen transfer-conf button display options +# 100317-1244 - Added User Group agent_fullscreen option +# 100401-0014 - Added agent_choose_blended option +# 100405-1425 - Added queuemetrics_callstatus option and full logging of user campaign/in-group settings +# 100414-1603 - Added extension_appended_cidname option to campaigns +# 100420-1010 - Added scheduled_callbacks_count campaign option +# 100423-1030 - Added realtime_block_user_info, manual dial campaign, blind monitor warnings, in-group callid, phones codecs features +# 100506-1807 - Added hidden settings for lists custom fields +# 100507-1102 - Added hold_time_option_minimum option to in-groups and copy carrier function +# 100512-1615 - Added more hold time press-1 options +# 100518-0643 - Added inbound_queue_no_dial and call time after hours override features +# 100523-0840 - Added inbound prompt and no-block options +# 100616-2232 - Added VIDPROMPT call menu options +# 100621-1010 - Added admin_web_directory system setting +# 100622-1700 - Added custom agent field names for default fields +# 100702-1142 - Added FORM get_call_launch option for custom list fields tab in agent interface +# 100703-1322 - Added LEADS ability to admin log display +# 100709-1025 - Added option for slave DB server to be used for selected reports +# 100718-2318 - Added Wait Time options to in-groups +# 100720-1332 - Small changes to Phone addition and modification pages +# 100723-1519 - Added LOCKED options for Quick Transfer Button in campaigns +# 100726-1017 - Added HANGUP, CALLMENU, EXTENSION and IN_GROUP timer actions to campaigns and in-groups +# 100802-2130 - Changed Admin links to point to links page instead of Phones listings, changed Remote Agents to allow 9-digit IDs +# 100803-1412 - Added allowed_reports option to User Groups, added CAMPLISTS_ALL for manual_dial_filter(issue #369) +# - Added allowed_campaigns enforcement for Campaign listings +# 100804-2313 - Added filter phone groups section for inbound call filtering by incoming phone number when it comes into a DID +# 100805-1539 - Added option to clean up cid numbers when calls come into DIDs +# 100806-0607 - Added validation for remote agents settings, user_start must be valid user, number of lines must not overlap +# 100811-0827 - Added webphone_url_override to User Groups and calculate_estimated_hold_seconds to In-Groups +# 100813-0544 - Added campaign presets and option to hide xfer number to dial +# 100815-0802 - Added manual_dial_prefix campaign option +# 100817-1243 - Added checking for reserved menu_id on creation of Call Menus +# 100823-1501 - Added CallCard search as an available User Group report option +# 100827-1535 - Added webphone options for dialpad and systemkey +# 100901-2055 - Added password strength grading, force password change, password default settings and first login screen +# 100908-0926 - Added 3way hangup logging options to campaigns +# 100912-0842 - Several small changes, removed Emergency VDAC clear since it does not do anything anymore +# 100927-2321 - Added entry_list_id as a script, webform, dispo_call_url variable +# 100928-1634 - Moved Realtime Block User Info user setting into the new ADMIN REPORT OPTIONS section +# 100929-1203 - Added add_lead_url feature to In-Groups +# 101008-0349 - Added Estimated Hold Time Minimum options, Manual Dial Preview settings and two new variables for recording filenames +# 101022-1427 - Added ability to change user in-group prefs from in-group mod screen, added realtime_agent_time_stats campaign option # # 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.2.0-234'; -$build = '100116-0718'; +$admin_version = '2.4-285'; +$build = '101022-1427'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2098,7 +2629,7 @@ if ($force_logout) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan FROM system_settings;"; +$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -2109,6 +2640,7 @@ if ($qm_conf_ct > 0) $SSauto_dial_limit = $row[1]; $SSuser_territories_active = $row[2]; $SSallow_custom_dialplan = $row[3]; + $SScallcard_enabled = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -2120,6 +2652,19 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and active='Y' and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_auth=$row[0]; + +$reports_only_user=0; +if ( ($reports_auth > 0) and ($auth < 1) ) + { + $ADD=999999; + $reports_only_user=1; + } + if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} @@ -2127,77 +2672,113 @@ $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); -if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ( ($auth < 1 ) and ($reports_auth < 1) ) ) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +if ( ($auth > 0) or ($reports_auth > 0) ) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + + $stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGallowed_reports = $row[1]; + + $LOGallowed_campaignsSQL=''; + $whereLOGallowed_campaignsSQL=''; + if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + $regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); + fclose($fp); + } + + $first_login_link=0; + + if ($LOGforce_change_password=='Y') + { + $ADD=999997; + $reports_only_user=1; + } + if ($SSfirst_login_trigger=='Y') + { + + if ($ADD==999996) + {$reports_only_user=1;} + else + { + $ADD=999995; + $first_login_link=1; + } + } + if ($ADD==999995) + { + $reports_only_user=1; + } } else { - if($auth>0) + if ($WeBRooTWritablE > 0) { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfull_name =$row[3]; - $LOGuser_level =$row[4]; - $LOGuser_group =$row[5]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGast_admin_access =$row[16]; - $LOGast_delete_phones =$row[17]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - $LOGmodify_users =$row[34]; - $LOGmodify_campaigns =$row[35]; - $LOGmodify_lists =$row[36]; - $LOGmodify_scripts =$row[37]; - $LOGmodify_filters =$row[38]; - $LOGmodify_ingroups =$row[39]; - $LOGmodify_usergroups =$row[40]; - $LOGmodify_remoteagents =$row[41]; - $LOGmodify_servers =$row[42]; - $LOGview_reports =$row[43]; - $LOGmodify_dids =$row[56]; - $LOGdelete_dids =$row[57]; - $LOGmanager_shift_enforcement_override=$row[61]; - $LOGexport_reports =$row[64]; - $LOGdelete_from_dnc =$row[65]; - - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGallowed_campaigns = $row[0]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); } } + ###################################################################################################### ###################################################################################################### ####### Header settings @@ -2219,13 +2800,16 @@ if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Añadir una Campaña";} if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Campaña Del Copy";} if ($ADD==111) {$hh='lists'; echo "Añadir una Lista";} if ($ADD==121) {$hh='lists'; echo "Agregue DNC Nuevo";} +if ($ADD==171) {$hh='ingroups'; echo "Filter Phone Group Numbers";} if ($ADD==1111) {$hh='ingroups'; echo "Añadir un Grupo-Entrantes";} if ($ADD==1211) {$hh='ingroups'; echo "En-Grupo Del Copy";} if ($ADD==1311) {$hh='ingroups'; echo "Agregar nuevoDID";} if ($ADD==1411) {$hh='ingroups'; echo "CopiarDID";} if ($ADD==1511) {$hh='ingroups'; echo "Añadir Call Menú";} if ($ADD==1611) {$hh='ingroups'; echo "Copia de llamadas Menú";} +if ($ADD==1711) {$hh='ingroups'; echo "Add Filter Phone Group";} if ($ADD==11111) {$hh='remoteagent'; echo "Añadir Agentes Remotos";} +if ($ADD==12111) {$hh='remoteagent'; echo "Add Extension Group";} if ($ADD==111111) {$hh='usergroups'; echo "Añadir un Grupo De Usuarios";} if ($ADD==1111111) {$hh='scripts'; echo "Agregue La Nueva Escritura";} if ($ADD==11111111) {$hh='filters'; echo "Agregue El Filtro Nuevo";} @@ -2238,6 +2822,7 @@ if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "Añadir NUEVO GRUPO DE if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "NUEVO SERVIDOR";} if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "Añadir CONF NUEVA PLANTILLA";} if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "Añadir nueva compañía";} +if ($ADD==140111111111) {$hh='admin'; $sh='carriers'; echo "ADD COPIED CARRIER";} if ($ADD==151111111111) {$hh='admin'; $sh='tts'; echo "ADD NEW TTS ENTRADA";} if ($ADD==161111111111) {$hh='admin'; $sh='moh'; echo "ADD NEW MUSIC EN ESPERA DE ENTRADA";} if ($ADD==171111111111) {$hh='admin'; $sh='vm'; echo "ADD NEW contestador";} @@ -2254,6 +2839,7 @@ if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Nuevo Estado Del Dial Del if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Nuevo Código De la Pausa Del Agente";} if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Estado Del Dial De la Campaña Agregado";} if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Mezcla De la Lista De la Campaña Agregada";} +if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Campaña Preset Added";} if ($ADD==211) {$hh='lists'; echo "Nueva Adición De la Lista";} if ($ADD==2111) {$hh='ingroups'; echo "Nueva Adición Del Grupo de Entrantes";} if ($ADD==2011) {$hh='ingroups'; echo "Nueva Adicin Copiada Del En-Grupo";} @@ -2261,7 +2847,9 @@ if ($ADD==2311) {$hh='ingroups'; echo "Nueva DID adjunta";} if ($ADD==2411) {$hh='ingroups'; echo "Nueva copiado DID adjunta";} if ($ADD==2511) {$hh='ingroups'; echo "Nueva llamada del menú";} if ($ADD==2611) {$hh='ingroups'; echo "Nueva llamada del menú";} +if ($ADD==2711) {$hh='ingroups'; echo "New Filter Phone Group";} if ($ADD==21111) {$hh='remoteagent'; echo "Nueva Adición de Agentes Remotos";} +if ($ADD==22111) {$hh='remoteagent'; echo "New Group Extension Addition";} if ($ADD==211111) {$hh='usergroups'; echo "Nueva Adición Del Grupo De Usuarios";} if ($ADD==2111111) {$hh='scripts'; echo "Nueva Adición De la Escritura";} if ($ADD==21111111) {$hh='filters'; echo "Nueva Adición Del Filtro";} @@ -2275,6 +2863,7 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "CREANDO SERVIDOR";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADICIÓN DEL NUEVO EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL";} if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "AGREGAR NUEVO CONF PLANTILLA";} if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "AGREGAR NUEVOS SOPORTES";} +if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "ADDING COPIED CARRIER";} if ($ADD==251111111111) {$hh='admin'; $sh='tts'; echo "AGREGAR NUEVO TTS ENTRADA";} if ($ADD==261111111111) {$hh='admin'; $sh='moh'; echo "ADDING NEW MUSIC EN ESPERA DE ENTRADA";} if ($ADD==271111111111) {$hh='admin'; $sh='vm'; echo "AGREGAR NUEVO contestador";} @@ -2296,6 +2885,7 @@ if ($ADD==31) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - Mezcla listaes";} if ($SUB=='20A') {echo " - Encuesta";} + if ($SUB==201) {echo " - Presets";} } if ($ADD==34) { @@ -2308,6 +2898,7 @@ if ($ADD==34) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - Mezcla listaes";} if ($SUB=='20A') {echo " - Encuesta";} + if ($SUB==201) {echo " - Presets";} } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Estados De la Campaña";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Campaña Teclas rápidas";} @@ -2316,11 +2907,14 @@ if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Estados Auto Del Dial Del if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Códigos De la Pausa Del Agente De la Campaña";} if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Estados Del Dial De la Campaña";} if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Mezclas De la Lista De la Campaña";} +if ($ADD==301) {$hh='campaigns'; $sh='preset'; echo "Campaña Presets";} if ($ADD==311) {$hh='lists'; echo "Modificar Lista";} if ($ADD==3111) {$hh='ingroups'; echo "Modificar In-Group";} if ($ADD==3311) {$hh='ingroups'; echo "ModificarDID";} if ($ADD==3511) {$hh='ingroups'; echo "Modificar Call Menú";} +if ($ADD==3711) {$hh='ingroups'; echo "Modifique El Filtro Phone Group";} if ($ADD==31111) {$hh='remoteagent'; echo "Modificar Agentes Remotos";} +if ($ADD==32111) {$hh='remoteagent'; echo "ModificarExtension Group";} if ($ADD==311111) {$hh='usergroups'; echo "Modificar Grupos De Usuarios";} if ($ADD==3111111) {$hh='scripts'; echo "Modifique La Escritura";} if ($ADD==31111111) {$hh='filters'; echo "Modifique El Filtro";} @@ -2354,12 +2948,15 @@ if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modifique El Plomo De la if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modifique El Código De la Pausa Del Agente";} if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Modificar la campaña de CC Configuración";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modifique La Mezcla De la Lista De la Campaña";} +if ($ADD==401) {$hh='campaigns'; $sh='preset'; echo "Modifcar Campaña Preset";} if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Modificar la campaña Encuesta";} if ($ADD==411) {$hh='lists'; echo "Modificar Lista";} if ($ADD==4111) {$hh='ingroups'; echo "Modificar In-Group";} if ($ADD==4311) {$hh='ingroups'; echo "ModificarDID";} if ($ADD==4511) {$hh='ingroups'; echo "Modificar Call Menú";} +if ($ADD==4711) {$hh='ingroups'; echo "Modifique El Filtro Phone Group";} if ($ADD==41111) {$hh='remoteagent'; echo "Modificar Agentes Remotos";} +if ($ADD==42111) {$hh='remoteagent'; echo "ModificarExtension Group";} if ($ADD==411111) {$hh='usergroups'; echo "Modificar Grupos De Usuarios";} if ($ADD==4111111) {$hh='scripts'; echo "Modifique La Escritura";} if ($ADD==41111111) {$hh='filters'; echo "Modifique El Filtro";} @@ -2390,7 +2987,9 @@ if ($ADD==511) {$hh='lists'; echo "BorrarList";} if ($ADD==5111) {$hh='ingroups'; echo "BorrarIn-Group";} if ($ADD==5311) {$hh='ingroups'; echo "BorrarDID";} if ($ADD==5511) {$hh='ingroups'; echo "Eliminar del menú de llamadas";} +if ($ADD==5711) {$hh='ingroups'; echo "BorrarPhone Filter Group";} if ($ADD==51111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} +if ($ADD==52111) {$hh='remoteagent'; echo "BorrarExtension Group";} if ($ADD==511111) {$hh='usergroups'; echo "Usuarios de la cancelación Group";} if ($ADD==5111111) {$hh='scripts'; echo "Escritura De la Cancelación";} if ($ADD==51111111) {$hh='filters'; echo "Filtro De la Cancelación";} @@ -2417,11 +3016,14 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Estado Auto Del Dial Del if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Código De la Pausa Del Agente De la Cancelación";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "El Estado Del Dial De la Campaña Quitó";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "La Mezcla De la Lista De la Campaña Quitó";} +if ($ADD==601) {$hh='campaigns'; $sh='preset'; echo "Campaña Preset Removed";} if ($ADD==611) {$hh='lists'; echo "BorrarList";} if ($ADD==6111) {$hh='ingroups'; echo "BorrarIn-Group";} if ($ADD==6311) {$hh='ingroups'; echo "BorrarDID";} if ($ADD==6511) {$hh='ingroups'; echo "Eliminar del menú de llamadas";} +if ($ADD==6711) {$hh='ingroups'; echo "BorrarPhone Filter Group";} if ($ADD==61111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} +if ($ADD==62111) {$hh='remoteagent'; echo "BorrarExtension Group";} if ($ADD==611111) {$hh='usergroups'; echo "Usuarios de la cancelación Group";} if ($ADD==6111111) {$hh='scripts'; echo "Escritura De la Cancelación";} if ($ADD==61111111) {$hh='filters'; echo "Filtro De la Cancelación";} @@ -2456,7 +3058,9 @@ if ($ADD==100) {$hh='lists'; echo "Listas";} if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} if ($ADD==1500) {$hh='ingroups'; echo "Llame a los menús";} +if ($ADD==1700) {$hh='ingroups'; echo "Filter Phone Groups";} if ($ADD==10000) {$hh='remoteagent'; echo "Agentes Remotos";} +if ($ADD==12000) {$hh='remoteagent'; echo "Extension Groups";} if ($ADD==100000) {$hh='usergroups'; echo "Grupos De Usuario";} if ($ADD==1000000) {$hh='scripts'; echo "Escrituras";} if ($ADD==10000000) {$hh='filters'; echo "Filtros";} @@ -2480,6 +3084,11 @@ if ($ADD==660) {$hh='users'; echo "RESULTADOS DE LA BÚSQUEDA";} if ($ADD==661) {$hh='users'; echo "RESULTADO DE LA BÚSQUEDA DE TELÉFONOS";} if ($ADD==99999) {$hh='users'; echo "AYUDA";} if ($ADD==999999) {$hh='reports'; echo "INFORMES";} +if ($ADD==999998) {$hh='admin'; echo "ADMIN";} +if ($ADD==999997) {$hh='reports'; echo "CHANGE PASSWORD";} +if ($ADD==999996) {$hh='reports'; echo "INITIAL INSTALL WELCOME";} +if ($ADD==999995) {$hh='reports'; echo "COPYRIGHT TRADEMARK LICENSE";} + if ( ($ADD>9) && ($ADD < 99998) ) { @@ -2531,23 +3140,10 @@ if ( ($ADD>9) && ($ADD < 99998) ) if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "\n"; - $o++; - } ##### BEGIN get campaigns listing for rankings ##### - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -2583,6 +3179,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { + $stmt_grp_values=''; if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} if (isset($_GET["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_GET["WEB_$campaign_id_values[$o]"];} @@ -2597,15 +3194,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$campaign_rank = $SELECT_campaign_rank;} @@ -2768,15 +3368,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_web_vars='$group_web' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$group_rank = $SELECT_group_rank;} @@ -2891,7 +3494,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A $qc_campaigns_list.="> ALL-CAMPAIGNS - USUARIOS PUEDEN CC CUALQUIER CAMPAÑA
\n"; $qc_groups_list.="> ALL-GROUPS - USUARIOS PUEDEN CC entrantes CUALQUIER GRUPO
\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -2957,10 +3560,10 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A ##### END get campaigns listing for checkboxes ##### -if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999) ) ) +if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999) ) or ($ADD=='141111111111') or ($ADD=='140111111111') or ($ADD=='341111111111') or ($ADD=='311111111111111') or ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; + ##### get server listing for dynamic pulldown + $stmt="SELECT server_ip,server_description,external_server_ip from servers order by server_ip"; $rsltx=mysql_query($stmt, $link); $servers_to_print = mysql_num_rows($rsltx); $servers_list=''; @@ -2969,7 +3572,7 @@ if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999 while ($servers_to_print > $o) { $rowx=mysql_fetch_row($rsltx); - $servers_list .= "\n"; + $servers_list .= "\n"; $o++; } } @@ -3008,7 +3611,12 @@ if ($ADD==99999)

- Contraseña - este campo es donde usted pone la contraseña de los usuarios de VICIDIAL. Deben ser por lo menos 2 caracteres en longitud. + Contraseña - este campo es donde usted pone la contraseña de los usuarios de VICIDIAL. Deben ser por lo menos 2 caracteres en longitud. A strong user password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number. + +
+
+
+ Force Change Password - If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N.
@@ -3040,6 +3648,11 @@ if ($ADD==99999)
Activo - Este campo define si el usuario está activo en el sistema y puede utilizar VICIDIAL recursos. Y es por defecto +
+
+
+ ID de correo de voz - This is the voicemail box that calls will be directed to in an AGENTDIRECT in-group at the drop time if the in-group has the drop method set to VOICEMAIL and the Buzón de Voz field set to AGENTVMAIL. +

@@ -3055,6 +3668,11 @@ if ($ADD==99999)
El agente elige Ingroups - esta opción si el sistema a 1 permite que el usuario elija los ingroups de los cuales recibirán llamadas cuando ellos conexión a una campaña MÁS CERCANA o DE ENTRADA. Si no el encargado necesitará fijar esto en su pantalla del detalle del usuario de la página del admin. +
+
+
+ Agent Choose Blended - This option if set to 1 allows the user to choose if the agent has their campaign set to blended or not, and if not then the default blended setting will be used. Default is 1 for enabled. +

@@ -3107,6 +3725,11 @@ if ($ADD==99999)
Agente de Cambio observancia Sobrescribir - Esta configuración anular cualquiera que sea el grupo de usuarios de los usuarios se ha fijado para Mayús Observancia. MINUSVALIDOS utilizará el grupo de usuarios de configuración. NO no aplicará en todos los turnos. PRINCIPIO sólo hacer cumplir el tiempo de inicio de sesión, pero no afectará a un agente que se está ejecutando en su momento, si en cambio ya están conectado TODOS hará cumplir turnos hora de inicio y de registro de un agente a cabo después de que ellos tienen sobre el final de su cambio de tiempo. Desactivado por defecto. +
+
+
+ Agent Call Log View Override - This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED. +

@@ -3187,6 +3810,15 @@ if ($ADD==99999) La carga conduce - esta opción si el sistema a 1 permite que el usuario cargue los plomos vicidial en la tabla del vicidial_list por el cargador basado tela del plomo. 0) + { + ?> +
+
+
+ Custom Fields Modificar- This option if set to 1 allows the user to modify custom list fields. +
@@ -3330,6 +3962,10 @@ if ($ADD==99999)
Eliminar de las listas de DNC - Este ajuste, si se establece en 1 permitirá a un administrador para quitar los números de teléfono de las listas de DNC en el sistema de Vicidial. +
+
+
+ Realtime Block Usuario Info - This setting if set to 1 will block user and station information from being displayed in the Real-time report. Default is 0 for disabled. @@ -3372,6 +4008,11 @@ if ($ADD==99999)
Los Stats de la campaña restauran - este checkbox permitirá queusted fuerce un stats vicidial restaura, incluso si la campaña no esactiva. +
+
+
+ Tiempo Real Agent Time Stats - Setting this to anything but DISABLED will enable the gathering of agent time stats for today for this campaign, that are viewable through the Tiempo Real report. CALLS are the average calls handled per agent, WAIT is the average agent wait time, CUST is the average customer talk time, ACW is the average After Call Work time, PAUSE is the average pause time. Default is DISABLED. +

@@ -3380,12 +4021,12 @@ if ($ADD==99999)

- Extensión del parque - aquí es donde usted puede modificar para requisitos particulares en-sostiene la música para VICIDIAL. Cerciórese de que la extensión esté en lugar en el extensions.conf y eso que señala al nombre de fichero abajo. + Park Music-on-Hold - This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default.

- Nombre del archivo del parque - aquí es donde usted puede modificar para requisitos particulares en-sostiene la música para VICIDIAL. Cerciórese de que el nombre de fichero sea 10 caracteres en longitud o menos y que el archivo está en lugar en el directorio de /var/lib/asterisk/sounds. + Park File Name - NOT USED.
@@ -3519,13 +4160,18 @@ if ($ADD==99999)

- Cola de prioridad - Este valor se utiliza para definir el orden en que las llamadas salientes de esta campaña debe responderse en relación con las llamadas entrantes si esta campaña está en el modo de mezcla. + Cola de prioridad - Este valor se utiliza para definir el orden en que las llamadas salientes de esta campaña debe responderse en relación con las llamadas entrantes si esta campaña está en el modo de mezcla. We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone.

Varias campañas Drop Rate Grupo - Esta característica le permite establecer una campaña como miembro de una campaña de la velocidad de descenso del Grupo, o un grupo de campañas cuyas llamadas contestadas y llamadas Humanos Drop para todas las campañas en el grupo se combinarán en un porcentaje de caída compartida, o tasa de abandono. Esto le permite ejecutar varias campañas a la vez y más fácil de controlar su tasa de caída. Esto es particularmente útil en el Reino Unido, donde las regulaciones lo permiten esta disminución método del tipo de cálculo con la campaña de la agrupación por la misma empresa, incluso si hay varias campañas que la empresa está ejecutando en el mismo día. Para habilitar esta para una campaña, sólo tienes que seleccionar un grupo de la lista. Hay 10 grupos definidos en el sistema por defecto, puede ponerse en contacto con el administrador del sistema para añadir más. Desactivado por defecto. +
+
+
+ Inbound Queue No Dial - This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED. +

@@ -3766,6 +4412,11 @@ if ($ADD==99999)
Prefijo del dial - este campo permite más fácilmente cambiar una trayectoria de marcar a salir con un diverso método sin hacer una recarga en asterisco. El defecto es 9 basados sobre un 91NXXNXXXXXX en el dial plan - extensions.conf. +
+
+
+ Manual Prefijo al marcar - This optional field allows you to set the dial prefix to be used only when placing manual dial calls from the agent interface, such as using the MANUAL DIAL feature, or Dial Next Number when in the MANUAL dial method, or manual alt number dialing, or scheduled user-only callbacks. Default is empty for disabled, which will use the Prefijo al marcar defined in the field above. This option does not interfere with the 3way Prefijo al marcar option. +

@@ -3776,6 +4427,11 @@ if ($ADD==99999)
Campaña CallerID - este campo permite enviar de un número de encargo del callerid en las llamadas de salida. Úste es el número que demostraría para arriba en el callerid de la persona que usted está llamando. El defecto es DESCONOCIDO. Esta opción está solamente disponible si usted está utilizando PRIs - ISDN T1 o E1 - que tienen la característica de encargo del callerid se giraron. Esta característica puede también trabajar con los troncos IAX2 dependiendo de lo que admite su abastecedor. El callerID de encargo se aplica solamente a las llamadas puestas para la campaña de VICIDIAL directamente, cualquier tercer persona llama o las transferencias no enviarán el callerID de encargo. NOTA: A veces el poner DESCONOCIDO o PRIVADO en el campo rendirá enviar de su número del callerID del defecto por su portador con las llamadas. Usted puede desear probar esto y poner 0000000000 en el campo del callerid en lugar de otro si usted no desea enviarle CallerID. +
+
+
+ Custom CallerID - When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the CallerID de la Campaña defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N. +

@@ -3789,7 +4445,7 @@ if ($ADD==99999)

- Nombre de fichero de Rec de la campaña - este campo permite que usted modifique el nombre para requisitos particulares de la grabación cuando la grabación de la campaña es ONDEMAND o ALLCALLS. Las variables permitidas son CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. El defecto es FULLDATE_AGENTE y parecería este 20051020-103108_6666. Otro ejemplo es CAMPAIGN_TINYDATE_CUSTPHONE que parecería este TESTCAMP_51020103108_3125551212. 50 char max. + Nombre de fichero De Rec De la Campaña - This field allows you to customize the name of the recording when Campaña recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE VENDORLEADCODE LEADID. The default is FULLDATE_AGENTE and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max.
@@ -3804,7 +4460,7 @@ if ($ADD==99999)

- Consiga el lanzamiento de la llamada - este menú permite que usted elija si usted desee automo'vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. + Consiga el lanzamiento de la llamada - este menú permite que usted elija si usted desee automo'vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent.
@@ -3814,17 +4470,37 @@ if ($ADD==99999)

- Rápida transferencia Button - Esta opción agrega un botón de la transferencia rápida a la pantalla por debajo de la agente de transferencia de botón Conf. que permitirá la transferencia de un solo clic ciego de llamadas a los seleccionados en Grupo o un número. IN_GROUP enviará pide al Grupo de Xfer predeterminado para esta campaña, o en grupo-si hay una llamada entrante. Las opciones predeterminadas enviará las llamadas a los preset seleccionado. Por defecto es n para discapacitados. + Rápida transferencia Button - Esta opción agrega un botón de la transferencia rápida a la pantalla por debajo de la agente de transferencia de botón Conf. que permitirá la transferencia de un solo clic ciego de llamadas a los seleccionados en Grupo o un número. IN_GROUP enviará pide al Grupo de Xfer predeterminado para esta campaña, o en grupo-si hay una llamada entrante. Las opciones predeterminadas enviará las llamadas a los preset seleccionado. Por defecto es n para discapacitados. The LOCKED options are used to lock the value to the Rápida transferencia Button even if the agent uses the transfer conference features during a cacll before using the Rápida transferencia Button.

Transferencia de rellenar previamente Preset - Esta opción le proporcione el número telefónico al campo en el marco de la Conferencia de transferencia de la pantalla si el agente definido. Por defecto es n para discapacitados. +
+
+
+ Enable Transfer Presets - This option will enable the Presets sub menu to appear at the top of the Campaña Modification page, and also you will have the ability to specify Preset dialing numbers for Agentes to use in the Transfer-Conference frame of the agent interface. Default is DISABLED. + +
+
+
+ Hide Transfer Number to Dial - This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED. + +
+
+
+ Park Call IVR - This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED. + +
+
+
+ Park Call IVR AGI - If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible. +

- Temporizador de Acción de - Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. + Temporizador de Acción de - Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Llame Menú specified in the Temporizador de Acción de Destination field, EXTENSION will send the call to the Extension that is specified in the Temporizador de Acción de Destination field, IN_GROUP will send the call to the In-Group specified in the Temporizador de Acción de Destination field.
@@ -3836,11 +4512,26 @@ if ($ADD==99999)
Temporizador Segundos Acción - Esta es la cantidad de tiempo después de la llamada se conecta a los clientes que se desencadena la acción del temporizador. El valor predeterminado es -1, que también está inactivo. +
+
+
+ Temporizador de Acción de Destination - This field is where you specify the Llame Menú, Extension or In-Group that you want the cacll sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty. +

Servicios repetidos programar - esta opción no prohibe a agente a la disposición una llamada como CALLBK y elige los datos y el tiempo en los cuales el plomo será reactivado. +
+
+
+ Scheduled Callbacks Alert - This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line. + +
+
+
+ Scheduled Callbacks Count - This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE. +

@@ -3886,6 +4577,11 @@ if ($ADD==99999)
Agente Mostrar cola Conde - Si se establece a Y, cuando un cliente está a la espera de un agente, la cola de llamadas en la pantalla superior de la pantalla agente se iluminará en rojo y muestran el número de llamadas en espera. Y es por defecto. +
+
+
+ Manual Dial Override - The setting can override the Usuarios setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Usuarios setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE. +

@@ -3894,7 +4590,12 @@ if ($ADD==99999)

- Manual de Acceso telefónico Filtro - Esto le permite filtrar las llamadas que hacen los agentes en el dial de modo de manual para esta campaña por cualquier combinación de los siguientes: DNC - a expulsar, CAMPAIGNLISTAS - el número debe estar dentro de las listas para la campaña, NINGUNA - sin filtro en el manual de marcación rápida o de marcación listas. + Manual de Acceso telefónico Filtro - Esto le permite filtrar las llamadas que hacen los agentes en el dial de modo de manual para esta campaña por cualquier combinación de los siguientes: DNC - a expulsar, CAMPAIGNLISTAS - el número debe estar dentro de las listas para la campaña, NINGUNA - sin filtro en el manual de marcación rápida o de marcación listas. CAMPLISTAS_ALL - will include listas inactivas in the search for the number. + +
+
+
+ Manual Preview Dial - This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP.
@@ -3904,13 +4605,28 @@ if ($ADD==99999)

- 3-Vías de salida de llamadas CallerID - Esto define lo que es enviado como el número de callerID salida de 3 vías llamadas realizadas por el agente, la costumbre CAMPAÑA usos callerID campaña, el cliente utiliza el número de cliente que está activa en la pantalla y los agentes AGENT_PHONE utiliza el callerID el teléfono para que el agente se registra en. AGENT_CHOOSE permite elegir el agente que callerID utilizar para llamadas de 3 vías a partir de una lista de opciones. + 3-Vías de salida de llamadas CallerID - Esto define lo que es enviado como el número de callerID salida de 3 vías llamadas realizadas por el agente, la costumbre CAMPAÑA usos callerID campaña, el cliente utiliza el número de cliente que está activa en la pantalla y los agentes AGENT_PHONE utiliza el callerID el teléfono para que el agente se registra en. AGENT_CHOOSE permite elegir el agente que callerID utilizar para llamadas de 3 vías a partir de una lista de opciones. CUSTOM_CID will use the Custom CID that is defined in the security_phrase field of the vicidial_list table for the lead.

3-Vías de llamadas Prefijo telefónico - Esto define lo que se utiliza como prefijo de marcación para las llamadas de 3 vías, por defecto está vacío por lo que la campaña se utiliza el prefijo de marcación, por lo que puede passthru oye un pitido es de 88. +
+
+
+ Customer 3-Way Hangup Logging - If this option is ENABLED the user_call_log will log when a customer hangup up if they hang up during a 3-way call. Also, this can allow for the Customer 3-way hangup action if one is defineed below. Default is ENABLED. + +
+
+
+ Customer 3-Way Hangup Seconds - If Customer 3-way logging is enabled, this option allows you to define the number of seconds after the customer hangup is detected before it is actually logged and the optional customer 3-way hangup action is executed. Default is 5 seconds. + +
+
+
+ Customer 3-Way Hangup Action - If Customer 3-way logging is enabled, this option allows you to have the agent screen automatically hang up on the call and go to the DISPO screen if this option is set to DISPO. Default is NONE. + 0) { @@ -3983,6 +4699,16 @@ if ($ADD==99999)
Vtiger Estado de llamada - Si la integración Vtiger está activado en la configuración del sistema a continuación, esta configuración definirá si la situación de la Cuenta Vtiger se actualizará con el estado de la llamada Vicidial después de haber sido dispositioned. Por defecto es n. +
+
+
+ QM CallStatus Override - If QueueMetrics integration is enabled in the system settings then this setting allow the overriding of the Ajustes Del Sistema setting for CallStatus queue_log entries. Default is DISABLED which will use the system setting. + +
+
+
+ Extension Append CID - If enabled, the calls placed from this campaign will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled. +

@@ -4038,6 +4764,21 @@ if ($ADD==99999)
Agente de pausa después de cada llamada - Esta opción si se define como Y hará una pausa en el agente después de cada llamada automáticamente. Por defecto es n. +
+
+
+ Blind Monitor Warning - This option if enabled will let the agent know in various optional ways if they are being blind monitored by someone. DISABLED means this feature is not active, ALERT will only pop an alert up on the agent screen, NOTICE will post a note that stays up on the agent screen as long as theya re being monitored, AUDIO will play the filename defined below when an agent is starting to be monitored and the other options are combibnations of the above options. Default is DISABLED. + +
+
+
+ Blind Monitor Notice - This is the message that will show on the agent screen while they are being monitored if the NOTICE option is selected. Default is -Someone is blind monitoring your session-. + +
+
+
+ Blind Monitor Filename - This is the audio file that will play in the agents session at the start of someone blind monitoring them. This prompt will be played for everyone in the session including the customer if any is present. Default is empty. + @@ -4177,10 +4918,15 @@ if ($ADD==99999)
Escritura de la campaña - este menú permite que usted elija la escritura que aparecerá en la pantalla de los agentes para esta campaña. No seleccione NONE no demostrar ninguna escritura para esta campaña. +
+
+
+ Ignore List Script Override- 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 ID De la Lista script settings. Default is N. +

- Consiga el lanzamiento de la llamada - este menú permite que usted elija si usted desee automo'vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. + Consiga el lanzamiento de la llamada - este menú permite que usted elija si usted desee automo'vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent.
@@ -4190,7 +4936,7 @@ if ($ADD==99999)

- Temporizador de Acción de - Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. Esta configuración anula la configuración de la campaña. + Temporizador de Acción de - Esta característica le permite activar acciones después de una cierta cantidad de tiempo. D1 y D2 opciones de marcación lanzará un llamamiento a la transferencia de presets Conferencia Número y enviarlos a la sesión del agente, éste se utiliza generalmente para aplicaciones sencillas de validación IVR AGI o simplemente para jugar un mensaje pregrabado. WebForm se abrirá la dirección de formulario web. MESSAGE_ONLY simplemente mostrará el mensaje de que está en el campo de abajo. Ninguna de ellas podrá deshabilitar esta característica y es el predeterminado. Esta configuración anula la configuración de la campaña. HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Llame Menú specified in the Temporizador de Acción de Destination field, EXTENSION will send the call to the Extension that is specified in the Temporizador de Acción de Destination field, IN_GROUP will send the call to the In-Group specified in the Temporizador de Acción de Destination field.
@@ -4202,6 +4948,11 @@ if ($ADD==99999)
Temporizador Segundos Acción - Esta es la cantidad de tiempo después de la llamada se conecta a los clientes que se desencadena la acción del temporizador. El valor predeterminado es -1, que también está inactivo. +
+
+
+ Temporizador de Acción de Destination - This field is where you specify the Llame Menú, Extension or In-Group that you want the cacll sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty. +

@@ -4220,7 +4971,7 @@ if ($ADD==99999)

- Buzón de Voz - If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. + Buzón de Voz - If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Usuario voicemail ID to use.
@@ -4250,7 +5001,7 @@ if ($ADD==99999)

- Después de las horas Buzón de Voz - la caja del voicemail para enviar lallamada si la acción se fija a VOICEMAIL. + Después de las horas Buzón de Voz - la caja del voicemail para enviar lallamada si la acción se fija a VOICEMAIL. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Usuario voicemail ID to use.
@@ -4260,7 +5011,7 @@ if ($ADD==99999)

- N de colas n Agentes - Si este campo está establecido en Y o NO_PAUSED entonces no se pide se pondrá en la cola de este grupo en si no hay agentes conectado y las llamadas se vaya a la agente n Ninguna acción de la cola. La opción NO_PAUSED no se envían también las personas que llaman a la cola si sólo hay una pausa en los agentes en el grupo. Por defecto es n. + N de colas n Agentes - Si este campo está establecido en Y o NO_PAUSED entonces no se pide se pondrá en la cola de este grupo en si no hay agentes conectado y las llamadas se vaya a la agente n Ninguna acción de la cola. La opción NO_PAUSED no se envían también las personas que llaman a la cola si sólo hay una pausa en los agentes en el grupo. Por defecto es n. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Usuario voicemail ID to use.
@@ -4297,6 +5048,16 @@ if ($ADD==99999)
En el intervalo del aviso del asimiento - la longitud de la hora ensegundos de esperar antes de jugar encendido el aviso del sostener. Eldefecto es 60. Para desactivar la espera El símbolo, definir el intervalo a 0. +
+
+
+ On Hold Prompt No Block - Setting this option to Y will allow calls in line behind a call where the on hold prompt is playing to go to an agent if one becomes available while the message is playing. While the On Hold Prompt Filename message is playing to a customer they cannot be sent to an agent. Default is N. + +
+
+
+ On Hold Prompt Seconds - This field needs to be set to the number of seconds that the On Hold Prompt Filename plays for. Default is 10. +

@@ -4307,35 +5068,160 @@ if ($ADD==99999)
Juega Mantenga Tiempo estimado - Este define si la persona que llama escuchará la estimación de tiempo de espera antes de ser transferido a un agente. El valor predeterminado es N. Si el cliente está en espera y escucha este mensaje de tiempo de espera estimado, el tiempo mínimo que se jugará es de 15 segundos. +
+
+
+ Calculate Estimated Hold Seconds - This defines the number of seconds into the queue that the customer will wait before the Estimated Hold Time will be calculated and optionally played. Minimum is 3 seconds, even if set lower than 3. Default is 0. + +
+
+
+ Estimated Hold Time Minimum Filename - If the Estimated Hold Time is active and it is calculated to be at or below the minimum of 15 seconds, then this prompt file will be played instead of the default announcement. Default is Empty for inactive. + +
+
+
+ Estimated Hold Time Minimum Prompt No Block - If Estimated Hold Time is active and the Estimated Hold Time Minimum Filename field above is filled-in, then this option to allow calls in line behind a call where the prompt is playing to go to an agent if one becomes available while the message is playing. While the prompt is playing to a customer they cannot be sent to an agent. Default is N. + +
+
+
+ Estimated Hold Time Minimum Prompt Seconds - This field needs to be set to the number of seconds that the Estimated Hold Time Minimum Filename prompt plays for. Default is 10. + +
+
+
+ Wait Time Opción - This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. The PRESS_STAY option will send the customer back to the queue without loosing their place in line. + +
+
+
+ Wait Time Second Opción - Same as the first Wait Time Opción field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Wait Time Opción is selected then this option will not be offered. + +
+
+
+ Wait Time Third Opción - Same as the first Wait Time Opción field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Wait Time Opción is selected then this option will not be offered. + +
+
+
+ Wait Time Opción Seconds - If Wait Time Opción is set to anything but NONE, this is the number of seconds that the customer has been waiting in queue that will trigger the wait time options. Default is 120 seconds. + +
+
+
+ Wait Time Opción Extension - If Wait Time Opción is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option. + +
+
+
+ Wait Time Opción Callmenu - If Wait Time Opción is set to PRESS_CALLMENU, this is the Llame Menú that the call will be sent to if the customer presses the option key when presented with the option. + +
+
+
+ Wait Time Opción Buzón de Voz - If Wait Time Opción is set to PRESS_VMAIL, this is the voicemail box that the call will be sent to if the customer presses the option key when presented with the option. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Usuario voicemail ID to use. + +
+
+
+ Wait Time Opción Transfer In-Group - If Wait Time Opción is set to PRESS_INGROUP, this is the inbound group that the call will be sent to if the customer presses the option key when presented with the option. + +
+
+
+ Wait Time Opción Press Filename - If Wait Time Opción is set to one of the PRESS_ options, this is the filename prompt that is played if the customer wait time exceeds the Wait Time Opción Seconds to give the customer the option to press 1, 2 or 3 on their phone to run the selected Wait Time Press options. It is very important that you include options in the audio file for all of your selected Wait Time Opcións, and that the audio file length in seconds is properly defined in the Filename Seconds field below or there will be problems. Default is to-be-called-back. + +
+
+
+ Wait Time Opción Press No Block - Setting this option to Y will allow calls in line behind a call where the Wait Time Opción Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Wait Time Opción Press Filename message is playing to a customer they cannot be sent to an agent. Default is N. + +
+
+
+ Wait Time Opción Press Filename Seconds - This field needs to be set to the number of seconds that the Wait Time Opción Press Filename plays for. Default is 10. + +
+
+
+ Wait Time Opción After Press Filename - If Wait Time Opción is set to one of the PRESS_ options, this is the filename prompt that is played after the customer has pressed 1, 2 or 3. + +
+
+
+ Wait Time Opción Callback ID De la Lista - If Wait Time Opción is set to PRESS_CID_CALLBACK, this is the ID De la Lista the call is added to as a new lead if the customer presses the option key when presented with the option. + +
+
+
+ Wait Hold Opción Priority - If both Estimated Hold Time options and Wait Time options are active, this setting will define whether one, the other or both of these features are active. For example, if the Estimated Hold Time Opción is set to 360, the Wait Time option is set to 120 and the customer has been waiting for 120 seconds and there are still 400 seconds estimated hold time, then they are both active at the same time and this setting will be checked to see what options will be offered. Default is WAIT only. +

- Mantenga la opción Tiempo - Esto le permite especificar la ruta de la llamada si el tiempo de espera estimado es superior a la cantidad de segundos que se especifican a continuación. El valor predeterminado es NINGUNA. + Estimated Mantenga la opción Tiempo - Esto le permite especificar la ruta de la llamada si el tiempo de espera estimado es superior a la cantidad de segundos que se especifican a continuación. El valor predeterminado es NINGUNA. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. + +
+
+
+ Hold Time Second Opción - Same as the first Hold Time Opción field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Hold Time Opción is selected then this option will not be offered. + +
+
+
+ Hold Time Third Opción - Same as the first Hold Time Opción field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Hold Time Opción is selected then this option will not be offered.

Mantenga la opción Tiempo Segundos - Si el tiempo de la opción se establece en algo, pero ninguno, este es el número de segundos de tiempo de espera estimado que el tiempo de activar la opción. El valor por defecto es 360 segundos. +
+
+
+ Hold Time Opción Minimum - If Hold Time Opción enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Opción Seconds value. Default is 0 seconds. +

Mantenga la opción Tiempo de Extensión - Si el tiempo de la opción se fija a la extensión, esta es la extensión dialplan que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos. +
+
+
+ Hold Time Opción Callmenu - If Hold Time Opción is set to CALL_MENU, this is the Llame Menú that the call will be sent to if the estimated hold time exceeds the Hold Time Opción Seconds. +

- Mantenga la opción Tiempo de voz - Si el tiempo de la opción está establecida en voz, esta voz es la caja que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos. + Mantenga la opción Tiempo de voz - Si el tiempo de la opción está establecida en voz, esta voz es la caja que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Usuario voicemail ID to use.

Opción de Transferencia de celebrar Tiempo-Grupo A - Si el tiempo de la opción está establecida en IN_GROUP, este es el grupo de entrada que la convocatoria se enviará a si la estimación de tiempo de espera sobrepasa el tiempo de la opción Segundos. +
+
+
+ Hold Time Opción Press Filename - If Hold Time Opción is set to one of the PRESS_ options, this is the filename prompt that is played if the estimated hold time exceeds the Hold Time Opción Seconds to give the customer the option to press 1 on their phone to run the selected Hold Time Press Opción. It is very important that this audio file is 10 seconds or less or there will be problems. Default is to-be-called-back. + +
+
+
+ Hold Time Opción Press No Block - Setting this option to Y will allow calls in line behind a call where the Hold Time Opción Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Hold Time Opción Press Filename message is playing to a customer they cannot be sent to an agent. Default is N. + +
+
+
+ Hold Time Opción Press Filename Seconds - This field needs to be set to the number of seconds that the Hold Time Opción Press Filename plays for. Default is 10. +

- Mantenga la opción Tiempo de llamada de archivo - Si el tiempo de la opción está establecida en CALLERID_CALLBACK, este es el símbolo del nombre de archivo que se juega antes de la llamada se registra como un nuevo lugar a la lista de identificación se especifican a continuación si el tiempo de espera estimado es superior a la Mantenga la opción Tiempo Segundos. + Hold Time Opción After Press Filename - If Hold Time Opción is set to one of the PRESS_ options or CALLERID_CALLBACK, this is the filename prompt that is played after the customer has pressed 1 or the call has been added to the callback list.
@@ -4365,7 +5251,7 @@ if ($ADD==99999)

- En Nombre de archivo del grupo de grabación - Este campo sobre la Campaña de grabación régimen de nombramiento de ficheros si no está definido en ninguno. La variables son permitidos CAMPAÑA CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE. El valor por defecto es FULLDATE_AGENTE y se vería así 20051020-103108_6666. Otro ejemplo es CAMPAIGN_TINYDATE_CUSTPHONE que se vería así TESTCAMP_51020103108_3125551212. 50 caracteres máx. El valor predeterminado es NINGUNA. + In-Group Recording Filename - This field will override the Grabación De la Campaña Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE VENDORLEADCODE LEADID. The default is FULLDATE_AGENTE and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE. 0) @@ -4434,11 +5320,30 @@ if ($ADD==99999)
Dispo Call URL - This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. Default is blank. +
+
+
+ Add Lead URL - This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid +

Grupo Alias predeterminado - Si han permitido Alias Grupo para la campaña de que el agente se registra en este grupo es el alias que se ha seleccionado en primer lugar por incumplimiento de una llamada procedente de este grupo entrante cuando el agente decide usar un alias para un grupo de salida manual de llamada. El valor por defecto es vacío o NINGUNA. +
+
+
+ Extension Append CID - If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled. + +
+
+
+ Uniqueid Status Exponer - If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix defined blow to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed. If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent. + +
+
+
+ Uniqueid Status Prefix - If PREFIX option is selected above then this is the value of that prefix. Default is empty. @@ -4466,6 +5371,11 @@ if ($ADD==99999)
Ruta DID - Este es el tipo de ruta que establezca el uso de DID. EXTEN enviará las llamadas a la extensión entró a continuación, enviará las llamadas de voz directamente a la caja de voz entró a continuación, AGENTE enviará las llamadas a un agente VICIDIAL si está conectado, TELÉFONO enviará la llamada a un teléfono de entrada, seleccione a continuación, se IN_GROUP enviar las llamadas directamente a la entrada del grupo especificado. El valor predeterminado es EXTEN. CALLMENU enviará la llamada a definir el menú de llamadas. +
+
+
+ Record Call - This option allows you to set the calls coming into this DID to be recorded. Y will record the entire call, Y_QUEUESTOP will record the call until the call is hungup or enters an in-group queue, N will not record the call. Default is N. +

@@ -4541,6 +5451,32 @@ if ($ADD==99999)
En el Grupo-Teléfono Código - Si se ha seleccionado como IN_GROUP DID la Ruta, este es el Teléfono Código utilizarse si el plomo es un nuevo creado. +
+
+
+ Clean CID Number - This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L. + +
+
+
+ Filter Inbound Number - This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back. + +
+
+
+ Filter Phone ID De Grupo - If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call. + +
+
+
+ Filter URL - If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer caclled in on. + +
+
+
+ Filter Action - If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing. + + @@ -4549,7 +5485,7 @@ if ($ADD==99999) VICIDIAL_CALL MENU TABLA


- Menú ID - Este es el ID para este paso del menú de llamada. Esto también se mostrará como el contexto que se utiliza en el dialplan para esta convocatoria de menú. + Menú ID - Este es el ID para este paso del menú de llamada. Esto también se mostrará como el contexto que se utiliza en el dialplan para esta convocatoria de menú. Here is a list of reserved phrases that cannot be used as menu IDs: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor.
@@ -4626,15 +5562,40 @@ if ($ADD==99999)
Opción Ruta valor de contexto - Este campo es opcional y sólo se utiliza para las rutas opción de prórroga. +
+
+
+ Llame Menú In-Group Settings - If the route is set to INGROUP then there are many options that you can set to define how the call is sent to into the queue. In-Group is the inbound group that you want the call to go to. Handle Method is the way you want the call to be handled,
Click here to see a list of the available handle methods. Search Method defines how the queue will find the next agent, recommend leave this on LB. ID De la Lista is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. ID De la Campaña is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be ebtered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID. +

- Custom Dilplan entrada - Este campo le permite entrar en los elementos dialplan que desea para el menú de llamada. + Custom Dialplan Entry - Este campo le permite entrar en los elementos dialplan que desea para el menú de llamada. +



+ +
+
+
+ Filter Phone ID De Grupo - This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore. + +
+
+
+ Filter Phone Nombre De Grupo - This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters. + +
+
+
+ Filter Phone Group Description - This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field. + + + +



VICIDIAL_REMOTE_AGENTS TABLA

@@ -4657,6 +5618,11 @@ if ($ADD==99999)
Extensión externa - éste es el número que usted desea las llamadas remitidas a. Cerciórese de que sea un número dial plan completo y que si usted necesita 9 al principio usted lo pone adentro aquí. Pruebe marcando este número de un teléfono en el sistema. +
+
+
+ Extension Group - If set to something other than NONE or empty this will override the Extensión Externa field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated. +

@@ -4673,6 +5639,29 @@ if ($ADD==99999) Grupos de entrada - aquí es donde usted selecciona a grupos de entrada que usted desea recibir llamadas de si usted ha seleccionado la campaña MÁS CERCANA. +



+ + VICIDIAL_EXTENSION_GROUPS TABLA

+
+
+ Extension Group - This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers. + +
+
+
+ Extension - This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry. + +
+
+
+ Rank - This field allows you to rank the extension group entries that share the same extension group. Default is 0. + +
+
+
+ Campañas Groups - In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string. + +



VICIDIAL_CAMPAIGN_LISTAS

@@ -4740,6 +5729,17 @@ if ($ADD==99999) +



+ + VICIDIAL CAMPAIGN PRESETS

+
+
+ If the Campaña setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent. + + + + +



VICIDIAL_USER_GROUPS TABLA

@@ -4775,14 +5775,55 @@ if ($ADD==99999)

- Estado del agente visible Grupos - Esta es una lista seleccionable de grupos de usuarios y las funciones de usuario al que los miembros de este grupo de usuarios pueden ver el estado de las llamadas, así como la transferencia al interior de la pantalla del agente. La opción de grupo permite a los usuarios de este grupo para ver y transferir llamadas a cualquier usuario en el sistema. La campaña-AGENTES opción permite a los usuarios en este grupo para ver y transferir llamadas a cualquier usuario en la campaña que se registran en la. + Estado del agente visible Grupos - Esta es una lista seleccionable de grupos de usuarios y las funciones de usuario al que los miembros de este grupo de usuarios pueden ver el estado de las llamadas, así como la transferencia al interior de la pantalla del agente. La opción de grupo permite a los usuarios de este grupo para ver y transferir llamadas a cualquier usuario en el sistema. La campaña-AGENTES opción permite a los usuarios en este grupo para ver y transferir llamadas a cualquier usuario en la campaña que se registran en la. The NOT-LOGGED-IN-AGENTS option allows all users in the system to be displayed, even if they are not logged-in curently.

Ver estado del agente de turno - Esta opción define si el agente va a ver la cantidad de tiempo que los usuarios en su barra lateral agente han sido en su estado actual. Por defecto es n sin o con discapacidad. +
+
+
+ Agent Call Log View - This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled. + +
+
+
+ Agent Transfer Opcións - These options allow for the disabling of specific buttons in the Transfer Conference section of the Agent interface. Default is Y for yes or enabled. + +
+
+
+ Agent Fullscreen - This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agentes View, Calls in Queue View or Calls in Session view. Default is N for no or disabled. + +
+
+
+ Allowed Informes - 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. + 5) + { + ?> +
+
+
+ Webphone URL Override - This setting allows you to set an alternate webphone URL just for the members of one user group. Default is empty. + +
+
+
+ Webphone System Key Override - This setting allows you to set an alternate webphone System Key just for the members of one user group. Default is empty. + +
+
+
+ Webphone Dialpad Override - This setting allows you to activate or deactivate the dialpad on the webphone just for the members of one user group. Default is DISABLED. TOGGLE will allow the user to view and hide the dialpad by clicking a link. + + 0) { ?> @@ -4819,10 +5860,10 @@ if ($ADD==99999)
- Texto de la escritura - This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?

You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: + Texto de la escritura - This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id. For example, this sentence would print the persons name in it----

Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

This would read----

Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?

You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables:
- <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> + <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe>
@@ -4887,6 +5928,10 @@ if ($ADD==99999)
Tiempos del comienzo y de parada del día laborable - éstos son lostiempos de encargo por el día que se puede fijar para la definicióndel tiempo de la llamada que las mismas reglas se aplican como con lostiempos del comienzo y de parada del defecto. +
+
+ After Hours Filename Override - These fields allow you to override the After Hours message for inbound groups if it is set to something. Default is empty. +
Definiciones del tiempo de la llamada del estado - ésta es la listade las definiciones específicas del tiempo de la llamada del estadoque se siguen en esta definición del tiempo de la llamada. @@ -4927,7 +5972,7 @@ if ($ADD==99999)



- Audio de la tienda - Esta utilidad te permite subir archivos de audio para el servidor de forma que puedan ser distribuidos a todos los servidores de Vicidial en un multi-cluster de servidores. Una nota importante, sólo dos tipos de archivos de audio de trabajo,. Archivos WAV PCM de 16 bits que se 8k y los archivos. GSM que se 8bit 8k. Por favor, verifique que los archivos tienen el formato correcto antes de subirlos aquí. + Audio de la tienda - This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here. @@ -4972,6 +6017,10 @@ if ($ADD==99999) Activo - Esta opción le permite establecer la entrada de TTS a activos o inactivos. +
+
+ TTS Voice - This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz. +
TTS Texto - Este es el texto real de campo de datos de voz que se envía a Cepstral para la creación del archivo de audio que deben desempeñar para el cliente. Usted puede utilizar Speech Syntesis Markup Language-SSML-en este campo, por ejemplo,, <break time='1000ms'/> de 1 segundo descanso. También puede utilizar varias variables como el nombre, apellido y el título como variables Vicidial tal como lo harías en una secuencia de comandos: - A - first_name - B -. Aquí está una lista de las variables disponibles:lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner @@ -5103,7 +6152,27 @@ if ($ADD==99999)

- Contraseña - la contraseña usada para el usuario del teléfono a laconexión a los usos del cliente. Importante, esta es la única contraseña para la red de interfaz de usuario del agente de teléfono, para cambiar el sip.conf iax.conf o contraseña, o en secreto, para este dispositivo de teléfono que tenga que modificar el campo Archivo Secreto Conf. más abajo en esta página. + Login Password - The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registro Password in the next field. + +
+
+
+ Registro Password - Este es el secreto o la contraseña, por el teléfono de la SIP IAX o auto-generados conf para este teléfono. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. Formerly called Conf. Archivo Secreto. A strong registration password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number. + +
+
+
+ Set As Webphone - Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N. + +
+
+
+ Webphone Dialpad - This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions. + +
+
+
+ Use External IP Del Servidor - If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the IP Del Servidor. Default is empty.
@@ -5245,9 +6314,14 @@ if ($ADD==99999) Teléfono Contexto - Este es el contexto del plan de marcado que este teléfono se utiliza para marcar. Si está ejecutando un centro de llamadas y usted no desea que sus agentes sean capaces de marcar fuera de la aplicación Vicidial por ejemplo, entonces puedes establecer este campo a un contexto dialplan que no existe, algo como agente nodial. por defecto es por defecto.
-
+
- Conf. Archivo Secreto - Este es el secreto o la contraseña, por el teléfono de la SIP IAX o auto-generados conf para este teléfono. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. + Allowed Codecs - You can define a comma delimited list of codecs to be set as the default codecs for this phone. Opcións for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Some of these codecs might not be available on your system, like g729 or g726. If the field is empty, then the system default codecs or the phone entry above this one will be used for the allowable codecs. Default is empty. + +
+
+
+ Allowed Codecs With Template- Setting this option to 1 will include the codecs defined above even if a conf file template is used. Default is 0.
@@ -5557,7 +6631,7 @@ if ($ADD==99999)

- Conf. Archivo Secreto - Este es el secreto, o la contraseña, para que el servidor en el auto iax generado conf para este servidor en otros servidores. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. + Conf. Archivo Secreto - Este es el secreto, o la contraseña, para que el servidor en el auto iax generado conf para este servidor en otros servidores. Límite es el tablero de 20 caracteres alfanuméricos y de subrayado aceptado. El valor predeterminado es la prueba. A strong conf file secret should be at least 8 characters in length and have lower case and upper case letters as well as at least one number.
@@ -5619,6 +6693,11 @@ if ($ADD==99999)
Grabación de IP del servidor alternativo - Este valor es donde usted puede poner un servidor IP o nombre de otra máquina que se puede utilizar en lugar de la server_ip en los enlaces a las grabaciones en el administrador de páginas web. Por defecto está vacío. +
+
+
+ External IP Del Servidor - This setting is where you can put a server IP or other machine name that can be used in place of the server_ip when using a webphone in the agent interface. For this to work you also must have the phones entry set to use the External IP Del Servidor. Default is empty. +

@@ -5659,6 +6738,11 @@ if ($ADD==99999)
Portador de registro activo - Esta configuración le permite registrar todos los códigos de retorno para colgar cualquier lista de marcación saliente llamadas que están haciendo. Por defecto es N. +
+
+
+ Custom Dialplan Entry - This field allows you to enter in any dialplan elements that you want for the server, the lines will be added to the default context. + @@ -5815,6 +6899,11 @@ if ($ADD==99999)
Permita el logfile de la transferencia del agente - esta opciónregistrará a un logfile del texto en el webserver cada vez que unallamada se transfiere a un agente. El defecto es 0, inhabilitado. +
+
+
+ Enable Agent Disposition Logfile - This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled. +

@@ -5888,6 +6977,11 @@ if ($ADD==99999)
Sounds Web Directory - Esta auto-generado nombre del directorio es creado al azar por el sistema como el lugar que la tienda de audio se mantendrá. Todos los archivos de audio residir en este directorio. +
+
+
+ Admin Web Directory - This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes. +

@@ -5911,7 +7005,7 @@ if ($ADD==99999)

- Permitir Custom Dialplan entradas - Esta opción le permite introducir líneas personalizadas dialplan en llamadas menús. El valor predeterminado es 0 para los inactivos. + Permitir Custom Dialplan entradas - This option allows you to enter custom dialplan lines into Llame a los menús, Servidores and System Settings. Default is 0 for inactive.
@@ -5928,11 +7022,86 @@ if ($ADD==99999)
Habilitar TTS Integración - Esta configuración le permite habilitar Texto a la integración de voz con Cepstral. Esto sólo está disponible actualmente para las campañas de tipo de encuesta de salida. Por defecto es 0 para discapacitados. +
+
+
+ Enable CallCard - This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled. + +
+
+
+ Enable Custom List Fields - This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled. + +
+
+
+ First Login Trigger - This setting allows for the initial configuration of the server screen to be shown to the administrator when they first log into the system. + +
+
+
+ Default Phone Registro Password - This is the default registration password used when new phones are added to the system. Default is test. + +
+
+
+ Default Conexión Del Teléfono Password - This is the default phone web login password used when new phones are added to the system. Default is test. + +
+
+
+ Default Server Password - This is the default server password used when new servers are added to the system. Default is test. + +
+
+
+ Slave Database Server - If you have a MySQL slave database server then enter the local IP address for that server here. This option is currently only used by the selected reports in the next option and has nothing to do with automatically configuring MySQL master-slave replication. Default is empty for disabled. + +
+
+
+ Informes to use Slave DB - 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 ViciDial system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled. + +
+
+
+ Default Field Labels - These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface. +

Características de Activo CC - Esta opción le permite activar o desactivar el control de la calidad o las características de Control de Calidad. El valor por defecto es 0 para inactivos. +
+
+
+ Default Webphone - If set to 1, this option will make all new phones created have Set As Webphone set to Y. Default is 0. + +
+
+
+ Webphone System Key - If your system or provider requires it, this is where the System Key for the webphone should be entered in. Default is empty. + +
+
+
+ Default Codecs - You can define a comma delimited list of codecs to be set as the default codecs for all systems. Opcións for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Default is empty. + +
+
+
+ Custom Dialplan Entry - This field allows you to enter in any dialplan elements that you want for all of the asterisk servers, the lines will be added to the default context. + +
+
+
+ Default External IP Del Servidor - If set to 1, this option will make all new phones created have Use External IP Del Servidor set to Y. Default is 0. + +
+
+
+ Webphone URL - This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty. +

@@ -5973,6 +7142,16 @@ if ($ADD==99999)
QueueMetrics EnterQueue prepend - este campo se utiliza para permitirprepending de una de las zonas de informaciones del vicidial_listdelante del número de teléfono del cliente para los informesmodificados para requisitos particulares de QueueMetrics. El defectono es NINGUNO no poblar cualquier cosa. +
+
+
+ QueueMetrics Login-Out - This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently. + +
+
+
+ QueueMetrics CallStatus - This option if set to 0 will not put in the CALLSTATUS entry into queue_log when an agent dispositions a call. Default is 1 for enabled. +

@@ -6140,6 +7319,8 @@ if ($ADD==7111111) ##### TEST VARIABLES ##### $vendor_lead_code = 'VENDOR:LEAD;CODE'; $list_id = 'LISTID'; + $list_name = 'LISTNAME'; + $list_description = 'LISTDESCRIPTION'; $gmt_offset_now = 'GMTOFFSET'; $phone_code = '1'; $phone_number = '7275551212'; @@ -6198,6 +7379,14 @@ if ($ADD==7111111) $preset_number_f = 'preset_f'; $preset_dtmf_a = 'preset_dtmf_a'; $preset_dtmf_b = 'preset_dtmf_b'; + $did_id = 'did_id'; + $did_extension = 'did_extension'; + $did_pattern = 'did_pattern'; + $did_description = 'did_description'; + $closecallid = 'closecallid'; + $xfercallid = 'xfercallid'; + $agent_log_id = 'agent_log_id'; + $entry_list_id = 'entry_list_id'; echo "\n"; echo "\n"; @@ -6214,6 +7403,8 @@ if ($ADD==7111111) { $vendor_lead_code = eregi_replace(' ','+',$vendor_lead_code); $list_id = eregi_replace(' ','+',$list_id); + $list_name = eregi_replace(' ','+',$list_name); + $list_description = eregi_replace(' ','+',$list_description); $gmt_offset_now = eregi_replace(' ','+',$gmt_offset_now); $phone_code = eregi_replace(' ','+',$phone_code); $phone_number = eregi_replace(' ','+',$phone_number); @@ -6272,10 +7463,13 @@ if ($ADD==7111111) $preset_number_f = eregi_replace(' ','+',$preset_number_f); $preset_dtmf_a = eregi_replace(' ','+',$preset_dtmf_a); $preset_dtmf_b = eregi_replace(' ','+',$preset_dtmf_b); + $did_description = eregi_replace(' ','+',$did_description); } $script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); $script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); + $script_text = eregi_replace('--A--list_name--B--',"$list_name",$script_text); + $script_text = eregi_replace('--A--list_description--B--',"$list_description",$script_text); $script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); $script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); $script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); @@ -6335,6 +7529,14 @@ if ($ADD==7111111) $script_text = eregi_replace('--A--preset_number_f--B--',"$preset_number_f",$script_text); $script_text = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$script_text); $script_text = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$script_text); + $script_text = eregi_replace('--A--did_id--B--',"$did_id",$script_text); + $script_text = eregi_replace('--A--did_extension--B--',"$did_extension",$script_text); + $script_text = eregi_replace('--A--did_pattern--B--',"$did_pattern",$script_text); + $script_text = eregi_replace('--A--did_description--B--',"$did_description",$script_text); + $script_text = eregi_replace('--A--closecallid--B--',"$closecallid",$script_text); + $script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text); + $script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text); + $script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text); $script_text = eregi_replace("\n","
",$script_text); @@ -6398,9 +7600,11 @@ if ($ADD=="1") } else { - echo "
NÚmero De Usuario: $NWB#vicidial_users-user$NWE
NÚmero De Usuario: $NWB#vicidial_users-user$NWE
Contraseña: $NWB#vicidial_users-pass$NWE
Contraseña: $NWB#vicidial_users-pass$NWE     Strength:
Nombre Completo: $NWB#vicidial_users-full_name$NWE
Nivel Del Usuario:
NÚmero De Usuario: $NWB#vicidial_users-user$NWE
NÚmero De Usuario: $NWB#vicidial_users-user$NWE
Contraseña: $NWB#vicidial_users-pass$NWE
Contraseña: $NWB#vicidial_users-pass$NWE     Strength:
Nombre Completo: $NWB#vicidial_users-full_name$NWE
\n"; if ($voi_count > 0) { @@ -6543,14 +7750,13 @@ if ($ADD==11) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; echo "\n"; - echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; echo "
Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
Descripción De la Campaña: $NWB#vicidial_campaigns-campaign_description$NWE
Activo: $NWB#vicidial_campaigns-active$NWE
Extensión del parking: $NWB#vicidial_campaigns-park_ext$NWE
Nombre de fichero Del Parking: $NWB#vicidial_campaigns-park_file_name$NWE
Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE
Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
Nivel Del Hopper: $NWB#vicidial_campaigns-hopper_level$NWE
Nivel del Auto-Dial:
Nivel del Auto-Dial: $NWB#vicidial_campaigns-campaign_script$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_campaigns-get_call_launch$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_campaigns-get_call_launch$NWE
\n"; } @@ -6671,7 +7879,7 @@ if ($ADD==12) echo "Campaña De la Fuente:$NWB#vicidial_lists-list_description$NWE\n"; echo "Campaña: \n"; } echo "\n"; - echo "\n"; + echo "\n"; + + if ($LOGuser_level >= 9) + { + echo "
Download numbers in this list to a file:
\n"; + echo "\n"; + echo "
\n"; + } + } + + +###################### +# ADD=171 display the ADD NUMBER TO Filter Phone Group FORM SCREEN and add a new number +###################### + +if ($ADD==171) + { + echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; echo "
\n"; + echo ""; + + $stmt="SELECT filter_phone_group_id,filter_phone_group_name from vicidial_filter_phone_groups order by filter_phone_group_id"; + $rslt=mysql_query($stmt, $link); + $vfpg_to_print = mysql_num_rows($rslt); + + $o=0; + while ($vfpg_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vfpg_list .= "\n"; + $o++; + } + + if (strlen($phone_numbers) > 2) + { + $PN = explode("\n",$phone_numbers); + $PNct = count($PN); + $p=0; + while ($p < $PNct) + { + if ( (ereg('delete',$stage)) and ($LOGdelete_from_dnc > 0) ) + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
FILTER PHONE GROUP NUMBER NOT DELETED - This phone number is not in the Filter Phone Group List: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="DELETE FROM vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
FILTER PHONE GROUP NUMBER DELETED: $PN[$p] $filter_phone_group_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='FILTERPHONEGROUPS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
FILTER PHONE GROUP NUMBER NOT ADDED - This phone number is already in the Filter Phone Group List: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="INSERT INTO vicidial_filter_phone_numbers (phone_number,filter_phone_group_id) values('$PN[$p]','$filter_phone_group_id');"; + $rslt=mysql_query($stmt, $link); + + echo "
FILTER PHONE GROUP NUMBER ADDED: $PN[$p] $filter_phone_group_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='FILTERPHONEGROUPS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; + } + } + + if ($LOGdelete_from_dnc > 0) + {echo "
ADD OR DELETE NUMBERS FROM THE FILTER PHONE GROUP LIST
\n";} + else + {echo "
ADD NUMBERS TO THE FILTER PHONE GROUP LIST\n";} + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + if ($LOGdelete_from_dnc > 0) + { + echo "\n"; + } + echo "\n"; + echo "
Filter Phone Grupo:
Números de teléfono:

(un número de teléfono por línea sólo)
$NWB#vicidial_list-dnc$NWE
Agregar o eliminar:
\n"; + + if ($LOGuser_level >= 9) + { + echo "
Download numbers in this list to a file:
\n"; + echo "\n"; + echo "
\n"; + } + } @@ -6960,10 +8284,12 @@ if ($ADD==1111) echo "
Escritura: $NWB#vicidial_inbound_groups-ingroup_script$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
\n"; } @@ -7218,6 +8544,34 @@ if ($ADD==1611) } +###################### +# ADD=1711 display the ADD NEW FILTER PHONE GROUP SCREEN +###################### + +if ($ADD==1711) + { + if ($LOGmodify_dids==1) + { + echo "
\n"; + echo ""; + + echo "
Add Filter Phone Group
\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Filter Phone ID De Grupo: (no spaces or special characters)$NWB#vicidial_filter_phone_groups-filter_phone_group_id$NWE
Filter Phone Nombre De Grupo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
Filter Phone Group Descripción: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
\n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + ###################### # ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN ###################### @@ -7232,7 +8586,7 @@ if ($ADD==11111) echo "
NUEVO AGENTE REMOTO\n"; echo "\n"; echo "
\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
Comienzo Del ID del usuario: (Solamente números, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Comienzo Del ID del usuario: (Solamente números, incremented, must be an existing vicidial user)$NWB#vicidial_remote_agents-user_start$NWE
Número de líneas: (Solamente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Del Servidor: \n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; +# echo "\n"; +# echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; +# echo "\n"; +# echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -7796,20 +9200,6 @@ if ($ADD==141111111111) echo "\n"; echo "\n"; @@ -7824,6 +9214,56 @@ if ($ADD==141111111111) } +###################### +# ADD=140111111111 display the ADD COPIED CARRIER SCREEN +###################### + +if ($ADD==140111111111) + { + if ($LOGmodify_servers==1) + { + echo "
\n"; + echo ""; + + echo "
Add Extension Group Entry\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Extension Grupo: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
Extensión: (Solamente números)$NWB#vicidial_extension_groups-extension$NWE
Rango: $NWB#vicidial_extension_groups-rank$NWE
Campañas Groups: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
\n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + ###################### # ADD=111111 display the ADD NEW USERS GROUP SCREEN ###################### @@ -7345,6 +8739,8 @@ if ($ADD==1111111) echo ""; echo ""; echo ""; + echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -7402,6 +8798,14 @@ if ($ADD==1111111) echo ""; echo ""; echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo ""; echo "
"; # END Insert Field @@ -7603,21 +9007,21 @@ if ($ADD==11111111111) echo "
Número De Dial plan: (Solamente dígitos)$NWB#phones-dialplan_number$NWE
Caja de voz: (Solamente dígitos)$NWB#phones-voicemail_id$NWE
CallerID De salida: (Solamente dígitos)$NWB#phones-outbound_cid$NWE
Dirección IP del teléfono: (optional)$NWB#phones-phone_ip$NWE
Dirección IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
Phone IP address: (optional)$NWB#phones-phone_ip$NWE
Computer IP address: (optional)$NWB#phones-computer_ip$NWE
IP Del Servidor: $NWB#phones-server_ip$NWE
Login: $NWB#phones-login$NWE
Contraseña: $NWB#phones-pass$NWE
Login: $NWB#phones-login$NWE
Login Contraseña: $NWB#phones-pass$NWE
Registro Contraseña: $NWB#phones-conf_secret$NWE     Strength:
Estado: $NWB#phones-status$NWE
Cuenta Activa: $NWB#phones-active$NWE
Tipo Del Teléfono: $NWB#phones-phone_type$NWE
Nombre Completo: $NWB#phones-fullname$NWE
Compañía: $NWB#phones-company$NWE
Foto: $NWB#phones-picture$NWE
Company: $NWB#phones-company$NWE
Picture: $NWB#phones-picture$NWE
Protocolo Del Cliente: $NWB#phones-protocol$NWE
GMT Local: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
Dialplan Entrada: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP Del Servidor: $NWB#vicidial_server_carriers-server_ip$NWE
\n"; + echo ""; + + echo "
ADD COPIED CARRIER\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + echo "
Portador de Identificación: $NWB#vicidial_server_carriers-carrier_id$NWE
Transportista Nombre: $NWB#vicidial_server_carriers-carrier_name$NWE
IP Del Servidor: $NWB#vicidial_server_carriers-server_ip$NWE
Source Carrier: $NWB#vicidial_server_carriers-carrier_id$NWE
\n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + + ###################### # ADD=151111111111 display the ADD NEW TTS ENTRY SCREEN ###################### @@ -7932,9 +9372,7 @@ if ($ADD==1111111111111) echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Número de la Conferencia: (Solamente dígitos)$NWB#conferences-conf_exten$NWE
IP Del Servidor: $NWB#conferences-server_ip$NWE
\n"; @@ -7963,9 +9401,7 @@ if ($ADD==11111111111111) echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "
Número de la Conferencia: (Solamente dígitos)$NWB#conferences-conf_exten$NWE
IP Del Servidor: $NWB#conferences-server_ip$NWE
\n"; @@ -8018,10 +9454,10 @@ if ($ADD=="2") { $user = 'AUTOGENERA'; } - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 10) and (!ereg('AUTOGENERA',$user)) ) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 20) and (!ereg('AUTOGENERA',$user)) ) ) { echo "
USUARIO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
user id must be between 2 and 10 characters long\n"; + echo "
user id must be between 2 and 20 characters long\n"; echo "
el nombre completo y la contraseña deben ser por lo menos 2 caracteres de largo\n"; echo "
usted debe seleccionar un grupo de usuarios\n"; } @@ -8118,6 +9554,16 @@ if ($ADD=="2") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8296,10 +9742,10 @@ if ($ADD=="2A") {echo "
USUARIO NO AGREGADO - hay ya un usuario en el sistema con este número del usuario\n";} else { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 20) ) { echo "
USUARIO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
user id must be between 2 and 10 characters long\n"; + echo "
user id must be between 2 and 20 characters long\n"; echo "
el nombre completo y la contraseña deben ser por lo menos 2 caracteres de largo\n"; echo "\n"; } @@ -8342,7 +9788,7 @@ if ($ADD=="2A") $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; $rslt=mysql_query($stmt, $link); } - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user=\"$source_user_id\";"; + $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -8400,6 +9846,16 @@ if ($ADD=="2A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8664,7 +10120,7 @@ if ($ADD==20) { echo "
CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; @@ -8682,6 +10138,12 @@ if ($ADD==20) $stmtA="INSERT INTO vicidial_pause_codes (pause_code,pause_code_name,billable,campaign_id) SELECT pause_code,pause_code_name,billable,\"$campaign_id\" from vicidial_pause_codes where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_xfer_presets (campaign_id,preset_name,preset_number,preset_dtmf,preset_hide_number) SELECT \"$campaign_id\",preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_xfer_stats (campaign_id,preset_name) SELECT \"$campaign_id\",preset_name from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -8967,6 +10429,49 @@ if ($ADD==28) } +###################### +# ADD=201 adds new preset to the campaign presets +###################### +if ($ADD==201) + { + echo ""; + $stmt="SELECT count(*) from vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
PRESET NOT ADDED - there is already an entry for this campaign with this preset\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) + { + echo "
PRESET NOT ADDED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
preset name must be between 1 and 40 characters in length\n"; + echo "
preset number must be between 2 and 50 characters in length\n"; + } + else + { + echo "
PRESET ADDED: $campaign_id - $preset_name - $preset_number\n"; + + $stmt="INSERT INTO vicidial_xfer_presets(campaign_id,preset_name,preset_number,preset_dtmf,preset_hide_number) values('$campaign_id','$preset_name','$preset_number','$preset_dtmf','$preset_hide_number');"; + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO vicidial_xfer_stats(campaign_id,preset_name) values('$campaign_id','$preset_name');"; + $rslt=mysql_query($stmt, $link); + + ### 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='CAMPAIGN_PRESET', event_type='ADD', record_id='$campaign_id', event_code='ADMIN NUEVA CAMPAÑA PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $SUB=201; + $ADD=31; + } + + ###################### # ADD=211 adds the new list to the system ###################### @@ -9066,7 +10571,7 @@ if ($ADD==2111) } else { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,web_form_address_two,start_call_url,dispo_call_url) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','');"; + $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,web_form_address_two,start_call_url,dispo_call_url,add_lead_url) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; @@ -9131,7 +10636,7 @@ if ($ADD==2011) } else { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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,ignore_list_script_override,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,timer_action_destination,calculate_estimated_hold_seconds,add_lead_url,eht_minimum_prompt_filename,eht_minimum_prompt_no_block,eht_minimum_prompt_seconds) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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,ignore_list_script_override,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,timer_action_destination,calculate_estimated_hold_seconds,add_lead_url,eht_minimum_prompt_filename,eht_minimum_prompt_no_block,eht_minimum_prompt_seconds from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); echo "
GRUPO AÑADIDO: $group_id\n"; @@ -9223,7 +10728,7 @@ if ($ADD==2411) } else { - $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id) SELECT \"$did_pattern\",\"$did_description\",did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id from vicidial_inbound_dids where did_id=\"$source_did\";"; + $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number) SELECT \"$did_pattern\",\"$did_description\",did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number from vicidial_inbound_dids where did_id=\"$source_did\";"; $rslt=mysql_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -9271,31 +10776,45 @@ if ($ADD==2511) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
CALL MENU NO AGREGADOS - there is already a CALL MENU in the system with this ID\n";} + { + echo "
CALL MENU NO AGREGADOS - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + if ( (preg_match("/^vicidial$/i",$menu_id)) or (preg_match("/^vicidial-auto$/i",$menu_id)) or (preg_match("/^general$/i",$menu_id)) or (preg_match("/^globals$/i",$menu_id)) or (preg_match("/^default$/i",$menu_id)) or (preg_match("/^trunkinbound$/i",$menu_id)) or (preg_match("/^loopback-no-log$/i",$menu_id)) or (preg_match("/^monitor_exit$/i",$menu_id)) or (preg_match("/^monitor$/i",$menu_id)) ) { echo "
CALL MENU NO AGREGADOS - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Llame Menú de identificación debe ser entre 2 y 50 caracteres de longitud y no contienen ' '.\n"; + echo "
Llame Menú ID cannot use reserved words: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + $ADD=1500; } else { - $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');"; - $rslt=mysql_query($stmt, $link); + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + { + echo "
CALL MENU NO AGREGADOS - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Llame Menú de identificación debe ser entre 2 y 50 caracteres de longitud y no contienen ' '.\n"; + $ADD=1500; + } + else + { + $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');"; + $rslt=mysql_query($stmt, $link); - echo "
CALL AGREGADOS MENU: $menu_id $menu_name\n"; + echo "
CALL AGREGADOS MENU: $menu_id $menu_name\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='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### 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='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } } } - $ADD=3511; } @@ -9324,34 +10843,87 @@ if ($ADD==2611) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
CALL MENU NO AGREGADOS - there is already a CALL MENU in the system with this ID\n";} + { + echo "
CALL MENU NO AGREGADOS - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + if ( (preg_match("/^vicidial$/i",$menu_id)) or (preg_match("/^vicidial-auto$/i",$menu_id)) or (preg_match("/^general$/i",$menu_id)) or (preg_match("/^globals$/i",$menu_id)) or (preg_match("/^default$/i",$menu_id)) or (preg_match("/^trunkinbound$/i",$menu_id)) or (preg_match("/^loopback-no-log$/i",$menu_id)) or (preg_match("/^monitor_exit$/i",$menu_id)) or (preg_match("/^monitor$/i",$menu_id)) ) { echo "
CALL MENU NO AGREGADOS - Vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
Llame Menú de identificación debe ser entre 2 y 50 caracteres de longitud y no contienen ' '.\n"; + echo "
Llame Menú ID cannot use reserved words: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + $ADD=1500; } else { - $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group) SELECT \"$menu_id\",\"$menu_name\",menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group from vicidial_call_menu where menu_id=\"$source_menu\";"; + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + { + echo "
CALL MENU NO AGREGADOS - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Llame Menú de identificación debe ser entre 2 y 50 caracteres de longitud y no contienen ' '.\n"; + $ADD=1500; + } + else + { + $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group) SELECT \"$menu_id\",\"$menu_name\",menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group from vicidial_call_menu where menu_id=\"$source_menu\";"; + $rslt=mysql_query($stmt, $link); + + $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; + $rslt=mysql_query($stmtA, $link); + + echo "
CALL AGREGADOS MENU: $menu_id - $menu_name\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$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='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } + } + } + } + + +###################### +# ADD=2711 adds the new filter phone group to the system +###################### + +if ($ADD==2711) + { + echo ""; + $stmt="SELECT count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
PHONE FILTER GROUP NOT ADDED - there is already a PHONE FILTER GROUP in the system with this ID\n";} + else + { + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_id) > 20) or (eregi(' ',$filter_phone_group_id)) ) + { + echo "
PHONE FILTER GRUPO NO AGREGADO - vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Phone Filter La ID de grupo debe estar entre 2 y 20 caracteres en longitud y contener no ' '.\n"; + } + else + { + $stmt="INSERT INTO vicidial_filter_phone_groups (filter_phone_group_id,filter_phone_group_name,filter_phone_group_description) values('$filter_phone_group_id','$filter_phone_group_name','$filter_phone_group_description');"; $rslt=mysql_query($stmt, $link); - $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; - $rslt=mysql_query($stmtA, $link); - - echo "
CALL AGREGADOS MENU: $menu_id - $menu_name\n"; + echo "
PHONE FILTER GRUPO AÑADIDO: $filter_phone_group_id $filter_phone_group_name\n"; ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtA"; + $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='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', 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='FILTERPHONEGROUPS', event_type='ADD', record_id='$filter_phone_group_id', event_code='ADMIN AGREGUE EL FILTRO PHONE GROUP', event_sql=\"$SQL_log\", event_notes='$filter_phone_group_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=3511; + $ADD=3711; } @@ -9369,30 +10941,94 @@ if ($ADD==21111) {echo "
AGENTES ALEJADOS NO AGREGADOS - hay ya una entrada alejada de los agentes comenzando con esta ID del usuario\n";} else { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + ### check for a valid user that will be associated with this account + $stmt="SELECT count(*) from vicidial_users where user='$user_start';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
AGENTES REMOTOS NOT ADDED - you must use a valid user as the user_start for remote agents\n";} + else { - echo "
AGENTES ALEJADOS NO AGREGADOS - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
El comienzo de la ID del usuario y la extensión externa deben ser por lo menos 2 caracteres en longitud\n"; + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start >= '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
AGENTES REMOTOS NOT ADDED - your number of lines overlaps with another remote agent\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
AGENTES ALEJADOS NO AGREGADOS - vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
El comienzo de la ID del usuario y la extensión externa deben ser por lo menos 2 caracteres en longitud\n"; + } + else + { + $stmt="INSERT INTO vicidial_remote_agents (user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns) values('$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $rslt=mysql_query($stmt, $link); + + echo "
AGENTES REMOTO AÑADIDO: $user_start\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='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + $ADD=10000; + } + + +###################### +# ADD=22111 adds new extension group entry to the system +###################### + +if ($ADD==22111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
EXTENSION GROUP ENTRY NOT ADDED - there is already an extension group entry with these values\n";} + else + { + if ( (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) ) + { + echo "
EXTENSION GROUP ENTRY NOT ADDED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
extension group id and extension and rank must be at least 2 characters in length\n"; } else { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $stmt="INSERT INTO vicidial_extension_groups (extension_group_id,extension,rank,campaign_groups) values('$extension_group_id','$extension','$rank','$campaign_groups');"; $rslt=mysql_query($stmt, $link); - echo "
AGENTES REMOTO AÑADIDO: $user_start\n"; + $stmt="SELECT extension_id from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + + echo "
EXTENSION GROUP ENTRY ADDED: $extension_id - $extension_group_id - $extension\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='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', 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='EXTENGROUP', event_type='ADD', record_id='$extension_id', event_code='ADMIN ADD EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=10000; + $ADD=12000; } + ###################### # ADD=211111 adds new user group to the system ###################### @@ -9830,7 +11466,7 @@ if ($ADD==21111111111) { echo "
EL TELÉFONO AGREGÚ\n"; - $stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');"; + $stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid,conf_secret) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid','$conf_secret');"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -9957,7 +11593,7 @@ if ($ADD==211111111111) { echo "
SERVIDOR AGREGADO\n"; - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; + $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version,conf_secret) values('$server_id','$server_description','$server_ip','$active','$asterisk_version','$SSdefault_server_password');"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -10109,6 +11745,45 @@ if ($ADD==241111111111) } +###################### +# ADD=240111111111 adds copied server carrier to the system +###################### + +if ($ADD==240111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
TRANSPORTISTA NO AÑADIDO - ya existe un soporte en el sistema con este ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
TRANSPORTISTA NO AÑADIDO - Vaya por favor detrás y mire los datos que usted incorporó\n";} + else + { + echo "
COPIED CARRIER ADDED\n"; + + $stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description) SELECT \"$carrier_id\",\"$carrier_name\",registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,\"$server_ip\",\"N\",carrier_description from vicidial_server_carriers where carrier_id=\"$source_carrier\";"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; + $rslt=mysql_query($stmtA, $link); + + ### 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='CARRIERS', event_type='COPY', record_id='$carrier_id', event_code='ADMIN COPY CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=341111111111; + } + + ###################### # ADD=251111111111 adds new tts entry to the system ###################### @@ -10461,11 +12136,11 @@ if ($ADD=="4A") } echo "
USUARIO MODIFICADO - ADMIN: $user\n"; - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',callcard_admin='$callcard_admin',agent_choose_blended='$agent_choose_blended',realtime_block_user_info='$realtime_block_user_info',custom_fields_modify='$custom_fields_modify',force_change_password='$force_change_password' where user='$user';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmt_grp_values|"; $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='USUARIOS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; @@ -10513,6 +12188,16 @@ if ($ADD=="4A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10694,7 +12379,7 @@ if ($ADD=="4B") } echo "
USUARIO MODIFICADO - ADMIN: $user\n"; - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',alter_custphone_override='$alter_custphone_override',active='$active',agent_shift_enforcement_override='$agent_shift_enforcement_override',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',alter_custphone_override='$alter_custphone_override',active='$active',agent_shift_enforcement_override='$agent_shift_enforcement_override',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',agent_choose_blended='$agent_choose_blended' where user='$user';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10746,6 +12431,16 @@ if ($ADD=="4B") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10973,6 +12668,16 @@ if ($ADD==4) $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -11265,7 +12970,7 @@ if ($ADD==41) if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) {$hopper_level='100';} - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where campaign_id='$campaign_id';"; + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -11998,6 +13703,48 @@ if ($ADD==49) } +###################### +# ADD=401 modify campaign preset in the system +###################### + +if ($ADD==401) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) + { + echo "
PRESET NOT MODIFIED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
preset name must be between 1 and 40 characters in length\n"; + echo "
preset number must be between 2 and 50 characters in length\n"; + } + else + { + echo "
PRESET MODIFIED: $campaign_id - $preset_name - $preset_number\n"; + + $stmt="UPDATE vicidial_xfer_presets SET preset_dtmf='$preset_dtmf',preset_number='$preset_number',preset_hide_number='$preset_hide_number' where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + + ### 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='CAMPAIGN_PRESET', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } + + ###################### # ADD=411 submit list modifications to the system ###################### @@ -12129,7 +13876,7 @@ if ($ADD==4111) echo "
GRUPO MODIFICADO: $group_id\n"; - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where group_id='$group_id';"; + $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',ignore_list_script_override='$ignore_list_script_override',extension_appended_cidname='$extension_appended_cidname',uniqueid_status_display='$uniqueid_status_display',uniqueid_status_prefix='$uniqueid_status_prefix',hold_time_option_minimum='$hold_time_option_minimum',hold_time_option_press_filename='$hold_time_option_press_filename',hold_time_option_callmenu='$hold_time_option_callmenu',onhold_prompt_no_block='$onhold_prompt_no_block',onhold_prompt_seconds='$onhold_prompt_seconds',hold_time_option_no_block='$hold_time_option_no_block',hold_time_option_prompt_seconds='$hold_time_option_prompt_seconds',hold_time_second_option='$hold_time_second_option',hold_time_third_option='$hold_time_third_option',wait_hold_option_priority='$wait_hold_option_priority',wait_time_option='$wait_time_option',wait_time_second_option='$wait_time_second_option',wait_time_third_option='$wait_time_third_option',wait_time_option_seconds='$wait_time_option_seconds',wait_time_option_exten='$wait_time_option_exten',wait_time_option_voicemail='$wait_time_option_voicemail',wait_time_option_xfer_group='$wait_time_option_xfer_group',wait_time_option_callmenu='$wait_time_option_callmenu',wait_time_option_callback_filename='$wait_time_option_callback_filename',wait_time_option_callback_list_id='$wait_time_option_callback_list_id',wait_time_option_press_filename='$wait_time_option_press_filename',wait_time_option_no_block='$wait_time_option_no_block',wait_time_option_prompt_seconds='$wait_time_option_prompt_seconds',timer_action_destination='$timer_action_destination',calculate_estimated_hold_seconds='$calculate_estimated_hold_seconds',add_lead_url='" . mysql_real_escape_string($add_lead_url) . "',eht_minimum_prompt_filename='$eht_minimum_prompt_filename',eht_minimum_prompt_no_block='$eht_minimum_prompt_no_block',eht_minimum_prompt_seconds='$eht_minimum_prompt_seconds' where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12169,7 +13916,7 @@ if ($ADD==4311) { echo "
DID MODIFICADOS: $did_pattern\n"; - $stmt="UPDATE vicidial_inbound_dids set did_pattern='$did_pattern',did_description='$did_description',did_active='$did_active',did_route='$did_route',extension='$extension',exten_context='$exten_context',voicemail_ext='$voicemail_ext',phone='$phone',server_ip='$server_ip',user='$user',user_unavailable_action='$user_unavailable_action',user_route_settings_ingroup='$user_route_settings_ingroup',group_id='$group_id',call_handle_method='$call_handle_method',agent_search_method='$agent_search_method',list_id='$list_id',campaign_id='$campaign_id',phone_code='$phone_code',menu_id='$menu_id' where did_id='$did_id';"; + $stmt="UPDATE vicidial_inbound_dids set did_pattern='$did_pattern',did_description='$did_description',did_active='$did_active',did_route='$did_route',extension='$extension',exten_context='$exten_context',voicemail_ext='$voicemail_ext',phone='$phone',server_ip='$server_ip',user='$user',user_unavailable_action='$user_unavailable_action',user_route_settings_ingroup='$user_route_settings_ingroup',group_id='$group_id',call_handle_method='$call_handle_method',agent_search_method='$agent_search_method',list_id='$list_id',campaign_id='$campaign_id',phone_code='$phone_code',menu_id='$menu_id',record_call='$record_call',filter_inbound_number='$filter_inbound_number',filter_phone_group_id='$filter_phone_group_id',filter_url='$filter_url',filter_action='$filter_action',filter_extension='$filter_extension',filter_exten_context='$filter_exten_context',filter_voicemail_ext='$filter_voicemail_ext',filter_phone='$filter_phone',filter_server_ip='$filter_server_ip',filter_user='$filter_user',filter_user_unavailable_action='$filter_user_unavailable_action',filter_user_route_settings_ingroup='$filter_user_route_settings_ingroup',filter_group_id='$filter_group_id',filter_call_handle_method='$filter_call_handle_method',filter_agent_search_method='$filter_agent_search_method',filter_list_id='$filter_list_id',filter_campaign_id='$filter_campaign_id',filter_phone_code='$filter_phone_code',filter_menu_id='$filter_menu_id',filter_clean_cid_number='$filter_clean_cid_number' where did_id='$did_id';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12231,18 +13978,26 @@ if ($ADD==4511) if ($option_route == "INGROUP") { - if (isset($_GET["IGhandle_method_$h"])) {$IGhandle_method=$_GET["IGhandle_method_$h"];} - elseif (isset($_POST["IGhandle_method_$h"])) {$IGhandle_method=$_POST["IGhandle_method_$h"];} - if (isset($_GET["IGsearch_method_$h"])) {$IGsearch_method=$_GET["IGsearch_method_$h"];} - elseif (isset($_POST["IGsearch_method_$h"])) {$IGsearch_method=$_POST["IGsearch_method_$h"];} - if (isset($_GET["IGlist_id_$h"])) {$IGlist_id=$_GET["IGlist_id_$h"];} - elseif (isset($_POST["IGlist_id_$h"])) {$IGlist_id=$_POST["IGlist_id_$h"];} - if (isset($_GET["IGcampaign_id_$h"])) {$IGcampaign_id=$_GET["IGcampaign_id_$h"];} - elseif (isset($_POST["IGcampaign_id_$h"])) {$IGcampaign_id=$_POST["IGcampaign_id_$h"];} - if (isset($_GET["IGphone_code_$h"])) {$IGphone_code=$_GET["IGphone_code_$h"];} - elseif (isset($_POST["IGphone_code_$h"])) {$IGphone_code=$_POST["IGphone_code_$h"];} + if (isset($_GET["IGhandle_method_$h"])) {$IGhandle_method=$_GET["IGhandle_method_$h"];} + elseif (isset($_POST["IGhandle_method_$h"])) {$IGhandle_method=$_POST["IGhandle_method_$h"];} + if (isset($_GET["IGsearch_method_$h"])) {$IGsearch_method=$_GET["IGsearch_method_$h"];} + elseif (isset($_POST["IGsearch_method_$h"])) {$IGsearch_method=$_POST["IGsearch_method_$h"];} + if (isset($_GET["IGlist_id_$h"])) {$IGlist_id=$_GET["IGlist_id_$h"];} + elseif (isset($_POST["IGlist_id_$h"])) {$IGlist_id=$_POST["IGlist_id_$h"];} + if (isset($_GET["IGcampaign_id_$h"])) {$IGcampaign_id=$_GET["IGcampaign_id_$h"];} + elseif (isset($_POST["IGcampaign_id_$h"])) {$IGcampaign_id=$_POST["IGcampaign_id_$h"];} + if (isset($_GET["IGphone_code_$h"])) {$IGphone_code=$_GET["IGphone_code_$h"];} + elseif (isset($_POST["IGphone_code_$h"])) {$IGphone_code=$_POST["IGphone_code_$h"];} + if (isset($_GET["IGvid_enter_filename_$h"])) {$IGvid_enter_filename=$_GET["IGvid_enter_filename_$h"];} + elseif (isset($_POST["IGvid_enter_filename_$h"])) {$IGvid_enter_filename=$_POST["IGvid_enter_filename_$h"];} + if (isset($_GET["IGvid_id_number_filename_$h"])) {$IGvid_id_number_filename=$_GET["IGvid_id_number_filename_$h"];} + elseif (isset($_POST["IGvid_id_number_filename_$h"])) {$IGvid_id_number_filename=$_POST["IGvid_id_number_filename_$h"];} + if (isset($_GET["IGvid_confirm_filename_$h"])) {$IGvid_confirm_filename=$_GET["IGvid_confirm_filename_$h"];} + elseif (isset($_POST["IGvid_confirm_filename_$h"])) {$IGvid_confirm_filename=$_POST["IGvid_confirm_filename_$h"];} + if (isset($_GET["IGvid_validate_digits_$h"])) {$IGvid_validate_digits=$_GET["IGvid_validate_digits_$h"];} + elseif (isset($_POST["IGvid_validate_digits_$h"])) {$IGvid_validate_digits=$_POST["IGvid_validate_digits_$h"];} - $option_route_value_context = "$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; + $option_route_value_context = "$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code,$IGvid_enter_filename,$IGvid_id_number_filename,$IGvid_confirm_filename,$IGvid_validate_digits"; } if ($non_latin < 1) @@ -12334,32 +14089,32 @@ if ($ADD==4511) ###################### -# ADD=41111 modify remote agents info in the system +# ADD=4711 modify filter phone group info in the system ###################### -if ($ADD==41111) +if ($ADD==4711) { - if ($LOGmodify_remoteagents==1) + if ($LOGmodify_dids==1) { echo ""; - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_name) < 2) or (strlen($filter_phone_group_name) > 40) ) { - echo "
AGENTES ALEJADOS NO MODIFICADOS - vaya por favor detrás y mire los datos que usted incorporó\n"; - echo "
El comienzo de la ID del usuario y la extensión externa deben ser por lo menos 2 caracteres en longitud\n"; + echo "
FILTER PHONE GRUPO NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Filter Phone Nombre De Grupo and ID must be at least 2 characters in length\n"; } else { - $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id';"; + $stmt="UPDATE vicidial_filter_phone_groups set filter_phone_group_name='$filter_phone_group_name', filter_phone_group_description='$filter_phone_group_description' where filter_phone_group_id='$filter_phone_group_id';"; $rslt=mysql_query($stmt, $link); - echo "
LOS AGENTES ALEJADOS SE MODIFICARON\n"; + echo "
FILTER PHONE GRUPO MODIFICADO\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='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', 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='FILTERPHONEGROUPS', event_type='MODIFY', record_id='$filter_phone_group_id', event_code='ADMIN FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -12369,10 +14124,108 @@ if ($ADD==41111) echo "Usted no tiene permiso de visión esta página\n"; exit; } + $ADD=3711; # go to filter phone group modification form below + } + + +###################### +# ADD=41111 modify remote agents info in the system +###################### + +if ($ADD==41111) + { + if ($LOGmodify_remoteagents==1) + { + echo ""; + + $stmt="SELECT count(*) from vicidial_users where user='$user_start';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
AGENTES REMOTOS NOT MODIFIED - you must use a valid user as the user_start for remote agents\n";} + else + { + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start > '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
AGENTES REMOTOS NOT MODIFIED - your number of lines overlaps with another remote agent\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
AGENTES ALEJADOS NO MODIFICADOS - vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
El comienzo de la ID del usuario y la extensión externa deben ser por lo menos 2 caracteres en longitud\n"; + } + else + { + $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value',extension_group='$extension_group' where remote_agent_id='$remote_agent_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
LOS AGENTES ALEJADOS SE MODIFICARON\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='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } $ADD=31111; # go to remote agents modification form below } +###################### +# ADD=42111 modify extenison group entry in the system +###################### + +if ($ADD==42111) + { + if ($LOGmodify_remoteagents==1) + { + echo ""; + + if ( (strlen($extension_id) < 1) or (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) ) + { + echo "
EXTENSION GROUP ENTRY NOT MODIFIED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
Extension group id and extension must be at least 2 characters in length\n"; + } + else + { + $stmt="UPDATE vicidial_extension_groups set extension_group_id='$extension_group_id', extension='$extension', rank='$rank', campaign_groups='$campaign_groups' where extension_id='$extension_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
EXTENSION GROUP ENTRY 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='EXTENGROUP', event_type='MODIFY', record_id='$extension_id', event_code='ADMIN MODIFY EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + $ADD=32111; # go to extension group modification form below + } + + ###################### # ADD=411111 modify user group info in the system ###################### @@ -12408,8 +14261,17 @@ if ($ADD==411111) $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; $p++; } - - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time' where user_group='$OLDuser_group';"; + $k=0; + $multi_count = count($allowed_reports); + $multi_array = $allowed_reports; + while ($k < $multi_count) + { + $new_field_value .= "$multi_array[$k],"; + $k++; + } + $allowed_reports = preg_replace("/,$/","",$new_field_value); + + $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports',webphone_url_override='" . mysql_real_escape_string($webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override' where user_group='$OLDuser_group';"; $rslt=mysql_query($stmt, $link); echo "
GRUPO DE USUARIO MODIFICADO\n"; @@ -12630,7 +14492,7 @@ if ($ADD==411111111) $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop' where call_time_id='$call_time_id';"; + $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop', default_afterhours_filename_override='$default_afterhours_filename_override', sunday_afterhours_filename_override='$sunday_afterhours_filename_override', monday_afterhours_filename_override='$monday_afterhours_filename_override', tuesday_afterhours_filename_override='$tuesday_afterhours_filename_override', wednesday_afterhours_filename_override='$wednesday_afterhours_filename_override', thursday_afterhours_filename_override='$thursday_afterhours_filename_override', friday_afterhours_filename_override='$friday_afterhours_filename_override', saturday_afterhours_filename_override='$saturday_afterhours_filename_override' where call_time_id='$call_time_id';"; $rslt=mysql_query($stmt, $link); echo "
TIEMPO DE LA LLAMADA MODIFICADO\n"; @@ -12783,7 +14645,7 @@ if ($ADD==41111111111) { echo "
TELÉFONO MODIFICADO: $extension\n"; - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email' where extension='$old_extension' and server_ip='$old_server_ip';"; + $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email',is_webphone='$is_webphone',use_external_server_ip='$use_external_server_ip',codecs_list='$codecs_list',codecs_with_template='$codecs_with_template',webphone_dialpad='$webphone_dialpad' where extension='$old_extension' and server_ip='$old_server_ip';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -12916,7 +14778,7 @@ if ($ADD==411111111111) {echo "
SERVIDOR NO MODIFICADO - vaya por favor detrás y mire los datos que usted incorporó\n";} else { - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output', vicidial_balance_active='$vicidial_balance_active',balance_trunks_offlimits='$balance_trunks_offlimits',recording_web_link='$recording_web_link',alt_server_ip='$alt_server_ip',active_asterisk_server='$active_asterisk_server',generate_vicidial_conf='$generate_vicidial_conf',rebuild_conf_files='$rebuild_conf_files',outbound_calls_per_second='$outbound_calls_per_second',sounds_update='$sounds_update',vicidial_recording_limit='$vicidial_recording_limit',carrier_logging_active='$carrier_logging_active',vicidial_balance_rank='$vicidial_balance_rank',rebuild_music_on_hold='$rebuild_music_on_hold',active_agent_login_server='$active_agent_login_server',conf_secret='$conf_secret' where server_id='$old_server_id';"; + $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output', vicidial_balance_active='$vicidial_balance_active',balance_trunks_offlimits='$balance_trunks_offlimits',recording_web_link='$recording_web_link',alt_server_ip='$alt_server_ip',active_asterisk_server='$active_asterisk_server',generate_vicidial_conf='$generate_vicidial_conf',rebuild_conf_files='$rebuild_conf_files',outbound_calls_per_second='$outbound_calls_per_second',sounds_update='$sounds_update',vicidial_recording_limit='$vicidial_recording_limit',carrier_logging_active='$carrier_logging_active',vicidial_balance_rank='$vicidial_balance_rank',rebuild_music_on_hold='$rebuild_music_on_hold',active_agent_login_server='$active_agent_login_server',conf_secret='$conf_secret',external_server_ip='$external_server_ip',custom_dialplan_entry='$custom_dialplan_entry' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; @@ -13096,7 +14958,7 @@ if ($ADD==451111111111) {echo "
TTS ENTRADA SIN MODIFICAR - Vaya por favor detrás y mire los datos que usted incorporó\n";} else { - $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_text=\"$tts_text\" where tts_id='$tts_id';"; + $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_voice='$tts_voice',tts_text=\"$tts_text\" where tts_id='$tts_id';"; $rslt=mysql_query($stmt, $link); echo "
TTS entrada modificada: $tts_id\n"; @@ -13288,7 +15150,7 @@ if ($ADD==4111111111111) { echo "
CONFERENCIA MODIFICADA: $conf_exten\n"; - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } } @@ -13325,7 +15187,7 @@ if ($ADD==41111111111111) { echo "
VICIDIAL CONFERENCIA MODIFICADA: $conf_exten\n"; - $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } @@ -13352,7 +15214,17 @@ if ($ADD==411111111111111) echo "
AJUSTES DEL SISTEMA DE VICIDIAL MODIFICADOS\n"; - $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform';"; + $k=0; + $multi_count = count($reports_use_slave_db); + $multi_array = $reports_use_slave_db; + while ($k < $multi_count) + { + $new_field_value .= "$multi_array[$k],"; + $k++; + } + $reports_use_slave_db = preg_replace("/,$/","",$new_field_value); + + $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13770,6 +15642,28 @@ if ($ADD==5511) $ADD='3511'; # go to call menu modification below } +###################### +# ADD=5711 confirmation before deletion of filter phone group +###################### + +if ($ADD==5711) + { + echo ""; + + if ( (strlen($filter_phone_group_id) < 2) or ($LOGdelete_dids < 1) ) + { + echo "
FILTER PHONE GROUP NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
filter_phone_group_id be at least 2 characters in length\n"; + } + else + { + echo "
FILTER PHONE GROUP DELETION CONFIRMATION: $filter_phone_group_id\n"; + echo "

Haga clic aquí para eliminarFILTER PHONE GROUP $filter_phone_group_id


\n"; + } + + $ADD='3711'; # go to filter phone group modification below + } + ###################### # ADD=51111 confirmation before deletion of remote agent record ###################### @@ -13792,6 +15686,28 @@ if ($ADD==51111) $ADD='31111'; # go to remote agent modification below } +###################### +# ADD=52111 confirmation before deletion of extension group record +###################### + +if ($ADD==52111) + { + echo ""; + + if ( (strlen($extension_id) < 1) or ($LOGdelete_remote_agents < 1) ) + { + echo "
EXTENSION GROUP ENTRY NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
extension_id be at least 1 characters in length\n"; + } + else + { + echo "
EXTENSION GROUP ENTRY DELETION CONFIRMATION: $extension_id\n"; + echo "

Haga clic aquí para eliminarextension group entry $extension_id


\n"; + } + + $ADD='32111'; # go to extension group modification below + } + ###################### # ADD=511111 confirmation before deletion of user group record ###################### @@ -14268,6 +16184,12 @@ if ($ADD==61) $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + echo "
QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($campaign_id)\n"; $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); @@ -14425,7 +16347,7 @@ if ($ADD==62) ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -14438,11 +16360,16 @@ if ($ADD==62) $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; + $queuemetrics_loginout = $row[6]; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### if ($enable_queuemetrics_logging > 0) { + $QM_LOGOFF = 'AGENTLOGOFF'; + if ($queuemetrics_loginout=='CALLBACK') + {$QM_LOGOFF = 'AGENTCALLBACKLOGOFF';} + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); @@ -14450,7 +16377,7 @@ if ($ADD==62) $agent_logged_in=''; $time_logged_in=''; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='AGENTLOGIN' order by time_id desc limit 1;"; + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "
$stmtB\n";} $qml_ct = mysql_num_rows($rsltB); @@ -14459,12 +16386,13 @@ if ($ADD==62) $row=mysql_fetch_row($rsltB); $agent_logged_in = $row[0]; $time_logged_in = $row[1]; + $phone_logged_in = $row[2]; } $time_logged_in = ($now_date_epoch - $time_logged_in); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='$VLA_user[$k]$agents',data2='$time_logged_in';"; + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; if ($DB) {echo "
$stmtB\n";} $rsltB=mysql_query($stmtB, $linkB); } @@ -14731,6 +16659,51 @@ if ($ADD==68) $ADD=31; # go to campaign modification form below } + +###################### +# ADD=601 delete preset in the system +###################### + +if ($ADD==601) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) ) + { + echo "
CAMPAIGN PRESET NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
preset name must be between 1 and 40 characters in length\n"; + } + else + { + echo "
CAMPAIGN PRESET DELETED: $campaign_id - $preset_name\n"; + + $stmt="DELETE FROM vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + + ### 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='CAMPAIGN_PRESETS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } + + ###################### # ADD=611 delete list record and all leads within it ###################### @@ -14884,6 +16857,42 @@ if ($ADD==6511) $ADD='1500'; # go to call menu list } +###################### +# ADD=6711 delete filter phone group record +###################### + +if ($ADD==6711) + { + echo ""; + + if ( (strlen($filter_phone_group_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) ) + { + echo "
FILTER PHONE GROUP NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
filter_phone_group_id be at least 1 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + $stmtA="DELETE from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$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='FILTERPHONEGROUPS', event_type='DELETE', record_id='$filter_phone_group_id', event_code='ADMIN DELETE FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
FILTER PHONE GROUP DELETION COMPLETED: $filter_phone_group_id\n"; + echo "

\n"; + } + + $ADD='1700'; # go to filter phone group list + } + ###################### # ADD=61111 delete remote agent record ###################### @@ -14917,6 +16926,41 @@ if ($ADD==61111) $ADD='10000'; # go to remote agents list } +###################### +# ADD=62111 delete extension group record +###################### + +if ($ADD==62111) + { + echo ""; + + if ( (strlen($extension_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) + { + echo "
EXTENSION GROUP ENTRY NOT DELETED - Vaya por favor detrás y mire los datos que usted incorporó\n"; + echo "
extension_id be at least 1 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_extension_groups where extension_id='$extension_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### 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='EXTENGROUP', event_type='DELETE', record_id='$extension_id', event_code='ADMIN DELETE EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
EXTENSION GROUP ENTRY DELETION COMPLETED: $extension_id\n"; + echo "

\n"; + } + + $ADD='12000'; # go to extension group list + } + + + ###################### # ADD=611111 delete user group record ###################### @@ -15606,7 +17650,7 @@ if ($ADD==3) echo "
\n"; echo ""; - $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$user';"; + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $user_id = $row[0]; @@ -15683,6 +17727,13 @@ if ($ADD==3) $user_custom_three = $row[73]; $user_custom_four = $row[74]; $user_custom_five = $row[75]; + $voicemail_id = $row[76]; + $agent_call_log_view_override = $row[77]; + $callcard_admin = $row[78]; + $agent_choose_blended = $row[79]; + $realtime_block_user_info = $row[80]; + $custom_fields_modify = $row[81]; + $force_change_password = $row[82]; if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) { @@ -15700,10 +17751,18 @@ if ($ADD==3) else {echo "\n";} } + if ($SScustom_fields_enabled < 1) + { + echo "\n"; + } + echo "\n"; echo "
\n"; echo "\n"; - echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -15756,6 +17816,7 @@ if ($ADD==3) { echo "\n"; echo "\n"; + echo "\n"; if ($SSuser_territories_active > 0) { echo "\n"; @@ -15775,6 +17836,7 @@ if ($ADD==3) echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -15808,6 +17870,10 @@ if ($ADD==3) } if ($LOGuser_level > 8) { + echo "\n"; + + echo "\n"; + echo "\n"; #9BB9FB @@ -15830,6 +17896,11 @@ if ($ADD==3) echo "\n"; echo "\n"; + if ($SScustom_fields_enabled > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; echo "\n"; @@ -15855,6 +17926,7 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -15863,7 +17935,7 @@ if ($ADD==3) echo "\n"; } - echo "\n"; + echo "\n"; echo "
NÚmero De Usuario: $user$NWB#vicidial_users-user$NWE
Contraseña: $NWB#vicidial_users-pass$NWE
Contraseña: $NWB#vicidial_users-pass$NWE     Strength:
Force Change Contraseña: $NWB#vicidial_users-force_change_password$NWE
Nombre Completo: $NWB#vicidial_users-full_name$NWE
Nivel Del Usuario:
Conexión Del Teléfono: $NWB#vicidial_users-phone_login$NWE
Contraseña Del Teléfono: $NWB#vicidial_users-phone_pass$NWE
Activo: $NWB#vicidial_users-active$NWE
ID de correo de voz: voicemail chooser$NWB#vicidial_users-voicemail_id$NWE
Correo electrónico:$NWB#vicidial_users-optional$NWE
Usuario Code: $NWB#vicidial_users-optional$NWE
Main Territorio: $NWB#vicidial_users-optional$NWE
OPCIONES DE INTERFAZ DEL AGENTE:
El Agente Elige Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
Agent Choose Blended: $NWB#vicidial_users-agent_choose_blended$NWE
Agente Elija territorios: $NWB#vicidial_users-agent_choose_territories$NWE
Modificar Agente Cliente Sobreescribe Teléfono:$NWB#vicidial_users-alter_custphone_override$NWE
Agente de Cambio observancia Sobrescribir: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
Agent Call Log View Override: $NWB#vicidial_users-agent_call_log_view_override$NWE
Alerta Activado: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
ADMIN REPORT OPTIONS:
Realtime Block Usuario Info: $NWB#vicidial_users-realtime_block_user_info$NWE
OPCIONES DE INTERFAZ DEL ADMIN:
Informes de exportación: $NWB#vicidial_users-export_reports$NWE
Eliminar de las listas de DNC: $NWB#vicidial_users-delete_from_dnc$NWE
Custom Fields Modify: $NWB#vicidial_users-custom_fields_modify$NWE
Modifique Las Campañas: $NWB#vicidial_users-modify_sections$NWE
Detalle de la campaña: $NWB#vicidial_users-campaign_detail$NWE
La cancelación hace campaña: $NWB#vicidial_users-delete_campaigns$NWE
Modifique El Tiempo De la Llamadas: $NWB#vicidial_users-modify_call_times$NWE
BorrarTiempos De la Llamada: $NWB#vicidial_users-delete_call_times$NWE
Modifique Los Servidores: $NWB#vicidial_users-modify_sections$NWE
CallCard Access: $NWB#vicidial_users-modify_sections$NWE
Agente de acceso a la API:$NWB#vicidial_users-vdc_agent_api_access$NWE
AñadirReloj de tiempo Registrarse Registro: $NWB#vicidial_users-add_timeclock_log$NWE
Gerente de Turno observancia Sobrescribir: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
\n"; if ($LOGdelete_users > 0) @@ -15919,7 +17991,7 @@ if ($ADD==31) $enable_vtiger_integration_LU = $row[0]; $vtiger_url_LU = $row[1]; - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_name = $row[1]; @@ -16060,6 +18132,28 @@ if ($ADD==31) $xferconf_c_number = $row[139]; $xferconf_d_number = $row[140]; $xferconf_e_number = $row[141]; + $use_custom_cid = $row[142]; + $scheduled_callbacks_alert = $row[143]; + $queuemetrics_callstatus = $row[144]; + $extension_appended_cidname = $row[145]; + $scheduled_callbacks_count = $row[146]; + $manual_dial_override = $row[147]; + $blind_monitor_warning = $row[148]; + $blind_monitor_message = $row[149]; + $blind_monitor_filename = $row[150]; + $inbound_queue_no_dial = $row[151]; + $timer_action_destination = $row[152]; + $enable_xfer_presets = $row[153]; + $hide_xfer_number_to_dial = $row[154]; + $manual_dial_prefix = $row[155]; + $customer_3way_hangup_logging = $row[156]; + $customer_3way_hangup_seconds = $row[157]; + $customer_3way_hangup_action = $row[158]; + $ivr_park_call = $row[159]; + $ivr_park_call_agi = $row[160]; + $manual_preview_dial = $row[161]; + $realtime_agent_time_stats = $row[162]; + if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -16248,6 +18342,8 @@ if ($ADD==31) else {$camp_listmix_color=$campaigns_color;} if ($SUB=='20A') {$camp_survey_color=$subcamp_color;} else {$camp_survey_color=$campaigns_color;} + if ($SUB==201) {$camp_preset_color=$subcamp_color;} + else {$camp_preset_color=$campaigns_color;} echo "\n"; echo ""; echo ""; @@ -16263,6 +18359,10 @@ if ($ADD==31) echo ""; } echo ""; + if ($enable_xfer_presets == 'ENABLED') + { + echo ""; + } if ($SSqc_features_active > 0) { echo ""; @@ -16284,6 +18384,7 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "
$row[0]: Básico EncuestaPausa CódigosPresetsQC
\n"; echo "\n"; echo "\n"; @@ -16292,7 +18393,7 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; if ($SSenable_second_webform > 0) { @@ -16605,7 +18706,7 @@ if ($ADD==31) while ($DRgroups_to_print > $o) { $DRcampaigns=''; - $stmt="SELECT campaign_id from vicidial_campaigns where drop_rate_group='$DRgroups[$o]';"; + $stmt="SELECT campaign_id from vicidial_campaigns where drop_rate_group='$DRgroups[$o]' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $DRcampaigns_to_print = mysql_num_rows($rslt); $p=0; @@ -16625,7 +18726,7 @@ if ($ADD==31) } echo "$DRgroups_list$NWB#vicidial_campaigns-drop_rate_group$NWE\n"; - + echo "\n"; echo "\n"; } @@ -16643,6 +18744,8 @@ if ($ADD==31) } echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + if ($SSoutbound_autodial_active > 0) { echo "\n"; @@ -16676,10 +18781,12 @@ if ($ADD==31) {echo " LIST OVERRIDE ACTIVE";} echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; if ($SSoutbound_autodial_active > 0) { @@ -16727,6 +18844,10 @@ if ($ADD==31) } echo "\n"; + echo "\n"; + + echo "\n"; + if ($SSoutbound_autodial_active > 0) { echo "\n"; @@ -16759,6 +18880,8 @@ if ($ADD==31) echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -16789,9 +18912,13 @@ if ($ADD==31) echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; @@ -16799,10 +18926,16 @@ if ($ADD==31) { echo "\n"; } - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; if ($agent_allow_group_alias == 'Y') @@ -16857,6 +18990,15 @@ if ($ADD==31) echo "\n"; } + if ($SSenable_queuemetrics_logging > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; echo "\n"; @@ -16865,6 +19007,14 @@ if ($ADD==31) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + if ($campaign_allow_inbound == 'Y') { echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -18303,384 +20499,452 @@ if ( ($ADD==34) or ($ADD==31) ) ###################### if ($ADD==30) -{ -echo "
ID De la Campaña: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
Nombre de la Campaña: $NWB#vicidial_campaigns-campaign_name$NWE
Campaña Fecha de inicio de sesión: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Campaña Call Date: $campaign_calldate   $NWB#vicidial_campaigns-campaign_calldate$NWE
Activo: $NWB#vicidial_campaigns-active$NWE
Extensión del parking: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
Formulario Web: $NWB#vicidial_campaigns-web_form_address$NWE
Inbound Queue No Dial: $NWB#vicidial_campaigns-inbound_queue_no_dial$NWE
El Marcar Auto Del Alt-Nu'mero: $NWB#vicidial_campaigns-auto_alt_dial$NWE
Prefijo al marcar: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
Manual Prefijo al marcar: $NWB#vicidial_campaigns-manual_dial_prefix$NWE
Omita El Código Del Teléfono: $NWB#vicidial_campaigns-omit_phone_code$NWE
CallerID de la Campaña: $NWB#vicidial_campaigns-campaign_cid$NWE\n"; @@ -16653,6 +18756,8 @@ if ($ADD==31) {echo " LIST OVERRIDE ACTIVE";} echo "
Custom CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
Exten VDAD de La campaña: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_campaigns-get_call_launch$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_campaigns-get_call_launch$NWE
Mensaje del contestador automático: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y';"; @@ -16711,15 +18818,25 @@ if ($ADD==31) echo "
Transfiera -Conf El Número 5: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
Rápida transferencia Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
Enable Transfer Presets: $NWB#vicidial_campaigns-enable_xfer_presets$NWE
Hide Transfer Number to Dial: $NWB#vicidial_campaigns-hide_xfer_number_to_dial$NWE
Rápida transferencia Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
Transferencia de rellenar previamente Preset: $NWB#vicidial_campaigns-prepopulate_transfer_preset$NWE
Temporizador de Acción de: $NWB#vicidial_campaigns-timer_action$NWE
Park Call IVR: $NWB#vicidial_campaigns-ivr_park_call$NWE
Temporizador de mensaje de acción: $NWB#vicidial_campaigns-timer_action_message$NWE
Park Call IVR AGI: $NWB#vicidial_campaigns-ivr_park_call_agi$NWE
Temporizador Segundos Acción: $NWB#vicidial_campaigns-timer_action_seconds$NWE
Temporizador de Acción de: $NWB#vicidial_campaigns-timer_action$NWE
Temporizador de mensaje de acción: $NWB#vicidial_campaigns-timer_action_message$NWE
Temporizador Segundos Acción: $NWB#vicidial_campaigns-timer_action_seconds$NWE
Temporizador de Acción de Destination: $NWB#vicidial_campaigns-timer_action_destination$NWE
Servicios repetidos Programar: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
Scheduled Callbacks Alert: $NWB#vicidial_campaigns-scheduled_callbacks_alert$NWE
Scheduled Callbacks Count: $NWB#vicidial_campaigns-scheduled_callbacks_count$NWE
Segundos De la Llamada De la Gota: $NWB#vicidial_campaigns-drop_call_seconds$NWE
Campaña Stats Refresh: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
Tiempo Real Agent Time Stats: $NWB#vicidial_campaigns-realtime_agent_time_stats$NWE
Inhabilite Alteran Datos Del Cliente:$NWB#vicidial_campaigns-disable_alter_custdata$NWE
Deshabilitar Modificar Cliente Teléfono:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
Agente de pausa después de cada llamada: $NWB#vicidial_campaigns-pause_after_each_call$NWE
Manual Dial Override: $NWB#vicidial_campaigns-manual_dial_override$NWE
Identificación Manual De la Lista Del Dial:$NWB#vicidial_campaigns-manual_dial_list_id$NWE
Manual de Acceso telefónico Filtro:$NWB#vicidial_campaigns-manual_dial_filter$NWE
Manual de Acceso telefónico Filtro:$NWB#vicidial_campaigns-manual_dial_filter$NWE
Manual Preview Dial: $NWB#vicidial_campaigns-manual_preview_dial$NWE
Agente de pantalla Portapapeles Copiar: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
Agente de pantalla ampliada Alt telefónico: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
3-Vías de salida de llamadas CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
3-Vías de salida de llamadas CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
3-Vías de llamadas Prefijo telefónico: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
Customer 3-Way Hangup Logging: $NWB#vicidial_campaigns-customer_3way_hangup_logging$NWE
Customer 3-Way Hangup Seconds: $NWB#vicidial_campaigns-customer_3way_hangup_seconds$NWE
Customer 3-Way Hangup Action: $NWB#vicidial_campaigns-customer_3way_hangup_action$NWE
Grupo Alias permitidas: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
QM CallStatus Override: $NWB#vicidial_campaigns-queuemetrics_callstatus$NWE
CRM Popup Login: $NWB#vicidial_campaigns-crm_popup_login$NWE
CRM Dirección Popup: $NWB#vicidial_campaigns-crm_login_address$NWE
Dispo Call URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
Extension Append CID: $NWB#vicidial_campaigns-extension_appended_cidname$NWE
Blind Monitor Warning: $NWB#vicidial_campaigns-blind_monitor_warning$NWE
Blind Monitor Notice: $NWB#vicidial_campaigns-blind_monitor_message$NWE
Blind Monitor Filename: audio chooser $NWB#vicidial_campaigns-blind_monitor_filename$NWE
Grupos De entrada Permitidos:
"; @@ -17040,7 +19190,7 @@ if ($ADD==31) echo "\n"; echo "\n"; - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id'"; + $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -17459,11 +19609,57 @@ if ($ADD==31) } + ##### CAMPAIGN PRESETS ##### + if ($SUB==201) + { + echo "

PRESETS FOR THIS CAMPAÑA:   $NWB#vicidial_xfer_presets$NWE
\n"; + echo "
ESTADODESCRIPCIÓNSELECCIONABLERESPUESTA HUMANOSACATEGORÍAMODIFY-DELETE
\n"; + echo "\n"; + + $stmt="SELECT preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$campaign_id' order by preset_name"; + $rslt=mysql_query($stmt, $link); + $presets_to_print = mysql_num_rows($rslt); + $o=0; + while ($presets_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
PRESET NAMENÚMERODTMFPIELMODIFICARELIMINAR
$rowx[0]\n"; + echo "\n"; + echo "\n"; + echo "  ELIMINAR
\n"; + + echo "
ADD NEW PRESET
\n"; + echo "\n"; + echo "\n"; + echo "Preset Name: \n"; + echo "Preset Number:
\n"; + echo "Preset DTMF: \n"; + echo "   Hide Number: \n"; + echo "
\n"; + + echo "

\n"; + } + if ($SUB < 1) { echo "

\n"; echo "REGISTRE TODOS LOS AGENTES FUERA DE ESTA CAMPAÑA

\n"; - echo "EMERGENCY VDAC CLEAR FOR THIS CAMPAIGN

\n"; + # echo "EMERGENCY VDAC CLEAR FOR THIS CAMPAIGN

\n"; if ($LOGdelete_campaigns > 0) { @@ -17652,7 +19848,7 @@ if ($ADD==34) echo "
Campaña Fecha de inicio de sesión: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
Activo: $NWB#vicidial_campaigns-active$NWE
Extensión del parking: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
Park Music-on-Hold: $row[10] $NWB#vicidial_campaigns-park_ext$NWE
Formulario Web: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
Permitir Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
Grupo De la Transferencia Del Defecto:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
\n"; - echo ""; -echo "You do not have permission to view campaign $campaign_id\n"; -} + { + echo "
\n"; + echo ""; + echo "You do not have permission to view campaign $campaign_id\n"; + } ###################### # ADD=32 display all campaign statuses ###################### if ($ADD==32) -{ -echo "
\n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
\n"; + echo ""; -echo "
LISTADOS DE ENCARGO DE LOS ESTADOS DE LA CAMPAÑA:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
LISTADOS DE ENCARGO DE LOS ESTADOS DE LA CAMPAÑA:\n"; + echo "
CAMPAIGNNOMBRESTATUSESMODIFICAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
CAMPAIGNNOMBRESTATUSESMODIFICAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY STATUSES
\n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY STATUSES
\n"; + } ###################### # ADD=33 display all campaign hotkeys ###################### if ($ADD==33) -{ -echo "
\n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
\n"; + echo ""; -echo "
LISTADOS DE LA CAMPAÑA HOTKEYS:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
LISTADOS DE LA CAMPAÑA HOTKEYS:\n"; + echo "
CAMPAIGNNOMBREHOTKEYSMODIFICAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
CAMPAIGNNOMBREHOTKEYSMODIFICAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY HOTKEYS
\n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by hotkey"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY HOTKEYS
\n"; + } ###################### # ADD=35 display all campaign lead recycle entries ###################### if ($ADD==35) -{ -echo "
\n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
\n"; + echo ""; -echo "
EL PLOMO DE LA CAMPAÑA RECICLA LISTADOS:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
EL PLOMO DE LA CAMPAÑA RECICLA LISTADOS:\n"; + echo "
CAMPAIGNNOMBREEL PLOMO RECICLAMODIFICAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
CAMPAIGNNOMBREEL PLOMO RECICLAMODIFICAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY EL PLOMO RECICLA
\n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY EL PLOMO RECICLA
\n"; + } ###################### # ADD=36 display all campaign auto-alt dial entries ###################### if ($ADD==36) -{ -echo "
\n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
\n"; + echo ""; -echo "
LISTADOS DEL DIAL DEL PLOMO AUTO-ALT DE LA CAMPAÑA:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
LISTADOS DEL DIAL DEL PLOMO AUTO-ALT DE LA CAMPAÑA:\n"; + echo "
CAMPAIGNNOMBREAUTO-ALT DIALMODIFICAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
CAMPAIGNNOMBREAUTO-ALT DIALMODIFICAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if (strlen($row[0])<3) - {echo "NONE";} - echo "MODIFY AUTO-ALT DIAL
\n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if (strlen($row[0])<3) + {echo "NONE";} + echo "MODIFY AUTO-ALT DIAL
\n"; + } ###################### # ADD=37 display all campaign agent pause codes ###################### if ($ADD==37) -{ -echo "
\n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
\n"; + echo ""; -echo "
LISTADOS DE CÓDIGO DE LA PAUSA DEL AGENTE DE LA CAMPAÑA:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
LISTADOS DE CÓDIGO DE LA PAUSA DEL AGENTE DE LA CAMPAÑA:\n"; + echo "
CAMPAIGNNOMBRECÓDIGOS DE LA PAUSAMODIFICAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
CAMPAIGNNOMBRECÓDIGOS DE LA PAUSAMODIFICAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY CÓDIGOS DE LA PAUSA
\n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY CÓDIGOS DE LA PAUSA
\n"; + } ###################### # ADD=39 display all campaign list mixes ###################### if ($ADD==39) -{ -echo "
\n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
\n"; + echo ""; -echo "
LISTADOS DE LA MEZCLA DE LA LISTA DE LA CAMPAÑA:\n"; -echo "
\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
LISTADOS DE LA MEZCLA DE LA LISTA DE LA CAMPAÑA:\n"; + echo "
CAMPAIGNNOMBRELIST MIXMODIFICAR
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
CAMPAIGNNOMBRELIST MIXMODIFICAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NONE";} - echo "MODIFY LIST MIX
\n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY LIST MIX
\n"; + } + + +###################### +# ADD=301 display all campaign presets +###################### +if ($ADD==301) + { + echo "\n"; echo "
\n"; + echo ""; + + echo "
CAMPAIGN PRESET LISTINGS:\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $enable_xfer_presets_list[$o] = $row[2]; + $o++; + } + + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if ($enable_xfer_presets_list[$o] == 'ENABLED') + { + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + } + $o++; + } + + echo "
CAMPAIGNNOMBREPRESETSMODIFICAR
$campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT preset_name from vicidial_xfer_presets where campaign_id='$campaigns_id_list[$o]' order by preset_name;"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NONE";} + echo "MODIFY PRESETS
\n"; + } @@ -18791,7 +21055,7 @@ if ($ADD==311) echo "
Descripción De la Lista: $NWB#vicidial_lists-list_description$NWE
Campaña: \n"; + $users_output .= "\n"; + $users_output .= "\n"; + + echo "$users_output"; + + echo "\n"; + + echo "
\n"; echo ""; - $stmt="SELECT group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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 from vicidial_inbound_groups where group_id='$group_id';"; + $stmt="SELECT group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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,ignore_list_script_override,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,timer_action_destination,calculate_estimated_hold_seconds,add_lead_url,eht_minimum_prompt_filename, eht_minimum_prompt_no_block, eht_minimum_prompt_seconds from vicidial_inbound_groups where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[1]; @@ -19333,6 +21607,62 @@ if ($ADD==3111) $xferconf_c_number = $row[65]; $xferconf_d_number = $row[66]; $xferconf_e_number = $row[67]; + $ignore_list_script_override = $row[68]; + $extension_appended_cidname = $row[69]; + $uniqueid_status_display = $row[70]; + $uniqueid_status_prefix = $row[71]; + $hold_time_option_minimum = $row[72]; + $hold_time_option_press_filename = $row[73]; + $hold_time_option_callmenu = $row[74]; + $onhold_prompt_no_block = $row[75]; + $onhold_prompt_seconds = $row[76]; + $hold_time_option_no_block = $row[77]; + $hold_time_option_prompt_seconds = $row[78]; + $hold_time_second_option = $row[79]; + $hold_time_third_option = $row[80]; + $wait_hold_option_priority = $row[81]; + $wait_time_option = $row[82]; + $wait_time_second_option = $row[83]; + $wait_time_third_option = $row[84]; + $wait_time_option_seconds = $row[85]; + $wait_time_option_exten = $row[86]; + $wait_time_option_voicemail = $row[87]; + $wait_time_option_xfer_group = $row[88]; + $wait_time_option_callmenu = $row[89]; + $wait_time_option_callback_filename = $row[90]; + $wait_time_option_callback_list_id = $row[91]; + $wait_time_option_press_filename = $row[92]; + $wait_time_option_no_block = $row[93]; + $wait_time_option_prompt_seconds = $row[94]; + $timer_action_destination = $row[95]; + $calculate_estimated_hold_seconds = $row[96]; + $add_lead_url = $row[97]; + $eht_minimum_prompt_filename = $row[98]; + $eht_minimum_prompt_no_block = $row[99]; + $eht_minimum_prompt_seconds = $row[100]; + + + ##### get callmenu listings for dynamic pulldown + $stmt="SELECT menu_id,menu_name from vicidial_call_menu order by menu_id"; + $rslt=mysql_query($stmt, $link); + $Xmenus_to_print = mysql_num_rows($rslt); + $o=0; + $Xmenuslist=''; + while ($Xmenus_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xmenuslist .= "\n"; + $o++; + } + if ($Xmenus_selected < 1) + {$Xmenuslist .= "\n";} + ##### get in-groups listings for dynamic pulldown $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; @@ -19417,6 +21747,8 @@ if ($ADD==3111) echo "
MODIFICAR UN REGISTRO DE LOS GRUPOS: $row[0]
\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "
\n"; echo "\n"; echo "\n"; @@ -19450,10 +21782,15 @@ if ($ADD==3111) echo "$scripts_list"; echo "\n"; echo "$NWB#vicidial_inbound_groups-ingroup_script$NWE\n"; - $eswHTML=''; + + echo "\n"; + + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; @@ -19469,19 +21806,21 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -19659,6 +22058,13 @@ if ($ADD==3111) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -19767,16 +22173,17 @@ if ($ADD==3111) } echo "
ID De Grupo: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
Nombre De Grupo: $NWB#vicidial_inbound_groups-group_name$NWE
Ignore List Script Override: $NWB#vicidial_inbound_groups-ignore_list_script_override$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Consiga El Lanzamiento De la Llamada: $NWB#vicidial_inbound_groups-get_call_launch$NWE
Transfiera -Conf DTMF 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Transfiera -Conf El Número 5: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
Temporizador de Acción de: $NWB#vicidial_inbound_groups-timer_action$NWE
Temporizador de Acción de: $NWB#vicidial_inbound_groups-timer_action$NWE
Temporizador de mensaje de acción: $NWB#vicidial_inbound_groups-timer_action_message$NWE
Temporizador Segundos Acción: $NWB#vicidial_inbound_groups-timer_action_seconds$NWE
Temporizador de Acción de Destination: $NWB#vicidial_inbound_groups-timer_action_destination$NWE
Segundos De la Llamada De la Gota: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
Caída de Acción:$NWB#vicidial_inbound_groups-drop_action$NWE
Gota Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
Buzón de Voz: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
Buzón de Voz: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
Grupo de Transferencia de caída:
Después De la Acción De las Horas:$NWB#vicidial_inbound_groups-after_hours_action$NWE
Después De Nombre de fichero Del Mensaje De las Horas: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Después De Nombre de fichero Del Mensaje De las Horas: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
Después De la Extensión De las Horas:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
Después De las Horas Buzón de Voz: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Después De las Horas Buzón de Voz: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
Horas después de la transferencia del Grupo:
Nombre de fichero Agradable Del Mensaje: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
Nombre de fichero Agradable Del Mensaje: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
Reproducir Mensaje de Bienvenida:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
Música En Contexto Del Asimiento: moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
Música En Contexto Del Asimiento: moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
En Nombre de fichero Del Aviso Del Asimiento: audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
En Nombre de fichero Del Aviso Del Asimiento: audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
En Intervalo Del Aviso Del Asimiento:$NWB#vicidial_inbound_groups-prompt_interval$NWE
On Hold Prompt No Block: $NWB#vicidial_inbound_groups-onhold_prompt_no_block$NWE
On Hold Prompt Seconds: $NWB#vicidial_inbound_groups-onhold_prompt_seconds$NWE
Lugar jugar en línea:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
Juega Mantenga Tiempo estimado:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
Mantenga la opción Hora:$NWB#vicidial_inbound_groups-hold_time_option$NWE
Calculate Estimated Hold Seconds: $NWB#vicidial_inbound_groups-calculate_estimated_hold_seconds$NWE
Estimated Hold Time Minimum Filename: audio chooser $NWB#vicidial_inbound_groups-eht_minimum_prompt_filename$NWE
Estimated Hold Time Minimum Prompt No Block: $NWB#vicidial_inbound_groups-eht_minimum_prompt_no_block$NWE
Estimated Hold Time Minimum Prompt Seconds: $NWB#vicidial_inbound_groups-eht_minimum_prompt_seconds$NWE
Wait Time Opción: $NWB#vicidial_inbound_groups-wait_time_option$NWE
Wait Time Second Opción: $NWB#vicidial_inbound_groups-wait_time_second_option$NWE
Wait Time Third Opción: $NWB#vicidial_inbound_groups-wait_time_third_option$NWE
Wait Time Opción Seconds: $NWB#vicidial_inbound_groups-wait_time_option_seconds$NWE
Wait Time Opción Extensión:$NWB#vicidial_inbound_groups-wait_time_option_exten$NWE
Wait Time Opción Callmenu: $NWB#vicidial_inbound_groups-wait_time_option_callmenu$NWE
Wait Time Opción Buzón de Voz: voicemail chooser $NWB#vicidial_inbound_groups-wait_time_option_voicemail$NWE
Wait Time Opción Transfer In-Grupo: $NWB#vicidial_inbound_groups-wait_time_option_xfer_group$NWE
Wait Time Opción Press Filename: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_press_filename$NWE
Wait Time Opción Press No Block: $NWB#vicidial_inbound_groups-wait_time_option_no_block$NWE
Wait Time Opción Press Filename Seconds: $NWB#vicidial_inbound_groups-wait_time_option_prompt_seconds$NWE
Wait Time Opción After Press Filename: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_callback_filename$NWE
Wait Time Opción Callback ID De la Lista: $NWB#vicidial_inbound_groups-wait_time_option_callback_list_id$NWE
Wait Hold Opción Priority: $NWB#vicidial_inbound_groups-wait_hold_option_priority$NWE
Estimated Mantenga la opción Hora:$NWB#vicidial_inbound_groups-hold_time_option$NWE
Hold Time Second Opción: $NWB#vicidial_inbound_groups-hold_time_second_option$NWE
Hold Time Third Opción: $NWB#vicidial_inbound_groups-hold_time_third_option$NWE
Mantenga la opción Segundos Hora:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
Hold Time Opción Minimum: $NWB#vicidial_inbound_groups-hold_time_option_minimum$NWE
Mantenga Tiempo Opción Extensión:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
Mantenga la opción Tiempo de voz: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
Hold Time Opción Callmenu: $NWB#vicidial_inbound_groups-hold_time_option_callmenu$NWE
Mantenga la opción Tiempo de voz: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
Opción de Transferencia de celebrar Tiempo-Grupo A:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
Mantenga la opción Tiempo de llamada de archivo: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
Hold Time Opción Press Filename: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_press_filename$NWE
Hold Time Opción Press No Block: $NWB#vicidial_inbound_groups-hold_time_option_no_block$NWE
Hold Time Opción Press Filename Seconds: $NWB#vicidial_inbound_groups-hold_time_option_prompt_seconds$NWE
Hold Time Opción After Press Filename: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
Mantenga la opción Tiempo de llamada Lista ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
Agente de Alerta Nombre de archivo: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
Agente de Alerta Nombre de archivo: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
La Alarma Del Agente Retrasa:$NWB#vicidial_inbound_groups-agent_alert_delay$NWE
Dispo Call URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
Add Lead URL: $NWB#vicidial_inbound_groups-add_lead_url$NWE
Extension Append CID: $NWB#vicidial_inbound_groups-extension_appended_cidname$NWE
Uniqueid Status Exponer: $NWB#vicidial_inbound_groups-uniqueid_status_display$NWE
Uniqueid Status Prefix: $NWB#vicidial_inbound_groups-uniqueid_status_prefix$NWE
\n"; - echo "

\n"; + echo "


\n"; ### list of agent rank or skill-level for this inbound group + # ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ echo "
\n"; echo "
AGENTE RANKS FOR THIS Entrantes GROUP:
\n"; - echo "\n"; - echo "\n"; + echo "
USER     RANK     CALLS TODAY
\n"; + echo "\n"; - $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;"; + $stmt="SELECT user,full_name,closer_campaigns from vicidial_users where active='Y';"; $rsltx=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rsltx); @@ -19786,20 +22193,181 @@ if ($ADD==3111) $rowx=mysql_fetch_row($rsltx); $o++; + $ARIG_user[$o] = $rowx[0]; + $ARIG_name[$o] = $rowx[1]; + $ARIG_close[$o] = $rowx[2]; + $ARIG_check[$o] = ''; + if (preg_match("/ $group_id /",$ARIG_close[$o])) + {$ARIG_check[$o] = ' CHECKED';} + } + + $o=0; + $ARIG_changenotes=''; + $stmtDlog=''; + while ($users_to_print > $o) + { + $o++; + $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where group_id='$group_id' and user='$ARIG_user[$o]';"; + $rsltx=mysql_query($stmt, $link); + $viga_to_print = mysql_num_rows($rsltx); + if ($viga_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $ARIG_rank[$o] = $rowx[0]; + $ARIG_calls[$o] = $rowx[1]; + } + else + { + $stmtD="INSERT INTO vicidial_inbound_group_agents set calls_today='0',group_rank='0',group_weight='0',user='$ARIG_user[$o]',group_id='$group_id';"; + $rslt=mysql_query($stmtD, $link); + if ($DB > 0) {echo "|$stmtD|";} + $stmtDlog .= "$stmtD|"; + $ARIG_changenotes .= "added missing user to viga table $ARIG_user[$o]|"; + $ARIG_rank[$o] = '0'; + $ARIG_calls[$o] = '0'; + } + } + if (strlen($ARIG_changenotes) > 10) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtDlog|"; + $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='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='USER INGROUP VIGA ADD', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + + if ($stage=='ENVIAR') + { + $o=0; + while ($users_to_print > $o) + { + $o++; + + $ARIG_checked=''; + $ARIG_ranked=''; + + $checkbox_field="CHECK_$ARIG_user[$o]$US$group_id"; + $rank_field="RANK_$ARIG_user[$o]$US$group_id"; + + if (isset($_GET["$checkbox_field"])) {$ARIG_checked=$_GET["$checkbox_field"];} + elseif (isset($_POST["$checkbox_field"])) {$ARIG_checked=$_POST["$checkbox_field"];} + if (isset($_GET["$rank_field"])) {$ARIG_ranked=$_GET["$rank_field"];} + elseif (isset($_POST["$rank_field"])) {$ARIG_ranked=$_POST["$rank_field"];} + $ARIG_checked = ereg_replace("[^A-Z]","",$ARIG_checked); + $ARIG_ranked = ereg_replace("[^-0-9]","",$ARIG_ranked); + + $stmtA=''; + $stmtB=''; + $stmtC=''; + $ARIG_updated=0; + $ARIG_changenotes=''; + if ( ($ARIG_check[$o]=='') and ($ARIG_checked=='YES') ) + { + if (strlen($ARIG_close[$o]) < 4) {$ARIG_close[$o]=' - ';} + $stmtA="UPDATE vicidial_users set closer_campaigns=' $group_id$ARIG_close[$o]' where user='$ARIG_user[$o]';"; + $rslt=mysql_query($stmtA, $link); + if ($DB > 0) {echo "|$stmtA|";} + $ARIG_updated++; + $ARIG_changenotes .= "added $group_id to selected in-groups|"; + } + if ( ($ARIG_check[$o]==' CHECKED') and ($ARIG_checked=='') ) + { + $ARIG_close[$o] = preg_replace("/ $group_id /",' ',$ARIG_close[$o]); + $stmtB="UPDATE vicidial_users set closer_campaigns='$ARIG_close[$o]' where user='$ARIG_user[$o]';"; + $rslt=mysql_query($stmtB, $link); + if ($DB > 0) {echo "|$stmtB|";} + $ARIG_updated++; + $ARIG_changenotes .= "removed $group_id from selected in-groups|"; + } + if ( ($ARIG_ranked < $ARIG_rank[$o]) or ($ARIG_ranked > $ARIG_rank[$o]) ) + { + $stmtC="UPDATE vicidial_inbound_group_agents set group_rank='$ARIG_ranked',group_weight='$ARIG_ranked' where user='$ARIG_user[$o]' and group_id='$group_id';"; + $rslt=mysql_query($stmtC, $link); + if ($DB > 0) {echo "|$stmtC|";} + $ARIG_updated++; + $ARIG_changenotes .= "changed rank from $ARIG_rank[$o] to $ARIG_ranked|"; + } + if ($ARIG_updated > 0) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|$stmtB|$stmtC|"; + $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='USUARIOS', event_type='MODIFY', record_id='$ARIG_user[$o]', event_code='USER INGROUP SETTINGS', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + + $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;"; + $rsltx=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + $ARIG_user[$o] = $rowx[0]; + $ARIG_rank[$o] = $rowx[1]; + $ARIG_calls[$o] = $rowx[2]; + $ARIG_name[$o] = $rowx[3]; + $ARIG_close[$o] = $rowx[4]; + $ARIG_check[$o] = ''; + if (preg_match("/ $group_id /",$ARIG_close[$o])) + {$ARIG_check[$o] = ' CHECKED';} + } + } + + $checkbox_count=0; + $o=0; + while ($users_to_print > $o) + { + $o++; + if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; - } + $checkbox_field="CHECK_$ARIG_user[$o]$US$group_id"; + $rank_field="RANK_$ARIG_user[$o]$US$group_id"; + $checkbox_list .= "|$checkbox_field"; + $checkbox_count++; - echo "
USERSELECTED     RANK     CALLS TODAY
$rowx[0] - $rowx[3]$rowx[1]$rowx[2]

\n"; + $users_output .= "
$ARIG_user[$o] - $ARIG_name[$o]   select all  

\n"; echo "

\n"; echo "Haga clic aquí para ver un informe de este grupo entrante

\n"; + echo "Click here to see agents logged in to this inbound group

\n"; + echo "
\n"; echo "DIDS USING THIS IN-GROUP:
\n"; @@ -19835,7 +22403,7 @@ if ($ADD==3111) echo "CAMPAÑAS QUE PERMITA EN ESTE GRUPO:
\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\";"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campin_to_print = mysql_num_rows($rslt); $o=0; @@ -19850,7 +22418,7 @@ if ($ADD==3111) if ($LOGdelete_ingroups > 0) { - echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; + # echo "

EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

\n"; echo "

SUPRIMA A ESTE EN-GRUPO\n"; } if ($LOGuser_level >= 9) @@ -19881,7 +22449,7 @@ if ($ADD==3311) $didSQL = "did_id='$did_id'"; if ( (strlen($did_id)<1) and (strlen($did_pattern)>0) ) {$didSQL = "did_pattern='$did_pattern'";} - $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id from vicidial_inbound_dids where $didSQL;"; + $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number from vicidial_inbound_dids where $didSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -19905,9 +22473,30 @@ if ($ADD==3311) $campaign_id = $row[17]; $phone_code = $row[18]; $menu_id = $row[19]; + $record_call = $row[20]; + $filter_inbound_number = $row[21]; + $filter_phone_group_id = $row[22]; + $filter_url = $row[23]; + $filter_action = $row[24]; + $filter_extension = $row[25]; + $filter_exten_context = $row[26]; + $filter_voicemail_ext = $row[27]; + $filter_phone = $row[28]; + $filter_server_ip = $row[29]; + $filter_user = $row[30]; + $filter_user_unavailable_action = $row[31]; + $filter_user_route_settings_ingroup = $row[32]; + $filter_group_id = $row[33]; + $filter_call_handle_method = $row[34]; + $filter_agent_search_method = $row[35]; + $filter_list_id = $row[36]; + $filter_campaign_id = $row[37]; + $filter_phone_code = $row[38]; + $filter_menu_id = $row[39]; + $filter_clean_cid_number = $row[40]; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -19925,23 +22514,36 @@ if ($ADD==3311) $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; $Xgroups_selected=0; + $FXgroups_menu=''; + $FXgroups_selected=0; $o=0; while ($Xgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Xgroups_menu .= "\n"; + $FXgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $o++; } if ($Xgroups_selected < 1) {$Xgroups_menu .= "\n";} else {$Xgroups_menu .= "\n";} + if ($FXgroups_selected < 1) + {$FXgroups_menu .= "\n";} + else + {$FXgroups_menu .= "\n";} ##### get in-groups listings for dynamic pulldown @@ -19950,23 +22552,36 @@ if ($ADD==3311) $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; $Dgroups_selected=0; + $FDgroups_menu=''; + $FDgroups_selected=0; $o=0; while ($Dgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Dgroups_menu .= "\n"; + $FDgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $o++; } if ($Dgroups_selected < 1) {$Dgroups_menu .= "\n";} else {$Dgroups_menu .= "\n";} + if ($FDgroups_selected < 1) + {$FDgroups_menu .= "\n";} + else + {$FDgroups_menu .= "\n";} echo "
MODIFICAR UN REGISTRO DID:$row[0]\n"; @@ -19977,6 +22592,7 @@ if ($ADD==3311) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -19986,7 +22602,7 @@ if ($ADD==3311) echo "\n"; echo "$NWB#vicidial_inbound_dids-server_ip$NWE\n"; - $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu;"; + $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu order by menu_id;"; $rslt=mysql_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); $menu_list=''; @@ -20017,11 +22633,67 @@ if ($ADD==3311) echo "$NWB#vicidial_inbound_dids-campaign_id$NWE\n"; echo "\n"; + + echo "\n"; + + echo "\n"; + + $stmt="select filter_phone_group_id,filter_phone_group_name from vicidial_filter_phone_groups order by filter_phone_group_id;"; + $rslt=mysql_query($stmt, $link); + $Fgroups_to_print = mysql_num_rows($rslt); + $Fgroups_list=''; + $i=0; + while ($i < $Fgroups_to_print) + { + $row=mysql_fetch_row($rslt); + $Fgroups_list .= ""; + $i++; + } + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + + + + echo "\n"; echo "
DID Descripción:$NWB#vicidial_inbound_dids-did_description$NWE
Activo: $NWB#vicidial_inbound_dids-did_active$NWE
DID Ruta:$NWB#vicidial_inbound_dids-did_route$NWE
Record Call: $NWB#vicidial_inbound_dids-record_call$NWE
Extensión:$NWB#vicidial_inbound_dids-extension$NWE
Extensión Contexto:$NWB#vicidial_inbound_dids-exten_context$NWE
Caja de voz: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
En el Grupo-Teléfono Código:$NWB#vicidial_inbound_dids-phone_code$NWE
Clean CID Number: $NWB#vicidial_inbound_dids-filter_clean_cid_number$NWE
Filter Inbound Number: $NWB#vicidial_inbound_dids-filter_inbound_number$NWE
Filter Phone ID De Grupo: $NWB#vicidial_inbound_dids-filter_phone_group_id$NWE
Filter URL: $NWB#vicidial_inbound_dids-filter_url$NWE
Filter Action: $NWB#vicidial_inbound_dids-filter_action$NWE
Filter Extensión:$NWB#vicidial_inbound_dids-extension$NWE
Filter Extensión Contexto:$NWB#vicidial_inbound_dids-exten_context$NWE
Filter Caja de voz: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
Filter Teléfono Extensión:$NWB#vicidial_inbound_dids-phone$NWE
Filter IP Del Servidor: $NWB#vicidial_inbound_dids-server_ip$NWE
Filter Llame Menú: $NWB#vicidial_inbound_dids-menu_id$NWE
Filter Agente de usuario:$NWB#vicidial_inbound_dids-user$NWE
Filter Usuario no disponible Acción:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
Filter En Configuración de usuario Ruta-Grupo:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
Filter In-ID De Grupo: $NWB#vicidial_inbound_dids-group_id$NWE
Filter En llamada de grupo Manipule Método:$NWB#vicidial_inbound_dids-call_handle_method$NWE
Filter En Grupo Agente Método de búsqueda:$NWB#vicidial_inbound_dids-agent_search_method$NWE
Filter -En la lista Grupo de Identificación:$NWB#vicidial_inbound_dids-list_id$NWE
Filter En el Grupo de Campaña-ID:$NWB#vicidial_inbound_dids-campaign_id$NWE
Filter En el Grupo-Teléfono Código:$NWB#vicidial_inbound_dids-phone_code$NWE
\n"; echo "

\n"; echo "
Haga clic aquí para ver un informe de tráfico para este DID

\n"; + echo "
Click here to see a list of recordings and calls for this DID
\n"; if ($LOGdelete_dids > 0) { @@ -20184,13 +22856,18 @@ if ($ADD==3511) if ($option_route=='INGROUP') { if (strlen($option_route_value_context) < 10) - {$option_route_value_context = 'CID,LB,998,TESTCAMP,1';} + {$option_route_value_context = 'CID,LB,998,TESTCAMP,1,,,,';} $IGoption_route_value_context = explode(",",$option_route_value_context); - $IGhandle_method = $IGoption_route_value_context[0]; - $IGsearch_method = $IGoption_route_value_context[1]; - $IGlist_id = $IGoption_route_value_context[2]; - $IGcampaign_id = $IGoption_route_value_context[3]; - $IGphone_code = $IGoption_route_value_context[4]; + $IGhandle_method = $IGoption_route_value_context[0]; + $IGsearch_method = $IGoption_route_value_context[1]; + $IGlist_id = $IGoption_route_value_context[2]; + $IGcampaign_id = $IGoption_route_value_context[3]; + $IGphone_code = $IGoption_route_value_context[4]; + $IGvid_enter_filename = $IGoption_route_value_context[5]; + $IGvid_id_number_filename = $IGoption_route_value_context[6]; + $IGvid_confirm_filename = $IGoption_route_value_context[7]; + $IGvid_validate_digits = $IGoption_route_value_context[8]; + echo ""; echo "
In-Group:"; echo ""; @@ -20198,13 +22875,17 @@ if ($ADD==3511) echo " "; echo "   Handle Method: \n"; + echo "$IGhandle_method_list $NWB#vicidial_call_menu-ingroup_settings$NWE\n"; echo "
Search Method: \n"; echo "   ID De la Lista: "; echo "
ID De la Campaña: \n"; echo "   Phone Code: "; + echo "
  VID Enter Filename: audio chooser"; + echo "
  VID ID Number Filename: audio chooser"; + echo "
  VID Confirm Filename: audio chooser"; + echo "   VID Digits: "; } if ($option_route=='DID') { @@ -20358,7 +23039,7 @@ if ($ADD==31111) echo "
\n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns,extension_group from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $remote_agent_id = $row[0]; @@ -20368,18 +23049,37 @@ if ($ADD==31111) $conf_exten = $row[4]; $status = $row[5]; $campaign_id = $row[6]; + $extension_group = $row[8]; + + ##### get extension group listing for dynamic pulldown + $stmt="SELECT extension_group_id,count(*) from vicidial_extension_groups group by extension_group_id order by extension_group_id;"; + $rsltx=mysql_query($stmt, $link); + $extengrp_to_print = mysql_num_rows($rsltx); + $extengrp_list=''; + $o=0; + while ($extengrp_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $extengrp_list .= "\n"; + $o++; + } echo "
MODIFICAR UNA ENTRADA DE LOS AGENTES REMOTOS: $row[0]
\n"; echo "\n"; echo "\n"; echo "
\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
Comienzo Del ID del usuario: (Solamente números, incremented)$NWB#vicidial_remote_agents-user_start$NWE
Comienzo Del ID del usuario: (Solamente números, incremented, must be an existing vicidial user)$NWB#vicidial_remote_agents-user_start$NWE
Número de líneas: (Solamente números)$NWB#vicidial_remote_agents-number_of_lines$NWE
IP Del Servidor: $NWB#vicidial_remote_agents-server_ip$NWE
Extensión Externa: (número del dial plan para alcanzar agentes)$NWB#vicidial_remote_agents-conf_exten$NWE
Extension Grupo: $NWB#vicidial_remote_agents-extension_group$NWE
Estado: $NWB#vicidial_remote_agents-status$NWE
Campaña:
\n"; + echo ""; + + $stmt="SELECT filter_phone_group_id,filter_phone_group_name,filter_phone_group_description from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $filter_phone_group_id = $row[0]; + $filter_phone_group_name = $row[1]; + $filter_phone_group_description = $row[2]; + + echo "
Modifique El Filtro Phone Grupo: $filter_phone_group_id\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Filter Phone ID De Grupo: $filter_phone_group_id $NWB#vicidial_filter_phone_groups-user_start$NWE
Filter Phone Nombre De Grupo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
Filter Phone Group Descripción: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
\n"; + + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + echo "

Numbers in this Filter Phone Grupo: $row[0]"; + + if ($LOGdelete_dids > 0) + { + echo "

SUPRIMA ESTE FILTRO PHONE GROUP\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Click here to download the numbers in this filter phone group
\n"; + + echo "

Haga clic aquí para ver chages al administrador de este filtro phone group\n"; + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + +###################### +# ADD=32111 modify extension group entry in the system +###################### + +if ($ADD==32111) + { + if ($LOGmodify_remoteagents==1) + { + echo "
\n"; + echo ""; + + $stmt="SELECT extension_id,extension_group_id,extension,rank,campaign_groups,call_count_today,last_call_time,last_callerid from vicidial_extension_groups where extension_id='$extension_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + $extension_group_id = $row[1]; + $extension = $row[2]; + $rank = $row[3]; + $campaign_groups = $row[4]; + $call_count_today = $row[5]; + $last_call_time = $row[6]; + $last_callerid = $row[7]; + + echo "
MODIFY AN EXTENSION GROUP ENTRY: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
Extension Grupo: (no spaces)$NWB#vicidial_extension_groups-extension_group_id$NWE
Extensión: (Solamente números)$NWB#vicidial_extension_groups-extension$NWE
Rango: $NWB#vicidial_extension_groups-rank$NWE
Campañas Groups: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
Call Count Today: $call_count_today
Last Tiempo De la Llamada:$last_call_time
Last Call ID: $last_callerid
\n"; + + if ($LOGdelete_remote_agents > 0) + { + echo "

DELETE THIS EXTENSION GROUP ENTRY\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Click here to see Admin chages to this extension group entry
\n"; + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; + } + } + + ###################### # ADD=311111 modify user group info in the system ###################### @@ -20421,16 +23243,28 @@ if ($ADD==311111) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if (strlen($SSwebphone_url) > 5) + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } + else + { + echo " "; + echo " "; + echo " "; + } + if ($SSqc_features_active > 0) { echo "
\n"; echo ""; - $stmt="SELECT user_group,group_name,allowed_campaigns,qc_allowed_campaigns,qc_allowed_inbound_groups,group_shifts,forced_timeclock_login,shift_enforcement,agent_status_viewable_groups,agent_status_view_time from vicidial_user_groups where user_group='$user_group';"; + $stmt="SELECT user_group,group_name,allowed_campaigns,qc_allowed_campaigns,qc_allowed_inbound_groups,group_shifts,forced_timeclock_login,shift_enforcement,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial,agent_fullscreen,allowed_reports,webphone_url_override,webphone_systemkey_override,webphone_dialpad_override from vicidial_user_groups where user_group='$user_group';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; - $GROUP_shifts = $row[5]; - $forced_timeclock_login = $row[6]; - $shift_enforcement = $row[7]; - $VGROUP_vgroups = $row[8]; - $agent_status_view_time = $row[9]; + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + $VGROUP_vgroups = $row[8]; + $agent_status_view_time = $row[9]; + $agent_call_log_view = $row[10]; + $agent_xfer_consultative = $row[11]; + $agent_xfer_dial_override = $row[12]; + $agent_xfer_vm_transfer = $row[13]; + $agent_xfer_blind_transfer = $row[14]; + $agent_xfer_dial_with_customer = $row[15]; + $agent_xfer_park_customer_dial = $row[16]; + $agent_fullscreen = $row[17]; + $allowed_reports = $row[18]; + $webphone_url_override = $row[19]; + $webphone_systemkey_override = $row[20]; + $webphone_dialpad_override = $row[21]; echo ""; @@ -20485,6 +23319,10 @@ if ($ADD==311111) if (ereg(" --CAMPAIGN-AGENTS-- ", $VGROUP_vgroups)) {echo " CHECKED";} echo ">CAMPAIGN-AGENTS - All users logged into the same campaign as the agent
\n"; + echo "NOT-LOGGED-IN-AGENTS - All users in the system, even not logged-in users
\n"; $stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group"; $rslt=mysql_query($stmt, $link); @@ -20512,6 +23350,52 @@ if ($ADD==311111) echo "
Ver estado del agente de turno: $NWB#vicidial_user_groups-agent_status_view_time$NWE
Agent Call Log View: $NWB#vicidial_user_groups-agent_call_log_view$NWE
Agent Allow Consultative Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
Agent Allow Dial Override Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
Agent Allow Buzón de Voz Message Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
Agent Allow Blind Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
Agent Allow Dial With Customer Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
Agent Allow Park Customer Dial Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
Agent Fullscreen: $NWB#vicidial_user_groups-agent_fullscreen$NWE
Allowed Informes: $NWB#vicidial_user_groups-allowed_reports$NWE
Webphone URL Override: $NWB#vicidial_user_groups-webphone_url_override$NWE
Webphone System Key Override: $NWB#vicidial_user_groups-webphone_systemkey_override$NWE
Webphone Dialpad Override: $NWB#vicidial_user_groups-webphone_dialpad_override$NWE
CC permitidas Campañas:
$NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
\n"; @@ -20671,6 +23555,14 @@ if ($ADD==3111111) echo ""; echo ""; echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo ""; echo "
"; # END Insert Field @@ -20684,7 +23576,7 @@ if ($ADD==3111111) echo " CAMPAÑAS USING THIS SCRIPT:
\n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20714,7 +23606,7 @@ if ($ADD==3111111) echo " LIST OVERRIDES USING THIS SCRIPT:
\n"; echo "
\n"; - $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id';"; + $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20776,7 +23668,7 @@ if ($ADD==31111111) echo "
\n"; ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -20817,7 +23709,7 @@ if ($ADD==31111111) ###################### -# ADD=321111111 modify call time definition info in the system +# ADD=321111111 modify call time definition info in the system, ADD/REMOVE ###################### if ($ADD==321111111) @@ -20872,7 +23764,7 @@ if ($ADD==311111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; $ct_srs=1; @@ -20931,7 +23831,7 @@ if ($ADD==311111111) $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - echo "\n"; + echo "\n"; $srs_SQL .= "'$state_rules[$b]',"; $srs_state_SQL .= "'$row[0]',"; } @@ -20970,7 +23870,7 @@ if ($ADD==311111111) echo "CAMPAÑAS USANDO ESTE TIEMPO DE LA LLAMADA:
\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 from vicidial_call_times where call_time_id='$call_time_id';"; + $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 from vicidial_call_times where call_time_id='$call_time_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $call_time_name = $row[1]; @@ -20894,6 +23786,14 @@ if ($ADD==311111111) $ct_saturday_start = $row[17]; $ct_saturday_stop = $row[18]; $ct_state_call_times = $row[19]; + $default_afterhours_filename_override = $row[20]; + $sunday_afterhours_filename_override = $row[21]; + $monday_afterhours_filename_override = $row[22]; + $tuesday_afterhours_filename_override = $row[23]; + $wednesday_afterhours_filename_override = $row[24]; + $thursday_afterhours_filename_override = $row[25]; + $friday_afterhours_filename_override = $row[26]; + $saturday_afterhours_filename_override = $row[27]; echo ""; @@ -20904,14 +23804,14 @@ if ($ADD==311111111) echo "
Identificación Del Tiempo De la Llamada: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
Nombre Del Tiempo De la Llamada: (descripción corta del tiempo de la llamada)$NWB#vicidial_call_times-call_time_name$NWE
Comentarios Del Tiempo De la Llamada: $NWB#vicidial_call_times-call_time_comments$NWE
Comienzo Del Defecto: Parada Del Defecto: $NWB#vicidial_call_times-ct_default_start$NWE
Comienzo De Domingo: Parada De Domingo: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Lunes: Parada De Lunes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Martes: Parada De Martes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Miércoles: Parada De Miércoles: $NWB#vicidial_call_times-ct_sunday_start$NWE
Jueves Start: Parada De Jueves: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Viernes: Parada De Viernes: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo De Sábado: Parada De Sábado: $NWB#vicidial_call_times-ct_sunday_start$NWE
Comienzo Del Defecto: Parada Del Defecto: $NWB#vicidial_call_times-ct_default_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Comienzo De Domingo: Parada De Domingo: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Comienzo De Lunes: Parada De Lunes: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Comienzo De Martes: Parada De Martes: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Comienzo De Miércoles: Parada De Miércoles: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Jueves Start: Parada De Jueves: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Comienzo De Viernes: Parada De Viernes: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
Comienzo De Sábado: Parada De Sábado: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
$state_rules[$b] - REMOVE $row[0] - $row[1]
$state_rules[$b] - REMOVE $row[0] - $row[1]
\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21223,7 +24123,7 @@ if ($ADD==31111111111) echo "
\n"; echo "\n"; @@ -21984,13 +24897,14 @@ if ($ADD==351111111111) echo "
\n"; echo ""; - $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email from phones where extension='$extension' and server_ip='$server_ip';"; + $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email,is_webphone,use_external_server_ip,codecs_list,codecs_with_template,webphone_dialpad from phones where extension='$extension' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21231,6 +24131,9 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; echo "\n"; echo "\n"; @@ -21243,8 +24146,12 @@ if ($ADD==31111111111) echo "$servers_list"; echo "\n"; echo "$NWB#phones-server_ip$NWE\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21273,11 +24180,12 @@ if ($ADD==31111111111) 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"; @@ -21332,10 +24240,16 @@ if ($ADD==31111111111) echo "

Pinchar aquí­ para ver las estadísticas del teléfono\n"; + echo "

Click here for phone call recordings\n"; + if ($LOGast_delete_phones > 0) { echo "

SUPRIMA ESTE TELÉFONO\n"; } + if ($LOGuser_level >= 9) + { + echo "

Click here to see Admin chages to this phone\n"; + } } else { @@ -21472,7 +24386,7 @@ if ($ADD==311111111111) echo "
Extensión del teléfono: $NWB#phones-extension$NWE (Agent Screen Conexión Del Teléfono)
Número De Dial plan: (Solamente dígitos)$NWB#phones-dialplan_number$NWE
Login: $NWB#phones-login$NWE
Contraseña: $NWB#phones-pass$NWE
Login: $NWB#phones-login$NWE
Login Contraseña: $NWB#phones-pass$NWE
Registro Contraseña: $NWB#phones-conf_secret$NWE     Strength:
Set As Webphone: $NWB#phones-is_webphone$NWE
Webphone Dialpad: $NWB#phones-webphone_dialpad$NWE
Use External IP Del Servidor: $NWB#phones-use_external_server_ip$NWE
Estado: $NWB#phones-status$NWE
Cuenta Activa: $NWB#phones-active$NWE
Tipo Del Teléfono: $NWB#phones-phone_type$NWE
Exten de VmaiDumpl: $NWB#phones-voicemail_dump_exten$NWE
Contexto De Exten: $NWB#phones-ext_context$NWE
Teléfono Contexto: $NWB#phones-phone_context$NWE
Conf. Archivo Secreto: $NWB#phones-conf_secret$NWE
Allowed Codecs: $NWB#phones-codecs_list$NWE
Allowed Codecs With Template: $NWB#phones-codecs_with_template$NWE
Canal de envío del DTMF: $NWB#phones-dtmf_send_extension$NWE
Grupo de las llamadas de salida: $NWB#phones-call_out_number_group$NWE
Localización del Navegador: $NWB#phones-client_browser$NWE
Directorio de instalación: $NWB#phones-install_directory$NWE
URL del CallerID: $NWB#phones-local_web_callerID_URL$NWE
URL por defecto de VICIDIAL: $NWB#phones-VICIDIAL_web_URL$NWE
Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21555,8 +24471,9 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21565,6 +24482,16 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; + if ($SSallow_custom_dialplan > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + + echo "\n"; echo "
\n"; echo ""; - $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,local_gmt,voicemail_dump_exten,answer_transfer_agent,ext_context,sys_perf_log,vd_server_logs,agi_output,vicidial_balance_active,balance_trunks_offlimits,recording_web_link,alt_server_ip,active_asterisk_server,generate_vicidial_conf,rebuild_conf_files,outbound_calls_per_second,sysload,channels_total,cpu_idle_percent,disk_usage,sounds_update,vicidial_recording_limit,carrier_logging_active,vicidial_balance_rank,rebuild_music_on_hold,active_agent_login_server,conf_secret from servers where server_id='$server_id' or server_ip='$server_ip';"; + $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,local_gmt,voicemail_dump_exten,answer_transfer_agent,ext_context,sys_perf_log,vd_server_logs,agi_output,vicidial_balance_active,balance_trunks_offlimits,recording_web_link,alt_server_ip,active_asterisk_server,generate_vicidial_conf,rebuild_conf_files,outbound_calls_per_second,sysload,channels_total,cpu_idle_percent,disk_usage,sounds_update,vicidial_recording_limit,carrier_logging_active,vicidial_balance_rank,rebuild_music_on_hold,active_agent_login_server,conf_secret,external_server_ip,custom_dialplan_entry from servers where server_id='$server_id' or server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $server_id = $row[0]; @@ -21514,6 +24428,8 @@ if ($ADD==311111111111) $rebuild_music_on_hold = $row[36]; $active_agent_login_server = $row[37]; $conf_secret = $row[38]; + $external_server_ip = $row[39]; + $custom_dialplan_entry = $row[40]; $cpu = (100 - $cpu_idle_percent); $disk_usage = preg_replace("/ /"," - ",$disk_usage); @@ -21546,7 +24462,7 @@ if ($ADD==311111111111) echo "
Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
Conf. Archivo Secreto: $NWB#servers-conf_secret$NWE
Conf. Archivo Secreto: $NWB#servers-conf_secret$NWE     Strength:
GMT Local: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
Extensión de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
Extensión del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
Registros Del Servidor: $NWB#servers-vd_server_logs$NWE
Salida de AGI: $NWB#servers-agi_output$NWE
Portador de registro activo: $NWB#servers-carrier_logging_active$NWE
Grabación de Enlace Web: $NWB#servers-recording_web_link$NWE
Grabación de Enlace Web: $NWB#servers-recording_web_link$NWE
Alternate Recording IP Del Servidor: $NWB#servers-alt_server_ip$NWE
External IP Del Servidor: $NWB#servers-external_server_ip$NWE
Activa del servidor de Asterisk: $NWB#servers-active_asterisk_server$NWE
Activo Server Agent: $NWB#servers-active_agent_login_server$NWE
Generar los archivos de configuración: $NWB#servers-generate_vicidial_conf$NWE
Actualización de los sonidos: $NWB#servers-sounds_update$NWE
Grabación Vicidial Límite: $NWB#servers-vicidial_recording_limit$NWE
Custom Dialplan Entrada: $NWB#servers-custom_dialplan_entry$NWE
Custom Dialplan Entrada: Disabled $NWB#servers-custom_dialplan_entry$NWE
\n"; @@ -21934,20 +24861,6 @@ if ($ADD==341111111111) echo "
Dialplan Entrada: $NWB#vicidial_server_carriers-dialplan_entry$NWE
IP Del Servidor: $NWB#vicidial_server_carriers-server_ip$NWE
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -22264,7 +25179,7 @@ if ($ADD==311111111111111) echo "
\n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts where tts_id='$tts_id';"; + $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts where tts_id='$tts_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $tts_id = $row[0]; $tts_name = $row[1]; $active = $row[2]; $tts_text = $row[3]; + $tts_voice = $row[4]; echo "
TTS MODIFICAR UN RECORD: $tts_id
\n"; echo "\n"; @@ -22000,6 +24914,7 @@ if ($ADD==351111111111) echo "
TTS ID: $tts_id
Nombre TTS: $NWB#vicidial_tts_prompts-tts_name$NWE
Activo: $NWB#vicidial_tts_prompts-active$NWE
TTS Voice: $NWB#vicidial_tts_prompts-tts_voice$NWE
TTS Texto: $NWB#vicidial_tts_prompts-tts_text$NWE
\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -22458,9 +25399,94 @@ if ($ADD==311111111111111) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if ($SSallow_custom_dialplan > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -22478,6 +25504,13 @@ if ($ADD==311111111111111) echo "\n"; echo "\n"; echo "$NWB#settings-queuemetrics_eq_prepend$NWE\n"; + echo "\n"; + echo "\n"; + echo "
\n"; echo ""; - $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform from system_settings;"; + $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -22312,6 +25227,44 @@ if ($ADD==311111111111111) $allow_custom_dialplan = $row[42]; $db_schema_update_date = $row[43]; $enable_second_webform = $row[44]; + $default_webphone = $row[45]; + $default_external_server_ip = $row[46]; + $webphone_url = $row[47]; + $enable_agc_dispo_log = $row[48]; + $custom_dialplan_entry = $row[49]; + $queuemetrics_loginout = $row[50]; + $callcard_enabled = $row[51]; + $queuemetrics_callstatus = $row[52]; + $default_codecs = $row[53]; + $admin_web_directory = $row[54]; + $label_title = $row[55]; + $label_first_name = $row[56]; + $label_middle_initial = $row[57]; + $label_last_name = $row[58]; + $label_address1 = $row[59]; + $label_address2 = $row[60]; + $label_address3 = $row[61]; + $label_city = $row[62]; + $label_state = $row[63]; + $label_province = $row[64]; + $label_postal_code = $row[65]; + $label_vendor_lead_code = $row[66]; + $label_gender = $row[67]; + $label_phone_number = $row[68]; + $label_phone_code = $row[69]; + $label_alt_phone = $row[70]; + $label_security_phrase = $row[71]; + $label_email = $row[72]; + $label_comments = $row[73]; + $custom_fields_enabled = $row[74]; + $slave_db_server = $row[75]; + $reports_use_slave_db = $row[76]; + $webphone_systemkey = $row[77]; + $first_login_trigger = $row[78]; + $default_phone_registration_password = $row[79]; + $default_phone_login_password = $row[80]; + $default_server_password = $row[81]; + echo "
MODIFIQUE LOS AJUSTES DEL SISTEMA DE VICIDIAL\n"; echo "\n"; @@ -22334,6 +25287,7 @@ if ($ADD==311111111111111) echo "
Permita Los Mensajes de SIPSAK: $NWB#settings-allow_sipsak_messages$NWE
URL Casero Del Admin: $NWB#settings-admin_home_url$NWE
Permita El Logfile De la Transferencia Del Agente: $NWB#settings-enable_agc_xfer_log$NWE
Enable Agent Disposition Logfile: $NWB#settings-enable_agc_dispo_log$NWE
Reloj de tiempo Fin de Día:$NWB#settings-timeclock_end_of_day$NWE
ÚltimaReloj de tiempo Auto Desconexión: $timeclock_last_reset_date
Agente de la pantalla de encabezado Formato de fecha:
Central de control de sonido activo: $NWB#settings-sounds_central_control_active$NWE
Sonidos de servidor Web: $NWB#settings-sounds_web_server$NWE
Sounds Web Directory: $sounds_web_directory $NWB#settings-sounds_web_directory$NWE
Admin Web Directory: $NWB#settings-admin_web_directory$NWE
Servidor de correo de voz activo: $NWB#settings-active_voicemail_server$NWE
Habilitar TTS Integración: $NWB#settings-enable_tts_integration$NWE
Enable CallCard: $NWB#settings-callcard_enabled$NWE
Enable Custom List Fields: $NWB#settings-custom_fields_enabled$NWE
First Login Trigger: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
Default Phone Registro Contraseña: $NWB#settings-default_phone_registration_password$NWE     Strength:
Default Conexión Del Teléfono Contraseña: $NWB#settings-default_phone_login_password$NWE     Strength:
Default Server Contraseña: $NWB#settings-default_server_password$NWE     Strength:
Slave Database Server: $NWB#settings-slave_db_server$NWE
Informes to use Slave DB: $NWB#settings-reports_use_slave_db$NWE
Custom Dialplan Entrada: $NWB#settings-custom_dialplan_entry$NWE
Custom Dialplan Entrada: Disabled $NWB#settings-custom_dialplan_entry$NWE
Label Title: $NWB#settings-default_field_labels$NWE
Label Nombre: $NWB#settings-default_field_labels$NWE
Label Inicial Media: $NWB#settings-default_field_labels$NWE
Label Apellidos: $NWB#settings-default_field_labels$NWE
Label Address1: $NWB#settings-default_field_labels$NWE
Label Address2: $NWB#settings-default_field_labels$NWE
Label Address3: $NWB#settings-default_field_labels$NWE
Label Ciudad: $NWB#settings-default_field_labels$NWE
Label State: $NWB#settings-default_field_labels$NWE
Label Provincia: $NWB#settings-default_field_labels$NWE
Label Código Postal: $NWB#settings-default_field_labels$NWE
Label Vendor Lead Code: $NWB#settings-default_field_labels$NWE
Label Sexo: $NWB#settings-default_field_labels$NWE
Label Número De Teléfono: $NWB#settings-default_field_labels$NWE
Label Phone Code: $NWB#settings-default_field_labels$NWE
Label Alt Phone: $NWB#settings-default_field_labels$NWE
Label Frase De Seguridad: $NWB#settings-default_field_labels$NWE
Label Correo electrónico:$NWB#settings-default_field_labels$NWE
Label Comentarios: $NWB#settings-default_field_labels$NWE
CC Características Activo: $NWB#settings-qc_features_active$NWE
Tire de CC Última Hora: $qc_last_pull_time
Default Codecs: $NWB#settings-default_codecs$NWE
Default Webphone: $NWB#settings-default_webphone$NWE
Default External IP Del Servidor: $NWB#settings-default_external_server_ip$NWE
Webphone URL: $NWB#settings-webphone_url$NWE
Webphone System Key: $NWB#settings-webphone_systemkey$NWE
Permita La Registración De QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
IP Del Servidor De QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
Nombre del DB De QueueMetrics: $NWB#settings-queuemetrics_dbname$NWE
QueueMetrics Login-Out: $NWB#settings-queuemetrics_loginout$NWE
QueueMetrics CallEstado: $NWB#settings-queuemetrics_callstatus$NWE
Habilitar Vtiger Integración: $NWB#settings-enable_vtiger_integration$NWE\n"; echo "   Haga clic aquí para sincronizar los usuarios con Vtiger\n"; @@ -22494,7 +25527,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

Haga clic aquí para ver chages a la administración de la configuración del sistema\n"; + echo "

Haga clic aquí para ver chages a la administración de la configuración del sistema\n"; } } else @@ -23156,7 +26189,7 @@ if ($ADD==10) echo "
\n"; echo ""; - $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -23225,7 +26258,7 @@ if ($ADD==100) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); @@ -23265,7 +26298,7 @@ if ($ADD==100) $o++; } - $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'');"; + $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'') $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $o=0; @@ -23292,7 +26325,6 @@ if ($ADD==100) } - ###################### # ADD=1000 display all inbound groups ###################### @@ -23347,7 +26379,7 @@ if ($ADD==1300) echo "\n"; echo ""; echo ""; + echo ""; echo "\n"; echo "\n"; @@ -23375,6 +26408,7 @@ if ($ADD==1300) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23442,6 +26476,69 @@ if ($ADD==1500) } +###################### +# ADD=1700 display all filter phone groups +###################### +if ($ADD==1700) + { + echo "
\n"; echo ""; - $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route from vicidial_inbound_dids order by did_pattern"; + $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,record_call from vicidial_inbound_dids order by did_pattern"; $rslt=mysql_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); @@ -23359,6 +26391,7 @@ if ($ADD==1300) echo "DESCRIPCIÓNACTIVOROUTERECMODIFICAR
$row[2] $row[3] $row[4] $row[5]MODIFICAR
\n"; + echo ""; + + $stmt="SELECT vfpg.filter_phone_group_id,filter_phone_group_name,filter_phone_group_description,count(*) as tally from vicidial_filter_phone_groups vfpg,vicidial_filter_phone_numbers vfpn where vfpg.filter_phone_group_id=vfpn.filter_phone_group_id group by filter_phone_group_id order by filter_phone_group_id"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + echo "
FILTER PHONE GROUP LISTINGS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $lists_printed = ''; + $o=0; + while ($lists_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 "\n"; + $groups_printed .= "'$row[0]',"; + $o++; + } + + $stmt="SELECT filter_phone_group_id,filter_phone_group_name,filter_phone_group_description,0 from vicidial_filter_phone_groups where filter_phone_group_id NOT IN($groups_printed'') order by filter_phone_group_id;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_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 "\n"; + $o++; + } + + echo "
FPG IDFPG NAMEDESCRIPCIÓNPHONES COUNTMODIFICAR
$row[0] $row[1] $row[2] $row[3]MODIFICAR
$row[0] $row[1] $row[2] $row[3]MODIFICAR
\n"; + } + + ###################### # ADD=10000 display all remote agents ###################### @@ -23450,7 +26547,7 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -23479,6 +26577,7 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23487,6 +26586,53 @@ if ($ADD==10000) } +###################### +# ADD=12000 display all extension group entries +###################### +if ($ADD==12000) + { + echo "
\n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id from vicidial_remote_agents order by server_ip,campaign_id,user_start"; + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,extension_group,status,campaign_id from vicidial_remote_agents $whereLOGallowed_campaignsSQL order by server_ip,campaign_id,user_start"; $rslt=mysql_query($stmt, $link); $remoteagents_to_print = mysql_num_rows($rslt); @@ -23461,6 +26558,7 @@ if ($ADD==10000) echo "LINESSERVIDOR   CONF-EXTEN   GROUP   STATUS   CAMPAIGN   MODIFICAR
$row[4] $row[5] $row[6] $row[7]MODIFICAR
\n"; + echo ""; + + $stmt="SELECT extension_id,extension_group_id,extension,rank,campaign_groups,call_count_today,last_call_time,last_callerid from vicidial_extension_groups order by extension_group_id,rank,extension"; + $rslt=mysql_query($stmt, $link); + $extensiongroups_to_print = mysql_num_rows($rslt); + + echo "
EXTENSION GROUP LISTINGS:\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($extensiongroups_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 "
GROUPEXTENSIÓNRANK   RESTRICT   COUNT   LAST CALL   LAST ID   MODIFICAR
$row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7]MODIFICAR
\n"; + } + + ###################### # ADD=100000 display all user groups ###################### @@ -24002,7 +27148,7 @@ if ($ADD==150000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo "\n"; @@ -24030,6 +27177,7 @@ if ($ADD==150000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo "\n"; $o++; @@ -24387,73 +27535,82 @@ if ($ADD==710000000000000) if ($ADD==720000000000000) { - echo "
\n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts order by tts_id"; + $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts order by tts_id"; $rslt=mysql_query($stmt, $link); $tts_to_print = mysql_num_rows($rslt); @@ -24012,6 +27158,7 @@ if ($ADD==150000000000) echo "TTS IDNombre TTSActivoTTS VoiceTTS TextoMODIFICAR
$row[0]$row[1]$row[2]$row[4]$row[3]MODIFICAR
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - echo "
ADMIN Change Log: Sección de Documentos - $category - $stage\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $logs_printed = ''; - $o=0; - while ($logs_to_print > $o) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIPCIÓNGOTO
"; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $logs_printed .= "'$row[0]',"; - $o++; + echo "
ADMIN Change Log: Sección de Documentos - $category - $stage\n"; + echo "
\n"; + echo ""; - if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} - if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} - if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} - if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} - if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} - if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} - if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} - if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} - if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} - if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} - if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} - if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} - if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} - if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} - if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} - if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} - if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} - if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} - if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "$PHP_SELF?ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "$PHP_SELF?ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "$PHP_SELF?ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "$PHP_SELF?ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "$PHP_SELF?ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "$PHP_SELF?ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=311111&user_group=$row[6]";} + 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('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]";} + if (eregi('SERVER',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "$PHP_SELF?ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "$PHP_SELF?ADD=33111111111&group_alias_id=$row[6]";} + if (eregi('LEADS',$row[4])) {$record_link = "./admin_modify_lead.php?lead_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
IDDATE TIMEUSERIPSECTIONTYPERECORD IDDESCRIPCIÓNGOTO
$row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


\n"; + echo "\n"; + echo "
\n"; + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; } - echo "


\n"; - echo "\n"; - echo "\n"; } @@ -24463,53 +27620,62 @@ if ($ADD==720000000000000) if ($ADD==730000000000000) { - echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -186,12 +237,33 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; + + ### Log search + echo "
\n"; + echo "
"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo "
\n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - if ($logs_to_print > 0) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); - echo "
ADMIN Change Log: Detalle de registro - $stage

\n"; - echo "
\n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - $row[9] = eregi_replace("',","' ,",$row[9]); - echo ""; - echo ""; - echo "\n"; - echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; - echo "\n"; - echo "
\n"; + echo "
\n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + if ($logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo "
ADMIN Change Log: Detalle de registro - $stage

\n"; + echo "
\n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + $row[9] = eregi_replace("',","' ,",$row[9]); + $row[9] = preg_replace("/\|/","
",$row[9]); + echo ""; + echo ""; + echo "\n"; + echo "
ID: $row[0]
DATE TIME: $row[1]
USER: $row[2] - $row[10]
IP: $row[3]
SECTION: $row[4]
TYPE: $row[5]
RECORD ID: $row[6]
DESCRIPTION: $row[7]
NOTES: $row[8]
SQL:

$row[9]



\n"; + echo "\n"; + echo "
\n"; + } + } + else + { + echo "Usted no tiene permiso de visión esta página\n"; + exit; } } @@ -24564,54 +27730,79 @@ if ($ADD==999999)
      - Tiempo Real Informes
-
- Inbound and Outbound Calling Informes
- \n"; + echo "
\n"; + echo "      \n"; + echo "\n"; + echo "Agent Informes
\n"; + echo "
    \n"; + if ( (preg_match("/Agente Tiempo Detalle/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • Agente Tiempo Detalle\n";} + if ( (preg_match("/Agent Status Detalle/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • Agent Status Detalle\n";} + if ( (preg_match("/Agent Performance Detalle/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • Agent Performance Detalle\n";} + if ( (preg_match("/Single Agent Daily/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • Single Agent Daily\n";} + if ( (preg_match("/Estadísticas de usuario/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • Estadísticas de usuario\n";} + if ( (preg_match("/Usuario Hoja de tiempo/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • Usuario Hoja de tiempo\n";} + echo "

\n"; + echo "Time Clock Informes
\n"; + echo "
    \n"; + if ( (preg_match("/UsuarioReloj de tiempo Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • UsuarioReloj de tiempo Report\n";} + if ( (preg_match("/Grupo Del UsuarioReloj de tiempo Status Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • Grupo Del UsuarioReloj de tiempo Status Report\n";} + if ( (preg_match("/UsuarioReloj de tiempo Detalle Informe/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • UsuarioReloj de tiempo Detalle Informe\n";} + echo "

\n"; + echo "Other Informes and Links
\n"; + echo "
    \n"; + if ( (preg_match("/Server Performance Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + {echo "
  • Server Performance Report\n";} -
-       - - Agent Informes
-
- Time Clock Informes
-
- Other Informes and Links
-
    -
  • Server Perforrmance Report - = 9) + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) ) { echo "
  • Administration Change Log\n"; } @@ -24623,58 +27814,112 @@ if ($ADD==999999) { echo "
  • VtigerCRM Home\n"; } - if ($list_update_count > 0) + if ( ($list_update_count > 0) and ( (preg_match("/List Update Stats/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) ) { echo "
  • List Update Stats\n"; } - ?> -
-
- - -

-		
-		 $o)
+		if ($SScallcard_enabled > 0)
 			{
-			$cpu = (100 - $cpu_idle_percent[$o]);
-			$disk = '';
-			$disk_ary = explode('|',$disk_usage[$o]);
-			$disk_ary_ct = count($disk_ary);
-			$k=0;
-			while ($k < $disk_ary_ct)
-				{
-				$disk_ary[$k] = preg_replace("/^\d* /","",$disk_ary[$k]);
-				if ($k<1) {$disk = "$disk_ary[$k]";}
-				else
-					{
-					if ($disk_ary[$k] > $disk) {$disk = "$disk_ary[$k]";}
-					}
-				$k++;
-				}
-			$disk = "$disk%";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			echo "\n";
-			$o++;
+			if ( (preg_match("/CallCard Search/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) )
+				{echo "
  • CallCard Search\n";} } - echo "
  • SERVERDESCRIPCIÓNIPACTLOADCHANDISKSALIENTEEntrantes
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$diskLINKLINK
    \n"; + echo "\n"; + echo "
    \n"; + + if ( (file_exists('custom_report_links.html')) and ( (preg_match("/Custom Informes Links/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) ) + { + readfile('custom_report_links.html'); + } + + + if ($reports_only_user < 1) + { + echo "
    \n";
    +
    +			if ($stage == 'TIME')
    +				{
    +				echo "";
    +				echo "\n";
    +				}
    +			else
    +				{
    +				echo "";
    +				echo "\n";
    +				}
    +
    +			$o=0;
    +			while ($servers_to_print > $o)
    +				{
    +				$cpu = (100 - $cpu_idle_percent[$o]);
    +				$disk = '';
    +				$disk_ary = explode('|',$disk_usage[$o]);
    +				$disk_ary_ct = count($disk_ary);
    +				$k=0;
    +				while ($k < $disk_ary_ct)
    +					{
    +					$disk_ary[$k] = preg_replace("/^\d* /","",$disk_ary[$k]);
    +					if ($k<1) {$disk = "$disk_ary[$k]";}
    +					else
    +						{
    +						if ($disk_ary[$k] > $disk) {$disk = "$disk_ary[$k]";}
    +						}
    +					$k++;
    +					}
    +				$disk = "$disk%";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				if ($stage == 'TIME')
    +					{
    +					$stmt="select last_update from server_updater where server_ip='$server_ip[$o]';";
    +					$rslt=mysql_query($stmt, $link);
    +					if ($DB) {echo "$stmt\n";}
    +					$servertime_to_print = mysql_num_rows($rslt);
    +					if ($servertime_to_print)
    +						{
    +						$row=mysql_fetch_row($rslt);
    +						echo "";
    +						}
    +					}
    +				else
    +					{
    +					if ( (preg_match("/Tiempo Real Main Report/",$LOGallowed_reports)) or (preg_match("/ALL INFORMES/",$LOGallowed_reports)) )
    +						{
    +						echo "\n";
    +						echo "\n";
    +						}
    +					else
    +						{
    +						echo "\n";
    +						echo "\n";
    +						}
    +					}
    +				echo "\n";
    +				$o++;
    +				}
    +
    +			if ($stage == 'TIME')
    +				{
    +				echo "";
    +
    +				$stmt="select NOW();";
    +				$rslt=mysql_query($stmt, $link);
    +				if ($DB) {echo "$stmt\n";}
    +				$dbtime_to_print = mysql_num_rows($rslt);
    +				if ($dbtime_to_print)
    +					{
    +					$row=mysql_fetch_row($rslt);
    +					echo "";
    +					}
    +				}
    +			echo "
    SERVIDOR -DESCRIPCIÓNIPACTLOADCHANDISKTIME
    SERVIDOR +DESCRIPCIÓNIPACTLOADCHANDISKSALIENTEEntrantes
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$disk$row[0]LINKLINK    
      PHP Time   " . date("Y-m-d H:i:s") . "
      DB Time   $row[0]
    \n"; + } } else { @@ -24682,6 +27927,244 @@ if ($ADD==999999) exit; } } +##### END report links ##### + + +###################### +# ADD=999998 display admin links page +###################### +if ($ADD==999998) + { + ?> + + + + + + Administration: Admin + Administration

    +
    + \n"; + echo "   \n"; + } +##### END admin links ##### + + +###################### +# ADD=999997 - user force change password page +###################### +if ($ADD==999997) + { + $show_form=1; + if ($stage=='ENVIAR') + { + if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) ) + {echo "Password has not been changed, please try again |1|" . strlen($pass);} + else + { + $stmt="select count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "Password has not been changed, please try again |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "Password has not been changed, please try again |3|$row[0]";} + else + { + $show_form=0; + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + ### 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='USUARIOS', event_type='MODIFY', record_id='$user', event_code='USER FORCE CHANGE PASSWORD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Password has been updated, you may now continue\n"; + } + } + } + } + if ($show_form > 0) + { + echo ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_agent_log records ##### + $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Alogs_to_print = mysql_num_rows($rslt); + + $y=0; + $agent_log = ''; + $Alog_campaign = ''; + while ($Alogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + + $campaign_id = $row[5]; + } + + ##### grab vicidial_closer_log records ##### + $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Clogs_to_print = mysql_num_rows($rslt); + + $y=0; + $closer_log = ''; + $Clog_campaign = ''; + while ($Clogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_list data for lead ##### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + if (strlen($row[0]) > 0) + {$lead_id = $row[0];} + $dispo = $row[3]; + $tsr = $row[4]; + $vendor_id = $row[5]; + $list_id = $row[7]; + $gmt_offset_now = $row[8]; + $phone_code = $row[10]; + $phone_number = $row[11]; + $title = $row[12]; + $first_name = $row[13]; + $middle_initial = $row[14]; + $last_name = $row[15]; + $address1 = $row[16]; + $address2 = $row[17]; + $address3 = $row[18]; + $city = $row[19]; + $state = $row[20]; + $province = $row[21]; + $postal_code = $row[22]; + $country_code = $row[23]; + $gender = $row[24]; + $date_of_birth = $row[25]; + $alt_phone = $row[26]; + $email = $row[27]; + $security = $row[28]; + $comments = $row[29]; + $called_count = $row[30]; + $last_local_call_time = $row[31]; + $rank = $row[32]; + $owner = $row[33]; + $entry_list_id = $row[34]; + + echo "
    Información de la llamada: $first_name $last_name - $phone_number

    \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 ""; + + echo "
    CHANGE PASSWORD
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    New Contraseña:     Strength:
    You are required to change your password before you can continue on to Administration. A strong password has both lower case and upper case letters as well as at least one number. Your password must be from 2 to 20 characters in length and cannot contain any characters that are not letters or numbers. Be sure that this password is something that you can remember, because as soon as you make this change you will be prompted to enter your new password to log back in to Administration
    \n"; + } + } +##### END user force change password page ##### + + +###################### +# ADD=999996 - initial install welcome page +###################### +if ($ADD==999996) + { + if ($SSfirst_login_trigger=='Y') + { + $show_form=1; + if ($stage=='ENVIAR') + { + if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) ) + {echo "Password has not been changed, please try again |1|" . strlen($pass);} + else + { + $stmt="select count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "Password has not been changed, please try again |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "Password has not been changed, please try again |3|$row[0]";} + else + { + $show_form=0; + + if (strlen($default_phone_registration_password) < 2) {$default_phone_registration_password = $SSdefault_phone_registration_password;} + if (strlen($default_phone_login_password) < 2) {$default_phone_login_password = $SSdefault_phone_login_password;} + if (strlen($default_server_password) < 2) {$default_server_password = $SSdefault_server_password;} + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE system_settings SET first_login_trigger='N',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password';"; + $rslt=mysql_query($stmtA, $link); + + $stmtB="UPDATE phones SET conf_secret='$default_phone_registration_password',pass='$default_phone_login_password';"; + $rslt=mysql_query($stmtB, $link); + + $stmtC="UPDATE servers SET conf_secret='$default_server_password',rebuild_conf_files='Y';"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|$stmtB|$stmtC|"; + $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='USUARIOS', event_type='MODIFY', record_id='$user', event_code='INITIAL SETTINGS UPDATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Passwords have been updated, you may now continue on into Administration.

    You may want to start by reading the ViciDial Manager Manual available at vicidial.org (there is a free version available)\n"; + } + } + } + } + if ($show_form > 0) + { + echo "\n"; echo "\n";echo "\n"; -$stmt="SELECT admin_home_url,enable_tts_integration from system_settings;"; +$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$admin_home_url_LU = $row[0]; +$admin_home_url_LU = $row[0]; $SSenable_tts_integration = $row[1]; +$SScallcard_enabled = $row[2]; +$SScustom_fields_enabled = $row[3]; ?>
    @@ -911,6 +1011,8 @@ $SSenable_tts_integration = $row[1]; VICIDIAL logo ADMINISTRATION
    \n"; + echo ""; + + echo "
    Bienvenido to ViciDial, initial setup screen

    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    You are required to change your password before you can continue on to Administration. A strong password has both lower case and upper case letters as well as at least one number. Your password must be from 2 to 20 characters in length and cannot contain any characters that are not letters or numbers. Be sure that this password is something that you can remember, because as soon as you complete this initial setup screen you will be prompted to enter your new password in again to log back in to Administration
    New Contraseña:     Strength:
     
    The next three default passwords are defined in the Ajustes Del Sistema section, and you can change them after you define them here. It is a good idea to make these passwords strong so that no one can hack into your phone accounts and place phone calls without you knowing. The default registration password used when new phones are added to the system as the SIP or IAX VOIP phone password. The default phone web login password used when new phones are added to the system, as the phone password that an agent would use in the ViciDial Agent Interface. The default server password used when new servers are added to the system for servers to communicate with each other.
    Default Phone Registro Contraseña:     Strength:
    Default Conexión Del Teléfono Contraseña:     Strength:
    Default Server Contraseña:     Strength:
     
    \n"; + } + } + } +##### END initial install welcome page ##### + + +###################### +# ADD=999995 - copyright trademark license page +###################### +if ($ADD==999995) + { + echo "
    \n"; + echo ""; + + echo "
    Recepción to ViciDial: copyright, trademark and license page

    \n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "
    Copyright:   The ViciDial Call Center Suite is maintained by the ViciDial Group, © 2010
    Trademark:   \"VICIDIAL\" is a registered trademark of the ViciDial Group. Here is our trademark use policy
    License:   The ViciDial Call Center Suite is released under the AGPLv2 open source license
    Source Code:   The ViciDial Call Center Suite software is available for download, and for use, free of cost. You can download the easy to install ViciBox CD ISO version, or only the source code
    \n"; + if ($first_login_link > 0) + { + echo "

    "; + echo "
    Continue on to the Initial Setup

      \n"; + } + } +##### END copyright trademark license page ##### echo "
    \n"; @@ -24695,8 +28178,10 @@ echo "
    \n"; echo "

    "; echo "VERSIÓN: $admin_version
    "; -echo "CONSTRUCCION: $build
    \n"; - +echo "CONSTRUCCION: $build\n"; +if (!preg_match("/_CONSTRUCCION_/",$SShosted_settings)) + {echo "
    © 2010 ViciDial Group
    ";} +echo "\n"; ?>
    @@ -25047,7 +28532,7 @@ if (isset($camp_lists)) } else {$active_leads = '0';} - echo "|$DB|\n"; + if ($DB > 0) {echo "|$DB|\n";} echo "Esta campaña tiene $active_leads Leads para ser llamados en estas listas\n"; } else diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin_header.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin_header.php index 8ccea972..9cb4175f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/admin_header.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin_header.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES @@ -18,6 +18,15 @@ # 90904-1534 - Added launch_moh_chooser # 90916-2334 - Added Voicemail options # 91223-1030 - Added VIDPROMPT options for in-group routing in Call Menus +# 100311-2210 - Added callcard_enabled Admin element +# 100428-1039 - Added custom fields display +# 100507-1339 - Added copy carrier submenu +# 100616-2350 - Added VIDPROMPT call menu options +# 100728-0904 - Changed Lead Loader link to the new 3rd gen lead loader +# 100802-2127 - Changed Admin to point to links page instead of Phones listings +# 100831-2255 - Added password strength checking function +# 100914-1311 - Removed other links for reports-only users +# 101022-1323 - Added IGU_selectall function # @@ -27,15 +36,23 @@ if($short_header) ?> + - + - + + + +
        Usuarios     Campañas     Listas     Escrituras     Filtros     In-Groups     Inbound     Grupos De Usuario     Agentes Remotos     Admin     Admin         Informes  
    @@ -319,34 +336,72 @@ if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_c + var weak = Image(); + weak.src = "images/weak.png"; + var medium = Image(); + medium.src = "images/medium.png"; + var strong = Image(); + strong.src = "images/strong.png"; - function openNewWindow(url) { - window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); - } - function scriptInsertField() { + function pwdChanged(pwd_field_str, pwd_img_str) + { + var pwd_field = document.getElementById(pwd_field_str); + var pwd_img = document.getElementById(pwd_img_str); + + var strong_regex = new RegExp( "^(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])", "g" ); + var medium_regex = new RegExp( "^(?=.{6,})(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9]))).*$", "g" ); + + if (strong_regex.test(pwd_field.value) ) + { + if (pwd_img.src != strong.src) + {pwd_img.src = strong.src;} + } + else if (medium_regex.test( pwd_field.value) ) + { + if (pwd_img.src != medium.src) + {pwd_img.src = medium.src;} + } + else + { + if (pwd_img.src != weak.src) + {pwd_img.src = weak.src;} + } + } + + function openNewWindow(url) + { + window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); + } + function scriptInsertField() + { openField = '--A--'; closeField = '--B--'; var textBox = document.scriptForm.script_text; var scriptIndex = document.getElementById("selectedField").selectedIndex; var insValue = document.getElementById('selectedField').options[scriptIndex].value; - if (document.selection) { - //IE - textBox = document.scriptForm.script_text; - insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; - textBox.focus(); - sel = document.selection.createRange(); - sel.text = openField + insValue + closeField; - } else if (textBox.selectionStart || textBox.selectionStart == 0) { - //Mozilla - var startPos = textBox.selectionStart; - var endPos = textBox.selectionEnd; - textBox.value = textBox.value.substring(0, startPos) - + openField + insValue + closeField - + textBox.value.substring(endPos, textBox.value.length); - } else { - textBox.value += openField + insValue + closeField; - } - } + if (document.selection) + { + //IE + textBox = document.scriptForm.script_text; + insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; + textBox.focus(); + sel = document.selection.createRange(); + sel.text = openField + insValue + closeField; + } + else if (textBox.selectionStart || textBox.selectionStart == 0) + { + //Mozilla + var startPos = textBox.selectionStart; + var endPos = textBox.selectionEnd; + textBox.value = textBox.value.substring(0, startPos) + + openField + insValue + closeField + + textBox.value.substring(endPos, textBox.value.length); + } + else + { + textBox.value += openField + insValue + closeField; + } + } + function IGU_selectall(temp_count,temp_fields) + { + var fields_array=temp_fields.split('|'); + var inc=0; + while (temp_count >= inc) + { + if (fields_array[inc].length > 0) + { + document.getElementById(fields_array[inc]).checked=true; + // document.admin_form.fields_array[inc].checked=true; + } + inc++; + } + } + + '; new_content = new_content + '   Handle Method: '; + new_content = new_content + '   AYUDA'; new_content = new_content + '
    Search Method: '; new_content = new_content + '   ID De la Lista: '; new_content = new_content + '
    ID De la Campaña: '; new_content = new_content + '   Phone Code: '; + new_content = new_content + "
      VID Enter Filename: audio chooser"; + new_content = new_content + "
      VID ID Number Filename: audio chooser"; + new_content = new_content + "
      VID Confirm Filename: audio chooser"; + new_content = new_content + '   VID Digits: '; } if (selected_route=='DID') { @@ -782,14 +871,18 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 if (selected_route=='INGROUP') { if ( (route != selected_route) || (value.length < 10) ) - {value = 'SALESLINE,CID,LB,998,TESTCAMP,1';} + {value = 'SALESLINE,CID,LB,998,TESTCAMP,1,,,,';} var value_split = value.split(","); - var IGgroup_id = value_split[0]; - var IGhandle_method = value_split[1]; - var IGsearch_method = value_split[2]; - var IGlist_id = value_split[3]; - var IGcampaign_id = value_split[4]; - var IGphone_code = value_split[5]; + var IGgroup_id = value_split[0]; + var IGhandle_method = value_split[1]; + var IGsearch_method = value_split[2]; + var IGlist_id = value_split[3]; + var IGcampaign_id = value_split[4]; + var IGphone_code = value_split[5]; + var IGvid_enter_filename = value_split[6]; + var IGvid_id_number_filename = value_split[7]; + var IGvid_confirm_filename = value_split[8]; + var IGvid_validate_digits = value_split[9]; if (route == selected_route) { @@ -807,6 +900,11 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 new_content = new_content + '
    ID De la Campaña: '; new_content = new_content + '   Phone Code: '; + // new_content = new_content + "
      VID Enter Filename: audio chooser"; + // new_content = new_content + "
      VID ID Number Filename: audio chooser"; + // new_content = new_content + "
      VID Confirm Filename: audio chooser"; + // new_content = new_content + '   VID Digits: '; + } if (selected_route=='DID') { @@ -896,11 +994,13 @@ echo "\n"; echo "\n"; echo "\n"; echo "
    English Español
    + > @@ -989,6 +1093,8 @@ $SSenable_tts_integration = $row[1]; ?> > + > + @@ -998,22 +1104,35 @@ $SSenable_tts_integration = $row[1]; ?> 1) { - if ($LOGdelete_from_dnc > 0) {$DNClink = 'Añadir-Supr Número de DNC';} - else {$DNClink = 'Add Number To DNC';} + if (strlen($lists_hh) > 1) + { + if ($LOGdelete_from_dnc > 0) {$DNClink = 'Add-BorrarDNC Number';} + else {$DNClink = 'Add DNC Number';} ?> - >>>>> - >>>>>>> + @@ -1051,11 +1170,13 @@ $SSenable_tts_integration = $row[1]; ?> 1) - { + { + if ($LOGdelete_from_dnc > 0) {$FPGlink = 'Add-BorrarFPG Number';} + else {$FPGlink = 'Add FPG Number';} ?> >>>>>> @@ -1109,12 +1236,16 @@ $SSenable_tts_integration = $row[1]; > Demuestre Los Agentes Alejados >>> 1) @@ -1145,6 +1276,8 @@ $SSenable_tts_integration = $row[1]; else {$vm_sh=''; $vm_fc='BLACK';} if ($sh=='tts') {$tts_sh="bgcolor=\"$tts_color\""; $tts_fc="$tts_font";} else {$tts_sh=''; $tts_fc='BLACK';} + if ($sh=='cc') {$cc_sh="bgcolor=\"$cc_color\""; $cc_fc="$cc_font";} + else {$cc_sh=''; $cc_fc='BLACK';} ?> > @@ -1185,8 +1318,16 @@ $SSenable_tts_integration = $row[1]; SIZE=> Text To Speech + 0) + { ?> + > + + > + > 1) and (strlen($admin_hh) > 1) ) { ?> > 1) and (strlen($admin_hh) > 1) ) { + ?> + > + 1) and (strlen($admin_hh) > 1) ) { ?> > diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin_modify_lead.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin_modify_lead.php index 2982acf0..9c17aadc 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/admin_modify_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin_modify_lead.php @@ -1,5 +1,5 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -33,6 +33,12 @@ # 90708-1549 - Added phone number dialed to outbound log # 90721-1246 - Added rank and owner as vicidial_list fields # 90917-2355 - Added extended alt phone entries +# 100405-1333 - Changed to show logs of non-found leads +# 100618-0148 - Added Middle name modify and fixes statuses list +# 100622-0945 - Added field labels +# 100703-1122 - Added custom fields display/edit +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100924-1431 - Added Called Count display # require("dbconnect.php"); @@ -48,8 +54,12 @@ if (isset($_GET["old_phone"])) {$old_phone=$_GET["old_phone"];} elseif (isset($_POST["old_phone"])) {$old_phone=$_POST["old_phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["title"])) {$title=$_GET["title"];} + elseif (isset($_POST["title"])) {$title=$_POST["title"];} if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} + elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} @@ -131,8 +141,8 @@ if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];} elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];} -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -140,26 +150,34 @@ $NOW_TIME = date("Y-m-d H:i:s"); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; } ##### END SETTINGS LOOKUP ##### ########################################### if ($non_latin < 1) { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $old_phone = ereg_replace("[^0-9]","",$old_phone); $phone_number = ereg_replace("[^0-9]","",$phone_number); $alt_phone = ereg_replace("[^0-9]","",$alt_phone); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); } + if (strlen($phone_number)<6) {$phone_number=$old_phone;} $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; @@ -210,6 +228,50 @@ else } } +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Ciudad'; +$label_state = 'State'; +$label_province = 'Provincia'; +$label_postal_code = 'Código Postal'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Sexo'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Comentarios'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + ?> @@ -224,7 +286,7 @@ echo "ADMINISTRATION: Registro del Lead modi if ($end_call > 0) { ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -366,271 +428,6 @@ else $alts_output .= "\n"; } - ##### grab vicidial_log records ##### - $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - $call_log = ''; - $log_campaign = ''; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (strlen($log_campaign)<1) {$log_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - $call_log .= ""; - $call_log .= ""; - $call_log .= ""; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_agent_log records ##### - $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Alogs_to_print = mysql_num_rows($rslt); - - $y=0; - $agent_log = ''; - $Alog_campaign = ''; - while ($Alogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - - $campaign_id = $row[5]; - } - - ##### grab vicidial_closer_log records ##### - $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Clogs_to_print = mysql_num_rows($rslt); - - $y=0; - $closer_log = ''; - $Clog_campaign = ''; - while ($Clogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_list data for lead ##### - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $gmt_offset_now = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; - $address1 = "$row[16]"; - $address2 = "$row[17]"; - $address3 = "$row[18]"; - $city = "$row[19]"; - $state = "$row[20]"; - $province = "$row[21]"; - $postal_code = "$row[22]"; - $country_code = "$row[23]"; - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; - $email = "$row[27]"; - $security = "$row[28]"; - $comments = "$row[29]"; - $called_count = "$row[30]"; - $last_local_call_time = "$row[31]"; - $rank = "$row[32]"; - $owner = "$row[33]"; - - echo "
    Información de la llamada: $first_name $last_name - $phone_number

    \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 "
    WIDTH=160> SIZE=>Usuarios @@ -966,6 +1068,8 @@ $SSenable_tts_integration = $row[1]; else {$pause_sh=''; $pause_fc='BLACK';} if ($sh=='listmix') {$listmix_sh="bgcolor=\"$subcamp_color\""; $listmix_fc="$subcamp_font";} else {$listmix_sh=''; $listmix_fc='BLACK';} + if ($sh=='preset') {$preset_sh="bgcolor=\"$subcamp_color\""; $preset_fc="$subcamp_font";} + else {$preset_sh=''; $preset_fc='BLACK';} ?>
    >   SIZE=>Pausa Códigos
    >   SIZE=>Presets
    > SIZE=>Listas
      - > Demuestre Las Listas -
      - > Agregue Una Nueva Lista -
      - > Búsqueda Para Un Plomo -
      - > -
      - > Nuevos Plomos De la Carga -
      + > Demuestre Las Listas +
      + > Agregue Una Nueva Lista +
      + > Búsqueda Para Un Plomo +
      + > +
      + > Nuevos Plomos De la Carga + 0) + { + ?> +
      + > List Custom Fields +
      + > CopiarCustom Fields + +
    > - SIZE=> En-Grupos + SIZE=> Inbound
      > Demuestre A En-Grupos @@ -1074,7 +1195,13 @@ $SSenable_tts_integration = $row[1];
      > Añadir un nuevo menú de llamadas
      - > Copia de llamadas Menú + > Copia de llamadas Menú
    +
      + > Filter Phone Groups +
      + > Add Filter Phone Group +
      + >
      > Agregue Los Agentes Alejados Nuevos +
      + > Show Extension Groups +
      + > Add Extension Group
    > - SIZE=> Admin + SIZE=> Admin
    >   + SIZE=> CallCard Admin
    > @@ -1245,12 +1386,16 @@ $SSenable_tts_integration = $row[1]; 1) and (strlen($admin_hh) > 1) ) { ?> -
      > Show Transportistas   |   > Add A New Carrier
      > Show Transportistas   |   > Add A New Carrier   |   > CopiarA Carrier
      > Mostrar las entradas TTS   |   > Agregar una nueva entrada TTS
      > CallCard Summary   |   > Runs   |   > Batches   |   > CallCard Search   |   > CallCard Log Export   |   > CallCard Generate New Numbers
      > Mostrar las entradas del Ministerio de Salud   |   > Agregar una nueva entrada del Ministerio de Salud
    $row[4]
    $u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
    $y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
    $y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
    Vendor ID: $vendor_id     Lead ID: $lead_id
    Fronter: $tsr     ID De la Lista: $list_id
    Nombre:   \n"; - echo " Apellidos:
    Dirección 1 :
    Dirección 2 :
    Dirección 3 :
    Ciudad :
    Estado:   \n"; - echo " Código Postal:
    Provincia:
    País :
    Main Phone :
    Alt Phone :
    Email :
    Seguridad:
    Rank :
    Owner :
    Comentarios :
    Disposición: (with $log_campaign statuses)
    Modificarvicidial log
    Modificaragent log
    Modificarcloser log
    Add closer log record
    \n"; - echo "


    \n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

    \n"; - - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UsuarioID: \n"; - echo "

    \n"; - } - else - { - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UsuarioID: \n"; - echo "

    \n"; - } - } - else - { - echo "
    No Callback records found
    \n"; - } - } } else { @@ -638,6 +435,288 @@ else # echo "Close this window\n

    \n"; } + ##### grab vicidial_log records ##### + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + $call_log = ''; + $log_campaign = ''; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (strlen($log_campaign)<1) {$log_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $call_log .= "
    $u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
    $y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
    $y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
    \n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "
    $label_vendor_lead_code: $vendor_id     Lead ID: $lead_id
    Fronter: $tsr     ID De la Lista: $list_id     Called Count: $called_count
    $label_title:   \n"; + echo "$label_first_name:
    $label_middle_initial:   \n"; + echo " $label_last_name:
    $label_address1 :
    $label_address2 :
    $label_address3 :
    $label_city :
    $label_state:   \n"; + echo " $label_postal_code:
    $label_province :
    País :
    $label_phone_number :
    $label_phone_code :
    $label_alt_phone :
    $label_email :
    $label_security_phrase :
    Rank :
    Owner :
    $label_comments :
    Disposición: (with $list_campaign statuses)
    Modificarvicidial log
    Modificaragent log
    Modificarcloser log
    Add closer log record
    \n"; + echo "


    \n"; + + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); + + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

    \n"; + + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UsuarioID: \n"; + echo "

    \n"; + } + else + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UsuarioID: \n"; + echo "

    \n"; + } + } + else + { + echo "
    No Callback records found
    \n"; + } + } echo "

    \n"; @@ -656,6 +735,37 @@ else echo "

    \n"; } + + + ### iframe for custom fields display/editing + if ($custom_fields_enabled > 0) + { + $CLlist_id = $list_id; + if (strlen($entry_list_id) > 2) + {$CLlist_id = $entry_list_id;} + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$CLlist_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + echo "CUSTOM FIELDS FOR THIS LEAD:
    \n"; + echo "\n"; + echo "

    "; + } + } + } + + echo "LLAMADAS A ESTE LEAD:\n"; echo "\n"; echo "\n"; @@ -692,6 +802,7 @@ else $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} $u=0; while ($logs_to_print > $u) @@ -731,7 +842,7 @@ else {$locat = substr($location,0,27); $locat = "$locat...";} else {$locat = $location;} - if (eregi("http",$location)) + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) {$location = "$locat";} else {$location = $locat;} @@ -750,7 +861,21 @@ else } - echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAÑA LIST LEAD HANGUP REASON PHONE
    \n"; + echo "


    \n"; + + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $admin_display=$row[0]; + if ($admin_display > 0) + { + echo "Click here to see Lead Modificarchanges to this lead\n"; + } + + echo "
    \n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/admin_search_lead.php b/agc_2-X/trunk/LANG_www/vicidial_es/admin_search_lead.php index c96c1982..6b62f25a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/admin_search_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/admin_search_lead.php @@ -1,5 +1,5 @@ LICENSE: AGPLv2 # @@ -22,6 +22,8 @@ # 90917-2307 - Added alternate phone number searching option # 90921-0713 - Removed SELECT STAR # 100224-1621 - Added first/last name search and changed format of the page +# 100405-1331 - Added log search ability +# 100622-0928 - Added field labels # require("dbconnect.php"); @@ -39,6 +41,10 @@ if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["log_phone"])) {$log_phone=$_GET["log_phone"];} + elseif (isset($_POST["log_phone"])) {$log_phone=$_POST["log_phone"];} +if (isset($_GET["log_lead_id"])) {$log_lead_id=$_GET["log_lead_id"];} + elseif (isset($_POST["log_lead_id"])) {$log_lead_id=$_POST["log_lead_id"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} @@ -141,13 +147,58 @@ $subcamp_color = '#C6C6C6'; require("admin_header.php"); +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Ciudad'; +$label_state = 'State'; +$label_province = 'Provincia'; +$label_postal_code = 'Código Postal'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Sexo'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Comentarios'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; echo date("l F j, Y G:i:s A"); echo "
    \n"; -if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) { + ### Lead search echo "
    \n"; echo "
    \n"; echo "\n"; @@ -156,16 +207,16 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo "
    Buscar Lead Opcións:
    Vendor ID(código del vendedor del Lead):   $label_vendor_lead_code(código del vendedor del Lead):  
     
    Home Número De Teléfono:   $label_phone_number:  
    Alt phone search:   $label_alt_phone search:  
     
     
    Nombre:   $label_first_name:  
    Apellidos:   $label_last_name:  
     
    Log Search Opcións:
    Lead ID:  
     
    $label_phone_number Dialed:  
     
    \n"; echo "\n\n"; echo "\n"; @@ -200,6 +272,189 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and else { + ##### BEGIN Log search ##### + if ( (strlen($log_lead_id)>0) or (strlen($log_phone)>0) ) + { + if (strlen($log_lead_id)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + } + if (strlen($log_phone)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; + } + + $rslt=mysql_query("$stmtA", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "There are no outbound calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    SALIENTE LOG RESULTS: $results_to_print
    \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"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + 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 "
    #LEAD ID  PHONE  CAMPAIGN  CALL FECHA  ESTADO  USER  ID DE LA LISTA  LENGTH  DIAL
    $o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]
    \n"; + } + + $rslt=mysql_query("$stmtB", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "There are no inbound calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    Entrantes LOG RESULTS: $results_to_print
    \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"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #LEAD ID  PHONE  INGROUP  CALL FECHA  ESTADO  USER  ID DE LA LISTA  LENGTH  
    $o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]
    \n"; + } + + if (strlen($stmtC) > 10) + { + $rslt=mysql_query("$stmtC", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "There are no inbound did calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    Entrantes DID LOG RESULTS: $results_to_print
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #DID  PHONE  DID ID  CALL FECHA  
    $o$row[0]$row[1]$row[2]$row[3]
    \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='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ENDtime = date("U"); + + $RUNtime = ($ENDtime - $STARTtime); + + echo "\n\n\n


    \nNUEVA BÚSQUEDA"; + + echo "\n\n\n


    \nScript runtime: $RUNtime seconds"; + + echo "\n\n\n"; + + exit; + } + ##### END Log search ##### + + + + + + ##### BEGIN Lead search ##### if ($vendor_id) { $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; @@ -365,6 +620,7 @@ else if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } + ##### END Lead search ##### diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/audio_store.php b/agc_2-X/trunk/LANG_www/vicidial_es/audio_store.php index 4f8941ea..1a8e7bcb 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/audio_store.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/audio_store.php @@ -1,17 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # # CHANGES # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel +# 100401-1037 - remove spaces and special characters from filenames, admin log uploads # -$version = '2.2.0-2'; -$build = '90618-0640'; +$version = '2.2.0-3'; +$build = '100401-1037'; $MT[0]=''; @@ -191,8 +192,12 @@ if ($action == "LIST") # curl 'http://10.0.0.4/vicidial/audio_store.php?action=AUTOUPLOAD' -F "audiofile=@/var/lib/asterisk/sounds/beep.gsm" if ($action == "AUTOUPLOAD") { - if ($audiofile) + if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -277,6 +282,10 @@ if ($action == "MANUALUPLOAD") { if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,6 +293,14 @@ if ($action == "MANUALUPLOAD") $stmt="UPDATE servers SET sounds_update='Y';"; $rslt=mysql_query($stmt, $link); + + ### 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=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } else { @@ -309,8 +326,18 @@ if ($action == "MANUALUPLOAD")
      Audio Store-     VERSION:     BUILD:    


    -
    We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) -

    -audio file list
    +
    We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files(.wav) +

    All spaces will be stripped from uploaded audio file names

    +audio file list
    + + + +




    \n"; + +echo "


    Click here to see a log of the uploads to the audio store
    \n"; + +?>
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/call_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_es/call_report_export.php index f4599238..a3d3f05f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/call_report_export.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/call_report_export.php @@ -17,6 +17,14 @@ # 100119-1039 - Filtered comments for \n newlines # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100507-1413 - Added headers for export +# 100702-1332 - Added custom fields option +# 100712-1324 - Added system setting slave server option +# 100713-0101 - Added recordings fields option (for filename, recording ID and URL) +# 100713-1050 - Fixed minor custom fields issue +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# Allow level 7 users to view this report # require("dbconnect.php"); @@ -42,6 +50,12 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -49,30 +63,52 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Export Calls Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $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]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and export_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -81,6 +117,38 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + ##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### if ($run_export > 0) @@ -110,8 +178,11 @@ if ($run_export > 0) $i=0; while($i < $campaign_ct) { - $campaign_string .= "$campaign[$i]|"; - $campaign_SQL .= "'$campaign[$i]',"; + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } $i++; } if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) @@ -218,7 +289,7 @@ if ($run_export > 0) $k=0; if ($RUNcampaign > 0) { - $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $outbound_to_print = mysql_num_rows($rslt); @@ -236,8 +307,11 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; $i++; $k++; @@ -248,7 +322,7 @@ if ($run_export > 0) if ($RUNgroup > 0) { - $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmtA, $link); if ($DB) {echo "$stmt\n";} $inbound_to_print = mysql_num_rows($rslt); @@ -266,8 +340,11 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; $i++; $k++; @@ -299,9 +376,28 @@ if ($run_export > 0) ob_clean(); flush(); + if ($header_row=='YES') + { + $CFheader = ''; + $RFheader = ''; + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + + echo "call_date\tphone_number\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id\tlist_name\tlist_description\tstatus_name$RFheader$CFheader\r\n"; + } + $i=0; while ($k > $i) { + $custom_data=''; $ex_list_name=''; $ex_list_description=''; $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; @@ -338,7 +434,85 @@ if ($run_export > 0) } } - echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name\r\n"; + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="SHOW TABLES LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$custom_data\r\n"; $i++; } } @@ -360,7 +534,7 @@ else if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} - $stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -405,7 +579,7 @@ else $i++; } - $stmt="select list_id from vicidial_lists order by list_id;"; + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $lists_to_print = mysql_num_rows($rslt); @@ -435,7 +609,7 @@ else $i++; } - $stmt="select distinct status from vicidial_campaign_statuses order by status;"; + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $Cstatuses_to_print = mysql_num_rows($rslt); @@ -455,7 +629,7 @@ else echo "\n"; echo "\n"; - echo "ADMINISTRATION: Export Calls Report"; + echo "<TITLE>ADMINISTRATION: $report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '100'; @@ -518,6 +692,30 @@ else </script> <?php + echo "<BR><BR>\n"; + + echo "Header Row:<BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "Recording Fields:<BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NONE</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "Custom Fields:<BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; echo "<font class=\"select_bold\"><B>Campaigns:</B></font><BR><CENTER>\n"; echo "<SELECT SIZE=15 NAME=campaign[] multiple>\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php index dca45485..c6011134 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/dbconnect.php @@ -1,50 +1,63 @@ <?php # -# dbconnect.php version 2.2.0 +# dbconnect.php version 2.4 # # database connection settings and some global web settings # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # +# CHANGES +# 100712-1430 - Added slave server option for connection +# + if ( file_exists("/etc/astguiclient.conf") ) -{ -$DBCagc = file("/etc/astguiclient.conf"); -foreach ($DBCagc as $DBCline) { - $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); - if (ereg("^PATHlogs", $DBCline)) - {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} - if (ereg("^PATHweb", $DBCline)) - {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} - if (ereg("^VARserver_ip", $DBCline)) - {$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);} - if (ereg("^VARDB_server", $DBCline)) - {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} - if (ereg("^VARDB_database", $DBCline)) - {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} - if (ereg("^VARDB_user", $DBCline)) - {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} - if (ereg("^VARDB_pass", $DBCline)) - {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} - if (ereg("^VARDB_port", $DBCline)) - {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + $DBCagc = file("/etc/astguiclient.conf"); + foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARserver_ip", $DBCline)) + {$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_custom_user", $DBCline)) + {$VARDB_custom_user = $DBCline; $VARDB_custom_user = preg_replace("/.*=/","",$VARDB_custom_user);} + if (ereg("^VARDB_custom_pass", $DBCline)) + {$VARDB_custom_pass = $DBCline; $VARDB_custom_pass = preg_replace("/.*=/","",$VARDB_custom_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } + } +else + { + #defaults for DB connection + $VARDB_server = 'localhost'; + $VARDB_port = '3306'; + $VARDB_user = 'cron'; + $VARDB_pass = '1234'; + $VARDB_custom_user = 'custom'; + $VARDB_custom_pass = 'custom1234'; + $VARDB_database = '1234'; + $WeBServeRRooT = '/usr/local/apache2/htdocs'; } -} -else -{ -#defaults for DB connection -$VARDB_server = 'localhost'; -$VARDB_user = 'cron'; -$VARDB_pass = '1234'; -$VARDB_database = '1234'; -$WeBServeRRooT = '/usr/local/apache2/htdocs'; -} - -$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); -if (!$link) { +if ( ($use_slave_server > 0) and (strlen($slave_db_server)>5) ) + {$VARDB_server = $slave_db_server;} +$link=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass"); +if (!$link) + { die('MySQL connect ERROR: ' . mysql_error()); -} + } mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/fcstats.php b/agc_2-X/trunk/LANG_www/vicidial_es/fcstats.php index e94d3b0a..a154c5dc 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/fcstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/fcstats.php @@ -14,6 +14,9 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -39,12 +42,48 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; + +$report_name = 'Fronter - Closer Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -53,6 +92,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -88,7 +148,7 @@ while ($i < $groups_to_print) <?php echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; -echo "<TITLE>In-Group Fronter-Closer Stats Report\n"; +echo "$report_name\n"; $short_header=1; @@ -605,7 +665,7 @@ echo "+--------------------------+--------+------+------+------+------+-------+\ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -if ($DB) {echo "\nRun Time: $RUNtime seconds\n";} +if ($DB) {echo "\nRun Time: $RUNtime seconds|$db_source\n";} } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/list_download.php b/agc_2-X/trunk/LANG_www/vicidial_es/list_download.php index a0156bcf..2de73711 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/list_download.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/list_download.php @@ -12,6 +12,14 @@ # 90508-0644 - Changed to PHP long tags # 90721-1238 - Added rank and owner as vicidial_list fields # 100119-1039 - Filtered comments for \n newlines +# 100508-1439 - Added header row to output +# 100702-1335 - Added custom fields +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100804-1745 - Added option to download DNC and FPGN lists +# 100924-1609 - Added ALL-LISTS option for downloading everything +# 100929-1919 - Fixed ALL-LISTS download option to include custom fields +# 101004-2108 - Added generic custom column headers for custom fields # require("dbconnect.php"); @@ -27,12 +35,20 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} + elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} +if (isset($_GET["download_type"])) {$download_type=$_GET["download_type"];} + elseif (isset($_POST["download_type"])) {$download_type=$_POST["download_type"];} if (strlen($shift)<2) {$shift='ALL';} +if ($group_id=='SYSTEM_INTERNAL') {$download_type='systemdnc';} + +$report_name = 'Download List'; +$db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -40,14 +56,27 @@ if ($qm_conf_ct > 0) { $row=mysql_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]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -62,23 +91,182 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } -$stmt="select count(*) from vicidial_list where list_id='$list_id';"; +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$count_to_print = mysql_num_rows($rslt); -if ($count_to_print > 0) +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) { - $row=mysql_fetch_row($rslt); - $leads_count =$row[0]; - $i++; + # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + # Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; } -if ($leads_count < 1) +$LOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) { - echo "There are no leads in list_id: $list_id\n"; - exit; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; } +if ($download_type == 'systemdnc') + { + ##### System DNC list validation ##### + $event_code_type='SYSTEM INTERNAL DNC'; + if (strlen($LOGallowed_campaignsSQL) > 2) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_dnc;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "There are no phone numbers in list: SYSTEM INTERNAL DNC\n"; + exit; + } + } +elseif ($download_type == 'dnc') + { + ##### Campaña DNC list validation ##### + $event_code_type='CAMPAIGN DNC'; + $stmt="select count(*) from vicidial_campaigns where campaign_id='$group_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_campaign_dnc where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "There are no leads in Campaña DNC list: $group_id\n"; + exit; + } + } +elseif ($download_type == 'fpgn') + { + ##### Filter Phone Group list validation ##### + $event_code_type='FILTER PHONE GROUP'; + $stmt="select count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "There are no leads in this filter phone group: $group_id\n"; + exit; + } + } +else + { + ##### list download validation ##### + $event_code_type='LIST'; + $stmt="select count(*) from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; + if ($list_id=='ALL-LISTAS') + {$stmt="select count(*) from vicidial_lists where list_id > 0 $LOGallowed_campaignsSQL;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTAS') + {$stmt="select count(*) from vicidial_list where list_id > 0;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "There are no leads in list_id: $list_id\n"; + exit; + } + } + + $US='_'; $MT[0]=''; $ip = getenv("REMOTE_ADDR"); @@ -90,16 +278,41 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -### LOG INSERTION Admin Log Table ### -$SQL_log = "$stmt|$stmtA|"; -$SQL_log = ereg_replace(';','',$SQL_log); -$SQL_log = addslashes($SQL_log); -$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT LIST', event_sql=\"$SQL_log\", event_notes='';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); - -$TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; +if ($download_type == 'systemdnc') + { + $TXTfilename = "SYSTEM_DNC_$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_dnc;"; + } +elseif ($download_type == 'dnc') + { + $TXTfilename = "DNC_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_campaign_dnc where campaign_id='$group_id';"; + } +elseif ($download_type == 'fpgn') + { + $TXTfilename = "FPGN_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + } +else + { + $TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; + $list_id_header=''; + $stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTAS') + { + $list_id_header="list_id\t"; + $stmt="select list_id,lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id > 0;"; + } + $header_row = $list_id_header . "lead_id\tentry_date\tmodify_date\tstatus\tuser\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tcalled_since_last_reset\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tcalled_count\tlast_local_call_time\trank\towner"; + $header_columns=''; + } // We'll be outputting a TXT file header('Content-type: application/octet-stream'); @@ -112,7 +325,8 @@ header('Pragma: public'); ob_clean(); flush(); -$stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $leads_to_print = mysql_num_rows($rslt); @@ -121,9 +335,166 @@ while ($i < $leads_to_print) { $row=mysql_fetch_row($rslt); - $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + if ( ($download_type == 'systemdnc') or ($download_type == 'dnc') or ($download_type == 'fpgn') ) + { + $row_data[$i] .= "$row[0]"; + } + else + { + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - echo "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\r\n"; + if ($list_id=='ALL-LISTAS') + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]"; + $export_list_id[$i] = $row[0]; + $export_lead_id[$i] = $row[1]; + } + else + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]"; + $export_list_id[$i] = $list_id; + $export_lead_id[$i] = $row[0]; + } + } + $i++; + } + +$ch=0; +if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') ) + { + $valid_custom_table=0; + if ($list_id=='ALL-LISTAS') + { + $stmtA = "SELECT list_id from vicidial_lists;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $lists_ct = mysql_num_rows($rslt); + $u=0; + while ($lists_ct > $u) + { + $row=mysql_fetch_row($rslt); + $custom_list_id[$u] = $row[0]; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$custom_list_id[$u]\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + $custom_tablecount[$u] = $tablecount_to_print; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $custom_columns[$u]=0; + if ($custom_tablecount[$u] > 0) + { + $stmtA = "describe custom_$custom_list_id[$u];"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $custom_columns[$u] = $columns_ct; + } + if ($DB) {echo "$custom_list_id[$u]|$custom_tablecount[$u]|$custom_columns[$u]\n";} + $u++; + } + $valid_custom_table=1; + } + else + { + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmtA = "describe custom_$list_id;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + if ($u > 0) + {$header_columns .= "\t$column";} + $u++; + } + if ($columns_ct > 1) + { + $valid_custom_table=1; + } + } + } + if ($valid_custom_table > 0) + { + $i=0; + while ($i < $leads_to_print) + { + if ($list_id=='ALL-LISTAS') + { + $valid_custom_table=0; + $u=0; + while ($lists_ct > $u) + { + if ( ($export_list_id[$i] == "$custom_list_id[$u]") and ($custom_columns[$u] > 1) ) + { + $valid_custom_table=1; + $columns_ct = $custom_columns[$u]; + } + $u++; + } + } + if ($valid_custom_table > 0) + { + $stmtA = "SELECT * from custom_$export_list_id[$i] where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$columns_ct|$stmtA\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data[$i] .= "\t$row[$t]"; + if ($ch <= $t) + { + $ch++; + $header_columns .= "\tcustom$ch"; + } + $t++; + } + } + + $custom_data[$i] = preg_replace("/\r\n/",'!N',$custom_data[$i]); + $custom_data[$i] = preg_replace("/\n/",'!N',$custom_data[$i]); + } + $i++; + } + } + } + + +### LOG INSERTION Admin Log Table ### +$SQL_log = "$stmt|$stmtA|"; +$SQL_log = ereg_replace(';','',$SQL_log); +$SQL_log = addslashes($SQL_log); +$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT $event_code_type', event_sql=\"$SQL_log\", event_notes='';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + + +echo "$header_row$header_columns\r\n"; + +$i=0; +while ($i < $leads_to_print) + { + echo "$row_data[$i]$custom_data[$i]\r\n"; $i++; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/listloader.pl b/agc_2-X/trunk/LANG_www/vicidial_es/listloader.pl index 72094d84..f660d140 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/listloader.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_es/listloader.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# listloader.pl version 2.2.0 +# listloader.pl version 2.4 # # Copyright (C) 2010 Matt Florell,Joe Johnson LICENSE: AGPLv2 # @@ -22,6 +22,8 @@ # 90721-1425 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0537 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,6 +273,38 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][24]; if ($oWkC) {$owner=$oWkC->Value; } + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; + if (length($forcelistid) > 0) { $list_id = $forcelistid; # set list_id to override value @@ -426,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -640,20 +674,30 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } $bad++; } $total++; @@ -666,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/listloader_super.pl b/agc_2-X/trunk/LANG_www/vicidial_es/listloader_super.pl index 93bfa20e..dc30c6bd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/listloader_super.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_es/listloader_super.pl @@ -21,6 +21,8 @@ # 90721-1341 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0539 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,7 +273,37 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][$xls_fields[24]]; if ($oWkC) {$owner=$oWkC->Value; } - + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; if (length($forcelistid) > 0) { @@ -428,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100)) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -642,21 +674,31 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list\n";} - $bad++; + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + $bad++; } $total++; if ($total%100==0) { @@ -668,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/new_listloader_superL.php b/agc_2-X/trunk/LANG_www/vicidial_es/new_listloader_superL.php index 9f797cd2..caa1d454 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/new_listloader_superL.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/new_listloader_superL.php @@ -30,11 +30,15 @@ # 90721-1339 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.2.0-34'; -$build = '100118-0543'; +$version = '2.4-37'; +$build = '100712-1416'; require("dbconnect.php"); @@ -127,22 +131,28 @@ if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} # $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -348,6 +358,7 @@ echo "
    ";
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + @@ -384,7 +395,7 @@ echo "
    - +
    ";
            
            DE NUEVO AL ADMINLIST LOADER-     VERSIÓN:     CONSTRUCCION:    
            DE NUEVO AL ADMIN         3rd Gen Lead Loader     LIST LOADER-     VERSIÓN:     CONSTRUCCION:    
    @@ -409,7 +420,7 @@ echo "
    "; if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); print "
    Procesando$delim_name-delimited file...\n"; @@ -445,7 +456,6 @@ echo "
    "; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -466,6 +476,36 @@ echo "
    "; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -477,6 +517,69 @@ echo "
    "; $phone_code = $phone_code_override; } + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -603,7 +706,7 @@ echo "
    "; } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -614,23 +717,54 @@ echo "
    "; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; - $multi_insert_counter=0; - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTA\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } $bad++; } $total++; @@ -642,7 +776,7 @@ echo "
    "; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -666,7 +800,7 @@ echo "
    "; { print "

    INVALIDACIÓN DEL CÓDIGO DEL TELÉFONO PARA ESTE ARCHIVO: $phone_code_override

    \n"; } - # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; + # print "|$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -674,13 +808,13 @@ echo "
    "; if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "
    ProcesandoCSV file... \n"; if (strlen($list_id_override)>0) @@ -708,7 +842,6 @@ echo "\n"; echo "\n"; } echo "\n"; - echo "
    "; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -729,18 +862,112 @@ echo "
    "; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); - if (strlen($rank)<1) {$rank='0';} - if (strlen($list_id_override)>0) + if (strlen($rank)<1) {$rank='0';} + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) { - $list_id = $list_id_override; - } - if (strlen($phone_code_override)>0) - { - $phone_code = $phone_code_override; - } + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -865,7 +1092,7 @@ echo "
    "; } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -878,23 +1105,53 @@ echo "
    "; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTA\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } $bad++; } $total++; @@ -905,7 +1162,7 @@ echo "
    "; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -932,7 +1189,7 @@ if ($leadfile) { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); $lead_file = "./vicidial_temp_file.txt"; } else @@ -942,7 +1199,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -951,7 +1208,7 @@ if ($leadfile) { if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; @@ -985,7 +1242,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1006,6 +1262,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1140,7 +1426,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1155,7 +1441,7 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1163,13 +1449,23 @@ if ($leadfile) { $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTA\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } $bad++; } $total++; @@ -1181,7 +1477,7 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1196,8 +1492,8 @@ if ($leadfile) { { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1206,7 +1502,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1214,15 +1510,15 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1231,7 +1527,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "
    ProcesandoCSV file... \n"; @@ -1258,7 +1554,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1279,6 +1574,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1413,7 +1738,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1427,7 +1752,7 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1435,13 +1760,23 @@ if ($leadfile) { $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID DE LA LISTA\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } $bad++; } $total++; @@ -1452,7 +1787,7 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1464,6 +1799,7 @@ if ($leadfile) { print ""; } else { + ##### BEGIN field chooser ##### print "
    "; flush(); print "\r\n"; @@ -1472,15 +1808,67 @@ if ($leadfile) { print " \r\n"; print " \r\n"; - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1", $link); - + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="DEMOSTRACIÓN TABLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"; } else { @@ -1489,7 +1877,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -1538,8 +1926,8 @@ if ($leadfile) { { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1547,7 +1935,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.xls"; } - # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1555,14 +1943,14 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1572,7 +1960,7 @@ if ($leadfile) { $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "
    ProcesandoCSV file... \n"; @@ -1617,6 +2005,8 @@ if ($leadfile) { print "
    Datos del archivo
    \r\n"; # } print ""; + + ##### END field chooser ##### } #} else if (filesize($leadfile)>8388608) { # print "
    ERROR: File exceeds the 8MB limit.
    "; @@ -1638,7 +2028,7 @@ exit; function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code) { -require("dbconnect.php"); +global $link; $postalgmt_found=0; if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/non_agent_api.php b/agc_2-X/trunk/LANG_www/vicidial_es/non_agent_api.php index faecfc20..6be8f1f4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/non_agent_api.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/non_agent_api.php @@ -9,7 +9,7 @@ # required variables: # - $user # - $pass -# - $function - ('add_lead','version') +# - $function - ('add_lead','update_lead','version','sounds_list','moh_list','vm_list','blind_monitor','agent_ingroup_info') # - $source - ('vtiger','webform','adminweb') # - $format - ('text','debug') @@ -31,10 +31,16 @@ # 91203-1140 - Added agent_ingroup_info feature # 91216-0331 - Added duplication check features to add_lead function # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100704-1148 - Added custom fields inserts to the add_lead function +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100718-0245 - Added update_lead function to update existing leads +# 100723-1333 - Added no_update option to the update_lead function +# 100728-1952 - Added delete_lead option to the update_lead function +# 100924-1403 - Added called_count as an update_lead option # -$version = '2.2.0-17'; -$build = '100118-0543'; +$version = '2.4-23'; +$build = '100924-1403'; require("dbconnect.php"); @@ -129,6 +135,31 @@ if (isset($_GET["agent_user"])) {$agent_user=$_GET["agent_user"];} elseif (isset($_POST["agent_user"])) {$agent_user=$_POST["agent_user"];} if (isset($_GET["duplicate_check"])) {$duplicate_check=$_GET["duplicate_check"];} elseif (isset($_POST["duplicate_check"])) {$duplicate_check=$_POST["duplicate_check"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["search_method"])) {$search_method=$_GET["search_method"];} + elseif (isset($_POST["search_method"])) {$search_method=$_POST["search_method"];} +if (isset($_GET["insert_if_not_found"])) {$insert_if_not_found=$_GET["insert_if_not_found"];} + elseif (isset($_POST["insert_if_not_found"])) {$insert_if_not_found=$_POST["insert_if_not_found"];} +if (isset($_GET["records"])) {$records=$_GET["records"];} + elseif (isset($_POST["records"])) {$records=$_POST["records"];} +if (isset($_GET["search_location"])) {$search_location=$_GET["search_location"];} + elseif (isset($_POST["search_location"])) {$search_location=$_POST["search_location"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["user_field"])) {$user_field=$_GET["user_field"];} + elseif (isset($_POST["user_field"])) {$user_field=$_POST["user_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["no_update"])) {$no_update=$_GET["no_update"];} + elseif (isset($_POST["no_update"])) {$no_update=$_POST["no_update"];} +if (isset($_GET["delete_lead"])) {$delete_lead=$_GET["delete_lead"];} + elseif (isset($_POST["delete_lead"])) {$delete_lead=$_POST["delete_lead"];} +if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} + elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -136,13 +167,14 @@ header ("Pragma: no-cache"); // HTTP/1.0 ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -208,6 +240,17 @@ if ($non_latin < 1) $rank = ereg_replace("[^0-9]","",$rank); $owner = ereg_replace("[^-_0-9a-zA-Z]","",$owner); $duplicate_check = ereg_replace("[^-_0-9a-zA-Z]","",$duplicate_check); + $custom_fields = ereg_replace("[^0-9a-zA-Z]","",$custom_fields); + $search_method = ereg_replace("[^-_0-9a-zA-Z]","",$search_method); + $insert_if_not_found = ereg_replace("[^A-Z]","",$insert_if_not_found); + $records = ereg_replace("[^0-9]","",$records); + $search_location = ereg_replace("[^A-Z]","",$search_location); + $user_field = ereg_replace("[^-_0-9a-zA-Z]","",$user_field); + $list_id_field = ereg_replace("[^0-9]","",$list_id_field); + $lead_id = ereg_replace("[^0-9]","",$lead_id); + $no_update = ereg_replace("[^A-Z]","",$no_update); + $delete_lead = ereg_replace("[^A-Z]","",$delete_lead); + $called_count=ereg_replace("[^0-9]","",$called_count); } else { @@ -216,12 +259,10 @@ else $source = ereg_replace("'|\"|\\\\|;","",$source); } -if (strlen($list_id)<1) {$list_id='999';} -if (strlen($phone_code)<1) {$phone_code='1';} $USarea = substr($phone_number, 0, 3); if (strlen($hopper_priority)<1) {$hopper_priority=0;} -if (strlen($gender)<1) {$gender='U';} -if (strlen($rank)<1) {$rank='0';} +if ($hopper_priority < -99) {$hopper_priority=-99;} +if ($hopper_priority > 99) {$hopper_priority=99;} $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); @@ -233,6 +274,7 @@ $postalgmt=''; $api_script = 'non-agent'; $api_logging = 1; +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|'; $secX = date("U"); $hour = date("H"); @@ -1167,6 +1209,11 @@ if ($function == 'add_lead') } else { + if (strlen($gender)<1) {$gender='U';} + if (strlen($rank)<1) {$rank='0';} + if (strlen($list_id)<3) {$list_id='999';} + if (strlen($phone_code)<1) {$phone_code='1';} + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) { $result = 'ERROR'; @@ -1419,7 +1466,7 @@ if ($function == 'add_lead') ### insert a new lead in the system with this phone number - $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='NEW',user='$user',vendor_lead_code='$vendor_lead_code',source_id='$source_id',gmt_offset_now='$gmt_offset',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',country_code='$country_code',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',called_since_last_reset='N',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',rank='$rank',owner='$owner';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='NEW',user='$user',vendor_lead_code='$vendor_lead_code',source_id='$source_id',gmt_offset_now='$gmt_offset',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',country_code='$country_code',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',called_since_last_reset='N',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',rank='$rank',owner='$owner',entry_list_id='0';"; if ($DB>0) {echo "DEBUG: add_lead query - $stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -1470,6 +1517,114 @@ if ($function == 'add_lead') api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); } + ### BEGIN custom fields insert section ### + if ($custom_fields == 'Y') + { + if ($custom_fields_enabled > 0) + { + $stmt="SHOW TABLES LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $CFinsert_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $new_field_value=''; + $form_field_value=''; + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_type[$o] = $rowx[6]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_required[$o] = $rowx[12]; + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o]; + + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + $A_field_value[$o] = $form_field_value; + + if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') ) + { + $A_field_value[$o]='----IGNORE----'; + } + else + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $CFinsert_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + $o++; + } + + if (strlen($CFinsert_SQL)>3) + { + $CFinsert_SQL = preg_replace("/,$/","",$CFinsert_SQL); + $custom_table_update_SQL = "INSERT INTO custom_$list_id SET lead_id='$lead_id',$CFinsert_SQL;"; + $rslt=mysql_query($custom_table_update_SQL, $link); + $custom_insert_count = mysql_affected_rows($link); + if ($custom_insert_count > 0) + { + # Update vicidial_list entry to put list_id as entry_list_id + $vl_table_entry_update_SQL = "UPDATE vicidial_list SET entry_list_id='$list_id' where lead_id='$lead_id';"; + $rslt=mysql_query($vl_table_entry_update_SQL, $link); + $vl_table_entry_update_count = mysql_affected_rows($link); + + $result = 'NOTICE'; + $result_reason = "add_lead CUSTOM FIELDS VALUES ADDED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id|$vl_table_entry_update_count\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + else + { + $result = 'NOTICE'; + $result_reason = "add_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "add_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "add_lead CUSTOM FIELDS NOT ADDED, NO CUSTOM FIELDS DEFINED FOR THIS LIST"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "add_lead CUSTOM FIELDS NOT ADDED, CUSTOM FIELDS DISABLED"; + echo "$result: $result_reason - $phone_number|$lead_id|$custom_fields|$custom_fields_enabled\n"; + $data = "$phone_number|$lead_id|$custom_fields|$custom_fields_enabled"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + ### END custom fields insert section ### + if ($add_to_hopper == 'Y') { $dialable=1; @@ -1542,6 +1697,569 @@ if ($function == 'add_lead') + + +################################################################################ +### update_lead - updates a lead in the vicidial_list table +################################################################################ +if ($function == 'update_lead') + { + if(strlen($source)<2) + { + $result = 'ERROR'; + $result_reason = "Invalid Source"; + echo "$result: $result_reason - $source\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + echo "ERROR: Invalid Source: |$source|\n"; + exit; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access='1' and modify_leads='1' and user_level > 7;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $modify_leads=$row[0]; + + if ($modify_leads < 1) + { + $result = 'ERROR'; + $result_reason = "update_lead USER DOES NOT HAVE PERMISSION TO UPDATE LEADS IN THE SYSTEM"; + echo "$result: $result_reason: |$user|$modify_leads|\n"; + $data = "$modify_leads"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $search_SQL=''; + $lead_id_SQL=''; + $vendor_lead_code_SQL=''; + $phone_number_SQL=''; + $find_lead_id=0; + $find_vendor_lead_code=0; + $find_phone_number=0; + if ( (strlen($search_location)<4) or ($list_id < 99) or (strlen($list_id)<3) ) + {$search_location='SYSTEM';} + if (strlen($search_method)<6) + {$search_method='LEAD_ID';} + if (strlen($records)<1) + {$records='1';} + if ( (preg_match("/LEAD_ID/",$search_method)) and (strlen($lead_id)>0) ) + { + $find_lead_id=1; + $lead_id_SQL = "lead_id='$lead_id'"; + } + if ( (preg_match("/VENDOR_LEAD_CODE/",$search_method)) and (strlen($vendor_lead_code)>0) ) + { + $find_vendor_lead_code=1; + $vendor_lead_code_SQL = "vendor_lead_code='$vendor_lead_code'"; + } + if ( (preg_match("/PHONE_NUMBER/",$search_method)) and (strlen($phone_number)>5) and (strlen($phone_number)<19) ) + { + $find_phone_number=1; + $phone_number_SQL = "phone_number='$phone_number'"; + } + if ( ($find_lead_id<1) and ($find_vendor_lead_code<1) and ($find_phone_number<1) ) + { + $result = 'ERROR'; + $result_reason = "update_lead NO VALID SEARCH METHOD"; + $data = "$search_method|$lead_id|$vendor_lead_code|$phone_number"; + echo "$result: $result_reason - $user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + if (eregi("CAMPAIGN",$search_location)) # find lists within campaign + { + $stmt="SELECT campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $search_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$search_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $search_lists .= "'$row[0]',"; + $L++; + } + $search_lists = eregi_replace(",$",'',$search_lists); + $search_SQL = "and list_id IN($search_lists)"; + } + } + } + if (eregi("LIST",$search_location)) # search check within list + { + $search_SQL = "and list_id='$list_id'"; + } + + $search_found=0; + if ($find_lead_id > 0) # search for the lead_id + { + if ($DB>0) {echo "DEBUG: Checking for lead_id - $lead_id\n";} + $stmt="SELECT lead_id,list_id,entry_list_id from vicidial_list where $lead_id_SQL $search_SQL order by entry_date desc limit $records;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + $n=0; + while ($pc_recs > $n) + { + $row=mysql_fetch_row($rslt); + $search_lead_id[$n] = $row[0]; + $search_lead_list[$n] = $row[1]; + $search_entry_list[$n] = $row[2]; + $n++; + $search_found++; + } + } + if ( ($find_vendor_lead_code > 0) and ($search_found < 1) ) # search for the vendor_lead_code + { + if ($DB>0) {echo "DEBUG: Checking for vendor_lead_code - $vendor_lead_code\n";} + $stmt="SELECT lead_id,list_id,entry_list_id from vicidial_list where $vendor_lead_code_SQL $search_SQL order by entry_date desc limit $records;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + $n=0; + while ($pc_recs > $n) + { + $row=mysql_fetch_row($rslt); + $search_lead_id[$n] = $row[0]; + $search_lead_list[$n] = $row[1]; + $search_entry_list[$n] = $row[2]; + $n++; + $search_found++; + } + } + if ( ($find_phone_number > 0) and ($search_found < 1) ) # search for the phone_number + { + if ($DB>0) {echo "DEBUG: Checking for phone_number - $phone_number\n";} + $stmt="SELECT lead_id,list_id,entry_list_id from vicidial_list where $phone_number_SQL $search_SQL order by entry_date desc limit $records;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + $n=0; + while ($pc_recs > $n) + { + $row=mysql_fetch_row($rslt); + $search_lead_id[$n] = $row[0]; + $search_lead_list[$n] = $row[1]; + $search_entry_list[$n] = $row[2]; + $n++; + $search_found++; + } + } + ### END searching ### + + if ($no_update=='Y') + { + if ($search_found > 0) + { + $result = 'NOTICE'; + $result_reason = "update_lead LEADS FOUND IN THE SYSTEM"; + $data = "$lead_id|$vendor_lead_code|$phone_number|$search_lead_list[0]|$search_entry_list[0]"; + echo "$result: $result_reason: |$user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead NO MATCHES FOUND IN THE SYSTEM"; + $data = "$lead_id|$vendor_lead_code|$phone_number"; + echo "$result: $result_reason: |$user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + exit; + } + else + { + if ($search_found > 0) + { + $VL_update_SQL=''; + ##### BEGIN update lead information in the system ##### + if (strlen($user_field)>0) {$VL_update_SQL .= "user='$user_field',";} + if (strlen($list_id_field)>0) {$VL_update_SQL .= "list_id='$list_id_field',";} + if (strlen($status)>0) {$VL_update_SQL .= "status='$status',";} + if (strlen($vendor_lead_code)>0) {$VL_update_SQL .= "vendor_lead_code='$vendor_lead_code',";} + if (strlen($source_id)>0) {$VL_update_SQL .= "source_id='$source_id',";} + if (strlen($gmt_offset_now)>0) {$VL_update_SQL .= "gmt_offset_now='$gmt_offset_now',";} + if (strlen($title)>0) {$VL_update_SQL .= "title='$title',";} + if (strlen($first_name)>0) {$VL_update_SQL .= "first_name='$first_name',";} + if (strlen($middle_initial)>0) {$VL_update_SQL .= "middle_initial='$middle_initial',";} + if (strlen($last_name)>0) {$VL_update_SQL .= "last_name='$last_name',";} + if (strlen($address1)>0) {$VL_update_SQL .= "address1='$address1',";} + if (strlen($address2)>0) {$VL_update_SQL .= "address2='$address2',";} + if (strlen($address3)>0) {$VL_update_SQL .= "address3='$address3',";} + if (strlen($city)>0) {$VL_update_SQL .= "city='$city',";} + if (strlen($state)>0) {$VL_update_SQL .= "state='$state',";} + if (strlen($province)>0) {$VL_update_SQL .= "province='$province',";} + if (strlen($postal_code)>0) {$VL_update_SQL .= "postal_code='$postal_code',";} + if (strlen($country_code)>0) {$VL_update_SQL .= "country_code='$country_code',";} + if (strlen($gender)>0) {$VL_update_SQL .= "gender='$gender',";} + if (strlen($date_of_birth)>0) {$VL_update_SQL .= "date_of_birth='$date_of_birth',";} + if (strlen($alt_phone)>0) {$VL_update_SQL .= "alt_phone='$alt_phone',";} + if (strlen($email)>0) {$VL_update_SQL .= "email='$email',";} + if (strlen($security_phrase)>0) {$VL_update_SQL .= "security_phrase='$security_phrase',";} + if (strlen($comments)>0) {$VL_update_SQL .= "comments='$comments',";} + if (strlen($rank)>0) {$VL_update_SQL .= "rank='$rank',";} + if (strlen($owner)>0) {$VL_update_SQL .= "owner='$owner',";} + if (strlen($called_count)>0) {$VL_update_SQL .= "called_count='$called_count',";} + $VL_update_SQL = preg_replace("/,$/","",$VL_update_SQL); + $VL_update_SQL = preg_replace("/'--BLANK--'/","''",$VL_update_SQL); + $VL_update_SQL = preg_replace("/\n/","!N",$VL_update_SQL); + + $n=0; + while ($search_found > $n) + { + $VLaffected_rows=0; + $CFaffected_rows=0; + if ( (strlen($VL_update_SQL)>6) or ($delete_lead=='Y') ) + { + if ($delete_lead=='Y') + { + $stmt = "DELETE from vicidial_list where lead_id='$search_lead_id[$n]';"; + $result_reason = "update_lead LEAD HAS BEEN DELETED"; + } + else + { + $stmt = "UPDATE vicidial_list SET $VL_update_SQL where lead_id='$search_lead_id[$n]';"; + $result_reason = "update_lead LEAD HAS BEEN UPDATED"; + } + if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $VLaffected_rows = mysql_affected_rows($link); + + $result = 'SUCCESS'; + echo "$result: $result_reason - $user|$search_lead_id[$n]\n"; + $data = "$phone_number|$list_id|$lead_id|$gmt_offset"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + ##### BEGIN custom fields update query build ##### + if ($custom_fields=='Y') + { + $lead_custom_list = $search_lead_list[$n]; + if ($search_entry_list[$n] > 99) {$lead_custom_list = $search_entry_list[$n];} + $update_sent=0; + $CFoutput=''; + $stmt="SHOW TABLES LIKE \"custom_$lead_custom_list\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $update_SQL=''; + $VL_update_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$lead_custom_list' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $new_field_value=''; + $form_field_value=''; + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_type[$o] = $rowx[6]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_required[$o] = $rowx[12]; + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o]; + + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + $A_field_value[$o] = $form_field_value; + + if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') ) + { + $A_field_value[$o]='----IGNORE----'; + } + else + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + $o++; + } + + $custom_update_count=0; + if (strlen($update_SQL)>3) + { + $custom_record_lead_count=0; + $stmt="SELECT count(*) from custom_$lead_custom_list where lead_id='$search_lead_id[$n]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldleadcount_to_print = mysql_num_rows($rslt); + if ($fieldleadcount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_record_lead_count = $rowx[0]; + } + $update_SQL = preg_replace("/,$/","",$update_SQL); + $custom_table_update_SQL = "INSERT INTO custom_$lead_custom_list SET lead_id='$search_lead_id[$n]',$update_SQL;"; + if ($custom_record_lead_count > 0) + {$custom_table_update_SQL = "UPDATE custom_$lead_custom_list SET $update_SQL where lead_id='$search_lead_id[$n]';";} + + $rslt=mysql_query($custom_table_update_SQL, $link); + $custom_update_count = mysql_affected_rows($link); + if ($DB) {echo "$custom_update_count|$custom_table_update_SQL\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS VALUES UPDATED"; + echo "$result: $result_reason - $phone_number|$search_lead_id[$n]|$search_lead_list[$n]|$search_entry_list[$n]|$lead_custom_list|$custom_update_count\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + + $update_sent++; + } + + if ($custom_update_count > 0) + { + $list_table_update_SQL = "UPDATE vicidial_list SET entry_list_id='$lead_custom_list' where lead_id='$search_lead_id[$n]';"; + $rslt=mysql_query($list_table_update_SQL, $link); + $list_update_count = mysql_affected_rows($link); + if ($DB) {echo "$list_update_count|$list_table_update_SQL\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO CUSTOM FIELDS DEFINED FOR THIS LIST"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + ##### END custom fields update query build ##### + + $n++; + } + + ##### END update lead information in the system ##### + } + else + { + $result = 'ERROR'; + if ($insert_if_not_found=='Y') + {$result = 'NOTICE';} + $result_reason = "update_lead NO MATCHES FOUND IN THE SYSTEM"; + $data = "$lead_id|$vendor_lead_code|$phone_number"; + echo "$result: $result_reason: |$user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + if ($insert_if_not_found!='Y') + {exit;} + else + { + if (strlen($list_id_field)>0) {$list_id=$list_id_field;} + ##### BEGIN insert not-found lead into the system ##### + if ( (strlen($phone_number)<6) or (strlen($phone_number)>18) or (strlen($phone_code)<1) or (strlen($list_id)<3) ) + { + $result = 'ERROR'; + $result_reason = "update_lead INVALID DATA FOR LEAD INSERTION"; + $data = "$phone_number|$phone_code|$list_id|$insert_if_not_found"; + echo "$result: $result_reason - $user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + ### get current gmt_offset of the phone_number + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); + + if (strlen($status)<1) + {$status='NEW';} + ### insert a new lead in the system with this phone number + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='$status',user='$user',vendor_lead_code='$vendor_lead_code',source_id='$source_id',gmt_offset_now='$gmt_offset',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',country_code='$country_code',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',called_since_last_reset='N',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',rank='$rank',owner='$owner',entry_list_id='0';"; + if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $lead_id = mysql_insert_id($link); + + $result = 'SUCCESS'; + $result_reason = "update_lead LEAD HAS BEEN ADDED"; + echo "$result: $result_reason - $phone_number|$list_id|$lead_id|$gmt_offset|$user\n"; + $data = "$phone_number|$list_id|$lead_id|$gmt_offset"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + + if (strlen($multi_alt_phones) > 5) + { + $map=$MT; $ALTm_phone_code=$MT; $ALTm_phone_number=$MT; $ALTm_phone_note=$MT; + $map = explode('!', $multi_alt_phones); + $map_count = count($map); + if ($DB>0) {echo "DEBUG: update_lead multi-al-entry - $a|$map_count|$multi_alt_phones\n";} + $g++; + $r=0; $s=0; $inserted_alt_phones=0; + while ($r < $map_count) + { + $s++; + $ncn=$MT; + $ncn = explode('_', $map[$r]); + print "$ncn[0]|$ncn[1]|$ncn[2]"; + + if (strlen($forcephonecode) > 0) + {$ALTm_phone_code[$r] = $forcephonecode;} + else + {$ALTm_phone_code[$r] = $ncn[1];} + if (strlen($ALTm_phone_code[$r]) < 1) + {$ALTm_phone_code[$r]='1';} + $ALTm_phone_number[$r] = $ncn[0]; + $ALTm_phone_note[$r] = $ncn[2]; + $stmt = "INSERT INTO vicidial_list_alt_phones (lead_id,phone_code,phone_number,alt_phone_note,alt_phone_count) values('$lead_id','$ALTm_phone_code[$r]','$ALTm_phone_number[$r]','$ALTm_phone_note[$r]','$s');"; + if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $Zaffected_rows = mysql_affected_rows($link); + $inserted_alt_phones = ($inserted_alt_phones + $Zaffected_rows); + $r++; + } + $result = 'NOTICE'; + $result_reason = "update_lead MULTI-ALT-PHONE NUMBERS LOADED"; + echo "$result: $result_reason - $inserted_alt_phones|$lead_id|$user\n"; + $data = "$inserted_alt_phones|$lead_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + + + ### BEGIN custom fields insert section ### + if ($custom_fields == 'Y') + { + if ($custom_fields_enabled > 0) + { + $stmt="SHOW TABLES LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $CFinsert_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $new_field_value=''; + $form_field_value=''; + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_type[$o] = $rowx[6]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_required[$o] = $rowx[12]; + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o]; + + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + $A_field_value[$o] = $form_field_value; + + if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') ) + { + $A_field_value[$o]='----IGNORE----'; + } + else + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $CFinsert_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + $o++; + } + + if (strlen($CFinsert_SQL)>3) + { + $CFinsert_SQL = preg_replace("/,$/","",$CFinsert_SQL); + $custom_table_update_SQL = "INSERT INTO custom_$list_id SET lead_id='$lead_id',$CFinsert_SQL;"; + $rslt=mysql_query($custom_table_update_SQL, $link); + $custom_insert_count = mysql_affected_rows($link); + if ($custom_insert_count > 0) + { + # Update vicidial_list entry to put list_id as entry_list_id + $vl_table_entry_update_SQL = "UPDATE vicidial_list SET entry_list_id='$list_id' where lead_id='$lead_id';"; + $rslt=mysql_query($vl_table_entry_update_SQL, $link); + $vl_table_entry_update_count = mysql_affected_rows($link); + + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS VALUES ADDED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id|$vl_table_entry_update_count\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO CUSTOM FIELDS DEFINED FOR THIS LIST"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS NOT ADDED, CUSTOM FIELDS DISABLED"; + echo "$result: $result_reason - $phone_number|$lead_id|$custom_fields|$custom_fields_enabled\n"; + $data = "$phone_number|$lead_id|$custom_fields|$custom_fields_enabled"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + ### END custom fields insert section ### + } + } + ##### END insert not-found lead into the system ##### + } + } + } + } + } + exit; + } + } +################################################################################ +### END update_lead +################################################################################ + + + + + $result = 'ERROR'; $result_reason = "NO FUNCTION SPECIFIED"; echo "$result: $result_reason\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_report.php b/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_report.php index 2b1198bd..1ba83d19 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_report.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_report.php @@ -12,6 +12,9 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -42,9 +45,12 @@ if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($order)<2) {$order='hours_down';} +$report_name = 'UsuarioReloj de tiempo Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -52,22 +58,39 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $SSoutbound_autodial_active = $row[2]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -76,6 +99,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -139,9 +183,10 @@ while ($i < $user_groups_to_print) -UsuarioReloj de tiempo Report +<TITLE> <?php +echo "$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -373,20 +418,6 @@ echo "</TR>\n"; echo "</TABLE>\n"; -echo "\n"; - -/* - $TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60); - $TOTavgWAIT_M = round($TOTavgWAIT_M, 2); - $TOTavgWAIT_M_int = intval("$TOTavgWAIT_M"); - $TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int); - $TOTavgWAIT_S = ($TOTavgWAIT_S * 60); - $TOTavgWAIT_S = round($TOTavgWAIT_S, 0); - if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";} - $TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S"; - $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); - while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} -*/ ?> </CENTER> </BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_status.php b/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_status.php index 21bf28c5..09ca5e09 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/timeclock_status.php @@ -10,6 +10,9 @@ # 90310-2103 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # header ("Content-type: text/html; charset=utf-8"); @@ -35,9 +38,12 @@ if (isset($_GET["ENVIAR"])) {$ENVIAR=$_GET["ENVIAR"];} elseif (isset($_POST["ENVIAR"])) {$ENVIAR=$_POST["ENVIAR"];} +$report_name = 'Grupo Del UsuarioReloj de tiempo Status Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable,timeclock_end_of_day FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -45,13 +51,24 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $timeclock_end_of_day = $row[2]; - $SSoutbound_autodial_active = $row[3]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; + $timeclock_end_of_day = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -68,12 +85,18 @@ else $EoDdate = date("Y-m-d H:i:s", $EoD); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); @@ -86,32 +109,28 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } -else + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) { - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; } - $stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -141,8 +160,9 @@ if (strlen($user_group) > 0) <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION:Reloj de tiempo Status +<title>ADMINISTRATION: <?php +echo "$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -399,7 +419,7 @@ $RUNtime = ($ENDtime - $STARTtime); echo "\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; +echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; ?> @@ -523,7 +543,7 @@ $RUNtime = ($ENDtime - $STARTtime); echo "\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; +echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/user_stats.php b/agc_2-X/trunk/LANG_www/vicidial_es/user_stats.php index bc15cbfc..0aa88237 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/user_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/user_stats.php @@ -20,8 +20,14 @@ # 90508-0644 - Changed to PHP long tags # 90524-2009 - Changed time display to use functions.php # 91130-2037 - Added user closer log manager flag display +# 100126-0847 - Added DID log display options # 100203-1008 - Added agent activity log section # 100216-0042 - Added popup date selector +# 100425-0115 - Added more login data +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100908-1205 - Added customer 3way hangup flags to user calls display +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # header ("Content-type: text/html; charset=utf-8"); @@ -29,25 +35,44 @@ header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); require("functions.php"); + +$report_name = 'Estadísticas de usuario'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} + elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} +if (isset($_GET["did"])) {$did=$_GET["did"];} + elseif (isset($_POST["did"])) {$did=$_POST["did"];} if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} @@ -72,12 +97,18 @@ $TODAY = date("Y-m-d"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); @@ -90,27 +121,40 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +$stmt="SELECT full_name,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGfullname = $row[0]; +$LOGuser_group = $row[1]; + +fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); +fclose($fp); + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL INFORMES/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +if ($did > 0) + { + $stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } else { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - echo "Nombre y contraseña inválidos del usuario: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - $stmt="SELECT full_name from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -128,9 +172,14 @@ else <link rel="stylesheet" href="calendar.css"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION: Estadísticas de usuario <?php +if ($did > 0) + {echo "<title>ADMINISTRATION: DID Call Stats";} +else + {echo "<title>ADMINISTRATION: $report_name";} + + ##### BEGIN Set variables to make header show properly ##### $ADD = '3'; @@ -148,6 +197,14 @@ $users_color = '#FFFF99'; $users_font = 'BLACK'; $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; +if ($did > 0) + { + $hh = 'ingroups'; + $ADD = '3311'; + $ingroups_color = '#FFFF99'; + $ingroups_font = 'BLACK'; + $ingroups_color = '#E6E6E6'; + } ##### END Set variables to make header show properly ##### require("admin_header.php"); @@ -155,17 +212,25 @@ require("admin_header.php"); ?> -<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Estadísticas de usuario for <?php echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> - - - - +<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2> <?php +if ($did > 0) + {echo "<B>   DID Call Stats for $user";} +else + {echo "<B>   Estadísticas de usuario for $user";} + +?> +</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> +<?php + + echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; echo "<form action=$PHP_SELF method=POST name=vicidial_report id=vicidial_report>\n"; echo "<input type=hidden name=DB value=\"$DB\">\n"; +echo "<input type=hidden name=did_id value=\"$did_id\">\n"; +echo "<input type=hidden name=did value=\"$did\">\n"; echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; ?> @@ -197,19 +262,27 @@ o_cal.a_tpl.yearscroll = false; <?php if (strlen($user)>1) - {echo "  <input type=hidden name=user value=\"$user\">\n";} + {echo "<input type=hidden name=user value=\"$user\">\n";} else - {echo "  <input type=text name=user size=12 maxlength=10>\n";} + {echo "<input type=text name=user size=12 maxlength=10>\n";} echo "<input type=submit name=submit value=submit>\n"; echo "           $user - $full_name<BR><BR>\n"; echo "<center>\n"; -echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Hoja de tiempo</a>\n"; -echo " | <a href=\"./user_status.php?user=$user\">Condición de Usuario</a>\n"; -echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modificar Usuario</a>\n"; -echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Usuario multiple day status detail report</a>"; +if ($did > 0) + { + echo "<a href=\"./AST_DIDstats.php?group[0]=$did_id&query_date=$begin_date&end_date=$end_date\">DID traffic report</a>\n"; + echo " | <a href=\"./admin.php?ADD=3311&did_id=$did_id\">ModificarDID</a>\n"; + } +else + { + echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Hoja de tiempo</a>\n"; + echo " | <a href=\"./user_status.php?user=$user\">Condición de Usuario</a>\n"; + echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modificar Usuario</a>\n"; + echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Usuario multiple day status detail report</a>"; + } echo "</center>\n"; @@ -218,324 +291,332 @@ echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; echo "<br><center>\n"; -##### vicidial agent talk time and status ##### -echo "<B>AGENTE TIEMPO Y ESTADO DE CONVERSACIÓN:</B>\n"; - -echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ESTADO</td><td align=right><font size=2>CUENTA</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VLstatuses_to_print = mysql_num_rows($rslt); -$total_calls=0; -$o=0; $p=0; -while ($VLstatuses_to_print > $o) +if ($did < 1) { - $row=mysql_fetch_row($rslt); - $counts[$p] = $row[0]; - $status[$p] = $row[1]; - $call_sec[$p] = $row[2]; - $p++; - $o++; - } + ##### vicidial agent talk time and status ##### + echo "<B>AGENTE TIEMPO Y ESTADO DE CONVERSACIÓN:</B>\n"; -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VCLstatuses_to_print = mysql_num_rows($rslt); -$o=0; -while ($VCLstatuses_to_print > $o) - { - $status_match=0; - $r=0; - $row=mysql_fetch_row($rslt); - while ($VLstatuses_to_print > $r) - { - if ($status[$r] == $row[1]) - { - $counts[$r] = ($counts[$r] + $row[0]); - $call_sec[$r] = ($call_sec[$r] + $row[2]); - $status_match++; - } - $r++; - } - if ($status_match < 1) + echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=2>ESTADO</td><td align=right><font size=2>CUENTA</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; + $rslt=mysql_query($stmt, $link); + $VLstatuses_to_print = mysql_num_rows($rslt); + $total_calls=0; + $o=0; $p=0; + while ($VLstatuses_to_print > $o) { + $row=mysql_fetch_row($rslt); $counts[$p] = $row[0]; $status[$p] = $row[1]; $call_sec[$p] = $row[2]; - $VLstatuses_to_print++; $p++; + $o++; } - $o++; - } -$o=0; -$total_sec=0; -while ($o < $p) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_hours_minutes = sec_convert($call_sec[$o],'H'); - - echo "<tr $bgcolor><td><font size=2>$status[$o]</td>"; - echo "<td align=right><font size=2> $counts[$o]</td>\n"; - echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; - $total_calls = ($total_calls + $counts[$o]); - $total_sec = ($total_sec + $call_sec[$o]); - $call_seconds=0; - $o++; - } - -$call_hours_minutes = sec_convert($total_sec,'H'); - -echo "<tr><td><font size=2>LLAMADAS TOTALES </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; -echo "</TABLE></center>\n"; - - -##### Login and Logout time from vicidial agent interface ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>AGENTE TIEMPO LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; + $VCLstatuses_to_print = mysql_num_rows($rslt); $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { + while ($VCLstatuses_to_print > $o) + { + $status_match=0; + $r=0; $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) + while ($VLstatuses_to_print > $r) + { + if ($status[$r] == $row[1]) + { + $counts[$r] = ($counts[$r] + $row[0]); + $call_sec[$r] = ($call_sec[$r] + $row[2]); + $status_match++; + } + $r++; + } + if ($status_match < 1) + { + $counts[$p] = $row[0]; + $status[$p] = $row[1]; + $call_sec[$p] = $row[2]; + $VLstatuses_to_print++; + $p++; + } + $o++; + } + + $o=0; + $total_sec=0; + while ($o < $p) + { + if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) + $call_hours_minutes = sec_convert($call_sec[$o],'H'); + + echo "<tr $bgcolor><td><font size=2>$status[$o]</td>"; + echo "<td align=right><font size=2> $counts[$o]</td>\n"; + echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); + $call_seconds=0; + $o++; + } + + $call_hours_minutes = sec_convert($total_sec,'H'); + + echo "<tr><td><font size=2>LLAMADAS TOTALES </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + echo "</TABLE></center>\n"; + + + ##### Login and Salir time from vicidial agent interface ##### + + echo "<br><br>\n"; + + echo "<center>\n"; + + echo "<B>AGENTE TIEMPO LOGIN/LOGOUT:</B>\n"; + echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td><td align=right><font size=2>SESSION</td><td align=right><font size=2>SERVER</td><td align=right><font size=2>PHONE</td><td align=right><font size=2>COMPUTER</td></tr>\n"; + + $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_calls=0; + $o=0; + $event_start_seconds=''; + $event_stop_seconds=''; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if (eregi("LOGIN", $row[0])) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if (ereg("LOGIN", $row[0])) { - - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours_minutes = sec_convert($event_seconds,'H'); - + $event_start_seconds = $row[1]; echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; echo "<td align=right><font size=2> $row[2]</td>\n"; echo "<td align=right><font size=2> $row[3]</td>\n"; echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes</td></tr>\n"; - $event_start_seconds=''; - $event_stop_seconds=''; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> $row[5] </td>\n"; + echo "<td align=right><font size=2> $row[6] </td>\n"; + echo "<td align=right><font size=2> $row[7] </td>\n"; + echo "<td align=right><font size=2> $row[8] </td></tr>\n"; } - else + if (ereg("LOGOUT", $row[0])) { - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; + if ($event_start_seconds) + { + + $event_stop_seconds = $row[1]; + $event_seconds = ($event_stop_seconds - $event_start_seconds); + $total_login_time = ($total_login_time + $event_seconds); + $event_hours_minutes = sec_convert($event_seconds,'H'); + + echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> $row[3]</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; + echo "<td align=right><font size=2> $event_hours_minutes</td>\n"; + echo "<td align=right colspan=4><font size=2>  </td></tr>\n"; + $event_start_seconds=''; + $event_stop_seconds=''; + } + else + { + echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> $row[3]</td>\n"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right colspan=5><font size=2>  </td></tr>\n"; + } + } + + $total_calls = ($total_calls + $row[0]); + + $call_seconds=0; + $o++; + } + + $total_login_hours_minutes = sec_convert($total_login_time,'H'); + + echo "<tr><td><font size=2>TOTAL</td>"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + + echo "</TABLE></center>\n"; + + + + + + ##### vicidial_timeclock log records for user ##### + + $total_login_time=0; + $SQday_ARY = explode('-',$begin_date); + $EQday_ARY = explode('-',$end_date); + $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); + $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); + + echo "<br><br>\n"; + + echo "<center>\n"; + + echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; + echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; + if ($DB>0) {echo "|$stmt|";} + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_logs=0; + $o=0; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $TC_log_date = date("Y-m-d H:i:s", $row[1]); + + $manager_edit=''; + if (strlen($row[6])>0) {$manager_edit = ' * ';} + + if (ereg("LOGIN", $row[0])) + { + $login_sec=''; + echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + echo "<td align=right><font size=2>$manager_edit</td>"; + echo "<td align=right><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $TC_log_date</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; echo "<td align=right><font size=2> </td></tr>\n"; } - } + if (ereg("LOGOUT", $row[0])) + { + $login_sec = $row[3]; + $total_login_time = ($total_login_time + $login_sec); + $event_hours_minutes = sec_convert($login_sec,'H'); - $total_calls = ($total_calls + $row[0]); + echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + echo "<td align=right><font size=2>$manager_edit</td>"; + echo "<td align=right><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $TC_log_date</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {echo " - $total_login_time - $login_sec";} + echo "</td></tr>\n"; + } + $o++; + } + if (strlen($login_sec)<1) + { + $login_sec = ($STARTtime - $row[1]); + $total_login_time = ($total_login_time + $login_sec); + if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} + } + $total_login_hours_minutes = sec_convert($total_login_time,'H'); - $call_seconds=0; - $o++; - } + if ($DB) {echo " - $total_login_time - $login_sec";} -$total_login_hours_minutes = sec_convert($total_login_time,'H'); + echo "<tr><td align=right><font size=2> </td>"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; + echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; -echo "<tr><td><font size=2>TOTAL</td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; - -echo "</TABLE></center>\n"; + echo "</TABLE></center>\n"; + ##### closer in-group selection logs ##### + echo "<br><br>\n"; -##### vicidial_timeclock log records for user ##### + echo "<center>\n"; -$total_login_time=0; -$SQday_ARY = explode('-',$begin_date); -$EQday_ARY = explode('-',$end_date); -$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); -$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); + echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n"; + echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAÑA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO</td><td align=right><font size=2> FECHA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - - $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + $stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); + $logs_to_print = mysql_num_rows($rslt); - $total_logs=0; - $o=0; - while ($events_to_print > $o) { + $u=0; + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); - if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $TC_log_date = date("Y-m-d H:i:s", $row[1]); + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$row[2]</td>"; + echo "<td align=left><font size=2> $row[1]</td>\n"; + echo "<td align=left><font size=2> $row[3]</td>\n"; + echo "<td align=left><font size=2> $row[4] </td>\n"; + echo "<td align=left><font size=2> $row[5]</td>\n"; + echo "</tr>\n"; + } - $manager_edit=''; - if (strlen($row[6])>0) {$manager_edit = ' * ';} - if (ereg("LOGIN", $row[0])) - { - $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - if (ereg("LOGOUT", $row[0])) - { - $login_sec = $row[3]; - $total_login_time = ($total_login_time + $login_sec); - $event_hours_minutes = sec_convert($login_sec,'H'); + echo "</TABLE><BR><BR>\n"; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; - } - $o++; + + ##### vicidial agent outbound calls for this time period ##### + + echo "<B>SALIENTE CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; + echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$row[4]</td>"; + echo "<td align=left><font size=2> $row[7]</td>\n"; + echo "<td align=left><font size=2> $row[8]</td>\n"; + echo "<td align=left><font size=2> $row[10] </td>\n"; + echo "<td align=right><font size=2> $row[3] </td>\n"; + echo "<td align=right><font size=2> $row[14] </td>\n"; + echo "<td align=right><font size=2> $row[2] </td>\n"; + echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; + echo "<td align=right><font size=2> $row[15] </td></tr>\n"; + } + + + echo "</TABLE><BR><BR>\n"; } -if (strlen($login_sec)<1) - { - $login_sec = ($STARTtime - $row[1]); - $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} - } -$total_login_hours_minutes = sec_convert($total_login_time,'H'); - -if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTAL </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE></center>\n"; - - - -##### closer in-group selection logs ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAÑA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; - -$stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[2]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[3]</td>\n"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[5]</td>\n"; - echo "</tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - - -##### vicidial agent outbound calls for this time period ##### - -echo "<B>SALIENTE CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; - -$stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[4]</td>"; - echo "<td align=left><font size=2> $row[7]</td>\n"; - echo "<td align=left><font size=2> $row[8]</td>\n"; - echo "<td align=left><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[14] </td>\n"; - echo "<td align=right><font size=2> $row[2] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; - echo "<td align=right><font size=2> $row[15] </td></tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - ##### vicidial agent inbound calls for this time period ##### @@ -544,6 +625,10 @@ echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENTE (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; $stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; +if ($did > 0) + { + $stmt="select start_time,length_in_sec,0,caller_code,0,0,0,extension,0 from call_log where channel_group='DID_Entrantes' and number_dialed='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by start_time desc limit 10000;"; + } $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -558,6 +643,16 @@ while ($logs_to_print > $u) else {$bgcolor='bgcolor="#9BB9FB"';} + if ($did > 0) + { + if (strlen($row[7]) > 17) + { + $row[7] = substr($row[7], -9); + $row[7] = ($row[7] + 0); + } + else + {$row[7]='0';} + } $TOTALinSECONDS = ($TOTALinSECONDS + $row[1]); $AGENTseconds = ($row[1] - $row[5]); if ($AGENTseconds < 0) @@ -590,99 +685,124 @@ echo "</TABLE></center><BR><BR>\n"; ##### vicidial agent activity records for this time period ##### -echo "<B>AGENTE ACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1>   </td></tr>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; - -$stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -$TOTALpauseSECONDS=0; -$TOTALwaitSECONDS=0; -$TOTALtalkSECONDS=0; -$TOTALdispoSECONDS=0; -$TOTALdeadSECONDS=0; -$TOTALcustomerSECONDS=0; -while ($logs_to_print > $u) +if ($did < 1) { - $row=mysql_fetch_row($rslt); - $event_time = $row[0]; - $lead_id = $row[1]; - $campaign_id = $row[2]; - $pause_sec = $row[3]; - $wait_sec = $row[4]; - $talk_sec = $row[5]; - $dispo_sec = $row[6]; - $dead_sec = $row[7]; - $status = $row[8]; - $pause_code = $row[9]; - $user_group = $row[10]; - $customer_sec = ($talk_sec - $dead_sec); - if ($customer_sec < 0) - {$customer_sec=0;} + echo "<B>AGENTE ACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; + echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1>   </td></tr>\n"; + echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAÑA</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + $stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); - $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); - $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); - $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); - $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); - $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + $u=0; + $TOTALpauseSECONDS=0; + $TOTALwaitSECONDS=0; + $TOTALtalkSECONDS=0; + $TOTALdispoSECONDS=0; + $TOTALdeadSECONDS=0; + $TOTALcustomerSECONDS=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $event_time = $row[0]; + $lead_id = $row[1]; + $campaign_id = $row[2]; + $pause_sec = $row[3]; + $wait_sec = $row[4]; + $talk_sec = $row[5]; + $dispo_sec = $row[6]; + $dead_sec = $row[7]; + $status = $row[8]; + $pause_code = $row[9]; + $user_group = $row[10]; + $customer_sec = ($talk_sec - $dead_sec); + if ($customer_sec < 0) + {$customer_sec=0;} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$event_time</td>"; - echo "<td align=right><font size=2> $pause_sec</td>\n"; - echo "<td align=right><font size=2> $wait_sec</td>\n"; - echo "<td align=right><font size=2> $talk_sec </td>\n"; - echo "<td align=right><font size=2> $dispo_sec </td>\n"; - echo "<td align=right><font size=2> $dead_sec </td>\n"; - echo "<td align=right><font size=2> $customer_sec </td>\n"; - echo "<td align=right><font size=2> $status </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; - echo "<td align=right><font size=2> $campaign_id </td>\n"; - echo "<td align=right><font size=2> $pause_code </td></tr>\n"; + $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); + $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); + $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); + $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); + $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); + $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + + if ($DB > 0) + { + $DBtotal_sec = ($pause_sec + $wait_sec + $talk_sec + $dispo_sec); + $DBdatetime = explode(" ",$event_time); + $DBdate = explode("-",$DBdatetime[0]); + $DBtime = explode(":",$DBdatetime[1]); + + $DBcall_end_sec = mktime($DBtime[0], $DBtime[1], ($DBtime[2] + $DBtotal_sec), $DBdate[1], $DBdate[2], $DBdate[0]); + $DBcall_end = date("Y-m-d H:i:s",$DBcall_end_sec); + echo "<tr $bgcolor>"; + echo "<td><font size=1>  </td>"; + echo "<td><font size=2>$DBcall_end</td>"; + echo "<td align=right><font size=2> $DBtotal_sec </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td></tr>\n"; + } + + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$event_time</td>"; + echo "<td align=right><font size=2> $pause_sec</td>\n"; + echo "<td align=right><font size=2> $wait_sec</td>\n"; + echo "<td align=right><font size=2> $talk_sec </td>\n"; + echo "<td align=right><font size=2> $dispo_sec </td>\n"; + echo "<td align=right><font size=2> $dead_sec </td>\n"; + echo "<td align=right><font size=2> $customer_sec </td>\n"; + echo "<td align=right><font size=2> $status </td>\n"; + echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; + echo "<td align=right><font size=2> $campaign_id </td>\n"; + echo "<td align=right><font size=2> $pause_code </td></tr>\n"; + } + + echo "<tr bgcolor=white>"; + echo "<td colspan=2><font size=2>TOTALS</td>"; + echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; + echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; + echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; + echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; + echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; + echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; + echo "<td colspan=4><font size=2>   </td></tr>\n"; + + $TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); + $TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); + $TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); + $TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); + $TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); + $TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); + + echo "<tr bgcolor=white>"; + echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>"; + echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; + echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; + echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; + echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; + echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; + echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; + echo "<td colspan=4><font size=2>   </td></tr>\n"; + + echo "</TABLE></center><BR><BR>\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALS</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -$TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); -$TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); -$TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); -$TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); -$TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); -$TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); - -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -echo "</TABLE></center><BR><BR>\n"; - - ##### vicidial recordings for this time period ##### @@ -732,7 +852,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$locat = substr($location,0,27); $locat = "$locat...";} else {$locat = $location;} - if (eregi("http",$location)) + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) {$location = "<a href=\"$location\">$locat</a>";} else {$location = $locat;} @@ -746,50 +866,56 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon echo "<td align=center><font size=2> $row[10] </td>\n"; echo "<td align=right><font size=2> $location   </td>\n"; echo "</tr>\n"; - } - echo "</TABLE><BR><BR>\n"; -##### vicidial agent outbound user manual calls for this time period ##### +if ($did < 1) + { + ##### vicidial agent outbound user manual calls for this time period ##### -echo "<B>MANUAL SALIENTE CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td></tr>\n"; + echo "<B>MANUAL SALIENTE CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; + echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td><td align=right><font size=2> PRESET</td><td align=right><font size=2>C3HU</td></tr>\n"; - $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id,preset_name,customer_hungup,customer_hungup_seconds from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); $u=0; - while ($logs_to_print > $u) { + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> $row[7] </td></tr>\n"; + $C3HU=''; + if ($row[9]=='BEFORE_CALL') {$row[9]='BC';} + if ($row[9]=='DURING_CALL') {$row[9]='DC';} + if (strlen($row[9]) > 1) + {$C3HU = "$row[9] $row[10]";} + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$row[0]</td>"; + echo "<td align=left><font size=2> $row[1]</td>\n"; + echo "<td align=left><font size=2> $row[2]</td>\n"; + echo "<td align=left><font size=2> $row[3] </td>\n"; + echo "<td align=right><font size=2> $row[4] </td>\n"; + echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; + echo "<td align=right><font size=2> $row[6] </td>\n"; + echo "<td align=right><font size=2> $row[7] </td>\n"; + echo "<td align=right><font size=2> $row[8] </td>\n"; + echo "<td align=right NOWRAP><font size=2> $C3HU </td></tr>\n"; + } + echo "</TABLE><BR><BR>\n"; } -echo "</TABLE><BR><BR>\n"; - - - $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); @@ -797,7 +923,7 @@ $RUNtime = ($ENDtime - $STARTtime); echo "\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds</font>"; +echo "<font size=0>\n\n\n<br><br><br>\nScript runtime: $RUNtime seconds|$db_source</font>"; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/user_status.php b/agc_2-X/trunk/LANG_www/vicidial_es/user_status.php index 2f7620d9..fdf779cf 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/user_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/user_status.php @@ -1,7 +1,7 @@ <?php # user_status.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,7 @@ # 91012-0536 - Added selected territories display # 91130-2039 - Added user closer log manager flag display # 91212-0656 - Added more complete logging of Emergency Logout process +# 100309-0544 - Added queuemetrics_loginout option # header ("Content-type: text/html; charset=utf-8"); @@ -338,7 +339,7 @@ if ($stage == "log_agent_out") ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "<BR>$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -351,11 +352,16 @@ if ($stage == "log_agent_out") $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; + $queuemetrics_loginout = $row[6]; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### if ($enable_queuemetrics_logging > 0) { + $QM_LOGOFF = 'AGENTLOGOFF'; + if ($queuemetrics_loginout=='CALLBACK') + {$QM_LOGOFF = 'AGENTCALLBACKLOGOFF';} + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); @@ -363,7 +369,7 @@ if ($stage == "log_agent_out") $agent_logged_in=''; $time_logged_in=''; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb='AGENTLOGIN' order by time_id desc limit 1;"; + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "<BR>$stmtB\n";} $qml_ct = mysql_num_rows($rsltB); @@ -372,12 +378,13 @@ if ($stage == "log_agent_out") $row=mysql_fetch_row($rsltB); $agent_logged_in = $row[0]; $time_logged_in = $row[1]; + $phone_logged_in = $row[2]; } $time_logged_in = ($now_date_epoch - $time_logged_in); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='" . mysql_real_escape_string($user) . "$agents',data2='$time_logged_in';"; + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; if ($DB) {echo "<BR>$stmtB\n";} $rsltB=mysql_query($stmtB, $linkB); } diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/vtiger_search.php b/agc_2-X/trunk/LANG_www/vicidial_es/vtiger_search.php index 6636a431..19fd5b30 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/vtiger_search.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/vtiger_search.php @@ -616,7 +616,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Vtiger no longer use auto increment for vtiger_crmentity crmid, vtiger_crmentity_seq is used instead to list next aviable entity ID - # Get next aviable id to use as crmid in vtiger_crmentity + # Get next available id to use as crmid in vtiger_crmentity $stmt="SELECT id from vtiger_crmentity_seq ;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -624,7 +624,7 @@ if ($lead_search > 0) $leadid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysql_error());} - # Increase next aviable crmid with 1 so next record gets proper id + # Increase next available crmid with 1 so next record gets proper id $stmt="UPDATE vtiger_crmentity_seq SET id = '$leadid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -644,7 +644,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Insert values into vtiger_leaddetails - $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$province','$country','$phone','$alt_phone','$address1 $address2');"; + $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$state','$country','$phone','$alt_phone','$address1 $address2');"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysql_error());} diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/vtiger_user.php b/agc_2-X/trunk/LANG_www/vicidial_es/vtiger_user.php index f53a989a..a7d062f9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/vtiger_user.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/vtiger_user.php @@ -3,12 +3,13 @@ # vicidial_users table into the Vtiger system as well as # the groups from VICIDIAL to Vtiger # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 81231-1307 - First build # 90228-2152 - Added Groups support # 90508-0644 - Changed to PHP long tags +# 100127-0616 - Added Vtiger ViciDial user_level role lookup # header ("Content-type: text/html; charset=utf-8"); @@ -183,15 +184,25 @@ while ($i < $VD_users_ct) $roleid = 'H5'; $status = 'Active'; $groupid = '1'; - if ($user_level[$i] >= 7) {$roleid = 'H4';} - if ($user_level[$i] >= 8) {$roleid = 'H3';} - if ($user_level[$i] >= 9) {$roleid = 'H2';} - if ($user_level[$i] >= 9) {$is_admin = 'on';} - if (ereg('N',$active[$i])) {$status = 'Inactive';} + if ($user_level[$i] >= 7) {$roleid = 'H4';} + if ($user_level[$i] >= 8) {$roleid = 'H3';} + if ($user_level[$i] >= 9) {$roleid = 'H2';} + if ($user_level[$i] >= 9) {$is_admin = 'on';} + if (ereg('N',$active[$i])) {$status = 'Inactive';} $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); $i++; + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } $j=0; $all_VICIDIAL_groups_SQL=''; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/welcome_demo.php b/agc_2-X/trunk/LANG_www/vicidial_es/welcome_demo.php index 238cf5cf..3b48ee07 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/welcome_demo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/welcome_demo.php @@ -2,7 +2,7 @@ # welcome_demo.php - VICIDIAL welcome Demo page # # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,9 @@ echo "<font size=3><b>   <a href=\"../agc_nl/vicidial.php?relogin=YES&VD_lo echo "</TD></TR>\n"; echo "<TR><TD ALIGN=LEFT >"; echo "<font size=3><b>   <a href=\"../agc_tw/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/tw.gif\" border=0> Chinese(T) Agent Login</a>"; +echo "</TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT >"; +echo "<font size=3><b>   <a href=\"../agc_se/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/se.gif\" border=0> Swedish Agent Login</a>"; echo "</TD></TR></TABLE>\n"; echo "</TD><TD VALIGN=TOP>\n"; @@ -78,6 +81,9 @@ echo "<font size=3><b>   <a href=\"../vicidial_el/admin.php\"><IMG SRC=\".. echo "</TD></TR>\n"; echo "<TR><TD ALIGN=LEFT >"; echo "<font size=3><b>   <a href=\"../vicidial_fr/admin.php\"><IMG SRC=\"../agc/images/fr.gif\" border=0> French Administration</a>"; +echo "</TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT >"; +echo "<font size=3><b>   <a href=\"../vicidial_br/admin.php\"><IMG SRC=\"../agc/images/br.gif\" border=0> Brazilian Portuguese Administration</a>"; echo "</TD></TR></TABLE>\n"; echo "<TR><TD ALIGN=LEFT ><font size=1>   </TD></TR>\n"; echo "</TABLE>\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_es/welcome_languages.php b/agc_2-X/trunk/LANG_www/vicidial_es/welcome_languages.php index d53707a9..4fe6d387 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_es/welcome_languages.php +++ b/agc_2-X/trunk/LANG_www/vicidial_es/welcome_languages.php @@ -1,8 +1,8 @@ <?php -# welcome_demo.php - VICIDIAL welcome Demo page +# welcome_languages.php - VICIDIAL welcome Languages page # # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,9 @@ echo "<font size=3><b>   <a href=\"../agc_nl/vicidial.php\"><IMG SRC=\"../a echo "</TD></TR>\n"; echo "<TR><TD ALIGN=LEFT >"; echo "<font size=3><b>   <a href=\"../agc_tw/vicidial.php\"><IMG SRC=\"../agc/images/tw.gif\" border=0> Chinese(T) Agent Login</a>"; +echo "</TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT >"; +echo "<font size=3><b>   <a href=\"../agc_se/vicidial.php\"><IMG SRC=\"../agc/images/se.gif\" border=0> Swedish Agent Login</a>"; echo "</TD></TR></TABLE>\n"; echo "</TD><TD VALIGN=TOP>\n"; @@ -78,6 +81,9 @@ echo "<font size=3><b>   <a href=\"../vicidial_el/admin.php\"><IMG SRC=\".. echo "</TD></TR>\n"; echo "<TR><TD ALIGN=LEFT >"; echo "<font size=3><b>   <a href=\"../vicidial_fr/admin.php\"><IMG SRC=\"../agc/images/fr.gif\" border=0> French Administration</a>"; +echo "</TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT >"; +echo "<font size=3><b>   <a href=\"../vicidial_br/admin.php\"><IMG SRC=\"../agc/images/br.gif\" border=0> Brazilian Portuguese Administration</a>"; echo "</TD></TR></TABLE>\n"; echo "<TR><TD ALIGN=LEFT ><font size=1>   </TD></TR>\n"; echo "</TABLE>\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSER_service_level.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSER_service_level.php index 4bc7a60d..2beb8ff2 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSER_service_level.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSER_service_level.php @@ -14,6 +14,9 @@ # 90801-0923 - Added in-group name to pulldown # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -39,9 +42,12 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Inbound Service Level Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -49,17 +55,34 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { @@ -69,6 +92,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -106,7 +150,7 @@ echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n"; echo "<link rel=\"stylesheet\" href=\"calendar.css\">\n"; echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; -echo "<TITLE>Inbound Service Level Report\n"; +echo "$report_name\n"; $short_header=1; @@ -979,7 +1023,7 @@ echo "+-------------+-------+-----------------------------------------+ +------+ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "\nRun Time: $RUNtime seconds\n"; +echo "\nRun Time: $RUNtime seconds|$db_source\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php index 7bde74e4..a900089a 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERstats.php @@ -27,6 +27,10 @@ # 100206-1454 - Fixed TMR(service level) calculation # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100709-1809 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100913-1634 - Added DID option to select by DIDs instead of In-groups +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -47,6 +51,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["DID"])) {$DID=$_GET["DID"];} + elseif (isset($_POST["DID"])) {$DID=$_POST["DID"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} @@ -56,9 +62,12 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $MT[0]='0'; if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Inbound Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -66,10 +75,23 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + + $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -82,13 +104,18 @@ if ($gmt_conf_ct > 0) $epoch_offset = (($local_gmt + $dst) * 3600); } -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { @@ -98,6 +125,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -105,7 +153,9 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; +$stmt="select group_id,group_name,8 from vicidial_inbound_groups order by group_id;"; +if ($DID=='Y') + {$stmt="select did_pattern,did_description,did_id from vicidial_inbound_dids order by did_pattern;";} $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -118,6 +168,7 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] = $row[0]; $LISTgroup_names[$i] = $row[1]; + $LISTgroup_ids[$i] = $row[2]; $i++; } @@ -175,7 +226,7 @@ echo "\n"; echo "\n"; echo "\n"; -echo "Inbound Stats\n"; +echo "$report_name\n"; $short_header=1; @@ -195,6 +246,7 @@ if ($DB > 0) echo "\n"; echo "\n"; @@ -274,10 +332,13 @@ echo "
    \n\n";
     
     
     if ($groups_to_print < 1)
    -{
    -echo "\n\n";
    -echo "SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";
    -}
    +	{
    +	echo "\n\n";
    +	if ($DID=='Y')
    +		{echo "PLEASE SELECT A DID AND DATE RANGE ABOVE AND CLICK INVIA\n";}
    +	else
    +		{echo "SELEZIONA UN GRUPPO IN-E DATE SOPRA e fare clic su Invia\n";}
    +	}
     
     else
     {
    @@ -310,30 +371,111 @@ echo "Inbound Call Stats: $group_string          $NOW_TIME\n";
     
     
     
    +if ($DID=='Y')
    +	{
    +	$stmt="select did_id from vicidial_inbound_dids where did_pattern IN($group_SQL);";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$dids_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $dids_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$did_id[$i] = $row[0];
    +		$did_SQL .= "'$row[0]',";
    +		$i++;
    +		}
    +	$did_SQL = eregi_replace(",$",'',$did_SQL);
    +	if (strlen($did_SQL)<3) {$did_SQL="''";}
     
    +	$stmt="select uniqueid from vicidial_did_log where did_id IN($did_SQL);";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {echo "$stmt\n";}
    +	$unids_to_print = mysql_num_rows($rslt);
    +	$i=0;
    +	while ($i < $unids_to_print)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$unid_SQL .= "'$row[0]',";
    +		$i++;
    +		}
    +	$unid_SQL = eregi_replace(",$",'',$unid_SQL);
    +	if (strlen($unid_SQL)<3) {$unid_SQL="''";}
    +
    +	if ($DB > 0)
    +		{echo "|$did_SQL|$unid_SQL|\n";}
    +
    +	}
     
     if ($group_ct > 1)
     	{
     	echo "\n";
     	echo "---------- MULTI-GROUP BREAKDOWN:\n";
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    -	echo "| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    -	echo "+----------------------+---------+---------+---------+---------+\n";
    +	if ($DID=='Y')
    +		{
    +		echo "+----------------------+---------+---------+---------+---------+\n";
    +		echo "| DID                  | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		echo "+----------------------+---------+---------+---------+---------+\n";
    +		}
    +	else
    +		{
    +		echo "+----------------------+---------+---------+---------+---------+\n";
    +		echo "| IN-GROUP             | CALLS   | DROPS   | DROP %  | IVR     |\n";
    +		echo "+----------------------+---------+---------+---------+---------+\n";
    +		}
     
     	$i=0;
     	while($i < $group_ct)
     		{
    +		$did_id[$i]='0';
    +		$DIDunid_SQL='';
    +		$stmt="select did_id from vicidial_inbound_dids where did_pattern='$group[$i]';";
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {echo "$stmt\n";}
    +		$Sdids_to_print = mysql_num_rows($rslt);
    +		if ($Sdids_to_print > 0)
    +			{
    +			$row=mysql_fetch_row($rslt);
    +			$did_id[$i] = $row[0];
    +			}
    +
    +		$stmt="select uniqueid from vicidial_did_log where did_id='$did_id[$i]';";
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {echo "$stmt\n";}
    +		$DIDunids_to_print = mysql_num_rows($rslt);
    +		$k=0;
    +		while ($k < $DIDunids_to_print)
    +			{
    +			$row=mysql_fetch_row($rslt);
    +			$DIDunid_SQL .= "'$row[0]',";
    +			$k++;
    +			}
    +		$DIDunid_SQL = eregi_replace(",$",'',$DIDunid_SQL);
    +		if (strlen($DIDunid_SQL)<3) {$DIDunid_SQL="''";}
    +
     		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
    +			}
     		$rslt=mysql_query($stmt, $link);
     		if ($DB) {echo "$stmt\n";}
     		$row=mysql_fetch_row($rslt);
     
     		$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
    +			}
     		$rslt=mysql_query($stmt, $link);
     		if ($DB) {echo "$stmt\n";}
     		$rowx=mysql_fetch_row($rslt);
     
     		$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
    +		if ($DID=='Y')
    +			{
    +			$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($DIDunid_SQL);";
    +			}
     		$rslt=mysql_query($stmt, $link);
     		if ($DB) {echo "$stmt\n";}
     		$rowy=mysql_fetch_row($rslt);
    @@ -364,17 +506,30 @@ echo "\n";
     echo "Intervallo Di Tempo: $query_date_BEGIN to $query_date_END\n\n";
     echo "---------- TOTALI\n";
     
    +
     $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $row=mysql_fetch_row($rslt);
     
     $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') and uniqueid IN($unid_SQL);";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $rowy=mysql_fetch_row($rslt);
     
     $stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($unid_SQL);";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $rowx=mysql_fetch_row($rslt);
    @@ -419,6 +574,10 @@ echo "\n";
     echo "---------- ABBATTUTE\n";
     
     $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($unid_SQL);";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $row=mysql_fetch_row($rslt);
    @@ -458,41 +617,47 @@ echo "Average hold time for DROP Calls:             $average_hold_seconds second
     
     if (strlen($group_SQL)>3)
     	{
    -	$stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;";
    -	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    -	$row=mysql_fetch_row($rslt);
    -	$Sanswer_sec_pct_rt_stat_one = $row[0];
    -	$Sanswer_sec_pct_rt_stat_two = $row[1];
    -
    -	$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
    -	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    -	$row=mysql_fetch_row($rslt);
    -	$answer_sec_pct_rt_stat_one = $row[0];
    -
    -	$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
    -	$rslt=mysql_query($stmt, $link);
    -	if ($DB) {echo "$stmt\n";}
    -	$row=mysql_fetch_row($rslt);
    -	$answer_sec_pct_rt_stat_two = $row[0];
    -
    -	if ( ($RISPOSTAEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) )
    +	if ($DID!='Y')
     		{
    -		$PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $RISPOSTAEDcalls) * 100);
    -		$PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0);
    -		#$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one);
    -		$PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $RISPOSTAEDcalls) * 100);
    -		$PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0);
    -		#$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two);
    +		$stmt = "SELECT answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two from vicidial_inbound_groups where group_id IN($group_SQL) order by answer_sec_pct_rt_stat_one desc limit 1;";
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {echo "$stmt\n";}
    +		$row=mysql_fetch_row($rslt);
    +		$Sanswer_sec_pct_rt_stat_one = $row[0];
    +		$Sanswer_sec_pct_rt_stat_two = $row[1];
    +
    +		$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {echo "$stmt\n";}
    +		$row=mysql_fetch_row($rslt);
    +		$answer_sec_pct_rt_stat_one = $row[0];
    +
    +		$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND');";
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {echo "$stmt\n";}
    +		$row=mysql_fetch_row($rslt);
    +		$answer_sec_pct_rt_stat_two = $row[0];
    +
    +		if ( ($RISPOSTAEDcalls > 0) and ($answer_sec_pct_rt_stat_one > 0) and ($answer_sec_pct_rt_stat_two > 0) )
    +			{
    +			$PCTanswer_sec_pct_rt_stat_one = (($answer_sec_pct_rt_stat_one / $RISPOSTAEDcalls) * 100);
    +			$PCTanswer_sec_pct_rt_stat_one = round($PCTanswer_sec_pct_rt_stat_one, 0);
    +			#$PCTanswer_sec_pct_rt_stat_one = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_one);
    +			$PCTanswer_sec_pct_rt_stat_two = (($answer_sec_pct_rt_stat_two / $RISPOSTAEDcalls) * 100);
    +			$PCTanswer_sec_pct_rt_stat_two = round($PCTanswer_sec_pct_rt_stat_two, 0);
    +			#$PCTanswer_sec_pct_rt_stat_two = sprintf("%10s", $PCTanswer_sec_pct_rt_stat_two);
    +			}
     		}
     	}
     echo "\n";
     echo "---------- CUSTOM INDICATORS\n";
     echo "GDE (Answered/Llamadas totales tomadas in to this In-Group):  $RISPOSTAEDpercent%\n";
     echo "ACR (Dropped/Answered):                                $DROP_RISPOSTAEDpercent%\n";
    -echo "TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):            $PCTanswer_sec_pct_rt_stat_one%\n";
    -echo "TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):            $PCTanswer_sec_pct_rt_stat_two%\n";
    +if ($DID!='Y')
    +	{
    +	echo "TMR1 (Answered within $Sanswer_sec_pct_rt_stat_one seconds/Answered):            $PCTanswer_sec_pct_rt_stat_one%\n";
    +	echo "TMR2 (Answered within $Sanswer_sec_pct_rt_stat_two seconds/Answered):            $PCTanswer_sec_pct_rt_stat_two%\n";
    +	}
     
     
     # GET LIST OF ALL STATUSES and create SQL from human_answered statuses
    @@ -538,6 +703,10 @@ echo "\n";
     echo "---------- QUEUE STATS\n";
     
     $stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and (queue_seconds > 0) and uniqueid IN($unid_SQL);";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $row=mysql_fetch_row($rslt);
    @@ -587,6 +756,10 @@ echo "|     0     5    10    15    20    25    30    35    40    45    50    55
     echo "+-------------------------------------------------------------------------------------------+------------+\n";
     
     $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by queue_seconds;";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds;";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $reasons_to_print = mysql_num_rows($rslt);
    @@ -650,6 +823,10 @@ echo "|     0     5    10    15    20    25    30    35    40    45    50    55
     echo "+-------------------------------------------------------------------------------------------+------------+\n";
     
     $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds;";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $reasons_to_print = mysql_num_rows($rslt);
    @@ -714,6 +891,10 @@ echo "          |     0     5    10    15    20    25    30    35    40    45
     echo "----------+-------------------------------------------------------------------------------------------+------------+\n";
     
     $stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND') group by queue_seconds;";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $reasons_to_print = mysql_num_rows($rslt);
    @@ -922,6 +1103,10 @@ echo "| HANGUP REASON        | CALLS      |\n";
     echo "+----------------------+------------+\n";
     
     $stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by term_reason;";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason;";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $reasons_to_print = mysql_num_rows($rslt);
    @@ -964,6 +1149,10 @@ echo "+--------+----------------------+----------------------+------------+-----
     
     ## get counts and time totals for all statuses in this campaign
     $stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by status;";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by status;";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $statuses_to_print = mysql_num_rows($rslt);
    @@ -1095,6 +1284,10 @@ echo "|     1     2     3     4     5     6     7     8     9    10    15    20
     echo "+-------------------------------------------------------------------------------------+------------+\n";
     
     $stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) group by queue_position;";
    +if ($DID=='Y')
    +	{
    +	$stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position;";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $positions_to_print = mysql_num_rows($rslt);
    @@ -1159,6 +1352,10 @@ echo "| AGENT                    | CALLS      | TIME H:M:S |AVERAGE |\n";
     echo "+--------------------------+------------+------------+--------+\n";
     
     $stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and  campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
    +if ($DID=='Y')
    +	{
    +	$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $users_to_print = mysql_num_rows($rslt);
    @@ -1228,6 +1425,10 @@ echo "\n";
     #########  15-minute increment breakdowns of total calls and drops, then answered table
     $BDansweredCALLS = 0;
     $stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);";
    +if ($DID=='Y')
    +	{
    +	$stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);";
    +	}
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $calls_to_print = mysql_num_rows($rslt);
    @@ -1524,7 +1725,7 @@ echo "+------+------------------------------------------------------------------
     
     $ENDtime = date("U");
     $RUNtime = ($ENDtime - $STARTtime);
    -echo "\nRun Time: $RUNtime seconds\n";
    +echo "\nRun Time: $RUNtime seconds|$db_source\n";
     }
     
     
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERsummary_hourly.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERsummary_hourly.php
    index 2c5f60dc..b2a1da18 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERsummary_hourly.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_CLOSERsummary_hourly.php
    @@ -9,6 +9,9 @@
     # 90809-0216 - Added Exclude Outbound Drop Group option
     # 100214-1421 - Sort menu alphabetically
     # 100216-0042 - Added popup date selector
    +# 100712-1324 - Added system setting slave server option
    +# 100802-2347 - Added User Group Allowed Reports option validation
    +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
     #
     
     require("dbconnect.php");
    @@ -52,9 +55,12 @@ $MT[0]='0';
     if (strlen($shift)<2) {$shift='ALL';}
     if (strlen($exclude_rollover)<2) {$exclude_rollover='NO';}
     
    +$report_name = 'Inbound Summary Hourly Report';
    +$db_source = 'M';
    +
     #############################################
     ##### START SYSTEM_SETTINGS LOOKUP #####
    -$stmt = "SELECT use_non_latin FROM system_settings;";
    +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $qm_conf_ct = mysql_num_rows($rslt);
    @@ -62,10 +68,22 @@ if ($qm_conf_ct > 0)
     	{
     	$row=mysql_fetch_row($rslt);
     	$non_latin =					$row[0];
    +	$outbound_autodial_active =		$row[1];
    +	$slave_db_server =				$row[2];
    +	$reports_use_slave_db =			$row[3];
     	}
     ##### END SETTINGS LOOKUP #####
     ###########################################
     
    +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
    +	{
    +	mysql_close($link);
    +	$use_slave_server=1;
    +	$db_source = 'S';
    +	require("dbconnect.php");
    +	echo "\n";
    +	}
    +
     $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
    @@ -78,13 +96,19 @@ if ($gmt_conf_ct > 0)
     	$epoch_offset =		(($local_gmt + $dst) * 3600);
     	}
     
    -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
    +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
     if ($DB) {echo "|$stmt|\n";}
     if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
     $rslt=mysql_query($stmt, $link);
     $row=mysql_fetch_row($rslt);
     $auth=$row[0];
     
    +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$reports_only_user=$row[0];
    +
     if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
     	{
         Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
    @@ -93,6 +117,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
         exit;
     	}
     
    +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$LOGuser_group =			$row[0];
    +
    +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$LOGallowed_campaigns = $row[0];
    +$LOGallowed_reports =	$row[1];
    +
    +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
    +	{
    +    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
    +    Header("HTTP/1.0 401 Unauthorized");
    +    echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
    +    exit;
    +	}
    +
     $NOW_DATE = date("Y-m-d");
     $NOW_TIME = date("Y-m-d H:i:s");
     $STARTtime = date("U");
    @@ -187,7 +232,7 @@ echo "\n";
     echo "\n";
     
     echo "\n";
    -echo "Inbound Summary Hourly Report\n";
    +echo "$report_name\n";
     
     if ($bareformat < 1)
     	{
    @@ -676,7 +721,7 @@ else
     
     	$ENDtime = date("U");
     	$RUNtime = ($ENDtime - $STARTtime);
    -	echo "\n\nRun Time: $RUNtime seconds\n";
    +	echo "\n\nRun Time: $RUNtime seconds|$db_source\n";
     	}
     
     
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRstats.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRstats.php
    index 99d5dd79..0a006041 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRstats.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_IVRstats.php
    @@ -13,6 +13,9 @@
     # 91112-0719 - Added in-group names to select list
     # 100214-1421 - Sort menu alphabetically
     # 100301-1401 - Added popup date selector
    +# 100712-1324 - Added system setting slave server option
    +# 100802-2347 - Added User Group Allowed Reports option validation
    +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
     #
     
     require("dbconnect.php");
    @@ -40,9 +43,12 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
     
     if (strlen($shift)<2) {$shift='ALL';}
     
    +$report_name = 'Inbound IVR Report';
    +$db_source = 'M';
    +
     #############################################
     ##### START SYSTEM_SETTINGS LOOKUP #####
    -$stmt = "SELECT use_non_latin FROM system_settings;";
    +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $qm_conf_ct = mysql_num_rows($rslt);
    @@ -50,17 +56,34 @@ if ($qm_conf_ct > 0)
     	{
     	$row=mysql_fetch_row($rslt);
     	$non_latin =					$row[0];
    +	$outbound_autodial_active =		$row[1];
    +	$slave_db_server =				$row[2];
    +	$reports_use_slave_db =			$row[3];
     	}
     ##### END SETTINGS LOOKUP #####
     ###########################################
     
    -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
    +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
    +	{
    +	mysql_close($link);
    +	$use_slave_server=1;
    +	$db_source = 'S';
    +	require("dbconnect.php");
    +	echo "\n";
    +	}
    +
    +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
     if ($DB) {echo "|$stmt|\n";}
     if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
     $rslt=mysql_query($stmt, $link);
     $row=mysql_fetch_row($rslt);
     $auth=$row[0];
     
    +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$reports_only_user=$row[0];
     
     if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
     	{
    @@ -70,6 +93,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
         exit;
     	}
     
    +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$LOGuser_group =			$row[0];
    +
    +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$LOGallowed_campaigns = $row[0];
    +$LOGallowed_reports =	$row[1];
    +
    +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) )
    +	{
    +    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
    +    Header("HTTP/1.0 401 Unauthorized");
    +    echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
    +    exit;
    +	}
    +
     $NOW_DATE = date("Y-m-d");
     $NOW_TIME = date("Y-m-d H:i:s");
     $STARTtime = date("U");
    @@ -85,6 +129,7 @@ $i=0;
     	$LISTgroups[$i]='CALLMENU';
     	$LISTgroups_names[$i]='IVR';
     	$i++;
    +	$groups_to_print++;
     	$LISTgroups[$i]='XMLPULL';
     	$LISTgroups_names[$i]='Dynamic Application';
     	$i++;
    @@ -197,7 +242,7 @@ $end_date_T = $end_dateARRAY[1];
     \n";
    -echo "IVR Stats Report\n";
    +echo "$report_name\n";
     
     	$short_header=1;
     
    @@ -720,7 +765,7 @@ else
     
     	$ENDtime = date("U");
     	$RUNtime = ($ENDtime - $STARTtime);
    -	echo "\nRun Time: $RUNtime seconds\n";
    +	echo "\nRun Time: $RUNtime seconds|$db_source\n";
     	}
     
     
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_OUTBOUNDsummary_interval.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_OUTBOUNDsummary_interval.php
    index 4ce1906b..bfe26cb6 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_OUTBOUNDsummary_interval.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_OUTBOUNDsummary_interval.php
    @@ -9,6 +9,9 @@
     # 091129-0017 - Added Sales-type and DNC-type tallies
     # 100214-1421 - Sort menu alphabetically
     # 100216-0042 - Added popup date selector
    +# 100712-1324 - Added system setting slave server option
    +# 100802-2347 - Added User Group Allowed Reports option validation
    +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
     #
     
     require("dbconnect.php");
    @@ -50,9 +53,12 @@ $MT[0]='0';
     if (strlen($shift)<2) {$shift='ALL';}
     if (strlen($include_rollover)<2) {$include_rollover='NO';}
     
    +$report_name = 'Outbound Summary Interval Report';
    +$db_source = 'M';
    +
     #############################################
     ##### START SYSTEM_SETTINGS LOOKUP #####
    -$stmt = "SELECT use_non_latin FROM system_settings;";
    +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $qm_conf_ct = mysql_num_rows($rslt);
    @@ -60,10 +66,22 @@ if ($qm_conf_ct > 0)
     	{
     	$row=mysql_fetch_row($rslt);
     	$non_latin =					$row[0];
    +	$outbound_autodial_active =		$row[1];
    +	$slave_db_server =				$row[2];
    +	$reports_use_slave_db =			$row[3];
     	}
     ##### END SETTINGS LOOKUP #####
     ###########################################
     
    +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
    +	{
    +	mysql_close($link);
    +	$use_slave_server=1;
    +	$db_source = 'S';
    +	require("dbconnect.php");
    +	echo "\n";
    +	}
    +
     $stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
    @@ -91,6 +109,12 @@ if ($records_to_print > 0)
     	$auth++;
     	}
     
    +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$reports_only_user=$row[0];
    +
     if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
     	{
         Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
    @@ -101,28 +125,31 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
     
     $LOGallowed_campaignsSQL='';
     $whereLOGallowed_campaignsSQL='';
    -if ($user_level < 9)
    +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$user_group';";
    +$rslt=mysql_query($stmt, $link);
    +$records_to_print = mysql_num_rows($rslt);
    +if ($records_to_print > 0)
     	{
    -	$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$user_group';";
    -	$rslt=mysql_query($stmt, $link);
    -	$records_to_print = mysql_num_rows($rslt);
    -	if ($records_to_print > 0)
    +	$row=mysql_fetch_row($rslt);
    +	$LOGallowed_reports =	$row[1];
    +	if ( (!eregi("ALL-CAMPAIGNS",$row[0])) )
     		{
    -		$row=mysql_fetch_row($rslt);
    -		if ( (!eregi("ALL-CAMPAIGNS",$row[0])) )
    -			{
    -			$rawLOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]);
    -			$rawLOGallowed_campaignsSQL = eregi_replace(' ',"','",$rawLOGallowed_campaignsSQL);
    -			$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
    -			$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
    -			}
    +		$rawLOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]);
    +		$rawLOGallowed_campaignsSQL = eregi_replace(' ',"','",$rawLOGallowed_campaignsSQL);
    +		$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
    +		$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
     		}
    -	else
    +	if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
     		{
    -		echo "Campaigns Permissions Error: |$PHP_AUTH_USER|$user_group|\n";
    +		echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
     		exit;
     		}
     	}
    +else
    +	{
    +	echo "Campaigns Permissions Error: |$PHP_AUTH_USER|$user_group|\n";
    +	exit;
    +	}
     
     $NOW_DATE = date("Y-m-d");
     $NOW_TIME = date("Y-m-d H:i:s");
    @@ -163,10 +190,6 @@ $group_string='|';
     $group_ct = count($group);
     while($i < $group_ct)
     	{
    -	$group_string .= "$group[$i]|";
    -	$group_SQL .= "'$group[$i]',";
    -	$groupQS .= "&group[]=$group[$i]";
    -
     	$stmt="select campaign_name from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL;";
     	$rslt=mysql_query($stmt, $link);
     	$campaign_names_to_print = mysql_num_rows($rslt);
    @@ -174,6 +197,9 @@ while($i < $group_ct)
     		{
     		$row=mysql_fetch_row($rslt);
     		$group_cname[$i] =	$row[0];
    +		$group_string .= "$group[$i]|";
    +		$group_SQL .= "'$group[$i]',";
    +		$groupQS .= "&group[]=$group[$i]";
     		}
     
     	if (eregi("YES",$include_rollover))
    @@ -336,7 +362,7 @@ echo "\n";
     echo "\n";
     
     echo "\n";
    -echo "Outbound Summary Interval Report\n";
    +echo "$report_name\n";
     
     if ($bareformat < 1)
     	{
    @@ -1167,8 +1193,8 @@ else
     			$hTOTcalls_count =			sprintf("%6s", $hTOTcalls_count);
     			$hTOTsystem_count =			sprintf("%6s", $hTOTsystem_count);
     			$hTOTagent_count =			sprintf("%6s", $hTOTagent_count);
    -			$hTOTptp_count =			sprintf("%6s", $hTOTrtp_count);
    -			$hTOTrtp_count =			sprintf("%6s", $hTOTptp_count);
    +			$hTOTptp_count =			sprintf("%6s", $hTOTptp_count);
    +			$hTOTrtp_count =			sprintf("%6s", $hTOTrtp_count);
     			if ( ($hTOTcalls_count < 1) or ($hTOTna_count < 1) )
     				{$hTOTna_percent=0;}
     			else
    @@ -1268,7 +1294,7 @@ else
     
     	$ENDtime = date("U");
     	$RUNtime = ($ENDtime - $STARTtime);
    -	echo "\n\nRun Time: $RUNtime seconds\n";
    +	echo "\n\nRun Time: $RUNtime seconds|$db_source\n";
     	}
     
     
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_VDADstats.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_VDADstats.php
    index ee6cadcb..94a2ca9c 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_VDADstats.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_VDADstats.php
    @@ -26,6 +26,10 @@
     # 100202-1034 - Added statuses to no-answer section
     # 100214-1421 - Sort menu alphabetically
     # 100216-0042 - Added popup date selector
    +# 100712-1324 - Added system setting slave server option
    +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
    +# 100814-2307 - Added display of preset dials if presets are enabled in the campaign
    +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
     #
     
     header ("Content-type: text/html; charset=utf-8");
    @@ -73,10 +77,12 @@ if (strlen($bottom_graph)<2) {$bottom_graph='NO';}
     if (strlen($carrier_stats)<2) {$carrier_stats='NO';}
     if (strlen($include_rollover)<2) {$include_rollover='NO';}
     
    +$report_name = 'Outbound Calling Report';
    +$db_source = 'M';
     
     #############################################
     ##### START SYSTEM_SETTINGS LOOKUP #####
    -$stmt = "SELECT use_non_latin FROM system_settings;";
    +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $qm_conf_ct = mysql_num_rows($rslt);
    @@ -84,10 +90,22 @@ if ($qm_conf_ct > 0)
     	{
     	$row=mysql_fetch_row($rslt);
     	$non_latin =					$row[0];
    +	$outbound_autodial_active =		$row[1];
    +	$slave_db_server =				$row[2];
    +	$reports_use_slave_db =			$row[3];
     	}
     ##### END SETTINGS LOOKUP #####
     ###########################################
     
    +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
    +	{
    +	mysql_close($link);
    +	$use_slave_server=1;
    +	$db_source = 'S';
    +	require("dbconnect.php");
    +	echo "\n";
    +	}
    +
     ##### SERVER CARRIER LOGGING LOOKUP #####
     $stmt = "SELECT count(*) FROM servers where carrier_logging_active='Y' and max_vicidial_trunks > 0;";
     $rslt=mysql_query($stmt, $link);
    @@ -99,13 +117,19 @@ if ($srv_conf_ct > 0)
     	$carrier_logging_active =		$row[0];
     	}
     
    -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1';";
    +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
     if ($DB) {echo "|$stmt|\n";}
     if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
     $rslt=mysql_query($stmt, $link);
     $row=mysql_fetch_row($rslt);
     $auth=$row[0];
     
    +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$reports_only_user=$row[0];
    +
     if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
     	{
         Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
    @@ -114,6 +138,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
         exit;
     	}
     
    +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$LOGuser_group =			$row[0];
    +
    +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$LOGallowed_campaigns = $row[0];
    +$LOGallowed_reports =	$row[1];
    +
    +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) )
    +	{
    +    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
    +    Header("HTTP/1.0 401 Unauthorized");
    +    echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
    +    exit;
    +	}
    +
     $NOW_DATE = date("Y-m-d");
     $NOW_TIME = date("Y-m-d H:i:s");
     $STARTtime = date("U");
    @@ -130,7 +175,18 @@ while($i < $group_ct)
     	$i++;
     	}
     
    -$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;";
    +$LOGallowed_campaignsSQL='';
    +$whereLOGallowed_campaignsSQL='';
    +if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
    +	{
    +	$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
    +	$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
    +	$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
    +	$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
    +	}
    +$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
    +
    +$stmt="select campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
     $rslt=mysql_query($stmt, $link);
     if ($DB) {echo "$stmt\n";}
     $campaigns_to_print = mysql_num_rows($rslt);
    @@ -140,7 +196,7 @@ while ($i < $campaigns_to_print)
     	$row=mysql_fetch_row($rslt);
     	$groups[$i] =		$row[0];
     	$group_names[$i] =	$row[1];
    -	if (ereg("--ALL",$group_string) )
    +	if (ereg("-ALL",$group_string) )
     		{$group[$i] = $groups[$i];}
     	$i++;
     	}
    @@ -151,13 +207,16 @@ $group_string='|';
     $group_ct = count($group);
     while($i < $group_ct)
     	{
    -	$group_string .= "$group[$i]|";
    -	$group_SQL .= "'$group[$i]',";
    -	$groupQS .= "&group[]=$group[$i]";
    +	if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) )
    +		{
    +		$group_string .= "$group[$i]|";
    +		$group_SQL .= "'$group[$i]',";
    +		$groupQS .= "&group[]=$group[$i]";
    +		}
     
     	if (eregi("YES",$include_rollover))
     		{
    -		$stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';";
    +		$stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';";
     		$rslt=mysql_query($stmt, $link);
     		if ($DB) {echo "$stmt\n";}
     		$in_groups_to_print = mysql_num_rows($rslt);
    @@ -174,9 +233,9 @@ while($i < $group_ct)
     	}
     if (strlen($group_drop_SQL) < 2)
     	{$group_drop_SQL = "''";}
    -if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) )
    +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) or (strlen($group_string) < 2) )
     	{
    -	$group_SQL = "";
    +	$group_SQL = "$LOGallowed_campaignsSQL";
     	$group_drop_SQL = "";
     	}
     else
    @@ -252,7 +311,7 @@ echo "\n";
     echo "\n";
     
     echo "\n";
    -echo "Outbound Stats\n";
    +echo "$report_name\n";
     
     $short_header=1;
     
    @@ -981,7 +1040,7 @@ else
     	if ( ($carrier_logging_active > 0) and ($carrier_stats == 'YES') )
     		{
     		##############################
    -		#########  STATUS CATEGORIA STATS
    +		#########  CARRIER STATS
     
     		$OUToutput .= "\n";
     		$OUToutput .= "---------- CARRIER CALL STATUSES\n";
    @@ -1016,6 +1075,55 @@ else
     		}
     
     
    +	## find if any selected campaigns have presets enabled
    +	$presets_enabled=0;
    +	$stmt="select count(*) from vicidial_campaigns where enable_xfer_presets='ENABLED' $group_SQLand;";
    +	$rslt=mysql_query($stmt, $link);
    +	if ($DB) {$OUToutput .= "$stmt\n";}
    +	$presets_enabled_count = mysql_num_rows($rslt);
    +	if ($presets_enabled_count > 0)
    +		{
    +		$row=mysql_fetch_row($rslt);
    +		$presets_enabled = $row[0];
    +		}
    +
    +	if ($presets_enabled > 0)
    +		{
    +		##############################
    +		#########  PRESET DIAL STATS
    +
    +		$OUToutput .= "\n";
    +		$OUToutput .= "---------- AGENT PRESET DIALS\n";
    +		$OUToutput .= "+------------------------------------------+------------+\n";
    +		$OUToutput .= "| PRESET NAME                              | CALLS      |\n";
    +		$OUToutput .= "+------------------------------------------+------------+\n";
    +
    +		## get counts and time totals for all statuses in this campaign
    +		$stmt="select preset_name,count(*) from user_call_log where call_date > \"$query_date_BEGIN\" and call_date < \"$query_date_END\" and preset_name!='' and preset_name is not NULL  $group_SQLand group by preset_name order by preset_name;";
    +		$rslt=mysql_query($stmt, $link);
    +		if ($DB) {$OUToutput .= "$stmt\n";}
    +		$carrierstatuses_to_print = mysql_num_rows($rslt);
    +		$i=0;
    +		while ($i < $carrierstatuses_to_print)
    +			{
    +			$row=mysql_fetch_row($rslt);
    +			$TOTPREcalls = ($TOTPREcalls + $row[1]);
    +			$PREstatus =	sprintf("%-40s", $row[0]); while(strlen($PREstatus)>40) {$PREstatus = substr("$PREstatus", 0, -1);}
    +			$PREcount =		sprintf("%10s", $row[1]); while(strlen($PREcount)>10) {$PREcount = substr("$PREcount", 0, -1);}
    +
    +			$OUToutput .= "| $PREstatus | $PREcount |\n";
    +
    +			$i++;
    +			}
    +
    +		$TOTPREcalls =	sprintf("%10s", $TOTPREcalls); while(strlen($TOTPREcalls)>10) {$TOTPREcalls = substr("$TOTPREcalls", 0, -1);}
    +
    +		$OUToutput .= "+------------------------------------------+------------+\n";
    +		$OUToutput .= "| TOTAL                                    | $TOTPREcalls |\n";
    +		$OUToutput .= "+------------------------------------------+------------+\n";
    +		}
    +
    +
     	##############################
     	#########  STATUS CATEGORIA STATS
     
    @@ -1446,7 +1554,7 @@ else
     
     	$ENDtime = date("U");
     	$RUNtime = ($ENDtime - $STARTtime);
    -	echo "\nRun Time: $RUNtime seconds\n";
    +	echo "\nRun Time: $RUNtime seconds|$db_source\n";
     	}
     
     
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_VICIDIAL_hopperlist.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_VICIDIAL_hopperlist.php
    index 1ec1a7ce..07cde771 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_VICIDIAL_hopperlist.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_VICIDIAL_hopperlist.php
    @@ -19,12 +19,14 @@ require("dbconnect.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["group"]))				{$group=$_GET["group"];}
     	elseif (isset($_POST["group"]))		{$group=$_POST["group"];}
     if (isset($_GET["submit"]))				{$submit=$_GET["submit"];}
    -	elseif (isset($_POST["submit"]))		{$submit=$_POST["submit"];}
    +	elseif (isset($_POST["submit"]))	{$submit=$_POST["submit"];}
     if (isset($_GET["INVIA"]))				{$INVIA=$_GET["INVIA"];}
    -	elseif (isset($_POST["INVIA"]))		{$INVIA=$_POST["INVIA"];}
    +	elseif (isset($_POST["INVIA"]))	{$INVIA=$_POST["INVIA"];}
     
     $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
     $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
    @@ -77,10 +79,14 @@ while ($i < $campaigns_to_print)
     
     \n";
    -echo "Coda Chiamate Report\n";
    +echo "Coda Chiamate Report\n";
    +
    +	$short_header=1;
    +
    +	require("admin_header.php");
    +
    +echo "
    \n"; echo "\n"; +echo "\n"; echo "Date:
    \n"; echo ""; @@ -227,7 +279,10 @@ o_cal.a_tpl.yearscroll = false;
    \n"; -echo "Gruppi Inbound: \n"; +if ($DID=='Y') + {echo "Inbound DIDs: \n";} +else + {echo "Gruppi Inbound: \n";} echo "\n"; echo "\n"; echo "\n"; echo "           "; -echo "MODIFICA | "; +if ($DID!='Y') + { + echo "MODIFICA | "; + echo "IVR REPORT | \n"; + } echo "REPORT | "; -echo "IVR REPORT \n"; echo "\n"; echo "
    "; echo "\n"; -#echo "\n"; -#echo "\n"; echo "
    + diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_days_detail.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_days_detail.php index cc0da452..4ca1776e 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_days_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_days_detail.php @@ -11,6 +11,9 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # @@ -42,9 +45,12 @@ if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Single Agent Daily'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -52,20 +58,38 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -74,6 +98,38 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -82,7 +138,16 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns;"; +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -91,6 +156,8 @@ while ($i < $campaigns_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} $i++; } @@ -99,9 +166,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) @@ -164,7 +234,7 @@ if ($file_download < 1) echo "\n"; echo "\n"; - echo "Agent Giorni di stato Report\n"; + echo "Single Agent Daily\n"; echo ""; $short_header=1; @@ -273,12 +343,12 @@ else { echo "LEAD STATS BREAKDOWN:\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; - echo "| DATE | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| DATE | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+------------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "DATE,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "DATE,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } ### BEGIN loop through each user ### @@ -596,7 +666,7 @@ else echo "REPORT \n"; echo "
    "; -echo "\n\n"; +echo "\n\n
    $db_source"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_performance_detail.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_performance_detail.php index 8acd9c53..167f67a9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_performance_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_performance_detail.php @@ -23,6 +23,9 @@ # 100203-1131 - Added CUSTOMER time statistics # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -55,9 +58,12 @@ if (strlen($shift)<2) {$shift='ALL';} $LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date&group=$group&user_group=$user_group&shift=$shift&DB=$DB"; +$report_name = 'Agent Performance Dettagliata'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -65,20 +71,38 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -87,6 +111,38 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -95,7 +151,17 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -104,6 +170,8 @@ while ($i < $campaigns_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} $i++; } $stmt="select user_group from vicidial_user_groups order by user_group;"; @@ -123,9 +191,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) @@ -174,7 +245,7 @@ echo "\n"; echo "\n"; echo "\n"; -echo "Agent Performance Dettagliata\n"; +echo "$report_name\n"; $short_header=1; @@ -364,7 +435,7 @@ while ($i < $rows_to_print) echo "CALL STATS BREAKDOWN: (Statistics related to handling of calls only)\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; -echo "| USER NAME | ID | LEADS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; +echo "| USER NAME | ID | CALLS | TIME | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n"; echo "+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n"; @@ -863,7 +934,7 @@ echo "+-----------------+----------+----------+----------+----------+ +$sub_sta echo "| TOTALI AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n"; echo "+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n"; -echo "\n\n"; +echo "\n\n
    $db_source"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_status_detail.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_status_detail.php index 2eac0fc5..91730bf8 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_status_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_status_detail.php @@ -12,6 +12,9 @@ # 100119-0935 - Fixed bug 291 # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # @@ -43,9 +46,12 @@ if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Agent Status Dettagliata'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -53,20 +59,38 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -75,6 +99,39 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -83,7 +140,17 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -92,6 +159,8 @@ while ($i < $campaigns_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} $i++; } $stmt="select user_group from vicidial_user_groups order by user_group;"; @@ -111,9 +180,12 @@ $group_string='|'; $group_ct = count($group); while($i < $group_ct) { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } $i++; } if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) @@ -210,7 +282,7 @@ if ($file_download < 1) echo "\n"; echo "\n"; - echo "Agent Status Dettagliata Report\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -319,14 +391,14 @@ else if ($file_download < 1) { - echo "LEADS STATS BREAKDOWN:\n"; + echo "CALLS STATS BREAKDOWN:\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | CIcalls| DNC/CI%|$statusesHTML\n"; + echo "| USER NAME | ID | CALLS | CIcalls| DNC/CI%|$statusesHTML\n"; echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,CIcalls,DNC-CI%,$statusesFILE\n"; + $file_output .= "USER,ID,CALLS,CIcalls,DNC-CI%,$statusesFILE\n"; } @@ -338,7 +410,7 @@ else { $Suser=$usersARY[$m]; $Sfull_name=$user_namesARY[$m]; - $Scalls=$calls[$m]; + $Scalls=0; $SstatusesHTML=''; $SstatusesFILE=''; $CIScount=0; @@ -663,7 +735,7 @@ echo " REPORT \n"; echo "\n"; echo "
    "; -echo "\n\n"; +echo "\n\n
    $db_source"; echo "\n"; echo "\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_detail.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_detail.php index 3f3edb50..9bca0328 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_detail.php @@ -12,6 +12,9 @@ # 100203-1147 - Added CUSTOMER time statistics # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -44,9 +47,12 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($stage)<2) {$stage='NAME';} +$report_name = 'Agent Time Detail'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -54,20 +60,38 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -76,6 +100,38 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -84,7 +140,18 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + $group_string .= "$group[$i]|"; + $i++; + } + +$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -93,8 +160,32 @@ while ($i < $campaigns_to_print) { $row=mysql_fetch_row($rslt); $groups[$i] =$row[0]; + if (ereg("-ALL",$group_string) ) + {$group[$i] = $groups[$i];} $i++; } + +$i=0; +$group_string='|'; +$group_ct = count($group); +while($i < $group_ct) + { + if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $group_string .= "$group[$i]|"; + $group_SQL .= "'$group[$i]',"; + $groupQS .= "&group[]=$group[$i]"; + } + $i++; + } +if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) + {$group_SQL = "";} +else + { + $group_SQL = eregi_replace(",$",'',$group_SQL); + $group_SQL = "and campaign_id IN($group_SQL)"; + } + $stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -107,24 +198,6 @@ while ($i < $user_groups_to_print) $i++; } -$i=0; -$group_string='|'; -$group_ct = count($group); -while($i < $group_ct) - { - $group_string .= "$group[$i]|"; - $group_SQL .= "'$group[$i]',"; - $groupQS .= "&group[]=$group[$i]"; - $i++; - } -if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) - {$group_SQL = "";} -else - { - $group_SQL = eregi_replace(",$",'',$group_SQL); - $group_SQL = "and campaign_id IN($group_SQL)"; - } - $i=0; $user_group_string='|'; $user_group_ct = count($user_group); @@ -183,7 +256,7 @@ if ($file_download < 1) echo "\n"; echo "\n"; - echo "Agent Time Detail\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -421,12 +494,12 @@ else { echo "AGENT TIME BREAKDOWN:\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; - echo "| USER NAME | ID | LEADS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; + echo "| USER NAME | ID | CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n"; echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n"; } else { - $file_output .= "USER,ID,LEADS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; + $file_output .= "USER,ID,CALLS,TIME CLOCK,AGENT TIME,WAIT,TALK,DISPO,PAUSE,DEAD,CUSTOMER$sub_statusesFILE\n"; } ##### END print the output to screen or put into file output variable @@ -861,7 +934,7 @@ echo " REPORTS \n"; echo "\n"; echo "
    "; -echo "\n\n"; +echo "\n\n
    $db_source"; ############################################################################ ##### END HTML form section ############################################################################ diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_sheet.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_sheet.php index 0d323d5c..6c7d3984 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_sheet.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_time_sheet.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -11,27 +11,44 @@ # 90310-0745 - Added admin header # 90508-0644 - Changed to PHP long tags # 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); require("functions.php"); +$report_name = 'Utente Time Sheet'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -51,14 +68,20 @@ $user=$agent; $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -66,6 +89,27 @@ $auth=$row[0]; exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -86,7 +130,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;} \n"; -echo "Agent Time Sheet"; +echo "<TITLE>$report_name"; ##### BEGIN Set variables to make header show properly ##### @@ -298,7 +342,7 @@ echo "<td align=right><font size=2> </td>\n"; echo "<td align=right colspan=2><font size=2><font size=2>TOTALE </td>\n"; echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; -echo "</TABLE>\n"; +echo "</TABLE><BR>$db_source\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_timeclock_detail.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_timeclock_detail.php index e8d0b8b8..6b03fb37 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_timeclock_detail.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_agent_timeclock_detail.php @@ -8,6 +8,9 @@ # CHANGES # 90602-2244 - First build # 100301-1401 - Added popup date selector +# 100712-1324 - Added system setting slave server option and added user stats link dates +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # @@ -41,9 +44,12 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($stage)<2) {$stage='ID';} +$report_name = 'User Timeclock Detail Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -51,20 +57,38 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -73,6 +97,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $MT[0]=''; $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -145,6 +190,7 @@ if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) {$user_group_SQL = "";} else { + $TCuser_group_SQL = $user_group_SQL; $user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL); @@ -188,7 +234,7 @@ if ($file_download < 1) <?php echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; - echo "<TITLE>User Time-Clock Detail\n"; + echo "$report_name\n"; echo ""; $short_header=1; @@ -428,7 +474,7 @@ else if ($file_download < 1) { - $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; + $Toutput = "| $Sname[$m] | $Suser[$m] | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n"; } else { @@ -636,7 +682,7 @@ else $o=0; while ($user_groups_to_print > $o) { - if (eregi("$user_groups[$o]\|",$user_group_string)) {echo "\n";} + if (eregi("\|$user_groups[$o]\|",$user_group_string)) {echo "\n";} else {echo "\n";} $o++; } @@ -684,7 +730,7 @@ echo "\n\n"; $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -echo "$RUNtime\n"; +echo "$RUNtime|$db_source\n"; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_server_performance.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_server_performance.php index 61024d9b..9ba4e4ef 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_server_performance.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_server_performance.php @@ -13,6 +13,9 @@ # 90310-2151 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -36,12 +39,47 @@ if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';"; +$report_name = 'Server Performance Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -50,6 +88,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + # path from root to where ploticus files will be stored $PLOTroot = "vicidial/ploticus"; $DOCroot = "$WeBServeRRooT/$PLOTroot/"; @@ -88,7 +147,7 @@ while ($i < $servers_to_print) \n"; -echo "Server Performance Report\n"; +echo "$report_name\n"; $short_header=1; @@ -343,5 +402,6 @@ echo ""; ?>
    - +
    + \ No newline at end of file diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADall.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADall.php index 45af0097..f06ce1c4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADall.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADall.php @@ -60,10 +60,19 @@ # 91204-1548 - Added ability to change agent in-groups and blended # 100214-1127 - Added no-dialable-leads alert and in-groups stats option # 100301-1229 - Added 3-WAY status for consultative transfer agents +# 100303-0930 - Added carrier stats display option +# 100424-0943 - Added realtime_block_user_info option +# 100709-1054 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100805-0704 - Fixed minor bug in campaigns restrictions +# 100815-0002 - Added optional display of preset dials if presets are enabled in the campaign +# 100912-0839 - Changed several stats to limit to 2 or 3 decimal spaces +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# 101024-0832 - Added Agent time stats option and agents-in-dispo counter # -$version = '2.2.0-51'; -$build = '100301-1229'; +$version = '2.4-60'; +$build = '101024-0832'; header ("Content-type: text/html; charset=utf-8"); @@ -123,11 +132,19 @@ if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"]; elseif (isset($_POST["monitor_active"])) {$monitor_active=$_POST["monitor_active"];} if (isset($_GET["monitor_phone"])) {$monitor_phone=$_GET["monitor_phone"];} elseif (isset($_POST["monitor_phone"])) {$monitor_phone=$_POST["monitor_phone"];} +if (isset($_GET["CARRIERstats"])) {$CARRIERstats=$_GET["CARRIERstats"];} + elseif (isset($_POST["CARRIERstats"])) {$CARRIERstats=$_POST["CARRIERstats"];} +if (isset($_GET["PRESETstats"])) {$PRESETstats=$_GET["PRESETstats"];} + elseif (isset($_POST["PRESETstats"])) {$PRESETstats=$_POST["PRESETstats"];} +if (isset($_GET["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_GET["AGENTtimeSTATS"];} + elseif (isset($_POST["AGENTtimeSTATS"])) {$AGENTtimeSTATS=$_POST["AGENTtimeSTATS"];} +$report_name = 'Real-Time Main Report'; +$db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -136,13 +153,24 @@ if ($qm_conf_ct > 0) $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + if (!isset($DB)) {$DB=0;} if (!isset($RR)) {$RR=40;} -if (!isset($group)) {$group='';} +if (!isset($group)) {$group='ALL-ACTIVE';} if (!isset($usergroup)) {$usergroup='';} if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name @@ -155,13 +183,13 @@ if (!isset($PAUSEcodes)) {$PAUSEcodes='N';} # 0=no, 1=yes if (!isset($with_inbound)) { if ($outbound_autodial_active > 0) - {$with_inbound='N';} # N=no, Y=yes, O=only + {$with_inbound='Y';} # N=no, Y=yes, O=only else {$with_inbound='O';} # N=no, Y=yes, O=only } $ingroup_detail=''; -if (strlen($group)>1) {$groups[0] = $group; $RR=40;} +if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group; $RR=40;} else {$group = $groups[0];} function get_server_load($windows = false) @@ -216,8 +244,18 @@ $NOW_TIME = date("Y-m-d H:i:s"); $NOW_DAY = date("Y-m-d"); $NOW_HOUR = date("H:i:s"); $STARTtime = date("U"); +$epochONEminuteAGO = ($STARTtime - 60); +$timeONEminuteAGO = date("Y-m-d H:i:s",$epochONEminuteAGO); +$epochFIVEminutesAGO = ($STARTtime - 300); +$timeFIVEminutesAGO = date("Y-m-d H:i:s",$epochFIVEminutesAGO); +$epochFIFTEENminutesAGO = ($STARTtime - 900); +$timeFIFTEENminutesAGO = date("Y-m-d H:i:s",$epochFIFTEENminutesAGO); +$epochONEhourAGO = ($STARTtime - 3600); +$timeONEhourAGO = date("Y-m-d H:i:s",$epochONEhourAGO); $epochSIXhoursAGO = ($STARTtime - 21600); $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO); +$epochTWENTYFOURhoursAGO = ($STARTtime - 86400); +$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); @@ -230,7 +268,13 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -247,7 +291,41 @@ if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) $monitor_phone = $row[0]; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; +$stmt="SELECT realtime_block_user_info,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$realtime_block_user_info = $row[0]; +$LOGuser_group = $row[1]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + +$allactivecampaigns=''; +$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -260,26 +338,32 @@ while ($i < $groups_to_print) $row=mysql_fetch_row($rslt); $LISTgroups[$i] =$row[0]; $LISTnames[$i] =$row[1]; + $allactivecampaigns .= "'$LISTgroups[$i]',"; $i++; } +$allactivecampaigns .= "''"; $i=0; $group_string='|'; $group_ct = count($groups); while($i < $group_ct) { - $group_string .= "$groups[$i]|"; - $group_SQL .= "'$groups[$i]',"; - $groupQS .= "&groups[]=$groups[$i]"; + if ( (preg_match("/ $groups[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) ) + { + $group_string .= "$groups[$i]|"; + $group_SQL .= "'$groups[$i]',"; + $groupQS .= "&groups[]=$groups[$i]"; + } + $i++; } $group_SQL = eregi_replace(",$",'',$group_SQL); ### if no campaigns selected, display all -if ($group_ct < 1) +if ( ($group_ct < 1) or (strlen($group_string) < 2) ) { $groups[0] = 'ALL-ACTIVE'; - $group_string = 'ALL-ACTIVE'; + $group_string = '|ALL-ACTIVE|'; $group = 'ALL-ACTIVE'; $groupQS .= "&groups[]=ALL-ACTIVE"; } @@ -294,9 +378,9 @@ if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) elseif ( eregi('ALL-ACTIVE',$group_string) ) { $all_active = 1; - $group_SQL = "''"; - $group_SQLand = ""; - $group_SQLwhere = ""; + $group_SQL = $allactivecampaigns; + $group_SQLand = "and campaign_id IN($allactivecampaigns)"; + $group_SQLwhere = "where campaign_id IN($allactivecampaigns)"; } else { @@ -325,7 +409,7 @@ $NFB = ''; $NFE = ''; $F=''; $FG=''; $B=''; $BG=''; -$select_list = "\n"; + echo "\n"; } - echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; } - echo "\n"; + + echo "\n"; + echo "\n"; if ($LOGuser_level==9) {$levelMAX=10;} @@ -6531,6 +7737,7 @@ if ($ADD==11) echo "
    NUOVA CAMPAGNA\n"; echo "\n"; + echo "\n"; echo "
    Select Campagnas:
    "; +$select_list = "
    Select Campagnas:
    "; $select_list .= ""; $select_list .= "
    (Per selezionare più di campagna 1, tenere premuto il tasto Ctrl e fare clic su)"; $select_list .= "
    "; $select_list .= "Chiudi pannello

    "; +$select_list .= ""; -if ($UGdisplay > 0) - { - $select_list .= "Select Gruppo Utente:
    "; - $select_list .= "

    "; - } - -$select_list .= "   Inbound: "; +$select_list .= ""; -$select_list .= "   Dialable Leads Alert:
    "; + } + +$select_list .= ""; $select_list .= ""; -$select_list .= "
    "; +$select_list .= "Inbound:
     
    "; + $select_list .= "Select Gruppo Utente: "; + $select_list .= "
    "; +$select_list .= "Dialable Leads Alert:
    "; + $select_list .= "Show Presets Stats:
    "; $select_list .= "   "; $select_list .= ""; +$select_list .= ""; $select_list .= "VERSIONE: $version   BUILD: $build"; $select_list .= "
    "; @@ -707,8 +843,8 @@ $rslt=mysql_query($stmt, $link); $campaign_allow_inbound = $row[0]; echo "\n"; -echo"\n"; -echo "Real-Time Report: $group\n"; +echo"\n"; +echo "$report_name: $group\n"; $short_header=1; @@ -734,6 +870,9 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; echo "Real-Time Report                                                                               \n"; echo "\n"; echo ""; + } + + +##### PRESET STATS TOTALS ### +$PRESETstatsHTML=''; +if ($PRESETstats > 0) + { + $PRESETstatsHTML .= ""; + } + + +# http://server/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1 + ##### INBOUND ONLY ### if (ereg('O',$with_inbound)) { @@ -974,10 +1307,8 @@ if (ereg('O',$with_inbound)) if (eregi('ALL-ACTIVE',$group_string)) { - $non_inboundSQL=''; - if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} - $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $non_inboundSQL;"; + $inboundSQL = "where campaign_id IN ($closer_campaignsSQL)"; + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $inboundSQL;"; } $stmtC="select agent_non_pause_sec from vicidial_campaign_stats $group_SQLwhere;"; @@ -1100,11 +1431,13 @@ else { $non_inboundSQL=''; if (ereg('N',$with_inbound)) - {$non_inboundSQL = "where campaign_id NOT IN ($ALLcloser_campaignsSQL)";} + {$non_inboundSQL = "and campaign_id NOT IN($ALLcloser_campaignsSQL)";} + else + {$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";} $multi_drop++; - $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y';"; + $stmt="select avg(auto_dial_level),min(dial_status_a),min(dial_status_b),min(dial_status_c),min(dial_status_d),min(dial_status_e),min(lead_order),min(lead_filter_id),sum(hopper_level),min(dial_method),avg(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),min(available_only_ratio_tally),min(adaptive_latest_server_time),min(local_call_time),avg(dial_timeout),min(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where active='Y' $group_SQLand;"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats $non_inboundSQL;"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where calls_today > -1 $non_inboundSQL;"; } else { @@ -1117,13 +1450,13 @@ else $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses,agent_pause_codes_active,list_order_mix from vicidial_campaigns where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN ($group_SQL,$closer_campaignsSQL);"; } else { $stmt="select avg(auto_dial_level),max(dial_status_a),max(dial_status_b),max(dial_status_c),max(dial_status_d),max(dial_status_e),max(lead_order),max(lead_filter_id),max(hopper_level),max(dial_method),max(adaptive_maximum_level),avg(adaptive_dropped_percentage),avg(adaptive_dl_diff_target),avg(adaptive_intensity),max(available_only_ratio_tally),max(adaptive_latest_server_time),max(local_call_time),max(dial_timeout),max(dial_statuses),max(agent_pause_codes_active),max(list_order_mix) from vicidial_campaigns where campaign_id IN($group_SQL);"; - $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; + $stmtB="select sum(dialable_leads),sum(calls_today),sum(drops_today),avg(drops_answers_today_pct),avg(differential_onemin),avg(agents_average_onemin),sum(balance_trunk_fill),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(agent_calls_today),sum(agent_wait_today),sum(agent_custtalk_today),sum(agent_acw_today),sum(agent_pause_today) from vicidial_campaign_stats where campaign_id IN($group_SQL);"; } } if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";} @@ -1187,6 +1520,11 @@ else $VSCcat3tally = $row[13]; $VSCcat4 = $row[14]; $VSCcat4tally = $row[15]; + $VSCagentcalls = $row[16]; + $VSCagentwait = $row[17]; + $VSCagentcust = $row[18]; + $VSCagentacw = $row[19]; + $VSCagentpause = $row[20]; if ( ($diffONEMIN != 0) and ($agentsONEMIN > 0) ) { @@ -1207,7 +1545,7 @@ else } else { - $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $groupSQLand limit 1;"; + $stmt="select vcl_id from vicidial_campaigns_list_mix where status='ACTIVE' $group_SQLand limit 1;"; $rslt=mysql_query($stmt, $link); $Lmix_to_print = mysql_num_rows($rslt); if ($Lmix_to_print > 0) @@ -1217,6 +1555,10 @@ else $DIALorder = "Elenco Mix: $row[0]"; } } + $DIALlev = sprintf("%01.3f", $DIALlev); + $agentsONEMIN = sprintf("%01.2f", $agentsONEMIN); + $diffONEMIN = sprintf("%01.2f", $diffONEMIN); + echo "
    \n"; @@ -743,9 +882,9 @@ echo "\n"; echo "\n"; echo "   "; echo "\n"; -echo "STOP | "; -echo "PIU LENTO | "; -echo "INIZIA"; +echo "STOP | "; +echo "PIU LENTO | "; +echo "INIZIA"; if (eregi('ALL-ACTIVE',$group_string)) { echo "       MODIFICA | \n"; @@ -798,10 +937,9 @@ if ( ( ereg('Y',$with_inbound) or ereg('O',$with_inbound) ) and ($campaign_allow } $closer_campaignsSQL = preg_replace("/,$/","",$closer_campaignsSQL); } -else - { - $closer_campaignsSQL = "''"; - } +if (strlen($closer_campaignsSQL)<2) + {$closer_campaignsSQL="''";} + if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} @@ -936,6 +1074,7 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) $dtp++; } $DIGcampaigns = preg_replace("/,$/",'',$DIGcampaigns); + if (strlen($DIGcampaigns) < 2) {$DIGcampaigns = "''";} $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today) from vicidial_campaign_stats where campaign_id IN($DIGcampaigns);"; if ($DB > 0) {echo "\n|$stmtB|\n";} @@ -963,6 +1102,200 @@ if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) } +##### CARRIER STATS TOTALS ### +$CARRIERstatsHTML=''; +if ($CARRIERstats > 0) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeTWENTYFOURhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $car_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($car_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $TFhour_status[$ctp] = $row[0]; + $TFhour_count[$ctp] = $row[1]; + $dialstatuses .= "'$row[0]',"; + $ctp++; + } + $dialstatuses = preg_replace("/,$/",'',$dialstatuses); + + $CARRIERstatsHTML .= "
    "; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + + if (strlen($dialstatuses) > 1) + { + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeSIXhoursAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$SIXhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEhourAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEhour_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIFTEENminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FTminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeFIVEminutesAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$FIVEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + $stmtB="select dialstatus,count(*) from vicidial_carrier_log where call_date >= \"$timeONEminuteAGO\" group by dialstatus;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $scar_to_print = mysql_num_rows($rslt); + $print_sctp=0; + while ($scar_to_print > $print_sctp) + { + $row=mysql_fetch_row($rslt); + $print_ctp=0; + while ($print_ctp < $ctp) + { + if ($TFhour_status[$print_ctp] == $row[0]) + {$ONEminute_count[$print_ctp] = $row[1];} + $print_ctp++; + } + $print_sctp++; + } + + + $print_ctp=0; + while ($print_ctp < $ctp) + { + if (strlen($TFhour_count[$print_ctp])<1) {$TFhour_count[$print_ctp]=0;} + if (strlen($SIXhour_count[$print_ctp])<1) {$SIXhour_count[$print_ctp]=0;} + if (strlen($ONEhour_count[$print_ctp])<1) {$ONEhour_count[$print_ctp]=0;} + if (strlen($FTminute_count[$print_ctp])<1) {$FTminute_count[$print_ctp]=0;} + if (strlen($FIVEminute_count[$print_ctp])<1) {$FIVEminute_count[$print_ctp]=0;} + if (strlen($ONEminute_count[$print_ctp])<1) {$ONEminute_count[$print_ctp]=0;} + + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $CARRIERstatsHTML .= ""; + $print_ctp++; + } + } + else + { + $CARRIERstatsHTML .= ""; + } + $CARRIERstatsHTML .= "
    CARRIER STATS:                 HANGUP STATUS     24 HOURS     6 HOURS     1 HOUR     15 MIN     5 MIN     1 MIN  
         $TFhour_status[$print_ctp] $TFhour_count[$print_ctp] $SIXhour_count[$print_ctp] $ONEhour_count[$print_ctp] $FTminute_count[$print_ctp] $FIVEminute_count[$print_ctp] $ONEminute_count[$print_ctp]
    no log entries
    "; + $CARRIERstatsHTML .= "
    "; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $stmtB="select preset_name,xfer_count from vicidial_xfer_stats where preset_name!='' and preset_name is not NULL $group_SQLand order by preset_name;"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $pre_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($pre_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $PRESETstatsHTML .= ""; + $ctp++; + } + if ($ctp < 1) + { + $PRESETstatsHTML .= ""; + } + $PRESETstatsHTML .= "
      AGENT DIAL PRESETS:     PRESET NAMES                 CALLS  
                $row[0]     $row[1]  
    no log entries
    "; + $PRESETstatsHTML .= "
    "; echo ""; @@ -1271,7 +1613,55 @@ else echo ""; echo ""; + if ($AGENTtimeSTATS>0) + { + if ( ($VSCagentcalls > 0) and ($VSCagentpause > 0) ) + { + $avgpauseTODAY = ($VSCagentpause / $VSCagentcalls); + $avgpauseTODAY = round($avgpauseTODAY, 0); + $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); + } + else + {$avgpauseTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentwait > 0) ) + { + $avgwaitTODAY = ($VSCagentwait / $VSCagentcalls); + $avgwaitTODAY = round($avgwaitTODAY, 0); + $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); + } + else + {$avgwaitTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentcust > 0) ) + { + $avgcustTODAY = ($VSCagentcust / $VSCagentcalls); + $avgcustTODAY = round($avgcustTODAY, 0); + $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); + } + else + {$avgcustTODAY=0;} + + if ( ($VSCagentcalls > 0) and ($VSCagentacw > 0) ) + { + $avgacwTODAY = ($VSCagentacw / $VSCagentcalls); + $avgacwTODAY = round($avgacwTODAY, 0); + $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); + } + else + {$avgacwTODAY=0;} + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "$DROPINGROUPstatsHTML\n"; + echo "$CARRIERstatsHTML\n"; + echo "$PRESETstatsHTML\n"; } echo ""; @@ -1292,60 +1682,60 @@ echo "$ingroup_detail"; if ($adastats<2) { - echo "+ VIEW MORE"; + echo "+ VIEW MORE"; } else { - echo "+ VIEW LESS"; + echo "+ VIEW LESS"; } if ($UGdisplay>0) { - echo "       NASCONDI GRUPPI UTENTI"; + echo "       NASCONDI GRUPPI UTENTI"; } else { - echo "       MOSTRA GRUPPI UTENTI"; + echo "       MOSTRA GRUPPI UTENTI"; } if ($SERVdisplay>0) { - echo "       NASCONDI INFO SERVER"; + echo "       NASCONDI INFO SERVER"; } else { - echo "       MOSTRA INFO SERVER"; + echo "       MOSTRA INFO SERVER"; } if ($CALLSdisplay>0) { - echo "       NASCONDI WAITING CALLS"; + echo "       NASCONDI WAITING CALLS"; } else { - echo "       MOSTRA WAITING CALLS"; + echo "       MOSTRA WAITING CALLS"; } if ($ALLINGROUPstats>0) { - echo "       NASCONDI IN-GROUP STATS"; + echo "       NASCONDI IN-GROUP STATS"; } else { - echo "       MOSTRA IN-GROUP STATS"; + echo "       MOSTRA IN-GROUP STATS"; } if ($PHONEdisplay>0) { - echo "       NASCONDI PHONES"; + echo "       NASCONDI PHONES"; } else { - echo "       MOSTRA PHONES"; + echo "       MOSTRA PHONES"; } if ($CUSTPHONEdisplay>0) { - echo "       NASCONDI CUSTPHONES"; + echo "       NASCONDI CUSTPHONES"; } else { - echo "       MOSTRA CUSTPHONES"; + echo "       MOSTRA CUSTPHONES"; } echo ""; echo ""; @@ -1390,6 +1780,20 @@ if ( ($with_inbound != 'O') and ($NOLEADSalert == 'YES') ) ################################################################################### if ($campaign_allow_inbound > 0) { + if (eregi('ALL-ACTIVE',$group_string)) + { + $stmt="select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand"; + $rslt=mysql_query($stmt, $link); + $closer_campaigns=""; + while ($row=mysql_fetch_row($rslt)) + { + $closer_campaigns.="$row[0]"; + } + $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); + $closer_campaigns = preg_replace("/ - /"," ",$closer_campaigns); + $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); + $closer_campaignsSQL = "'$closer_campaigns'"; + } $stmtB="from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaignsSQL)) or (call_type IN('OUT','OUTBALANCE') $group_SQLand) ) order by queue_priority desc,campaign_id,call_time;"; } else @@ -1515,15 +1919,15 @@ if ($agentonlycount > 0) {$agentonlyheader = 'AGENTONLY';} $Cecho = ''; $Cecho .= "VICIDIAL: Calls Waiting $NOW_TIME\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; -$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITY | $agentonlyheader\n"; -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "| STATUS | CAMPAIGN | PHONE NUMBER | SERVER_IP | DIALTIME| CALL TYPE | PRIORITY | $agentonlyheader\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; $p=0; while($p<$k) { $Cstatus = sprintf("%-6s", $CDstatus[$p]); - $Ccampaign_id = sprintf("%-12s", $CDcampaign_id[$p]); + $Ccampaign_id = sprintf("%-20s", $CDcampaign_id[$p]); $Cphone_number = sprintf("%-12s", $CDphone_number[$p]); $Cserver_ip = sprintf("%-15s", $CDserver_ip[$p]); $Ccall_type = sprintf("%-10s", $CDcall_type[$p]); @@ -1548,7 +1952,7 @@ while($p<$k) $p++; } -$Cecho .= "+--------+--------------+--------------+-----------------+---------+------------+----------+\n"; +$Cecho .= "+--------+----------------------+--------------+-----------------+---------+------------+----------+\n"; if ($p<1) {$Cecho='';} @@ -1560,6 +1964,7 @@ if ($p<1) $agent_incall=0; $agent_ready=0; $agent_paused=0; +$agent_dispo=0; $agent_dead=0; $agent_total=0; @@ -1589,25 +1994,25 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; $HDuser = "------------------------+"; -$HTuser = " UTENTE "; +$HTuser = " UTENTE "; if ($UidORname>0) { - $HTuser .= "MOSTRA ID "; + $HTuser .= "MOSTRA ID "; } else { - $HTuser .= "MOSTRA NAME"; + $HTuser .= "MOSTRA NAME"; } $HTuser .= " INFO |"; $HDusergroup = "--------------+"; -$HTusergroup = " Utente Group |"; +$HTusergroup = " Utente Group |"; $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -1621,9 +2026,9 @@ $HTserver_ip = " SERVER IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVER IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; $HDcampaign = "------------+"; -$HTcampaign = " CAMPAGNA |"; +$HTcampaign = " CAMPAGNA |"; $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; @@ -1672,9 +2077,16 @@ if ($SERVdisplay < 1) } - -$Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; -$Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; +if ($realtime_block_user_info > 0) + { + $Aline = "$HDbegin$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } +else + { + $Aline = "$HDbegin$HDstation$HDphone$HDuser$HDusergroup$HDsessionid$HDbarge$HDstatus$HDpause$HDcustphone$HDserver_ip$HDcall_server_ip$HDtime$HDcampaign$HDcalls$HDigcall\n"; + $Bline = "$HTbegin$HTstation$HTphone$HTuser$HTusergroup$HTsessionid$HTbarge$HTstatus$HTpause$HTcustphone$HTserver_ip$HTcall_server_ip$HTtime$HTcampaign$HTcalls$HTigcall\n"; + } $Aecho .= "$Aline"; $Aecho .= "$Bline"; $Aecho .= "$Aline"; @@ -1698,7 +2110,7 @@ else if ($orderby=='userdown') {$orderSQL='vicidial_live_agents.user desc';} } -if (eregi('ALL-ACTIVE',$group_string)) {$UgroupSQL = '';} +if ( (eregi('ALL-ACTIVE',$group_string)) and (strlen($group_SQL) < 3) ) {$UgroupSQL = '';} else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";} if (strlen($usergroup)<1) {$usergroupSQL = '';} else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} @@ -2000,7 +2412,7 @@ $calls_to_list = mysql_num_rows($rslt); {$j++; continue;} else { - $agent_paused++; $agent_total++; + $agent_dispo++; $agent_total++; $G=''; $EG=''; if ($call_time_S >= 10) {$G=''; $EG='';} if ($call_time_S >= 60) {$G=''; $EG='';} @@ -2088,14 +2500,20 @@ $calls_to_list = mysql_num_rows($rslt); $agentcount++; - $Aecho .= "| $G$extension$EG |$phoneD$G$user$EG+ |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; - + if ($realtime_block_user_info > 0) + { + $Aecho .= "|$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } + if ($realtime_block_user_info < 1) + { + $Aecho .= "| $G$extension$EG |$phoneD$G$user$EG+ |$UGD $G$sessionid$EG$L$R | $G$status$EG $CM $pausecode| $CP$SVD$G$call_time_MS$EG | $G$campaign_id$EG | $G$calls_today$EG |$INGRP\n"; + } $j++; } $Aecho .= "$Aline"; $Aecho .= " $agentcount agents logged in on all servers\n"; - $Aecho .= " Sistema di carico Average: $load_ave\n\n"; + $Aecho .= " Sistema di carico Average: $load_ave   $db_source\n\n"; # $Aecho .= " - Balanced call\n"; $Aecho .= " - Agent waiting for call\n"; @@ -2123,6 +2541,7 @@ $calls_to_list = mysql_num_rows($rslt); echo "$NFB$B  $agent_ready $BG$NFE agents waiting       \n"; echo "$NFB$agent_paused$NFE paused agents       \n"; echo "$NFB$agent_dead$NFE agenti morti chiamate      \n"; + echo "$NFB$agent_dispo$NFE agents in dispo      \n"; echo "
    ";
     		echo "";
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php b/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php
    index caad2592..2fd9eb2c 100644
    --- a/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php
    +++ b/agc_2-X/trunk/LANG_www/vicidial_it/AST_timeonVDADallSUMMARY.php
    @@ -1,7 +1,7 @@
         LICENSE: AGPLv2
    +# Copyright (C) 2010  Matt Florell     LICENSE: AGPLv2
     #
     # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers
     #
    @@ -16,6 +16,9 @@
     # 80525-1040 - Added IVR status summary display for inbound calls
     # 90310-2119 - Added admin header
     # 90508-0644 - Changed to PHP long tags
    +# 100709-1806 - Added system setting slave server option
    +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
    +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
     #
     
     header ("Content-type: text/html; charset=utf-8");
    @@ -38,17 +41,52 @@ if (isset($_GET["INVIA"]))				{$INVIA=$_GET["INVIA"];}
     
     if (!isset($RR))			{$gRRroup=4;}
     
    +$report_name = 'Real-Time Campagna Summary';
    +$db_source = 'M';
    +
    +#############################################
    +##### START SYSTEM_SETTINGS LOOKUP #####
    +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
    +$rslt=mysql_query($stmt, $link);
    +if ($DB) {echo "$stmt\n";}
    +$qm_conf_ct = mysql_num_rows($rslt);
    +if ($qm_conf_ct > 0)
    +	{
    +	$row=mysql_fetch_row($rslt);
    +	$non_latin =					$row[0];
    +	$outbound_autodial_active =		$row[1];
    +	$slave_db_server =				$row[2];
    +	$reports_use_slave_db =			$row[3];
    +	}
    +##### END SETTINGS LOOKUP #####
    +###########################################
    +
    +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
    +	{
    +	mysql_close($link);
    +	$use_slave_server=1;
    +	$db_source = 'S';
    +	require("dbconnect.php");
    +	echo "\n";
    +	}
    +
     
     $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
     $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
     
    -	$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
    -	if ($DB) {echo "|$stmt|\n";}
    -	$rslt=mysql_query($stmt, $link);
    -	$row=mysql_fetch_row($rslt);
    -	$auth=$row[0];
    +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$auth=$row[0];
     
    -  if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
    +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$reports_only_user=$row[0];
    +
    +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
     	{
         Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
         Header("HTTP/1.0 401 Unauthorized");
    @@ -56,10 +94,41 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
         exit;
     	}
     
    +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$LOGuser_group =			$row[0];
    +
    +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
    +if ($DB) {echo "|$stmt|\n";}
    +$rslt=mysql_query($stmt, $link);
    +$row=mysql_fetch_row($rslt);
    +$LOGallowed_campaigns = $row[0];
    +$LOGallowed_reports =	$row[1];
    +
    +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) )
    +	{
    +    Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
    +    Header("HTTP/1.0 401 Unauthorized");
    +    echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
    +    exit;
    +	}
    +
     $NOW_TIME = date("Y-m-d H:i:s");
     $STARTtime = date("U");
     
    -$stmt="select campaign_id from vicidial_campaigns where active='Y';";
    +$LOGallowed_campaignsSQL='';
    +$whereLOGallowed_campaignsSQL='';
    +if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
    +	{
    +	$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
    +	$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
    +	$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
    +	$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
    +	}
    +
    +$stmt="select campaign_id from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;";
     $rslt=mysql_query($stmt, $link);
     if (!isset($DB))   {$DB=0;}
     if ($DB) {echo "$stmt\n";}
    @@ -107,7 +176,7 @@ if (!isset($RR))   {$RR=4;}
     \n";
    -echo "Real-Time All Campagne Summary\n";
    +echo "$report_name\n";
     
     	$short_header=1;
     
    @@ -446,10 +515,12 @@ echo "";
     echo "";
     echo "
    LIVELLO CHIAMATE:  $DIALlev    ORDINE:  $DIALorder    
    AGENT AVG WAIT:  $avgwaitTODAY  AVG CUSTTIME:  $avgcustTODAY  AVG ACW:  $avgacwTODAY  AVG PAUSE:  $avgpauseTODAY  
    "; -echo "\n\n"; +echo "\n\n
    "; $k++; } + +echo "$db_source\n"; ?>
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin.php index 9cf6dcee..71cb561c 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/admin.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin.php @@ -94,6 +94,10 @@ $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +$Vreports = 'NONE, Real-Time Main Report, Real-Time Campagna Summary , Inbound Report, Inbound Service Level Report, Inbound Sintesi Resoconto, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Liste Esiti Campagna Report, Esporta invita Relazione , Agente Time Dettagliata, Agent Status Dettagliata, Agent Performance Dettagliata, Single Agent Daily , UtenteOrologio Report, Gruppo UtenteOrologio Status Report, UtenteOrologio Dettagliata Report , Server Performance Report, Administration Change Log, List Update Stats, Statistiche utente, Utente Time Sheet, Download List'; + +$UGreports = 'ALL REPORT, NONE, Real-Time Main Report, Real-Time Campagna Summary , Inbound Report, Inbound Service Level Report, Inbound Sintesi Resoconto, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Fronter - Closer Report, Liste Esiti Campagna Report, Esporta invita Relazione , Agente Time Dettagliata, Agent Status Dettagliata, Agent Performance Dettagliata, Single Agent Daily , UtenteOrologio Report, Gruppo UtenteOrologio Status Report, UtenteOrologio Dettagliata Report , Server Performance Report, Administration Change Log, List Update Stats, Statistiche utente, Utente Time Sheet, Download List, Custom Report Links, CallCard Search'; + ###################################################################################################### ###################################################################################################### ####### Form variable declaration @@ -1167,9 +1171,314 @@ if (isset($_GET["xferconf_d_number"])) {$xferconf_d_number=$_GET["xferconf_d_n elseif (isset($_POST["xferconf_d_number"])) {$xferconf_d_number=$_POST["xferconf_d_number"];} if (isset($_GET["xferconf_e_number"])) {$xferconf_e_number=$_GET["xferconf_e_number"];} elseif (isset($_POST["xferconf_e_number"])) {$xferconf_e_number=$_POST["xferconf_e_number"];} +if (isset($_GET["record_call"])) {$record_call=$_GET["record_call"];} + elseif (isset($_POST["record_call"])) {$record_call=$_POST["record_call"];} +if (isset($_GET["ignore_list_script_override"])) {$ignore_list_script_override=$_GET["ignore_list_script_override"];} + elseif (isset($_POST["ignore_list_script_override"])) {$ignore_list_script_override=$_POST["ignore_list_script_override"];} +if (isset($_GET["external_server_ip"])) {$external_server_ip=$_GET["external_server_ip"];} + elseif (isset($_POST["external_server_ip"])){$external_server_ip=$_POST["external_server_ip"];} +if (isset($_GET["is_webphone"])) {$is_webphone=$_GET["is_webphone"];} + elseif (isset($_POST["is_webphone"])) {$is_webphone=$_POST["is_webphone"];} +if (isset($_GET["use_external_server_ip"])) {$use_external_server_ip=$_GET["use_external_server_ip"];} + elseif (isset($_POST["use_external_server_ip"])){$use_external_server_ip=$_POST["use_external_server_ip"];} +if (isset($_GET["default_webphone"])) {$default_webphone=$_GET["default_webphone"];} + elseif (isset($_POST["default_webphone"])) {$default_webphone=$_POST["default_webphone"];} +if (isset($_GET["default_external_server_ip"])) {$default_external_server_ip=$_GET["default_external_server_ip"];} + elseif (isset($_POST["default_external_server_ip"])){$default_external_server_ip=$_POST["default_external_server_ip"];} +if (isset($_GET["webphone_url"])) {$webphone_url=$_GET["webphone_url"];} + elseif (isset($_POST["webphone_url"])) {$webphone_url=$_POST["webphone_url"];} +if (isset($_GET["enable_agc_dispo_log"])) {$enable_agc_dispo_log=$_GET["enable_agc_dispo_log"];} + elseif (isset($_POST["enable_agc_dispo_log"])) {$enable_agc_dispo_log=$_POST["enable_agc_dispo_log"];} +if (isset($_GET["agent_call_log_view"])) {$agent_call_log_view=$_GET["agent_call_log_view"];} + elseif (isset($_POST["agent_call_log_view"])) {$agent_call_log_view=$_POST["agent_call_log_view"];} +if (isset($_GET["agent_call_log_view_override"])) {$agent_call_log_view_override=$_GET["agent_call_log_view_override"];} + elseif (isset($_POST["agent_call_log_view_override"])) {$agent_call_log_view_override=$_POST["agent_call_log_view_override"];} +if (isset($_GET["use_custom_cid"])) {$use_custom_cid=$_GET["use_custom_cid"];} + elseif (isset($_POST["use_custom_cid"])) {$use_custom_cid=$_POST["use_custom_cid"];} +if (isset($_GET["scheduled_callbacks_alert"])) {$scheduled_callbacks_alert=$_GET["scheduled_callbacks_alert"];} + elseif (isset($_POST["scheduled_callbacks_alert"])) {$scheduled_callbacks_alert=$_POST["scheduled_callbacks_alert"];} +if (isset($_GET["queuemetrics_loginout"])) {$queuemetrics_loginout=$_GET["queuemetrics_loginout"];} + elseif (isset($_POST["queuemetrics_loginout"])) {$queuemetrics_loginout=$_POST["queuemetrics_loginout"];} +if (isset($_GET["callcard_enabled"])) {$callcard_enabled=$_GET["callcard_enabled"];} + elseif (isset($_POST["callcard_enabled"])) {$callcard_enabled=$_POST["callcard_enabled"];} +if (isset($_GET["callcard_admin"])) {$callcard_admin=$_GET["callcard_admin"];} + elseif (isset($_POST["callcard_admin"])) {$callcard_admin=$_POST["callcard_admin"];} +if (isset($_GET["agent_xfer_consultative"])) {$agent_xfer_consultative=$_GET["agent_xfer_consultative"];} + elseif (isset($_POST["agent_xfer_consultative"])) {$agent_xfer_consultative=$_POST["agent_xfer_consultative"];} +if (isset($_GET["agent_xfer_dial_override"])) {$agent_xfer_dial_override=$_GET["agent_xfer_dial_override"];} + elseif (isset($_POST["agent_xfer_dial_override"])) {$agent_xfer_dial_override=$_POST["agent_xfer_dial_override"];} +if (isset($_GET["agent_xfer_vm_transfer"])) {$agent_xfer_vm_transfer=$_GET["agent_xfer_vm_transfer"];} + elseif (isset($_POST["agent_xfer_vm_transfer"])) {$agent_xfer_vm_transfer=$_POST["agent_xfer_vm_transfer"];} +if (isset($_GET["agent_xfer_blind_transfer"])) {$agent_xfer_blind_transfer=$_GET["agent_xfer_blind_transfer"];} + elseif (isset($_POST["agent_xfer_blind_transfer"])) {$agent_xfer_blind_transfer=$_POST["agent_xfer_blind_transfer"];} +if (isset($_GET["agent_xfer_dial_with_customer"])) {$agent_xfer_dial_with_customer=$_GET["agent_xfer_dial_with_customer"];} + elseif (isset($_POST["agent_xfer_dial_with_customer"])) {$agent_xfer_dial_with_customer=$_POST["agent_xfer_dial_with_customer"];} +if (isset($_GET["agent_xfer_park_customer_dial"])) {$agent_xfer_park_customer_dial=$_GET["agent_xfer_park_customer_dial"];} + elseif (isset($_POST["agent_xfer_park_customer_dial"])) {$agent_xfer_park_customer_dial=$_POST["agent_xfer_park_customer_dial"];} +if (isset($_GET["agent_fullscreen"])) {$agent_fullscreen=$_GET["agent_fullscreen"];} + elseif (isset($_POST["agent_fullscreen"])) {$agent_fullscreen=$_POST["agent_fullscreen"];} +if (isset($_GET["extension_id"])) {$extension_id=$_GET["extension_id"];} + elseif (isset($_POST["extension_id"])) {$extension_id=$_POST["extension_id"];} +if (isset($_GET["extension_group_id"])) {$extension_group_id=$_GET["extension_group_id"];} + elseif (isset($_POST["extension_group_id"])) {$extension_group_id=$_POST["extension_group_id"];} +if (isset($_GET["campaign_groups"])) {$campaign_groups=$_GET["campaign_groups"];} + elseif (isset($_POST["campaign_groups"])) {$campaign_groups=$_POST["campaign_groups"];} +if (isset($_GET["extension_group"])) {$extension_group=$_GET["extension_group"];} + elseif (isset($_POST["extension_group"])) {$extension_group=$_POST["extension_group"];} +if (isset($_GET["agent_choose_blended"])) {$agent_choose_blended=$_GET["agent_choose_blended"];} + elseif (isset($_POST["agent_choose_blended"])) {$agent_choose_blended=$_POST["agent_choose_blended"];} +if (isset($_GET["queuemetrics_callstatus"])) {$queuemetrics_callstatus=$_GET["queuemetrics_callstatus"];} + elseif (isset($_POST["queuemetrics_callstatus"])) {$queuemetrics_callstatus=$_POST["queuemetrics_callstatus"];} +if (isset($_GET["extension_appended_cidname"])) {$extension_appended_cidname=$_GET["extension_appended_cidname"];} + elseif (isset($_POST["extension_appended_cidname"])) {$extension_appended_cidname=$_POST["extension_appended_cidname"];} +if (isset($_GET["scheduled_callbacks_count"])) {$scheduled_callbacks_count=$_GET["scheduled_callbacks_count"];} + elseif (isset($_POST["scheduled_callbacks_count"])) {$scheduled_callbacks_count=$_POST["scheduled_callbacks_count"];} +if (isset($_GET["realtime_block_user_info"])) {$realtime_block_user_info=$_GET["realtime_block_user_info"];} + elseif (isset($_POST["realtime_block_user_info"])) {$realtime_block_user_info=$_POST["realtime_block_user_info"];} +if (isset($_GET["manual_dial_override"])) {$manual_dial_override=$_GET["manual_dial_override"];} + elseif (isset($_POST["manual_dial_override"])) {$manual_dial_override=$_POST["manual_dial_override"];} +if (isset($_GET["blind_monitor_warning"])) {$blind_monitor_warning=$_GET["blind_monitor_warning"];} + elseif (isset($_POST["blind_monitor_warning"])) {$blind_monitor_warning=$_POST["blind_monitor_warning"];} +if (isset($_GET["blind_monitor_message"])) {$blind_monitor_message=$_GET["blind_monitor_message"];} + elseif (isset($_POST["blind_monitor_message"])) {$blind_monitor_message=$_POST["blind_monitor_message"];} +if (isset($_GET["blind_monitor_filename"])) {$blind_monitor_filename=$_GET["blind_monitor_filename"];} + elseif (isset($_POST["blind_monitor_filename"])) {$blind_monitor_filename=$_POST["blind_monitor_filename"];} +if (isset($_GET["uniqueid_status_display"])) {$uniqueid_status_display=$_GET["uniqueid_status_display"];} + elseif (isset($_POST["uniqueid_status_display"])) {$uniqueid_status_display=$_POST["uniqueid_status_display"];} +if (isset($_GET["uniqueid_status_prefix"])) {$uniqueid_status_prefix=$_GET["uniqueid_status_prefix"];} + elseif (isset($_POST["uniqueid_status_prefix"])) {$uniqueid_status_prefix=$_POST["uniqueid_status_prefix"];} +if (isset($_GET["default_codecs"])) {$default_codecs=$_GET["default_codecs"];} + elseif (isset($_POST["default_codecs"])) {$default_codecs=$_POST["default_codecs"];} +if (isset($_GET["codecs_list"])) {$codecs_list=$_GET["codecs_list"];} + elseif (isset($_POST["codecs_list"])) {$codecs_list=$_POST["codecs_list"];} +if (isset($_GET["codecs_with_template"])) {$codecs_with_template=$_GET["codecs_with_template"];} + elseif (isset($_POST["codecs_with_template"])) {$codecs_with_template=$_POST["codecs_with_template"];} +if (isset($_GET["custom_fields_modify"])) {$custom_fields_modify=$_GET["custom_fields_modify"];} + elseif (isset($_POST["custom_fields_modify"])) {$custom_fields_modify=$_POST["custom_fields_modify"];} +if (isset($_GET["hold_time_option_minimum"])) {$hold_time_option_minimum=$_GET["hold_time_option_minimum"];} + elseif (isset($_POST["hold_time_option_minimum"])) {$hold_time_option_minimum=$_POST["hold_time_option_minimum"];} +if (isset($_GET["source_carrier"])) {$source_carrier=$_GET["source_carrier"];} + elseif (isset($_POST["source_carrier"])) {$source_carrier=$_POST["source_carrier"];} +if (isset($_GET["hold_time_option_press_filename"])) {$hold_time_option_press_filename=$_GET["hold_time_option_press_filename"];} + elseif (isset($_POST["hold_time_option_press_filename"])) {$hold_time_option_press_filename=$_POST["hold_time_option_press_filename"];} +if (isset($_GET["hold_time_option_callmenu"])) {$hold_time_option_callmenu=$_GET["hold_time_option_callmenu"];} + elseif (isset($_POST["hold_time_option_callmenu"])) {$hold_time_option_callmenu=$_POST["hold_time_option_callmenu"];} +if (isset($_GET["inbound_queue_no_dial"])) {$inbound_queue_no_dial=$_GET["inbound_queue_no_dial"];} + elseif (isset($_POST["inbound_queue_no_dial"])) {$inbound_queue_no_dial=$_POST["inbound_queue_no_dial"];} +if (isset($_GET["default_afterhours_filename_override"])) {$default_afterhours_filename_override=$_GET["default_afterhours_filename_override"];} + elseif (isset($_POST["default_afterhours_filename_override"])) {$default_afterhours_filename_override=$_POST["default_afterhours_filename_override"];} +if (isset($_GET["sunday_afterhours_filename_override"])) {$sunday_afterhours_filename_override=$_GET["sunday_afterhours_filename_override"];} + elseif (isset($_POST["sunday_afterhours_filename_override"])) {$sunday_afterhours_filename_override=$_POST["sunday_afterhours_filename_override"];} +if (isset($_GET["monday_afterhours_filename_override"])) {$monday_afterhours_filename_override=$_GET["monday_afterhours_filename_override"];} + elseif (isset($_POST["monday_afterhours_filename_override"])) {$monday_afterhours_filename_override=$_POST["monday_afterhours_filename_override"];} +if (isset($_GET["tuesday_afterhours_filename_override"])) {$tuesday_afterhours_filename_override=$_GET["tuesday_afterhours_filename_override"];} + elseif (isset($_POST["tuesday_afterhours_filename_override"])) {$tuesday_afterhours_filename_override=$_POST["tuesday_afterhours_filename_override"];} +if (isset($_GET["wednesday_afterhours_filename_override"])) {$wednesday_afterhours_filename_override=$_GET["wednesday_afterhours_filename_override"];} + elseif (isset($_POST["wednesday_afterhours_filename_override"])) {$wednesday_afterhours_filename_override=$_POST["wednesday_afterhours_filename_override"];} +if (isset($_GET["thursday_afterhours_filename_override"])) {$thursday_afterhours_filename_override=$_GET["thursday_afterhours_filename_override"];} + elseif (isset($_POST["thursday_afterhours_filename_override"])) {$thursday_afterhours_filename_override=$_POST["thursday_afterhours_filename_override"];} +if (isset($_GET["friday_afterhours_filename_override"])) {$friday_afterhours_filename_override=$_GET["friday_afterhours_filename_override"];} + elseif (isset($_POST["friday_afterhours_filename_override"])) {$friday_afterhours_filename_override=$_POST["friday_afterhours_filename_override"];} +if (isset($_GET["saturday_afterhours_filename_override"])) {$saturday_afterhours_filename_override=$_GET["saturday_afterhours_filename_override"];} + elseif (isset($_POST["saturday_afterhours_filename_override"])) {$saturday_afterhours_filename_override=$_POST["saturday_afterhours_filename_override"];} +if (isset($_GET["onhold_prompt_no_block"])) {$onhold_prompt_no_block=$_GET["onhold_prompt_no_block"];} + elseif (isset($_POST["onhold_prompt_no_block"])) {$onhold_prompt_no_block=$_POST["onhold_prompt_no_block"];} +if (isset($_GET["onhold_prompt_seconds"])) {$onhold_prompt_seconds=$_GET["onhold_prompt_seconds"];} + elseif (isset($_POST["onhold_prompt_seconds"])) {$onhold_prompt_seconds=$_POST["onhold_prompt_seconds"];} +if (isset($_GET["hold_time_option_no_block"])) {$hold_time_option_no_block=$_GET["hold_time_option_no_block"];} + elseif (isset($_POST["hold_time_option_no_block"])) {$hold_time_option_no_block=$_POST["hold_time_option_no_block"];} +if (isset($_GET["hold_time_option_prompt_seconds"])) {$hold_time_option_prompt_seconds=$_GET["hold_time_option_prompt_seconds"];} + elseif (isset($_POST["hold_time_option_prompt_seconds"])) {$hold_time_option_prompt_seconds=$_POST["hold_time_option_prompt_seconds"];} +if (isset($_GET["admin_web_directory"])) {$admin_web_directory=$_GET["admin_web_directory"];} + elseif (isset($_POST["admin_web_directory"])) {$admin_web_directory=$_POST["admin_web_directory"];} +if (isset($_GET["tts_voice"])) {$tts_voice=$_GET["tts_voice"];} + elseif (isset($_POST["tts_voice"])) {$tts_voice=$_POST["tts_voice"];} +if (isset($_GET["label_title"])) {$label_title=$_GET["label_title"];} + elseif (isset($_POST["label_title"])) {$label_title=$_POST["label_title"];} +if (isset($_GET["label_first_name"])) {$label_first_name=$_GET["label_first_name"];} + elseif (isset($_POST["label_first_name"])) {$label_first_name=$_POST["label_first_name"];} +if (isset($_GET["label_middle_initial"])) {$label_middle_initial=$_GET["label_middle_initial"];} + elseif (isset($_POST["label_middle_initial"])) {$label_middle_initial=$_POST["label_middle_initial"];} +if (isset($_GET["label_last_name"])) {$label_last_name=$_GET["label_last_name"];} + elseif (isset($_POST["label_last_name"])) {$label_last_name=$_POST["label_last_name"];} +if (isset($_GET["label_address1"])) {$label_address1=$_GET["label_address1"];} + elseif (isset($_POST["label_address1"])) {$label_address1=$_POST["label_address1"];} +if (isset($_GET["label_address2"])) {$label_address2=$_GET["label_address2"];} + elseif (isset($_POST["label_address2"])) {$label_address2=$_POST["label_address2"];} +if (isset($_GET["label_address3"])) {$label_address3=$_GET["label_address3"];} + elseif (isset($_POST["label_address3"])) {$label_address3=$_POST["label_address3"];} +if (isset($_GET["label_city"])) {$label_city=$_GET["label_city"];} + elseif (isset($_POST["label_city"])) {$label_city=$_POST["label_city"];} +if (isset($_GET["label_state"])) {$label_state=$_GET["label_state"];} + elseif (isset($_POST["label_state"])) {$label_state=$_POST["label_state"];} +if (isset($_GET["label_province"])) {$label_province=$_GET["label_province"];} + elseif (isset($_POST["label_province"])) {$label_province=$_POST["label_province"];} +if (isset($_GET["label_postal_code"])) {$label_postal_code=$_GET["label_postal_code"];} + elseif (isset($_POST["label_postal_code"])) {$label_postal_code=$_POST["label_postal_code"];} +if (isset($_GET["label_vendor_lead_code"])) {$label_vendor_lead_code=$_GET["label_vendor_lead_code"];} + elseif (isset($_POST["label_vendor_lead_code"])){$label_vendor_lead_code=$_POST["label_vendor_lead_code"];} +if (isset($_GET["label_gender"])) {$label_gender=$_GET["label_gender"];} + elseif (isset($_POST["label_gender"])) {$label_gender=$_POST["label_gender"];} +if (isset($_GET["label_phone_number"])) {$label_phone_number=$_GET["label_phone_number"];} + elseif (isset($_POST["label_phone_number"])) {$label_phone_number=$_POST["label_phone_number"];} +if (isset($_GET["label_phone_code"])) {$label_phone_code=$_GET["label_phone_code"];} + elseif (isset($_POST["label_phone_code"])) {$label_phone_code=$_POST["label_phone_code"];} +if (isset($_GET["label_alt_phone"])) {$label_alt_phone=$_GET["label_alt_phone"];} + elseif (isset($_POST["label_alt_phone"])) {$label_alt_phone=$_POST["label_alt_phone"];} +if (isset($_GET["label_security_phrase"])) {$label_security_phrase=$_GET["label_security_phrase"];} + elseif (isset($_POST["label_security_phrase"])) {$label_security_phrase=$_POST["label_security_phrase"];} +if (isset($_GET["label_email"])) {$label_email=$_GET["label_email"];} + elseif (isset($_POST["label_email"])) {$label_email=$_POST["label_email"];} +if (isset($_GET["label_comments"])) {$label_comments=$_GET["label_comments"];} + elseif (isset($_POST["label_comments"])) {$label_comments=$_POST["label_comments"];} +if (isset($_GET["custom_fields_enabled"])) {$custom_fields_enabled=$_GET["custom_fields_enabled"];} + elseif (isset($_POST["custom_fields_enabled"])) {$custom_fields_enabled=$_POST["custom_fields_enabled"];} +if (isset($_GET["slave_db_server"])) {$slave_db_server=$_GET["slave_db_server"];} + elseif (isset($_POST["slave_db_server"])) {$slave_db_server=$_POST["slave_db_server"];} +if (isset($_GET["reports_use_slave_db"])) {$reports_use_slave_db=$_GET["reports_use_slave_db"];} + elseif (isset($_POST["reports_use_slave_db"])) {$reports_use_slave_db=$_POST["reports_use_slave_db"];} +if (isset($_GET["hold_time_second_option"])) {$hold_time_second_option=$_GET["hold_time_second_option"];} + elseif (isset($_POST["hold_time_second_option"])) {$hold_time_second_option=$_POST["hold_time_second_option"];} +if (isset($_GET["hold_time_third_option"])) {$hold_time_third_option=$_GET["hold_time_third_option"];} + elseif (isset($_POST["hold_time_third_option"])) {$hold_time_third_option=$_POST["hold_time_third_option"];} +if (isset($_GET["wait_hold_option_priority"])) {$wait_hold_option_priority=$_GET["wait_hold_option_priority"];} + elseif (isset($_POST["wait_hold_option_priority"])) {$wait_hold_option_priority=$_POST["wait_hold_option_priority"];} +if (isset($_GET["wait_time_option"])) {$wait_time_option=$_GET["wait_time_option"];} + elseif (isset($_POST["wait_time_option"])) {$wait_time_option=$_POST["wait_time_option"];} +if (isset($_GET["wait_time_second_option"])) {$wait_time_second_option=$_GET["wait_time_second_option"];} + elseif (isset($_POST["wait_time_second_option"])) {$wait_time_second_option=$_POST["wait_time_second_option"];} +if (isset($_GET["wait_time_third_option"])) {$wait_time_third_option=$_GET["wait_time_third_option"];} + elseif (isset($_POST["wait_time_third_option"])) {$wait_time_third_option=$_POST["wait_time_third_option"];} +if (isset($_GET["wait_time_option_seconds"])) {$wait_time_option_seconds=$_GET["wait_time_option_seconds"];} + elseif (isset($_POST["wait_time_option_seconds"])) {$wait_time_option_seconds=$_POST["wait_time_option_seconds"];} +if (isset($_GET["wait_time_option_exten"])) {$wait_time_option_exten=$_GET["wait_time_option_exten"];} + elseif (isset($_POST["wait_time_option_exten"])) {$wait_time_option_exten=$_POST["wait_time_option_exten"];} +if (isset($_GET["wait_time_option_voicemail"])) {$wait_time_option_voicemail=$_GET["wait_time_option_voicemail"];} + elseif (isset($_POST["wait_time_option_voicemail"])) {$wait_time_option_voicemail=$_POST["wait_time_option_voicemail"];} +if (isset($_GET["wait_time_option_xfer_group"])) {$wait_time_option_xfer_group=$_GET["wait_time_option_xfer_group"];} + elseif (isset($_POST["wait_time_option_xfer_group"])) {$wait_time_option_xfer_group=$_POST["wait_time_option_xfer_group"];} +if (isset($_GET["wait_time_option_callmenu"])) {$wait_time_option_callmenu=$_GET["wait_time_option_callmenu"];} + elseif (isset($_POST["wait_time_option_callmenu"])) {$wait_time_option_callmenu=$_POST["wait_time_option_callmenu"];} +if (isset($_GET["wait_time_option_callback_filename"])) {$wait_time_option_callback_filename=$_GET["wait_time_option_callback_filename"];} + elseif (isset($_POST["wait_time_option_callback_filename"])) {$wait_time_option_callback_filename=$_POST["wait_time_option_callback_filename"];} +if (isset($_GET["wait_time_option_callback_list_id"])) {$wait_time_option_callback_list_id=$_GET["wait_time_option_callback_list_id"];} + elseif (isset($_POST["wait_time_option_callback_list_id"])) {$wait_time_option_callback_list_id=$_POST["wait_time_option_callback_list_id"];} +if (isset($_GET["wait_time_option_press_filename"])) {$wait_time_option_press_filename=$_GET["wait_time_option_press_filename"];} + elseif (isset($_POST["wait_time_option_press_filename"])) {$wait_time_option_press_filename=$_POST["wait_time_option_press_filename"];} +if (isset($_GET["wait_time_option_no_block"])) {$wait_time_option_no_block=$_GET["wait_time_option_no_block"];} + elseif (isset($_POST["wait_time_option_no_block"])) {$wait_time_option_no_block=$_POST["wait_time_option_no_block"];} +if (isset($_GET["wait_time_option_prompt_seconds"])) {$wait_time_option_prompt_seconds=$_GET["wait_time_option_prompt_seconds"];} + elseif (isset($_POST["wait_time_option_prompt_seconds"])) {$wait_time_option_prompt_seconds=$_POST["wait_time_option_prompt_seconds"];} +if (isset($_GET["timer_action_destination"])) {$timer_action_destination=$_GET["timer_action_destination"];} + elseif (isset($_POST["timer_action_destination"])) {$timer_action_destination=$_POST["timer_action_destination"];} +if (isset($_GET["allowed_reports"])) {$allowed_reports=$_GET["allowed_reports"];} + elseif (isset($_POST["allowed_reports"])) {$allowed_reports=$_POST["allowed_reports"];} +if (isset($_GET["filter_phone_group_id"])) {$filter_phone_group_id=$_GET["filter_phone_group_id"];} + elseif (isset($_POST["filter_phone_group_id"])) {$filter_phone_group_id=$_POST["filter_phone_group_id"];} +if (isset($_GET["filter_phone_group_name"])) {$filter_phone_group_name=$_GET["filter_phone_group_name"];} + elseif (isset($_POST["filter_phone_group_name"])) {$filter_phone_group_name=$_POST["filter_phone_group_name"];} +if (isset($_GET["filter_phone_group_description"])) {$filter_phone_group_description=$_GET["filter_phone_group_description"];} + elseif (isset($_POST["filter_phone_group_description"])) {$filter_phone_group_description=$_POST["filter_phone_group_description"];} +if (isset($_GET["filter_inbound_number"])) {$filter_inbound_number=$_GET["filter_inbound_number"];} + elseif (isset($_POST["filter_inbound_number"])) {$filter_inbound_number=$_POST["filter_inbound_number"];} +if (isset($_GET["filter_url"])) {$filter_url=$_GET["filter_url"];} + elseif (isset($_POST["filter_url"])) {$filter_url=$_POST["filter_url"];} +if (isset($_GET["filter_action"])) {$filter_action=$_GET["filter_action"];} + elseif (isset($_POST["filter_action"])) {$filter_action=$_POST["filter_action"];} +if (isset($_GET["filter_extension"])) {$filter_extension=$_GET["filter_extension"];} + elseif (isset($_POST["filter_extension"])) {$filter_extension=$_POST["filter_extension"];} +if (isset($_GET["filter_exten_context"])) {$filter_exten_context=$_GET["filter_exten_context"];} + elseif (isset($_POST["filter_exten_context"])) {$filter_exten_context=$_POST["filter_exten_context"];} +if (isset($_GET["filter_voicemail_ext"])) {$filter_voicemail_ext=$_GET["filter_voicemail_ext"];} + elseif (isset($_POST["filter_voicemail_ext"])) {$filter_voicemail_ext=$_POST["filter_voicemail_ext"];} +if (isset($_GET["filter_phone"])) {$filter_phone=$_GET["filter_phone"];} + elseif (isset($_POST["filter_phone"])) {$filter_phone=$_POST["filter_phone"];} +if (isset($_GET["filter_server_ip"])) {$filter_server_ip=$_GET["filter_server_ip"];} + elseif (isset($_POST["filter_server_ip"])) {$filter_server_ip=$_POST["filter_server_ip"];} +if (isset($_GET["filter_user"])) {$filter_user=$_GET["filter_user"];} + elseif (isset($_POST["filter_user"])) {$filter_user=$_POST["filter_user"];} +if (isset($_GET["filter_user_unavailable_action"])) {$filter_user_unavailable_action=$_GET["filter_user_unavailable_action"];} + elseif (isset($_POST["filter_user_unavailable_action"])) {$filter_user_unavailable_action=$_POST["filter_user_unavailable_action"];} +if (isset($_GET["filter_user_route_settings_ingroup"])) {$filter_user_route_settings_ingroup=$_GET["filter_user_route_settings_ingroup"];} + elseif (isset($_POST["filter_user_route_settings_ingroup"])) {$filter_user_route_settings_ingroup=$_POST["filter_user_route_settings_ingroup"];} +if (isset($_GET["filter_group_id"])) {$filter_group_id=$_GET["filter_group_id"];} + elseif (isset($_POST["filter_group_id"])) {$filter_group_id=$_POST["filter_group_id"];} +if (isset($_GET["filter_call_handle_method"])) {$filter_call_handle_method=$_GET["filter_call_handle_method"];} + elseif (isset($_POST["filter_call_handle_method"])) {$filter_call_handle_method=$_POST["filter_call_handle_method"];} +if (isset($_GET["filter_agent_search_method"])) {$filter_agent_search_method=$_GET["filter_agent_search_method"];} + elseif (isset($_POST["filter_agent_search_method"])) {$filter_agent_search_method=$_POST["filter_agent_search_method"];} +if (isset($_GET["filter_list_id"])) {$filter_list_id=$_GET["filter_list_id"];} + elseif (isset($_POST["filter_list_id"])) {$filter_list_id=$_POST["filter_list_id"];} +if (isset($_GET["filter_campaign_id"])) {$filter_campaign_id=$_GET["filter_campaign_id"];} + elseif (isset($_POST["filter_campaign_id"])) {$filter_campaign_id=$_POST["filter_campaign_id"];} +if (isset($_GET["filter_phone_code"])) {$filter_phone_code=$_GET["filter_phone_code"];} + elseif (isset($_POST["filter_phone_code"])) {$filter_phone_code=$_POST["filter_phone_code"];} +if (isset($_GET["filter_menu_id"])) {$filter_menu_id=$_GET["filter_menu_id"];} + elseif (isset($_POST["filter_menu_id"])) {$filter_menu_id=$_POST["filter_menu_id"];} +if (isset($_GET["filter_clean_cid_number"])) {$filter_clean_cid_number=$_GET["filter_clean_cid_number"];} + elseif (isset($_POST["filter_clean_cid_number"])) {$filter_clean_cid_number=$_POST["filter_clean_cid_number"];} +if (isset($_GET["webphone_url_override"])) {$webphone_url_override=$_GET["webphone_url_override"];} + elseif (isset($_POST["webphone_url_override"])) {$webphone_url_override=$_POST["webphone_url_override"];} +if (isset($_GET["calculate_estimated_hold_seconds"])) {$calculate_estimated_hold_seconds=$_GET["calculate_estimated_hold_seconds"];} + elseif (isset($_POST["calculate_estimated_hold_seconds"])) {$calculate_estimated_hold_seconds=$_POST["calculate_estimated_hold_seconds"];} +if (isset($_GET["enable_xfer_presets"])) {$enable_xfer_presets=$_GET["enable_xfer_presets"];} + elseif (isset($_POST["enable_xfer_presets"])) {$enable_xfer_presets=$_POST["enable_xfer_presets"];} +if (isset($_GET["hide_xfer_number_to_dial"])) {$hide_xfer_number_to_dial=$_GET["hide_xfer_number_to_dial"];} + elseif (isset($_POST["hide_xfer_number_to_dial"])) {$hide_xfer_number_to_dial=$_POST["hide_xfer_number_to_dial"];} +if (isset($_GET["preset_name"])) {$preset_name=$_GET["preset_name"];} + elseif (isset($_POST["preset_name"])) {$preset_name=$_POST["preset_name"];} +if (isset($_GET["preset_number"])) {$preset_number=$_GET["preset_number"];} + elseif (isset($_POST["preset_number"])) {$preset_number=$_POST["preset_number"];} +if (isset($_GET["preset_dtmf"])) {$preset_dtmf=$_GET["preset_dtmf"];} + elseif (isset($_POST["preset_dtmf"])) {$preset_dtmf=$_POST["preset_dtmf"];} +if (isset($_GET["preset_hide_number"])) {$preset_hide_number=$_GET["preset_hide_number"];} + elseif (isset($_POST["preset_hide_number"])) {$preset_hide_number=$_POST["preset_hide_number"];} +if (isset($_GET["manual_dial_prefix"])) {$manual_dial_prefix=$_GET["manual_dial_prefix"];} + elseif (isset($_POST["manual_dial_prefix"])) {$manual_dial_prefix=$_POST["manual_dial_prefix"];} +if (isset($_GET["webphone_systemkey"])) {$webphone_systemkey=$_GET["webphone_systemkey"];} + elseif (isset($_POST["webphone_systemkey"])) {$webphone_systemkey=$_POST["webphone_systemkey"];} +if (isset($_GET["webphone_dialpad"])) {$webphone_dialpad=$_GET["webphone_dialpad"];} + elseif (isset($_POST["webphone_dialpad"])) {$webphone_dialpad=$_POST["webphone_dialpad"];} +if (isset($_GET["webphone_systemkey_override"])) {$webphone_systemkey_override=$_GET["webphone_systemkey_override"];} + elseif (isset($_POST["webphone_systemkey_override"])) {$webphone_systemkey_override=$_POST["webphone_systemkey_override"];} +if (isset($_GET["webphone_dialpad_override"])) {$webphone_dialpad_override=$_GET["webphone_dialpad_override"];} + elseif (isset($_POST["webphone_dialpad_override"])) {$webphone_dialpad_override=$_POST["webphone_dialpad_override"];} +if (isset($_GET["force_change_password"])) {$force_change_password=$_GET["force_change_password"];} + elseif (isset($_POST["force_change_password"])) {$force_change_password=$_POST["force_change_password"];} +if (isset($_GET["first_login_trigger"])) {$first_login_trigger=$_GET["first_login_trigger"];} + elseif (isset($_POST["first_login_trigger"])) {$first_login_trigger=$_POST["first_login_trigger"];} +if (isset($_GET["default_phone_registration_password"])) {$default_phone_registration_password=$_GET["default_phone_registration_password"];} + elseif (isset($_POST["default_phone_registration_password"])) {$default_phone_registration_password=$_POST["default_phone_registration_password"];} +if (isset($_GET["default_phone_login_password"])) {$default_phone_login_password=$_GET["default_phone_login_password"];} + elseif (isset($_POST["default_phone_login_password"])) {$default_phone_login_password=$_POST["default_phone_login_password"];} +if (isset($_GET["default_server_password"])) {$default_server_password=$_GET["default_server_password"];} + elseif (isset($_POST["default_server_password"])) {$default_server_password=$_POST["default_server_password"];} +if (isset($_GET["customer_3way_hangup_logging"])) {$customer_3way_hangup_logging=$_GET["customer_3way_hangup_logging"];} + elseif (isset($_POST["customer_3way_hangup_logging"])) {$customer_3way_hangup_logging=$_POST["customer_3way_hangup_logging"];} +if (isset($_GET["customer_3way_hangup_seconds"])) {$customer_3way_hangup_seconds=$_GET["customer_3way_hangup_seconds"];} + elseif (isset($_POST["customer_3way_hangup_seconds"])) {$customer_3way_hangup_seconds=$_POST["customer_3way_hangup_seconds"];} +if (isset($_GET["customer_3way_hangup_action"])) {$customer_3way_hangup_action=$_GET["customer_3way_hangup_action"];} + elseif (isset($_POST["customer_3way_hangup_action"])) {$customer_3way_hangup_action=$_POST["customer_3way_hangup_action"];} +if (isset($_GET["add_lead_url"])) {$add_lead_url=$_GET["add_lead_url"];} + elseif (isset($_POST["add_lead_url"])) {$add_lead_url=$_POST["add_lead_url"];} +if (isset($_GET["ivr_park_call"])) {$ivr_park_call=$_GET["ivr_park_call"];} + elseif (isset($_POST["ivr_park_call"])) {$ivr_park_call=$_POST["ivr_park_call"];} +if (isset($_GET["ivr_park_call_agi"])) {$ivr_park_call_agi=$_GET["ivr_park_call_agi"];} + elseif (isset($_POST["ivr_park_call_agi"])) {$ivr_park_call_agi=$_POST["ivr_park_call_agi"];} +if (isset($_GET["manual_preview_dial"])) {$manual_preview_dial=$_GET["manual_preview_dial"];} + elseif (isset($_POST["manual_preview_dial"])) {$manual_preview_dial=$_POST["manual_preview_dial"];} +if (isset($_GET["eht_minimum_prompt_filename"])) {$eht_minimum_prompt_filename=$_GET["eht_minimum_prompt_filename"];} + elseif (isset($_POST["eht_minimum_prompt_filename"])) {$eht_minimum_prompt_filename=$_POST["eht_minimum_prompt_filename"];} +if (isset($_GET["eht_minimum_prompt_no_block"])) {$eht_minimum_prompt_no_block=$_GET["eht_minimum_prompt_no_block"];} + elseif (isset($_POST["eht_minimum_prompt_no_block"])) {$eht_minimum_prompt_no_block=$_POST["eht_minimum_prompt_no_block"];} +if (isset($_GET["eht_minimum_prompt_seconds"])) {$eht_minimum_prompt_seconds=$_GET["eht_minimum_prompt_seconds"];} + elseif (isset($_POST["eht_minimum_prompt_seconds"])) {$eht_minimum_prompt_seconds=$_POST["eht_minimum_prompt_seconds"];} +if (isset($_GET["realtime_agent_time_stats"])) {$realtime_agent_time_stats=$_GET["realtime_agent_time_stats"];} + elseif (isset($_POST["realtime_agent_time_stats"])) {$realtime_agent_time_stats=$_POST["realtime_agent_time_stats"];} - if (isset($script_id)) {$script_id= strtoupper($script_id);} - if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} + +if (isset($script_id)) {$script_id= strtoupper($script_id);} +if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} if (strlen($dial_status) > 0) { @@ -1179,25 +1488,34 @@ if (strlen($dial_status) > 0) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,enable_queuemetrics_logging,enable_vtiger_integration,qc_features_active,outbound_autodial_active,sounds_central_control_active,enable_second_webform,user_territories_active,custom_fields_enabled,admin_web_directory,webphone_url,first_login_trigger,hosted_settings,default_phone_registration_password,default_phone_login_password,default_server_password FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSenable_queuemetrics_logging = $row[1]; - $SSenable_vtiger_integration = $row[2]; - $SSqc_features_active = $row[3]; - $SSoutbound_autodial_active = $row[4]; - $SSsounds_central_control_active = $row[5]; - $SSenable_second_webform = $row[6]; - $SSuser_territories_active = $row[7]; + $non_latin = $row[0]; + $SSenable_queuemetrics_logging = $row[1]; + $SSenable_vtiger_integration = $row[2]; + $SSqc_features_active = $row[3]; + $SSoutbound_autodial_active = $row[4]; + $SSsounds_central_control_active = $row[5]; + $SSenable_second_webform = $row[6]; + $SSuser_territories_active = $row[7]; + $SScustom_fields_enabled = $row[8]; + $SSadmin_web_directory = $row[9]; + $SSwebphone_url = $row[10]; + $SSfirst_login_trigger = $row[11]; + $SShosted_settings = $row[12]; + $SSdefault_phone_registration_password =$row[13]; + $SSdefault_phone_login_password = $row[14]; + $SSdefault_server_password = $row[15]; } ##### END SETTINGS LOOKUP ##### ########################################### + ###################################################################################################### ###################################################################################################### ####### Form variable filtering for security and data integrity @@ -1307,7 +1625,6 @@ if ($non_latin < 1) $vicidial_transfers = ereg_replace("[^0-9]","",$vicidial_transfers); $voicemail_button_enabled = ereg_replace("[^0-9]","",$voicemail_button_enabled); $voicemail_dump_exten = ereg_replace("[^0-9]","",$voicemail_dump_exten); - $voicemail_ext = ereg_replace("[^0-9]","",$voicemail_ext); $voicemail_exten = ereg_replace("[^0-9]","",$voicemail_exten); $wrapup_seconds = ereg_replace("[^0-9]","",$wrapup_seconds); $use_non_latin = ereg_replace("[^0-9]","",$use_non_latin); @@ -1366,6 +1683,28 @@ if ($non_latin < 1) $campaign_cid_override = ereg_replace("[^0-9]","",$campaign_cid_override); $agent_choose_territories = ereg_replace("[^0-9]","",$agent_choose_territories); $timer_action_seconds = ereg_replace("[^0-9]","",$timer_action_seconds); + $default_webphone = ereg_replace("[^0-9]","",$default_webphone); + $default_external_server_ip = ereg_replace("[^0-9]","",$default_external_server_ip); + $enable_agc_xfer_log = ereg_replace("[^0-9]","",$enable_agc_xfer_log); + $enable_agc_dispo_log = ereg_replace("[^0-9]","",$enable_agc_dispo_log); + $callcard_enabled = ereg_replace("[^0-9]","",$callcard_enabled); + $callcard_admin = ereg_replace("[^0-9]","",$callcard_admin); + $extension_id = ereg_replace("[^0-9]","",$extension_id); + $agent_choose_blended = ereg_replace("[^0-9]","",$agent_choose_blended); + $realtime_block_user_info = ereg_replace("[^0-9]","",$realtime_block_user_info); + $codecs_with_template = ereg_replace("[^0-9]","",$codecs_with_template); + $custom_fields_modify = ereg_replace("[^0-9]","",$custom_fields_modify); + $hold_time_option_minimum = ereg_replace("[^0-9]","",$hold_time_option_minimum); + $onhold_prompt_seconds = ereg_replace("[^0-9]","",$onhold_prompt_seconds); + $hold_time_option_prompt_seconds = ereg_replace("[^0-9]","",$hold_time_option_prompt_seconds); + $custom_fields_enabled = ereg_replace("[^0-9]","",$custom_fields_enabled); + $wait_time_option_seconds = ereg_replace("[^0-9]","",$wait_time_option_seconds); + $wait_time_option_callback_list_id = ereg_replace("[^0-9]","",$wait_time_option_callback_list_id); + $wait_time_option_prompt_seconds = ereg_replace("[^0-9]","",$wait_time_option_prompt_seconds); + $filter_list_id = ereg_replace("[^0-9]","",$filter_list_id); + $calculate_estimated_hold_seconds = ereg_replace("[^0-9]","",$calculate_estimated_hold_seconds); + $customer_3way_hangup_seconds = ereg_replace("[^0-9]","",$customer_3way_hangup_seconds); + $eht_minimum_prompt_seconds = ereg_replace("[^0-9]","",$eht_minimum_prompt_seconds); $drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds); @@ -1433,6 +1772,25 @@ if ($non_latin < 1) $agent_select_territories = ereg_replace("[^NY]","",$agent_select_territories); $delete_vm_after_email = ereg_replace("[^NY]","",$delete_vm_after_email); $crm_popup_login = ereg_replace("[^NY]","",$crm_popup_login); + $ignore_list_script_override = ereg_replace("[^NY]","",$ignore_list_script_override); + $is_webphone = ereg_replace("[^NY]","",$is_webphone); + $use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); + $use_custom_cid = ereg_replace("[^NY]","",$use_custom_cid); + $agent_xfer_consultative = ereg_replace("[^NY]","",$agent_xfer_consultative); + $agent_xfer_dial_override = ereg_replace("[^NY]","",$agent_xfer_dial_override); + $agent_xfer_vm_transfer = ereg_replace("[^NY]","",$agent_xfer_vm_transfer); + $agent_xfer_blind_transfer = ereg_replace("[^NY]","",$agent_xfer_blind_transfer); + $agent_xfer_dial_with_customer = ereg_replace("[^NY]","",$agent_xfer_dial_with_customer); + $agent_xfer_park_customer_dial = ereg_replace("[^NY]","",$agent_xfer_park_customer_dial); + $agent_fullscreen = ereg_replace("[^NY]","",$agent_fullscreen); + $extension_appended_cidname = ereg_replace("[^NY]","",$extension_appended_cidname); + $onhold_prompt_no_block = ereg_replace("[^NY]","",$onhold_prompt_no_block); + $hold_time_option_no_block = ereg_replace("[^NY]","",$hold_time_option_no_block); + $wait_time_option_no_block = ereg_replace("[^NY]","",$wait_time_option_no_block); + $preset_hide_number = ereg_replace("[^NY]","",$preset_hide_number); + $force_change_password = ereg_replace("[^NY]","",$force_change_password); + $first_login_trigger = ereg_replace("[^NY]","",$first_login_trigger); + $eht_minimum_prompt_no_block = ereg_replace("[^NY]","",$eht_minimum_prompt_no_block); $qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled); $active = ereg_replace("[^0-9NY]","",$active); @@ -1480,6 +1838,16 @@ if ($non_latin < 1) $use_campaign_dnc = ereg_replace("[^0-9a-zA-Z]","",$use_campaign_dnc); $voicemail_id = ereg_replace("[^0-9a-zA-Z]","",$voicemail_id); $status_id = ereg_replace("[^0-9a-zA-Z]","",$status_id); + $agent_call_log_view = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view); + $agent_call_log_view_override = ereg_replace("[^0-9a-zA-Z]","",$agent_call_log_view_override); + $queuemetrics_loginout = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_loginout); + $queuemetrics_callstatus = ereg_replace("[^0-9a-zA-Z]","",$queuemetrics_callstatus); + $filter_inbound_number = ereg_replace("[^0-9a-zA-Z]","",$filter_inbound_number); + $enable_xfer_presets = ereg_replace("[^0-9a-zA-Z]","",$enable_xfer_presets); + $hide_xfer_number_to_dial = ereg_replace("[^0-9a-zA-Z]","",$hide_xfer_number_to_dial); + $manual_dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$manual_dial_prefix); + $customer_3way_hangup_logging = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_logging); + $customer_3way_hangup_action = ereg_replace("[^0-9a-zA-Z]","",$customer_3way_hangup_action); ### DIGITS and Dots $server_ip = ereg_replace("[^\.0-9]","",$server_ip); @@ -1494,6 +1862,7 @@ if ($non_latin < 1) $auto_dial_limit = ereg_replace("[^\.0-9]","",$auto_dial_limit); $adaptive_dropped_percentage = ereg_replace("[^\.0-9]","",$adaptive_dropped_percentage); $drop_lockout_time = ereg_replace("[^\.0-9]","",$drop_lockout_time); + $filter_server_ip = ereg_replace("[^\.0-9]","",$filter_server_ip); ### ALPHA-NUMERIC and spaces and hash and star and comma $xferconf_a_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$xferconf_a_dtmf); @@ -1505,6 +1874,8 @@ if ($non_latin < 1) $survey_fourth_digit = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_digit); $survey_third_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_third_exten); $survey_fourth_exten = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$survey_fourth_exten); + $preset_dtmf = ereg_replace("[^ \,\*\#0-9a-zA-Z]","",$preset_dtmf); + ### ALPHACAPS-NUMERIC $xferconf_a_number = ereg_replace("[^0-9A-Z]","",$xferconf_a_number); @@ -1610,6 +1981,7 @@ if ($non_latin < 1) $cpd_amd_action = ereg_replace("[^-_0-9a-zA-Z]","",$cpd_amd_action); $template_id = ereg_replace("[^-_0-9a-zA-Z]","",$template_id); $carrier_id = ereg_replace("[^-_0-9a-zA-Z]","",$carrier_id); + $source_carrier = ereg_replace("[^-_0-9a-zA-Z]","",$source_carrier); $group_alias_id = ereg_replace("[^-_0-9a-zA-Z]","",$group_alias_id); $default_group_alias = ereg_replace("[^-_0-9a-zA-Z]","",$default_group_alias); $vtiger_search_dead = ereg_replace("[^-_0-9a-zA-Z]","",$vtiger_search_dead); @@ -1632,6 +2004,46 @@ if ($non_latin < 1) $moh_id = ereg_replace("[^-_0-9a-zA-Z]","",$moh_id); $drop_inbound_group_override = ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group_override); $timer_action = ereg_replace("[^-_0-9a-zA-Z]","",$timer_action); + $record_call = ereg_replace("[^-_0-9a-zA-Z]","",$record_call); + $scheduled_callbacks_alert = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_alert); + $extension_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group_id); + $extension_group = ereg_replace("[^-_0-9a-zA-Z]","",$extension_group); + $scheduled_callbacks_count = ereg_replace("[^-_0-9a-zA-Z]","",$scheduled_callbacks_count); + $manual_dial_override = ereg_replace("[^-_0-9a-zA-Z]","",$manual_dial_override); + $blind_monitor_warning = ereg_replace("[^-_0-9a-zA-Z]","",$blind_monitor_warning); + $uniqueid_status_display = ereg_replace("[^-_0-9a-zA-Z]","",$uniqueid_status_display); + $hold_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_option_callmenu); + $inbound_queue_no_dial = ereg_replace("[^-_0-9a-zA-Z]","",$inbound_queue_no_dial); + $hold_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_second_option); + $hold_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$hold_time_third_option); + $wait_hold_option_priority = ereg_replace("[^-_0-9a-zA-Z]","",$wait_hold_option_priority); + $wait_time_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option); + $wait_time_second_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_second_option); + $wait_time_third_option = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_third_option); + $wait_time_option_xfer_group = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_xfer_group); + $wait_time_option_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_callmenu); + $wait_time_option_voicemail = ereg_replace("[^-_0-9a-zA-Z]","",$wait_time_option_voicemail); + $filter_phone_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_phone_group_id); + $filter_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_action); + $filter_user_unavailable_action = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_unavailable_action); + $filter_user_route_settings_ingroup = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user_route_settings_ingroup); + $filter_agent_search_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_agent_search_method); + $filter_campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_campaign_id); + $filter_group_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_group_id); + $filter_menu_id = ereg_replace("[^-_0-9a-zA-Z]","",$filter_menu_id); + $filter_call_handle_method = ereg_replace("[^-_0-9a-zA-Z]","",$filter_call_handle_method); + $filter_user = ereg_replace("[^-_0-9a-zA-Z]","",$filter_user); + $filter_exten_context = ereg_replace("[^-_0-9a-zA-Z]","",$filter_exten_context); + $webphone_systemkey = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey); + $webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); + $webphone_systemkey_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_systemkey_override); + $webphone_dialpad_override = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad_override); + $default_phone_registration_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_registration_password); + $default_phone_login_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_phone_login_password); + $default_server_password = ereg_replace("[^-_0-9a-zA-Z]","",$default_server_password); + $ivr_park_call = ereg_replace("[^-_0-9a-zA-Z]","",$ivr_park_call); + $manual_preview_dial = ereg_replace("[^-_0-9a-zA-Z]","",$manual_preview_dial); + $realtime_agent_time_stats = ereg_replace("[^-_0-9a-zA-Z]","",$realtime_agent_time_stats); ### ALPHA-NUMERIC and underscore and dash and slash and dot $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt); @@ -1645,15 +2057,35 @@ if ($non_latin < 1) $filename = ereg_replace("[^-\/\._0-9a-zA-Z]","",$filename); $am_message_exten = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten); $am_message_exten_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$am_message_exten_override); + $campaign_groups = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$campaign_groups); + $blind_monitor_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$blind_monitor_filename); + $hold_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$hold_time_option_press_filename); + $default_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$default_afterhours_filename_override); + $sunday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$sunday_afterhours_filename_override); + $monday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$monday_afterhours_filename_override); + $tuesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tuesday_afterhours_filename_override); + $wednesday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wednesday_afterhours_filename_override); + $thursday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$thursday_afterhours_filename_override); + $friday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$friday_afterhours_filename_override); + $saturday_afterhours_filename_override = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$saturday_afterhours_filename_override); + $admin_web_directory = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$admin_web_directory); + $tts_voice = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$tts_voice); + $wait_time_option_callback_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_callback_filename); + $wait_time_option_press_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$wait_time_option_press_filename); + $eht_minimum_prompt_filename = ereg_replace("[^-\|\/\._0-9a-zA-Z]","",$eht_minimum_prompt_filename); ### ALPHA-NUMERIC and underscore and dash and comma $logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list); $forced_timeclock_login = ereg_replace("[^-\,\_0-9a-zA-Z]","",$forced_timeclock_login); + $uniqueid_status_prefix = ereg_replace("[^-\,\_0-9a-zA-Z]","",$uniqueid_status_prefix); ### ALPHA-NUMERIC and dots $sounds_web_server = ereg_replace("[^\.0-9a-zA-Z]","",$sounds_web_server); ### ALPHA-NUMERIC and spaces $lead_order = ereg_replace("[^ 0-9a-zA-Z]","",$lead_order); + ### ALPHA-NUMERIC and spaces and dashes and underscores + $preset_name = ereg_replace("[^ -\_0-9a-zA-Z]","",$preset_name); + ### ALPHA-NUMERIC and hash $group_color = ereg_replace("[^\#0-9a-zA-Z]","",$group_color); ### ALPHA-NUMERIC and hash and star and dot and underscore @@ -1662,6 +2094,12 @@ if ($non_latin < 1) $voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$voicemail_ext); $phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone); $phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$phone_code); + $wait_time_option_exten = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$wait_time_option_exten); + $filter_voicemail_ext = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_voicemail_ext); + $filter_phone_code = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone_code); + $filter_phone = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$filter_phone); + $preset_number = ereg_replace("[^\*\#\.\_0-9a-zA-Z]","",$preset_number); + ### ALPHA-NUMERIC and spaces dots, commas, dashes, underscores $adaptive_dl_diff_target = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$adaptive_dl_diff_target); @@ -1709,6 +2147,32 @@ if ($non_latin < 1) $tts_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$tts_name); $moh_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$moh_name); $timer_action_message = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$timer_action_message); + $external_server_ip = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$external_server_ip); + $default_codecs = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$default_codecs); + $codecs_list = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$codecs_list); + $label_title = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_title); + $label_first_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_first_name); + $label_middle_initial = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_middle_initial); + $label_last_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_last_name); + $label_address1 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address1); + $label_address2 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address2); + $label_address3 = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_address3); + $label_city = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_city); + $label_state = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_state); + $label_province = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_province); + $label_postal_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_postal_code); + $label_vendor_lead_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_vendor_lead_code); + $label_gender = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_gender); + $label_phone_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_number); + $label_phone_code = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_phone_code); + $label_alt_phone = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_alt_phone); + $label_security_phrase = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_security_phrase); + $label_email = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_email); + $label_comments = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$label_comments); + $slave_db_server = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$slave_db_server); + $filter_phone_group_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_name); + $filter_phone_group_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_phone_group_description); + $filter_clean_cid_number = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$filter_clean_cid_number); ### 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); @@ -1716,7 +2180,6 @@ if ($non_latin < 1) $DBX_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBX_server); $DBY_server = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$DBY_server); $dtmf_send_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$dtmf_send_extension); - $extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$extension); $install_directory = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$install_directory); $old_extension = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$old_extension); $telnet_host = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$telnet_host); @@ -1733,6 +2196,14 @@ if ($non_latin < 1) $custom_four = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_four); $custom_five = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$custom_five); + ### ALPHA-NUMERIC and underscore and dash and slash and at and dot and pound and star + $extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$extension); + $timer_action_destination = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$timer_action_destination); + $filter_extension = ereg_replace("[^-\*\#\.\:\/\@\_0-9a-zA-Z]","",$filter_extension); + + ### ALPHA-NUMERIC and space and underscore and dash and slash and at and dot and pound and star and pipe and comma + $ivr_park_call_agi = ereg_replace("[^ -\*\#\.\,\:\/\|\@\_0-9a-zA-Z]","",$ivr_park_call_agi); + ### NUMERIC and comma and pipe $waitforsilence_options = ereg_replace("[^\|\,0-9]","",$waitforsilence_options); @@ -1761,7 +2232,7 @@ if ($non_latin < 1) $dialplan_entry = ereg_replace(";","",$dialplan_entry); $dialplan_entry = ereg_replace("\r","",$dialplan_entry); $custom_dialplan_entry = ereg_replace("\\\\","",$custom_dialplan_entry); - $custom_dialplan_entry = ereg_replace(";","",$custom_dialplan_entry); + $custom_dialplan_entry = ereg_replace("'","",$custom_dialplan_entry); $custom_dialplan_entry = ereg_replace("\r","",$custom_dialplan_entry); $tts_text = ereg_replace("\\\\","",$tts_text); $tts_text = ereg_replace(";","",$tts_text); @@ -1771,7 +2242,10 @@ if ($non_latin < 1) $carrier_description = ereg_replace(";","",$carrier_description); $carrier_description = ereg_replace("\r","",$carrier_description); $carrier_description = ereg_replace("\"","",$carrier_description); - + $blind_monitor_message = ereg_replace("\\\\","",$blind_monitor_message); + $blind_monitor_message = ereg_replace(";","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\r","",$blind_monitor_message); + $blind_monitor_message = ereg_replace("\"","",$blind_monitor_message); ### VARIABLES TO BE mysql_real_escape_string ### # $web_form_address @@ -1783,6 +2257,11 @@ if ($non_latin < 1) # $crm_login_address # $start_call_url # $dispo_call_url + # $add_lead_url + # $webphone_url + # $webphone_url_override + # $filter_url + ### VARIABLES not filtered at all ### # $script_text @@ -2046,11 +2525,63 @@ else # 100103-0727 - Added Start/Dispo call url, 3/4/5 conf number presets, Lists conf-number overrides # 100104-1454 - Fixed in-group/campaign copy duplication issue # 100116-0718 - Added presets to script select list +# 100122-0747 - Added NOT-LOGGED-IN-AGENTS option for User Groups +# 100123-1301 - Added DID record call option +# 100127-0601 - Added Vtiger ViciDial user_level role lookup +# 100127-1546 - Added ignore_list_script_override option for ingroups +# 100219-1309 - Added agent dispo log system settings option and user call_log options +# 100220-1411 - Added system settings and servers custom_dialplan_entry +# 100221-0924 - Added Custom CallerID capability in Campaign settings +# 100302-2133 - Added Scheduled Callbacks Alert option +# 100309-0510 - Added queuemetrics_loginout option +# 100311-2348 - Added CallCard links and settings +# 100313-0020 - Added User Group agent screen transfer-conf button display options +# 100317-1244 - Added User Group agent_fullscreen option +# 100401-0014 - Added agent_choose_blended option +# 100405-1425 - Added queuemetrics_callstatus option and full logging of user campaign/in-group settings +# 100414-1603 - Added extension_appended_cidname option to campaigns +# 100420-1010 - Added scheduled_callbacks_count campaign option +# 100423-1030 - Added realtime_block_user_info, manual dial campaign, blind monitor warnings, in-group callid, phones codecs features +# 100506-1807 - Added hidden settings for lists custom fields +# 100507-1102 - Added hold_time_option_minimum option to in-groups and copy carrier function +# 100512-1615 - Added more hold time press-1 options +# 100518-0643 - Added inbound_queue_no_dial and call time after hours override features +# 100523-0840 - Added inbound prompt and no-block options +# 100616-2232 - Added VIDPROMPT call menu options +# 100621-1010 - Added admin_web_directory system setting +# 100622-1700 - Added custom agent field names for default fields +# 100702-1142 - Added FORM get_call_launch option for custom list fields tab in agent interface +# 100703-1322 - Added LEADS ability to admin log display +# 100709-1025 - Added option for slave DB server to be used for selected reports +# 100718-2318 - Added Wait Time options to in-groups +# 100720-1332 - Small changes to Phone addition and modification pages +# 100723-1519 - Added LOCKED options for Quick Transfer Button in campaigns +# 100726-1017 - Added HANGUP, CALLMENU, EXTENSION and IN_GROUP timer actions to campaigns and in-groups +# 100802-2130 - Changed Admin links to point to links page instead of Phones listings, changed Remote Agents to allow 9-digit IDs +# 100803-1412 - Added allowed_reports option to User Groups, added CAMPLISTS_ALL for manual_dial_filter(issue #369) +# - Added allowed_campaigns enforcement for Campaign listings +# 100804-2313 - Added filter phone groups section for inbound call filtering by incoming phone number when it comes into a DID +# 100805-1539 - Added option to clean up cid numbers when calls come into DIDs +# 100806-0607 - Added validation for remote agents settings, user_start must be valid user, number of lines must not overlap +# 100811-0827 - Added webphone_url_override to User Groups and calculate_estimated_hold_seconds to In-Groups +# 100813-0544 - Added campaign presets and option to hide xfer number to dial +# 100815-0802 - Added manual_dial_prefix campaign option +# 100817-1243 - Added checking for reserved menu_id on creation of Call Menus +# 100823-1501 - Added CallCard search as an available User Group report option +# 100827-1535 - Added webphone options for dialpad and systemkey +# 100901-2055 - Added password strength grading, force password change, password default settings and first login screen +# 100908-0926 - Added 3way hangup logging options to campaigns +# 100912-0842 - Several small changes, removed Emergency VDAC clear since it does not do anything anymore +# 100927-2321 - Added entry_list_id as a script, webform, dispo_call_url variable +# 100928-1634 - Moved Realtime Block User Info user setting into the new ADMIN REPORT OPTIONS section +# 100929-1203 - Added add_lead_url feature to In-Groups +# 101008-0349 - Added Estimated Hold Time Minimum options, Manual Dial Preview settings and two new variables for recording filenames +# 101022-1427 - Added ability to change user in-group prefs from in-group mod screen, added realtime_agent_time_stats campaign option # # 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.2.0-234'; -$build = '100116-0718'; +$admin_version = '2.4-285'; +$build = '101022-1427'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -2098,7 +2629,7 @@ if ($force_logout) ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan FROM system_settings;"; +$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -2109,6 +2640,7 @@ if ($qm_conf_ct > 0) $SSauto_dial_limit = $row[1]; $SSuser_territories_active = $row[2]; $SSallow_custom_dialplan = $row[3]; + $SScallcard_enabled = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -2120,6 +2652,19 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and active='Y' and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_auth=$row[0]; + +$reports_only_user=0; +if ( ($reports_auth > 0) and ($auth < 1) ) + { + $ADD=999999; + $reports_only_user=1; + } + if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");} @@ -2127,77 +2672,113 @@ $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); -if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ($auth<1)) +if ( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or ( ($auth < 1 ) and ($reports_auth < 1) ) ) { - Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); - Header("HTTP/1.0 401 Unauthorized"); - echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; + exit; + } + +if ( ($auth > 0) or ($reports_auth > 0) ) + { + $office_no=strtoupper($PHP_AUTH_USER); + $password=strtoupper($PHP_AUTH_PW); + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGfull_name =$row[3]; + $LOGuser_level =$row[4]; + $LOGuser_group =$row[5]; + $LOGdelete_users =$row[8]; + $LOGdelete_user_groups =$row[9]; + $LOGdelete_lists =$row[10]; + $LOGdelete_campaigns =$row[11]; + $LOGdelete_ingroups =$row[12]; + $LOGdelete_remote_agents =$row[13]; + $LOGload_leads =$row[14]; + $LOGcampaign_detail =$row[15]; + $LOGast_admin_access =$row[16]; + $LOGast_delete_phones =$row[17]; + $LOGdelete_scripts =$row[18]; + $LOGdelete_filters =$row[29]; + $LOGalter_agent_interface =$row[30]; + $LOGdelete_call_times =$row[32]; + $LOGmodify_call_times =$row[33]; + $LOGmodify_users =$row[34]; + $LOGmodify_campaigns =$row[35]; + $LOGmodify_lists =$row[36]; + $LOGmodify_scripts =$row[37]; + $LOGmodify_filters =$row[38]; + $LOGmodify_ingroups =$row[39]; + $LOGmodify_usergroups =$row[40]; + $LOGmodify_remoteagents =$row[41]; + $LOGmodify_servers =$row[42]; + $LOGview_reports =$row[43]; + $LOGmodify_dids =$row[56]; + $LOGdelete_dids =$row[57]; + $LOGmanager_shift_enforcement_override=$row[61]; + $LOGexport_reports =$row[64]; + $LOGdelete_from_dnc =$row[65]; + $LOGcallcard_admin =$row[70]; + $LOGforce_change_password =$row[71]; + + $stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $LOGallowed_campaigns = $row[0]; + $LOGallowed_reports = $row[1]; + + $LOGallowed_campaignsSQL=''; + $whereLOGallowed_campaignsSQL=''; + if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } + $regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + + if ($WeBRooTWritablE > 0) + { + fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); + fclose($fp); + } + + $first_login_link=0; + + if ($LOGforce_change_password=='Y') + { + $ADD=999997; + $reports_only_user=1; + } + if ($SSfirst_login_trigger=='Y') + { + + if ($ADD==999996) + {$reports_only_user=1;} + else + { + $ADD=999995; + $first_login_link=1; + } + } + if ($ADD==999995) + { + $reports_only_user=1; + } } else { - if($auth>0) + if ($WeBRooTWritablE > 0) { - $office_no=strtoupper($PHP_AUTH_USER); - $password=strtoupper($PHP_AUTH_PW); - $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfull_name =$row[3]; - $LOGuser_level =$row[4]; - $LOGuser_group =$row[5]; - $LOGdelete_users =$row[8]; - $LOGdelete_user_groups =$row[9]; - $LOGdelete_lists =$row[10]; - $LOGdelete_campaigns =$row[11]; - $LOGdelete_ingroups =$row[12]; - $LOGdelete_remote_agents =$row[13]; - $LOGload_leads =$row[14]; - $LOGcampaign_detail =$row[15]; - $LOGast_admin_access =$row[16]; - $LOGast_delete_phones =$row[17]; - $LOGdelete_scripts =$row[18]; - $LOGdelete_filters =$row[29]; - $LOGalter_agent_interface =$row[30]; - $LOGdelete_call_times =$row[32]; - $LOGmodify_call_times =$row[33]; - $LOGmodify_users =$row[34]; - $LOGmodify_campaigns =$row[35]; - $LOGmodify_lists =$row[36]; - $LOGmodify_scripts =$row[37]; - $LOGmodify_filters =$row[38]; - $LOGmodify_ingroups =$row[39]; - $LOGmodify_usergroups =$row[40]; - $LOGmodify_remoteagents =$row[41]; - $LOGmodify_servers =$row[42]; - $LOGview_reports =$row[43]; - $LOGmodify_dids =$row[56]; - $LOGdelete_dids =$row[57]; - $LOGmanager_shift_enforcement_override=$row[61]; - $LOGexport_reports =$row[64]; - $LOGdelete_from_dnc =$row[65]; - - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$LOGuser_group';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGallowed_campaigns = $row[0]; - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n"); - fclose($fp); - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } + fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); + fclose($fp); } } + ###################################################################################################### ###################################################################################################### ####### Header settings @@ -2219,13 +2800,16 @@ if ($ADD==11) {$hh='campaigns'; $sh='basic'; echo "Aggiungi Nuova Campagna";} if ($ADD==12) {$hh='campaigns'; $sh='basic'; echo "Copia Campagna";} if ($ADD==111) {$hh='lists'; echo "Aggiungi Nuova Lista";} if ($ADD==121) {$hh='lists'; echo "Agregue DNC Nuevo";} +if ($ADD==171) {$hh='ingroups'; echo "Filter Phone Group Numbers";} if ($ADD==1111) {$hh='ingroups'; echo "Aggiungi Nuovo Gruppo Inbound";} if ($ADD==1211) {$hh='ingroups'; echo "Copia Gruppo Inbound";} if ($ADD==1311) {$hh='ingroups'; echo "Aggiungi nuovoDID";} if ($ADD==1411) {$hh='ingroups'; echo "CopiaDID";} if ($ADD==1511) {$hh='ingroups'; echo "Aggiungi Call Menu";} if ($ADD==1611) {$hh='ingroups'; echo "Copia Call Menu";} +if ($ADD==1711) {$hh='ingroups'; echo "Add Filter Phone Group";} if ($ADD==11111) {$hh='remoteagent'; echo "Aggiungi Nuovo Operatore Remoto";} +if ($ADD==12111) {$hh='remoteagent'; echo "Add Extension Group";} if ($ADD==111111) {$hh='usergroups'; echo "Aggiungi Nuovo Gruppo Utente";} if ($ADD==1111111) {$hh='scripts'; echo "Aggiungi Nuovo Script";} if ($ADD==11111111) {$hh='filters'; echo "Agiungi Nuovo Filtro";} @@ -2238,6 +2822,7 @@ if ($ADD==13111111111) {$hh='admin'; $sh='phones'; echo "AGGIUNGI NUOVO GRUPPO A if ($ADD==111111111111) {$hh='admin'; $sh='server'; echo "AGGIUNGI SERVER";} if ($ADD==131111111111) {$hh='admin'; $sh='templates'; echo "ADD NEW CONF TEMPLATE";} if ($ADD==141111111111) {$hh='admin'; $sh='carriers'; echo "AGGIUNGI NUOVO VETTORE";} +if ($ADD==140111111111) {$hh='admin'; $sh='carriers'; echo "ADD COPIED CARRIER";} if ($ADD==151111111111) {$hh='admin'; $sh='tts'; echo "ADD NEW ENTRY TTS";} if ($ADD==161111111111) {$hh='admin'; $sh='moh'; echo "ADD NEW MUSIC IN ATTESA INGRESSO";} if ($ADD==171111111111) {$hh='admin'; $sh='vm'; echo "ADD NEW VOICEMAIL BOX";} @@ -2254,6 +2839,7 @@ if ($ADD==26) {$hh='campaigns'; $sh='autoalt'; echo "Nuevo Estado Del Dial Del if ($ADD==27) {$hh='campaigns'; $sh='pause'; echo "Nuevo Co`digo De la Pausa Del Agente";} if ($ADD==28) {$hh='campaigns'; $sh='dialstat'; echo "Esito Campagna Aggiunto";} if ($ADD==29) {$hh='campaigns'; $sh='listmix'; echo "Mezcla De la Lista De la Campaña Agregada";} +if ($ADD==201) {$hh='campaigns'; $sh='preset'; echo "Campagna Preset Added";} if ($ADD==211) {$hh='lists'; echo "Creazione Nuova Lista";} if ($ADD==2111) {$hh='ingroups'; echo "Creazione Nuovo Gruppo Inbound";} if ($ADD==2011) {$hh='ingroups'; echo "Nueva Adicin Copiada Del En-Grupo";} @@ -2261,7 +2847,9 @@ if ($ADD==2311) {$hh='ingroups'; echo "Nuova aggiunta DID";} if ($ADD==2411) {$hh='ingroups'; echo "Nuova aggiunta Copiato DID";} if ($ADD==2511) {$hh='ingroups'; echo "Nuova chiamata Menu";} if ($ADD==2611) {$hh='ingroups'; echo "Nuova chiamata Menu";} +if ($ADD==2711) {$hh='ingroups'; echo "New Filter Phone Group";} if ($ADD==21111) {$hh='remoteagent'; echo "Creazuibe Nuovi Operatori Remoti";} +if ($ADD==22111) {$hh='remoteagent'; echo "New Group Extension Addition";} if ($ADD==211111) {$hh='usergroups'; echo "Creazione Nuovo Gruppo Utenti";} if ($ADD==2111111) {$hh='scripts'; echo "Creazione Nuovo Script";} if ($ADD==21111111) {$hh='filters'; echo "Nueva Adicio`n Del Filtro";} @@ -2275,6 +2863,7 @@ if ($ADD==211111111111) {$hh='admin'; $sh='server'; echo "CREANDO SERVIDOR";} if ($ADD==221111111111) {$hh='admin'; $sh='server'; echo "ADICIo`N DEL NUEVO EXPEDIENTE DEL TRONCO DEL SERVIDOR VICIDIAL";} if ($ADD==231111111111) {$hh='admin'; $sh='templates'; echo "Aggiunta di nuovi CONF TEMPLATE";} if ($ADD==241111111111) {$hh='admin'; $sh='carriers'; echo "Aggiunta di nuovi VETTORE";} +if ($ADD==240111111111) {$hh='admin'; $sh='carriers'; echo "ADDING COPIED CARRIER";} if ($ADD==251111111111) {$hh='admin'; $sh='tts'; echo "Aggiunta di nuovi TTS ENTRY";} if ($ADD==261111111111) {$hh='admin'; $sh='moh'; echo "AGGIUNTA NUOVA MUSICA IN ATTESA INGRESSO";} if ($ADD==271111111111) {$hh='admin'; $sh='vm'; echo "Aggiunta di nuovi VOICEMAIL BOX";} @@ -2296,6 +2885,7 @@ if ($ADD==31) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - Elenco Mixes";} if ($SUB=='20A') {echo " - Indagine";} + if ($SUB==201) {echo " - Presets";} } if ($ADD==34) { @@ -2308,6 +2898,7 @@ if ($ADD==34) if ($SUB==28) {echo " - QC";} if ($SUB==29) {echo " - Elenco Mixes";} if ($SUB=='20A') {echo " - Indagine";} + if ($SUB==201) {echo " - Presets";} } if ($ADD==32) {$hh='campaigns'; $sh='status'; echo "Esiti Campagna";} if ($ADD==33) {$hh='campaigns'; $sh='hotkey'; echo "Hot-Key Campagna";} @@ -2316,11 +2907,14 @@ if ($ADD==36) {$hh='campaigns'; $sh='autoalt'; echo "Estados Auto Del Dial Del if ($ADD==37) {$hh='campaigns'; $sh='pause'; echo "Codici Pausa Operatore per Campagna";} if ($ADD==38) {$hh='campaigns'; $sh='dialstat'; echo "Estados Del Dial De la Campaña";} if ($ADD==39) {$hh='campaigns'; $sh='listmix'; echo "Mezclas De la Lista De la Campaña";} +if ($ADD==301) {$hh='campaigns'; $sh='preset'; echo "Campagna Presets";} if ($ADD==311) {$hh='lists'; echo "Modifica Lista";} if ($ADD==3111) {$hh='ingroups'; echo "Modifica Gruppo Inbound";} if ($ADD==3311) {$hh='ingroups'; echo "ModificareDID";} if ($ADD==3511) {$hh='ingroups'; echo "Modifica Call Menu";} +if ($ADD==3711) {$hh='ingroups'; echo "Modifica Filtro Phone Group";} if ($ADD==31111) {$hh='remoteagent'; echo "Modifica Operatori Remoti";} +if ($ADD==32111) {$hh='remoteagent'; echo "ModificareExtension Group";} if ($ADD==311111) {$hh='usergroups'; echo "Modifica Gruppi Utenti";} if ($ADD==3111111) {$hh='scripts'; echo "Modifica Script";} if ($ADD==31111111) {$hh='filters'; echo "Modifica Filtro";} @@ -2354,12 +2948,15 @@ if ($ADD==45) {$hh='campaigns'; $sh='recycle'; echo "Modifique El Plomo De la if ($ADD==47) {$hh='campaigns'; $sh='pause'; echo "Modifique El Co`digo De la Pausa Del Agente";} if ($ADD==48) {$hh='campaigns'; $sh='qc'; echo "Modifica impostazioni campagna, QC";} if ($ADD==49) {$hh='campaigns'; $sh='listmix'; echo "Modifique La Mezcla De la Lista De la Campaña";} +if ($ADD==401) {$hh='campaigns'; $sh='preset'; echo "Modifica Campagna Preset";} if ($ADD=='40A') {$hh='campaigns'; $sh='survey'; echo "Modificare la campagna Sondaggio";} if ($ADD==411) {$hh='lists'; echo "Modifica Lista";} if ($ADD==4111) {$hh='ingroups'; echo "Modifica Gruppo Inbound";} if ($ADD==4311) {$hh='ingroups'; echo "ModificareDID";} if ($ADD==4511) {$hh='ingroups'; echo "Modifica Call Menu";} +if ($ADD==4711) {$hh='ingroups'; echo "Modifica Filtro Phone Group";} if ($ADD==41111) {$hh='remoteagent'; echo "Modifica Operatori Remoti";} +if ($ADD==42111) {$hh='remoteagent'; echo "ModificareExtension Group";} if ($ADD==411111) {$hh='usergroups'; echo "Modifica Gruppi Utenti";} if ($ADD==4111111) {$hh='scripts'; echo "Modifica Script";} if ($ADD==41111111) {$hh='filters'; echo "Modifica Filtro";} @@ -2390,7 +2987,9 @@ if ($ADD==511) {$hh='lists'; echo "EliminareList";} if ($ADD==5111) {$hh='ingroups'; echo "EliminareIn-Group";} if ($ADD==5311) {$hh='ingroups'; echo "EliminareDID";} if ($ADD==5511) {$hh='ingroups'; echo "Elimina Call Menu";} +if ($ADD==5711) {$hh='ingroups'; echo "EliminarePhone Filter Group";} if ($ADD==51111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} +if ($ADD==52111) {$hh='remoteagent'; echo "EliminareExtension Group";} if ($ADD==511111) {$hh='usergroups'; echo "Cancella Utenti Group";} if ($ADD==5111111) {$hh='scripts'; echo "Cancella Script";} if ($ADD==51111111) {$hh='filters'; echo "Cancella Filtro";} @@ -2417,11 +3016,14 @@ if ($ADD==66) {$hh='campaigns'; $sh='autoalt'; echo "Estado Auto Del Dial Del if ($ADD==67) {$hh='campaigns'; $sh='pause'; echo "Co`digo De la Pausa Del Agente De la Cancelacio`n";} if ($ADD==68) {$hh='campaigns'; $sh='dialstat'; echo "Esito Campagna Rimosso";} if ($ADD==69) {$hh='campaigns'; $sh='listmix'; echo "La Mezcla De la Lista De la Campaña Quito`";} +if ($ADD==601) {$hh='campaigns'; $sh='preset'; echo "Campagna Preset Removed";} if ($ADD==611) {$hh='lists'; echo "EliminareList";} if ($ADD==6111) {$hh='ingroups'; echo "EliminareIn-Group";} if ($ADD==6311) {$hh='ingroups'; echo "EliminareDID";} if ($ADD==6511) {$hh='ingroups'; echo "Elimina Call Menu";} +if ($ADD==6711) {$hh='ingroups'; echo "EliminarePhone Filter Group";} if ($ADD==61111) {$hh='remoteagent'; echo "Suprima los agentes alejados";} +if ($ADD==62111) {$hh='remoteagent'; echo "EliminareExtension Group";} if ($ADD==611111) {$hh='usergroups'; echo "Cancella Utenti Group";} if ($ADD==6111111) {$hh='scripts'; echo "Cancella Script";} if ($ADD==61111111) {$hh='filters'; echo "Cancella Filtro";} @@ -2456,7 +3058,9 @@ if ($ADD==100) {$hh='lists'; echo "Liste";} if ($ADD==1000) {$hh='ingroups'; echo "In-Groups";} if ($ADD==1300) {$hh='ingroups'; echo "DIDs";} if ($ADD==1500) {$hh='ingroups'; echo "Call Menu";} +if ($ADD==1700) {$hh='ingroups'; echo "Filter Phone Groups";} if ($ADD==10000) {$hh='remoteagent'; echo "Operatori Remoti";} +if ($ADD==12000) {$hh='remoteagent'; echo "Extension Groups";} if ($ADD==100000) {$hh='usergroups'; echo "Gruppi Utenti";} if ($ADD==1000000) {$hh='scripts'; echo "Script";} if ($ADD==10000000) {$hh='filters'; echo "Filtri";} @@ -2480,6 +3084,11 @@ if ($ADD==660) {$hh='users'; echo "Risultati Ricerca";} if ($ADD==661) {$hh='users'; echo "RESULTADO DE LA BÚSQUEDA DE telefonOS";} if ($ADD==99999) {$hh='users'; echo "AIUTO";} if ($ADD==999999) {$hh='reports'; echo "REPORT";} +if ($ADD==999998) {$hh='admin'; echo "ADMIN";} +if ($ADD==999997) {$hh='reports'; echo "CHANGE PASSWORD";} +if ($ADD==999996) {$hh='reports'; echo "INITIAL INSTALL WELCOME";} +if ($ADD==999995) {$hh='reports'; echo "COPYRIGHT TRADEMARK LICENSE";} + if ( ($ADD>9) && ($ADD < 99998) ) { @@ -2531,23 +3140,10 @@ if ( ($ADD>9) && ($ADD < 99998) ) if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; - $rslt=mysql_query($stmt, $link); - $servers_to_print = mysql_num_rows($rslt); - $servers_list=''; - - $o=0; - while ($servers_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $servers_list .= "\n"; - $o++; - } ##### BEGIN get campaigns listing for rankings ##### - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -2583,6 +3179,7 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD {$calls_today=0; $SELECT_campaign_rank=0; $group_web_vars='';} if ( ($ADD=="4A") or ($ADD=="4B") ) { + $stmt_grp_values=''; if (isset($_GET["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_GET["RANK_$campaign_id_values[$o]"];} elseif (isset($_POST["RANK_$campaign_id_values[$o]"])) {$campaign_rank=$_POST["RANK_$campaign_id_values[$o]"];} if (isset($_GET["WEB_$campaign_id_values[$o]"])) {$campaign_web=$_GET["WEB_$campaign_id_values[$o]"];} @@ -2597,15 +3194,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', group_web_vars='$campaign_web' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_campaign_agents set campaign_rank='$campaign_rank', campaign_weight='$campaign_rank', campaign_id='$campaign_id_values[$o]', user='$user', group_web_vars='$campaign_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_agents set campaign_weight='$campaign_rank' where campaign_id='$campaign_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$campaign_rank = $SELECT_campaign_rank;} @@ -2768,15 +3368,18 @@ if ( ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD { $stmt="UPDATE vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_web_vars='$group_web' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else { $stmt="INSERT INTO vicidial_inbound_group_agents set group_rank='$group_rank', group_weight='$group_rank', group_id='$group_id_values[$o]', user='$user', group_web_vars='$group_web';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } $stmt="UPDATE vicidial_live_inbound_agents set group_weight='$group_rank' where group_id='$group_id_values[$o]' and user='$user';"; $rslt=mysql_query($stmt, $link); + $stmt_grp_values .= "$stmt|"; } else {$group_rank = $SELECT_group_rank;} @@ -2891,7 +3494,7 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A $qc_campaigns_list.="> ALL-CAMPAIGNS - Gli utenti possono, QC OGNI CAMPAGNA
    \n"; $qc_groups_list.="> ALL-GROUPS - Gli utenti possono QC INBOUND OGNI GRUPPO
    \n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -2957,10 +3560,10 @@ if ( ($ADD==211111) or ($ADD==311111) or ($ADD==411111) or ($ADD==511111) or ($A ##### END get campaigns listing for checkboxes ##### -if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999) ) ) +if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999) ) or ($ADD=='141111111111') or ($ADD=='140111111111') or ($ADD=='341111111111') or ($ADD=='311111111111111') or ( (strlen($ADD)>4) && ($ADD < 99998) ) or ($ADD==3) or (($ADD>20) and ($ADD<70)) or ($ADD=="4A") or ($ADD=="4B") or (strlen($ADD)==12) ) { - ##### get server listing for dynamic pulldown - $stmt="SELECT server_ip,server_description from servers order by server_ip"; + ##### get server listing for dynamic pulldown + $stmt="SELECT server_ip,server_description,external_server_ip from servers order by server_ip"; $rsltx=mysql_query($stmt, $link); $servers_to_print = mysql_num_rows($rsltx); $servers_list=''; @@ -2969,7 +3572,7 @@ if ( (strlen($ADD)==11) or (strlen($ADD)>12) or ( ($ADD > 1299) and ($ADD < 9999 while ($servers_to_print > $o) { $rowx=mysql_fetch_row($rsltx); - $servers_list .= "\n"; + $servers_list .= "\n"; $o++; } } @@ -3008,7 +3611,12 @@ if ($ADD==99999)

    - Contraseña - este campo es donde usted pone la contraseña de los usuarios de VICIDIAL. Deben ser por lo menos 2 caracteres en longitud. + Contraseña - este campo es donde usted pone la contraseña de los usuarios de VICIDIAL. Deben ser por lo menos 2 caracteres en longitud. A strong user password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number. + +
    +
    +
    + Force Change Password - If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage. Default is N.
    @@ -3040,6 +3648,11 @@ if ($ADD==99999)
    Attivo - Questo campo definisce se lutente è attivo nel sistema e può essere utilizzato VICIDIAL risorse. Il valore di default è Y +
    +
    +
    + Casella Vocale ID - This is the voicemail box that calls will be directed to in an AGENTDIRECT in-group at the drop time if the in-group has the drop method set to VOICEMAIL and the Casella Vocale field set to AGENTVMAIL. +

    @@ -3055,6 +3668,11 @@ if ($ADD==99999)
    El agente elige Ingroups - esta opcio`n si el sistema a 1 permite que el usuario elija los ingroups de los cuales recibirán llamadas cuando ellos conexion a una campaña MÁS CERCANA o DE ENTRADA. Si no el encargado necesitará fijar esto en su pantalla del detalle del usuario de la página del admin. +
    +
    +
    + Agent Choose Blended - This option if set to 1 allows the user to choose if the agent has their campaign set to blended or not, and if not then the default blended setting will be used. Default is 1 for enabled. +

    @@ -3107,6 +3725,11 @@ if ($ADD==99999)
    Agente Maiusc esecuzione Sovrascrive - Questa impostazione si sovrascriverà qualsiasi cosa gli utenti del gruppo di utenti ha fissato per lesecuzione Maiusc. ANDICAPPATI utilizzerà lutente gruppo. OFF non applicare a tutti i turni. INIZIO solo applicare il login, ma non riguarda un agente che è in esecuzione sul loro passaggio, se essi sono già eseguito laccesso TUTTE imporrà a turni orario di inizio e di un agente di log dopo che corrono oltre la fine del loro turno tempo. Il valore di default è disattivato. +
    +
    +
    + Agent Call Log View Override - This setting will override whatever the users user group has set for Agent Call Log View. DISABLED will use the user group setting. N will not allow showing the users call log. Y will allow showing the user call log. Default is DISABLED. +

    @@ -3187,6 +3810,15 @@ if ($ADD==99999) La carga conduce - esta opcio`n si el sistema a 1 permite que el usuario cargue los plomos vicidial en la tabla del vicidial_list por el cargador basado tela del plomo. 0) + { + ?> +
    +
    +
    + Custom Fields Modificare- This option if set to 1 allows the user to modify custom list fields. +
    @@ -3330,6 +3962,10 @@ if ($ADD==99999)
    Cancellare dalle liste DNC - Questa impostazione, se impostato a 1 permetterà un gestore di rimuovere i numeri di telefono dagli elenchi DNC nel sistema VICIDIAL. +
    +
    +
    + Realtime Block Utente Info - This setting if set to 1 will block user and station information from being displayed in the Real-time report. Default is 0 for disabled. @@ -3372,6 +4008,11 @@ if ($ADD==99999)
    Los Stats de la campaña restauran - este checkbox permitirá queusted fuerce un stats vicidial restaura, incluso si la campaña no esactiva. +
    +
    +
    + Real-Time Agent Time Stats - Setting this to anything but DISABLED will enable the gathering of agent time stats for today for this campaign, that are viewable through the Real-Time report. CALLS are the average calls handled per agent, WAIT is the average agent wait time, CUST is the average customer talk time, ACW is the average After Call Work time, PAUSE is the average pause time. Default is DISABLED. +

    @@ -3380,12 +4021,12 @@ if ($ADD==99999)

    - Extension del parque - aquí es donde usted puede modificar para requisitos particulares en-sostiene la música para VICIDIAL. Cercio`rese de que la extension este` en lugar en el extensions.conf y eso que señala al nombre de fichero abajo. + Park Music-on-Hold - This is where you can define the on-hold music context for this campaign. Make sure you select a valid music on hold context from the select list and that the context that you have selected has valid files in it. Default is default.

    - Nombre del archivo del parque - aquí es donde usted puede modificar para requisitos particulares en-sostiene la música para VICIDIAL. Cercio`rese de que el nombre de fichero sea 10 caracteres en longitud o menos y que el archivo está en lugar en el directorio de /var/lib/asterisk/sounds. + Park File Name - NOT USED.
    @@ -3519,13 +4160,18 @@ if ($ADD==99999)

    - Coda di priorità - Questa impostazione è utilizzata per definire lordine in cui le chiamate in uscita da questa campagna dovrebbe essere risolta in relazione alle chiamate in entrata, se questa è una campagna in modalità blended. + Coda di priorità - Questa impostazione è utilizzata per definire lordine in cui le chiamate in uscita da questa campagna dovrebbe essere risolta in relazione alle chiamate in entrata, se questa è una campagna in modalità blended. We do not recommend setting inbound calls to a higher priority than the outbound campaign calls because people calling in expect to wait and people being called expect for someone to be there on the phone.

    Multiple campagna Drop Rate Group - Questa funzione consente di impostare una campagna come membro di una campagna Drop Rate gruppo, o un gruppo di campagne cui dell-uomo chiede risposta e le chiamate Drop per tutte le campagne del gruppo verranno combinati in una percentuale condivisa goccia, o tasso di abbandono. Questo vi permette di eseguire più campagne contemporaneamente e controllare più facilmente il tasso di drop. Ciò è particolarmente utile nel Regno Unito, dove ai permessi di questo metodo di calcolo con il tasso di drop campagna di raggruppamento per la stessa società, anche se vi sono numerose campagne di tale società è in esecuzione durante il giorno stesso. Per attivare questa per una campagna, basta selezionare un gruppo dall-elenco. Ci sono 10 gruppi definiti nel sistema di default, è possibile contattare l-amministratore di sistema per aggiungere di più. Di default è disabilitato. +
    +
    +
    + Inbound Queue No Dial - This feature if set to ENABLED allows you to prevent outbound auto-dialing of this campaign if there are any inbound calls waiting in queue that are part of the allowed inbound groups set in this campaign. Setting this to ALL_SERVERS will change the algorithm to calculate all inbound calls as active calls on this server even if they are on another server which will reduce the chance of placing unnecessary outbound calls if you have calls coming in on another server. Default is DISABLED. +

    @@ -3766,6 +4412,11 @@ if ($ADD==99999)
    Prefijo del dial - este campo permite más fácilmente cambiar una trayectoria de marcar a salir con un diverso me`todo sin hacer una recarga en asterisco. El defecto es 9 basados sobre un 91NXXNXXXXXX en el dial plan - extensions.conf. +
    +
    +
    + Manual Prefisso Chiamata - This optional field allows you to set the dial prefix to be used only when placing manual dial calls from the agent interface, such as using the MANUAL DIAL feature, or Dial Next Number when in the MANUAL dial method, or manual alt number dialing, or scheduled user-only callbacks. Default is empty for disabled, which will use the Prefisso Chiamata defined in the field above. This option does not interfere with the 3way Prefisso Chiamata option. +

    @@ -3776,6 +4427,11 @@ if ($ADD==99999)
    Campaña CallerID - este campo permite enviar de un número de encargo del callerid en las llamadas de salida. Úste es el número que demostraría para arriba en el callerid de la persona que usted está llamando. El defecto es DESCONOCIDO. Esta opcio`n está solamente disponible si usted está utilizando PRIs - ISDN T1 o E1 - que tienen la característica de encargo del callerid se giraron. Esta característica puede Tambien trabajar con los troncos IAX2 dependiendo de lo que admite su abastecedor. El callerID de encargo se aplica solamente a las llamadas puestas para la campaña de VICIDIAL directamente, cualquier tercer persona llama o las transferencias no enviarán el callerID de encargo. NOTA: A veces el poner DESCONOCIDO o PRIVADO en el campo rendirá enviar de su número del callerID del defecto por su portador con las llamadas. Usted puede desear probar esto y poner 0000000000 en el campo del callerid en lugar de otro si usted no desea enviarle CallerID. +
    +
    +
    + Custom CallerID - When set to Y, this option allows you to use the security_phrase field in the vicidial_list table as the CallerID to send out when placing for each specific lead. If this field has no CID in it then the CallerID della Campagna defined above will be used instead. This option will disable the list CallerID Override if there is a CID present in the security_phrase field. Default is N. +

    @@ -3789,7 +4445,7 @@ if ($ADD==99999)

    - Nombre de fichero de Rec de la campaña - este campo permite que usted modifique el nombre para requisitos particulares de la grabacion cuando la grabacion de la campaña es ONDEMAND o ALLCALLS. Las variables permitidas son CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT. El defecto es FULLDATE_AGENT y parecería este 20051020-103108_6666. Otro ejemplo es CAMPAIGN_TINYDATE_CUSTPHONE que parecería este TESTCAMP_51020103108_3125551212. 50 char max. + Nome Registrazioni Per Questa Campagna - This field allows you to customize the name of the recording when Campagna recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max.
    @@ -3804,7 +4460,7 @@ if ($ADD==99999)

    - Consiga el lanzamiento de la llamada - este menú permite que usted elija si usted desee automo`vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. + Consiga el lanzamiento de la llamada - este menú permite que usted elija si usted desee automo`vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent.
    @@ -3814,17 +4470,37 @@ if ($ADD==99999)

    - Trasferimento rapido Button - Questa opzione aggiunge un pulsante di trasferimento rapido alla schermata agente sotto il pulsante Transfer-Conf che permetterà un clic cieco trasferimento di chiamate al selezionato In-gruppo o numero. IN_GROUP invierà le chiamate al Default Xfer gruppo per questa campagna, o In-gruppo se ci fosse una chiamata in entrata. Le opzioni preimpostate invierà le chiamate al preset selezionato. Di default è N per disabili. + Trasferimento rapido Button - Questa opzione aggiunge un pulsante di trasferimento rapido alla schermata agente sotto il pulsante Transfer-Conf che permetterà un clic cieco trasferimento di chiamate al selezionato In-gruppo o numero. IN_GROUP invierà le chiamate al Default Xfer gruppo per questa campagna, o In-gruppo se ci fosse una chiamata in entrata. Le opzioni preimpostate invierà le chiamate al preset selezionato. Di default è N per disabili. The LOCKED options are used to lock the value to the Trasferimento rapido Button even if the agent uses the transfer conference features during a cacll before using the Trasferimento rapido Button.

    Trasferimento PrePopulate Preset - Questa opzione di inserire il numero di campo Dial nella cornice Conferenza di trasferimento dello schermo agente se definito. Di default è N per disabili. +
    +
    +
    + Enable Transfer Presets - This option will enable the Presets sub menu to appear at the top of the Campagna Modification page, and also you will have the ability to specify Preset dialing numbers for Agenti to use in the Transfer-Conference frame of the agent interface. Default is DISABLED. + +
    +
    +
    + Hide Transfer Number to Dial - This option will hide the Number to Dial field in the Transfer-Conference frame of the agent interface. Default is DISABLED. + +
    +
    +
    + Park Call IVR - This option will allow an agent to park a call with a separate IVR PARK CALL button on their agent interface if this is ENABLED or ENABLED_PARK_ONLY. The ENABLED_PARK_ONLY option will allow the agent to send the call to park but not click to retrieve the call like the ENABLED option. The ENABLED_BUTTON_HIDDEN option allows the function through the API only. Default is DISABLED. + +
    +
    +
    + Park Call IVR AGI - If the Park Call IVR field is not DISABLED, then this field is used as the AGI application string that the customer is sent to. This is a setting that should be set by your administrator if possible. +

    - Timer azione - Questa funzione consente di attivare azioni dopo un certo periodo di tempo. D1 e D2 le opzioni di chiamata lancerà un appello per il trasferimento Conferenza preset Numero e li trasmette alla sessione di agente, questo è di solito utilizzato per semplici applicazioni IVR AGI convalida o semplicemente a svolgere un messaggio pre-registrato. FORM aprirà l-indirizzo web form. MESSAGE_ONLY semplicemente visualizzare il messaggio che è nel campo sottostante. NESSUNO sarà disabilitare questa funzione ed è il default. + Timer azione - Questa funzione consente di attivare azioni dopo un certo periodo di tempo. D1 e D2 le opzioni di chiamata lancerà un appello per il trasferimento Conferenza preset Numero e li trasmette alla sessione di agente, questo è di solito utilizzato per semplici applicazioni IVR AGI convalida o semplicemente a svolgere un messaggio pre-registrato. FORM aprirà l-indirizzo web form. MESSAGE_ONLY semplicemente visualizzare il messaggio che è nel campo sottostante. NESSUNO sarà disabilitare questa funzione ed è il default. HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer azione Destination field, EXTENSION will send the call to the Extension that is specified in the Timer azione Destination field, IN_GROUP will send the call to the In-Group specified in the Timer azione Destination field.
    @@ -3836,11 +4512,26 @@ if ($ADD==99999)
    Timer azione Secondi - Questa è la quantità di tempo dopo la chiamata è collegata al cliente che l-azione del timer viene attivato. Predefinito è -1, che è anche attivo. +
    +
    +
    + Timer azione Destination - This field is where you specify the Call Menu, Extension or In-Group that you want the cacll sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty. +

    Servicios repetidos programar - esta opcio`n no prohibe a agente a la disposicion una llamada como CALLBK y elige los datos y el tiempo en los cuales el plomo será reactivado. +
    +
    +
    + Scheduled Callbacks Alert - This option allows the callbacks status line in the agent interface to be red, blink or blink red when there are AGENTONLY scheduled callbacks that have hit their trigger time and date. Default is NONE for standard status line. + +
    +
    +
    + Scheduled Callbacks Count - This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE. +

    @@ -3886,6 +4577,11 @@ if ($ADD==99999)
    Agente Mostra Coda Conte - Se è impostata a Y, ogni volta che un cliente è in attesa di un agente, la coda invita visualizzazione nella parte superiore dello schermo agente diventa rosso e mostra il numero di chiamate in attesa. Il valore di default è Y. +
    +
    +
    + Manual Dial Override - The setting can override the Utenti setting for manual dial ability for agents when they are logged into this campaign. NONE will follow the Utenti setting, ALLOW_ALL will allow any agent logged into this campaign to place manual dial calls, DISABLE_ALL will not allow anyone logged into this campaign to place manual dial calls. Default is NONE. +

    @@ -3894,7 +4590,12 @@ if ($ADD==99999)

    - Manuale Dial Filtro - Questo ti permette di filtrare le chiamate che gli agenti fanno chiamare in modalità manuale per questa campagna da qualsiasi combinazione delle seguenti operazioni: DNC - a kick out, CAMPAIGNLISTE - il numero deve essere allinterno di elenchi per la campagna, NESSUNO - nessun filtro sul manuale o remoto veloce dial elenchi. + Manuale Dial Filtro - Questo ti permette di filtrare le chiamate che gli agenti fanno chiamare in modalità manuale per questa campagna da qualsiasi combinazione delle seguenti operazioni: DNC - a kick out, CAMPAIGNLISTE - il numero deve essere allinterno di elenchi per la campagna, NESSUNO - nessun filtro sul manuale o remoto veloce dial elenchi. CAMPLISTE_ALL - will include lista inattive in the search for the number. + +
    +
    +
    + Manual Preview Dial - This allows the agent in manual dial mode to see the lead information when they click Dial Next Number before they actively dial the phone call. There is an optional link to SKIP the lead and move on to the next one if selected. Default is PREVIEW_AND_SKIP.
    @@ -3904,13 +4605,28 @@ if ($ADD==99999)

    - 3-Way chiamate in uscita CallerID - Questo è ciò che definisce come inviato il numero in uscita callerID da 3-way chiamate effettuate dallagente, CAMPAGNA utilizza la campagna personalizzata callerID, il Cliente utilizza il numero di clienti che è attiva su schermo e gli agenti AGENT_PHONE usa il callerID per il telefono cellulare che lagente è registrato in. AGENT_CHOOSE lagente permette di scegliere quale callerID da utilizzare per le chiamate a 3 vie da un elenco di scelte. + 3-Way chiamate in uscita CallerID - Questo è ciò che definisce come inviato il numero in uscita callerID da 3-way chiamate effettuate dallagente, CAMPAGNA utilizza la campagna personalizzata callerID, il Cliente utilizza il numero di clienti che è attiva su schermo e gli agenti AGENT_PHONE usa il callerID per il telefono cellulare che lagente è registrato in. AGENT_CHOOSE lagente permette di scegliere quale callerID da utilizzare per le chiamate a 3 vie da un elenco di scelte. CUSTOM_CID will use the Custom CID that is defined in the security_phrase field of the vicidial_list table for the lead.

    3-Way Call Prefisso Chiamata - Questo definisce quello che è usato come prefisso per chiamare il 3-way chiamate, di default è vuoto in modo che il prefisso campagna quadrante è usato, passthru in modo che tu possa sentire suonare è 88. +
    +
    +
    + Customer 3-Way Hangup Logging - If this option is ENABLED the user_call_log will log when a customer hangup up if they hang up during a 3-way call. Also, this can allow for the Customer 3-way hangup action if one is defineed below. Default is ENABLED. + +
    +
    +
    + Customer 3-Way Hangup Seconds - If Customer 3-way logging is enabled, this option allows you to define the number of seconds after the customer hangup is detected before it is actually logged and the optional customer 3-way hangup action is executed. Default is 5 seconds. + +
    +
    +
    + Customer 3-Way Hangup Action - If Customer 3-way logging is enabled, this option allows you to have the agent screen automatically hang up on the call and go to the DISPO screen if this option is set to DISPO. Default is NONE. + 0) { @@ -3983,6 +4699,16 @@ if ($ADD==99999)
    Vtiger stato della chiamata - Se l-integrazione Vtiger è attivata nelle impostazioni di sistema, quindi, questa impostazione definirà se lo stato del Conto Vtiger verrà aggiornato con lo stato della chiamata VICIDIAL dopo che è stato dispositioned. Di default è N. +
    +
    +
    + QM CallStatus Override - If QueueMetrics integration is enabled in the system settings then this setting allow the overriding of the Impostazioni di Sistema setting for CallStatus queue_log entries. Default is DISABLED which will use the system setting. + +
    +
    +
    + Extension Append CID - If enabled, the calls placed from this campaign will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled. +

    @@ -4038,6 +4764,21 @@ if ($ADD==99999)
    Agente di pausa dopo ogni chiamata - Questa opzione se impostata a Y si fermerà l-agente, dopo ogni chiamata automaticamente. Di default è N. +
    +
    +
    + Blind Monitor Warning - This option if enabled will let the agent know in various optional ways if they are being blind monitored by someone. DISABLED means this feature is not active, ALERT will only pop an alert up on the agent screen, NOTICE will post a note that stays up on the agent screen as long as theya re being monitored, AUDIO will play the filename defined below when an agent is starting to be monitored and the other options are combibnations of the above options. Default is DISABLED. + +
    +
    +
    + Blind Monitor Notice - This is the message that will show on the agent screen while they are being monitored if the NOTICE option is selected. Default is -Someone is blind monitoring your session-. + +
    +
    +
    + Blind Monitor Filename - This is the audio file that will play in the agents session at the start of someone blind monitoring them. This prompt will be played for everyone in the session including the customer if any is present. Default is empty. + @@ -4177,10 +4918,15 @@ if ($ADD==99999)
    Escritura de la campaña - este menú permite que usted elija la escritura que aparecerá en la pantalla de los agentes para esta campaña. No seleccione NONE no demostrar ninguna escritura para esta campaña. +
    +
    +
    + Ignore List Script Override- 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 ID Lista script settings. Default is N. +

    - Consiga el lanzamiento de la llamada - este menú permite que usted elija si usted desee automo`vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. + Consiga el lanzamiento de la llamada - este menú permite que usted elija si usted desee automo`vil-lance la página en una ventana separada, auto-switch de la tela-forma a la lengüeta de la ESCRITURA o no haga nada cuando una llamada se envía al agente para esta campaña. If custom list fields are enabled on your system, FORM will open the FORM tab upon connection of a call to an agent.
    @@ -4190,7 +4936,7 @@ if ($ADD==99999)

    - Timer azione - Questa funzione consente di attivare azioni dopo un certo periodo di tempo. D1 e D2 le opzioni di chiamata lancerà un appello per il trasferimento Conferenza preset Numero e li trasmette alla sessione di agente, questo è di solito utilizzato per semplici applicazioni IVR AGI convalida o semplicemente a svolgere un messaggio pre-registrato. FORM aprirà l-indirizzo web form. MESSAGE_ONLY semplicemente visualizzare il messaggio che è nel campo sottostante. NESSUNO sarà disabilitare questa funzione ed è il default. Questa impostazione sovrascrive le impostazioni della campagna. + Timer azione - Questa funzione consente di attivare azioni dopo un certo periodo di tempo. D1 e D2 le opzioni di chiamata lancerà un appello per il trasferimento Conferenza preset Numero e li trasmette alla sessione di agente, questo è di solito utilizzato per semplici applicazioni IVR AGI convalida o semplicemente a svolgere un messaggio pre-registrato. FORM aprirà l-indirizzo web form. MESSAGE_ONLY semplicemente visualizzare il messaggio che è nel campo sottostante. NESSUNO sarà disabilitare questa funzione ed è il default. Questa impostazione sovrascrive le impostazioni della campagna. HANGUP will hang up the call when the timer is triggered, CALLMENU will send the call to the Call Menu specified in the Timer azione Destination field, EXTENSION will send the call to the Extension that is specified in the Timer azione Destination field, IN_GROUP will send the call to the In-Group specified in the Timer azione Destination field.
    @@ -4202,6 +4948,11 @@ if ($ADD==99999)
    Timer azione Secondi - Questa è la quantità di tempo dopo la chiamata è collegata al cliente che l-azione del timer viene attivato. Predefinito è -1, che è anche attivo. +
    +
    +
    + Timer azione Destination - This field is where you specify the Call Menu, Extension or In-Group that you want the cacll sent to if the Time Action is set to CALLMENU, EXTENSION or IN_GROUP. Default is empty. +

    @@ -4220,7 +4971,7 @@ if ($ADD==99999)

    - Casella Vocale - If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. + Casella Vocale - If Drop Action is set to VOICEMAIL, the call DROP would instead be directed to this voicemail box to hear and leave a message. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Utente voicemail ID to use.
    @@ -4250,7 +5001,7 @@ if ($ADD==99999)

    - Despue`s de las horas Casella Vocale - la caja del voicemail para enviar lallamada si la accio`n se fija a VOICEMAIL. + Despue`s de las horas Casella Vocale - la caja del voicemail para enviar lallamada si la accio`n se fija a VOICEMAIL. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Utente voicemail ID to use.
    @@ -4260,7 +5011,7 @@ if ($ADD==99999)

    - N. agenti n. Queueing - Se questo campo è impostato su Y o NO_PAUSED allora non le chiamate saranno messi in coda per questo gruppo se non ci sono agenti di login e le chiamate andrà l-agente No No Action coda. L-opzione NO_PAUSED non anche inviare i chiamanti in coda se non ci sono solo agenti in pausa in gruppo. Di default è N. + N. agenti n. Queueing - Se questo campo è impostato su Y o NO_PAUSED allora non le chiamate saranno messi in coda per questo gruppo se non ci sono agenti di login e le chiamate andrà l-agente No No Action coda. L-opzione NO_PAUSED non anche inviare i chiamanti in coda se non ci sono solo agenti in pausa in gruppo. Di default è N. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Utente voicemail ID to use.
    @@ -4297,6 +5048,16 @@ if ($ADD==99999)
    En el intervalo del aviso del asimiento - la longitud de la hora ensegundos de esperar antes de jugar encendido el aviso del sostener. Eldefecto es 60. Per disattivare il prompt Hold On, impostare lintervallo a 0. +
    +
    +
    + On Hold Prompt No Block - Setting this option to Y will allow calls in line behind a call where the on hold prompt is playing to go to an agent if one becomes available while the message is playing. While the On Hold Prompt Filename message is playing to a customer they cannot be sent to an agent. Default is N. + +
    +
    +
    + On Hold Prompt Seconds - This field needs to be set to the number of seconds that the On Hold Prompt Filename plays for. Default is 10. +

    @@ -4307,35 +5068,160 @@ if ($ADD==99999)
    Gioca stimato Hold Time - Questo definisce se il chiamante ascolterà il tempo stimato tenere prima di essere trasferiti a un agente. Il valore di default è N. Se il cliente è in attesa e sente questo messaggio stimato tempo attesa, il tempo minimo che verrà riprodotto è di 15 secondi. +
    +
    +
    + Calculate Estimated Hold Seconds - This defines the number of seconds into the queue that the customer will wait before the Estimated Hold Time will be calculated and optionally played. Minimum is 3 seconds, even if set lower than 3. Default is 0. + +
    +
    +
    + Estimated Hold Time Minimum Filename - If the Estimated Hold Time is active and it is calculated to be at or below the minimum of 15 seconds, then this prompt file will be played instead of the default announcement. Default is Empty for inactive. + +
    +
    +
    + Estimated Hold Time Minimum Prompt No Block - If Estimated Hold Time is active and the Estimated Hold Time Minimum Filename field above is filled-in, then this option to allow calls in line behind a call where the prompt is playing to go to an agent if one becomes available while the message is playing. While the prompt is playing to a customer they cannot be sent to an agent. Default is N. + +
    +
    +
    + Estimated Hold Time Minimum Prompt Seconds - This field needs to be set to the number of seconds that the Estimated Hold Time Minimum Filename prompt plays for. Default is 10. + +
    +
    +
    + Wait Time Opzione - This allows you to give customers options to leave the queue if their wait time is over the amount of seconds specified below. Default is NONE. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. The PRESS_STAY option will send the customer back to the queue without loosing their place in line. + +
    +
    +
    + Wait Time Second Opzione - Same as the first Wait Time Opzione field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Wait Time Opzione is selected then this option will not be offered. + +
    +
    +
    + Wait Time Third Opzione - Same as the first Wait Time Opzione field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Wait Time Opzione is selected then this option will not be offered. + +
    +
    +
    + Wait Time Opzione Seconds - If Wait Time Opzione is set to anything but NONE, this is the number of seconds that the customer has been waiting in queue that will trigger the wait time options. Default is 120 seconds. + +
    +
    +
    + Wait Time Opzione Extension - If Wait Time Opzione is set to PRESS_EXTEN, this is the dialplan extension that the call will be sent to if the customer presses the option key when presented with the option. + +
    +
    +
    + Wait Time Opzione Callmenu - If Wait Time Opzione is set to PRESS_CALLMENU, this is the Call Menu that the call will be sent to if the customer presses the option key when presented with the option. + +
    +
    +
    + Wait Time Opzione Casella Vocale - If Wait Time Opzione is set to PRESS_VMAIL, this is the voicemail box that the call will be sent to if the customer presses the option key when presented with the option. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Utente voicemail ID to use. + +
    +
    +
    + Wait Time Opzione Transfer In-Group - If Wait Time Opzione is set to PRESS_INGROUP, this is the inbound group that the call will be sent to if the customer presses the option key when presented with the option. + +
    +
    +
    + Wait Time Opzione Press Filename - If Wait Time Opzione is set to one of the PRESS_ options, this is the filename prompt that is played if the customer wait time exceeds the Wait Time Opzione Seconds to give the customer the option to press 1, 2 or 3 on their phone to run the selected Wait Time Press options. It is very important that you include options in the audio file for all of your selected Wait Time Opziones, and that the audio file length in seconds is properly defined in the Filename Seconds field below or there will be problems. Default is to-be-called-back. + +
    +
    +
    + Wait Time Opzione Press No Block - Setting this option to Y will allow calls in line behind a call where the Wait Time Opzione Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Wait Time Opzione Press Filename message is playing to a customer they cannot be sent to an agent. Default is N. + +
    +
    +
    + Wait Time Opzione Press Filename Seconds - This field needs to be set to the number of seconds that the Wait Time Opzione Press Filename plays for. Default is 10. + +
    +
    +
    + Wait Time Opzione After Press Filename - If Wait Time Opzione is set to one of the PRESS_ options, this is the filename prompt that is played after the customer has pressed 1, 2 or 3. + +
    +
    +
    + Wait Time Opzione Callback ID Lista - If Wait Time Opzione is set to PRESS_CID_CALLBACK, this is the ID Lista the call is added to as a new lead if the customer presses the option key when presented with the option. + +
    +
    +
    + Wait Hold Opzione Priority - If both Estimated Hold Time options and Wait Time options are active, this setting will define whether one, the other or both of these features are active. For example, if the Estimated Hold Time Opzione is set to 360, the Wait Time option is set to 120 and the customer has been waiting for 120 seconds and there are still 400 seconds estimated hold time, then they are both active at the same time and this setting will be checked to see what options will be offered. Default is WAIT only. +

    - Tenere Opzione Tempo - Questo ti permette di specificare linstradamento della chiamata, se la stima del tempo di attesa è di oltre limporto di secondi specificato in appresso. Il valore di default è NESSUNO. + Estimated Tenere Opzione Tempo - Questo ti permette di specificare linstradamento della chiamata, se la stima del tempo di attesa è di oltre limporto di secondi specificato in appresso. Il valore di default è NESSUNO. If one of the PRESS_ options is selected, it will play the Press Filename defined below and give the customer the option to press 1 on their phone to leave the queue and run the selected option. + +
    +
    +
    + Hold Time Second Opzione - Same as the first Hold Time Opzione field above, except this one will check for the customer pressing the 2 key. Default is NONE. If no first Hold Time Opzione is selected then this option will not be offered. + +
    +
    +
    + Hold Time Third Opzione - Same as the first Hold Time Opzione field above, except this one will check for the customer pressing the 3 key. Default is NONE. If no Second Hold Time Opzione is selected then this option will not be offered.

    Tenere Opzione Tempo Secondi - Se Hold Time opzione è impostata a nulla, ma NESSUNO, questo è il numero di secondi di attesa tempo stimato che il tempo di attivare lopzione. Il valore predefinito è 360 secondi. +
    +
    +
    + Hold Time Opzione Minimum - If Hold Time Opzione enabled, this is the minimum number of seconds the call must be waiting before it will be presented with the hold time option. The hold time option will immediately be presented at this time if the estimated hold time is greater than the Hold Time Opzione Seconds value. Default is 0 seconds. +

    Tenere Opzione Tempo Estensione - Se lopzione Hold Time è impostato per estensione, questo è il dialplan proroga che la richiesta sarà inviata a se la stima del tempo di attesa supera il tempo di Opzione Secondi. +
    +
    +
    + Hold Time Opzione Callmenu - If Hold Time Opzione is set to CALL_MENU, this is the Call Menu that the call will be sent to if the estimated hold time exceeds the Hold Time Opzione Seconds. +

    - Tenere Tempo Opzione Segreteria - Se Hold Time opzione è impostata a segreteria telefonica, questa è la casella di segreteria telefonica che la richiesta sarà inviata a se la stima del tempo di attesa supera il tempo di Opzione Secondi. + Tenere Tempo Opzione Segreteria - Se Hold Time opzione è impostata a segreteria telefonica, questa è la casella di segreteria telefonica che la richiesta sarà inviata a se la stima del tempo di attesa supera il tempo di Opzione Secondi. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the Utente voicemail ID to use.

    Tenere Opzione Tempo trasferimento in gruppo - Se Hold Time opzione è impostata a IN_GROUP, questo è il gruppo in entrata che linvito sarà inviato a se la stima del tempo di attesa supera il tempo di Opzione Secondi. +
    +
    +
    + Hold Time Opzione Press Filename - If Hold Time Opzione is set to one of the PRESS_ options, this is the filename prompt that is played if the estimated hold time exceeds the Hold Time Opzione Seconds to give the customer the option to press 1 on their phone to run the selected Hold Time Press Opzione. It is very important that this audio file is 10 seconds or less or there will be problems. Default is to-be-called-back. + +
    +
    +
    + Hold Time Opzione Press No Block - Setting this option to Y will allow calls in line behind a call where the Hold Time Opzione Press Filename prompt is playing to go to an agent if one becomes available while the message is playing. While the Hold Time Opzione Press Filename message is playing to a customer they cannot be sent to an agent. Default is N. + +
    +
    +
    + Hold Time Opzione Press Filename Seconds - This field needs to be set to the number of seconds that the Hold Time Opzione Press Filename plays for. Default is 10. +

    - Tenere Opzione Tempo richiamata Filename - Se lopzione Hold Time è impostato su CALLERID_CALLBACK, questo è il nome del file che viene riprodotto prompt prima che la chiamata viene registrata come un nuovo condurre alla lista ID specificato di seguito, se la stima del tempo di attesa supera i Tenere Opzione Tempo Secondi. + Hold Time Opzione After Press Filename - If Hold Time Opzione is set to one of the PRESS_ options or CALLERID_CALLBACK, this is the filename prompt that is played after the customer has pressed 1 or the call has been added to the callback list.
    @@ -4365,7 +5251,7 @@ if ($ADD==99999)

    - Nel gruppo di registrazione Filename - Questo campo sovrascrive la campagna di registrazione Filenaming sistema a meno che non sia impostato su NESSUNO. Le variabili sono ammessi CAMPAGNA CUSTPHONE FULLDATE TINYDATE EPOCH AGENTE. Il valore predefinito è FULLDATE_AGENT e sarebbe simile a questa 20051020-103108_6666. Un altro esempio è CAMPAIGN_TINYDATE_CUSTPHONE che assomigliare a questa TESTCAMP_51020103108_3125551212. Max 50 caratteri. Il valore di default è NESSUNO. + In-Group Recording Filename - This field will override the Registrazioni Per Questa Campagna Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. 50 char max. Default is NONE. 0) @@ -4434,11 +5320,30 @@ if ($ADD==99999)
    Dispo Call URL - This web URL address is not seen by the agent, but it is called every time a call is dispositioned by an agent if it is populated. Uses the same variables as the web form fields and scripts. dispo and talk_time are the variables you can use to retrieve the agent-defined disposition for the call and the actual talk time in seconds of the call. Default is blank. +
    +
    +
    + Add Lead URL - This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid +

    Predefinito Gruppo Alias - Se si hanno consentito Alias gruppo per la campagna che lagente è registrato in poi questo è il gruppo alias che è stato selezionato prima di default su un invito da parte di questo gruppo in entrata, quando lagente sceglie di utilizzare un gruppo di Alias per un manuale di chiamata in uscita. Il valore predefinito è vuoto o NESSUNO. +
    +
    +
    + Extension Append CID - If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled. + +
    +
    +
    + Uniqueid Status Visualizzare - If enabled, when an agent receives a call through this in-group they will see the uniqueid of the call added to the status line in their agent interface. The PREFIX option will add the prefix defined blow to the beginning of the uniqueid in the display. Default is DISABLED. If there was already a Uniqueid defined on a call entering this in-group, then the original uniqueid will be displayed. If the PRESERVE option is used and the call is sent to a second agent, the uniqueid and prefix displayed to the first agent will also be displayed to the second agent. + +
    +
    +
    + Uniqueid Status Prefix - If PREFIX option is selected above then this is the value of that prefix. Default is empty. @@ -4466,6 +5371,11 @@ if ($ADD==99999)
    HA rotta - Questo tipo di percorso che si è impostato il DID da usare. Estensione invierà le chiamate verso lestensione al di sotto, segreteria invierà chiede direttamente alla casella vocale al di sotto, AGENTE invierà le chiamate a un agente VICIDIAL se sono connesso, TELEFONO invierà la chiamata a un telefono voce selezionata di seguito, si IN_GROUP inviare chiamate direttamente al gruppo specificato in entrata. Il valore di default è Extensions. CALLMENU invierà la chiamata al call definita Menu. +
    +
    +
    + Record Call - This option allows you to set the calls coming into this DID to be recorded. Y will record the entire call, Y_QUEUESTOP will record the call until the call is hungup or enters an in-group queue, N will not record the call. Default is N. +

    @@ -4541,6 +5451,32 @@ if ($ADD==99999)
    Nel gruppo Codice Telefono - Se è selezionata come IN_GROUP DID rotta, allora questo è il codice utilizzato Telefono se un nuovo piombo è creato. +
    +
    +
    + Clean CID Number - This field allows you to specify a number of digits to restrict the incoming caller ID number to by putting an R in front of the number of digits, for example to restrict to the right 10 digits you would enter in R10. You can also use this feature to remove only a leading digit or digits by putting an L in front of the specific digits that you want to remove, for example to remove a 1 as the first digit you would enter in L1. Default is empty. If more than one rule is specified make sure you separate them with a space and the R will run before the L. + +
    +
    +
    + Filter Inbound Number - This option if enabled allows you to filter calls coming into this DID and send them to an alternative action if they match a phone number that is in the filter phone group or a URL response if you have configured one. Default is DISABLED. GROUP will search in a Filter Phone Group. URL will send a URL and will match if a 1 is sent back. + +
    +
    +
    + Filter Phone ID Gruppo - If the Filter Inbound Number field is set to GROUP then this is the ID of the Filter Phone Group that will have its numbers searched looking for a match to the caller ID number of the incoming call. + +
    +
    +
    + Filter URL - If the Filter Inbound Number field is set to URL then this is the web address of a script that will search a remote system and return a 1 for a match and a 0 for no match. Only two variables are available in the address if you use the VAR prefix like with webform addresses in campaigns, --A--phone_number--B-- and --A--did_pattern--B-- can be used in the URL to indicate the caller ID of the caller and the DID that the customer caclled in on. + +
    +
    +
    + Filter Action - If Filter Inbound Number is activated and a match is found then this is the action that is to be taken. This is the same as the Route that you select for a DID, and the settings below function just like they do for a standard routing. + + @@ -4549,7 +5485,7 @@ if ($ADD==99999) VICIDIAL_CALL MENU TABELLA


    - Menu ID - Questo è l-ID di questo passo del menù chiamata. Questo mostrerà anche come il contesto che viene utilizzata nel dialplan per il presente invito menu. + Menu ID - Questo è l-ID di questo passo del menù chiamata. Questo mostrerà anche come il contesto che viene utilizzata nel dialplan per il presente invito menu. Here is a list of reserved phrases that cannot be used as menu IDs: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor.
    @@ -4626,15 +5562,40 @@ if ($ADD==99999)
    Opzione Route valore di contesto - Questo campo è opzionale e solo utilizzati come percorsi di opzione di proroga. +
    +
    +
    + Call Menu In-Group Settings - If the route is set to INGROUP then there are many options that you can set to define how the call is sent to into the queue. In-Group is the inbound group that you want the call to go to. Handle Method is the way you want the call to be handled,
    Click here to see a list of the available handle methods. Search Method defines how the queue will find the next agent, recommend leave this on LB. ID Lista is the list that the new lead is inserted into, also if the Method is not a LOOKUP method and the lead is not found. ID Campagna is the campaign to search lists through if one of the RC methods is used. Phone Code is the phone_code field entry for the lead that is inserted with. VID Enter Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to ask the customer to enter their ID. VID ID Number Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played after customer enters their ID, something like YOU HAVE ENTERED. VID Confirm Filename is used if the Method is set to one of the VIDPROMPT methods, it is the audio prompt played to confirm their ID, something like PRESS 1 TO CONFIRM AND 2 TO REENTER. VID Digits is used if the Method is set to one of the VIDPROMPT methods, if it is set to a number it is the number of digits that must be ebtered by the customer when prompted for their ID, if set to empty or X then the customer will have to press pound or hash to finish their entry of their ID. +

    - Custom Dilplan Entry - Questo campo consente di inserire in ogni dialplan elementi che si desidera per il menu di chiamata. + Custom Dialplan Entry - Questo campo consente di inserire in ogni dialplan elementi che si desidera per il menu di chiamata. +



    + +
    +
    +
    + Filter Phone ID Gruppo - This is the ID of the Filter Phone Group that is the container for a group of phone numbers that you can have automatically searched through when a call comes into a DID and send to an alternate route if there is a match. This field should be between 2 and 20 characters and have no punctuation except for underscore. + +
    +
    +
    + Filter Phone Nome Gruppo - This is the name of the Filter Phone Group and is displayed with the ID in select lists where this feature is used. This field should be between 2 and 40 characters. + +
    +
    +
    + Filter Phone Group Description - This is the description of the Filter Phone Group, it is purely for notation purposes only and is not a required field. + + + +



    VICIDIAL_REMOTE_AGENTS TABELLA

    @@ -4657,6 +5618,11 @@ if ($ADD==99999)
    Extension externa - este es el número que usted desea las llamadas remitidas a. Cercio`rese de que sea un número dial plan completo y que si usted necesita 9 al principio usted lo pone adentro aquí. Pruebe marcando este número de un telefono en el sistema. +
    +
    +
    + Extension Group - If set to something other than NONE or empty this will override the Numero Di Interno Remoto field and use the Extension Group entries that have the same extension group ID. Default is NONE for deactivated. +

    @@ -4673,6 +5639,29 @@ if ($ADD==99999) Grupos de entrada - aquí es donde usted selecciona a grupos de entrada que usted desea recibir llamadas de si usted ha seleccionado la campaña MÁS CERCANA. +



    + + VICIDIAL_EXTENSION_GROUPS TABELLA

    +
    +
    + Extension Group - This required field is where you enter the group ID that you want this extension to be put into. No spaces or special characters except for underscore letters and numbers. + +
    +
    +
    + Extension - This required field is where you put the dialplan extension that you want the remote agent calls to be sent to for this extension group entry. + +
    +
    +
    + Rank - This field allows you to rank the extension group entries that share the same extension group. Default is 0. + +
    +
    +
    + Campagnas Groups - In this field you can put a list of campaign IDs and or inbound group IDs that you want to restrict the use of the extension group for. List must be separate by pipes and have a pipe at the beginning and end of the string. + +



    VICIDIAL_CAMPAIGN_LISTE

    @@ -4740,6 +5729,17 @@ if ($ADD==99999) +



    + + VICIDIAL CAMPAIGN PRESETS

    +
    +
    + If the Campagna setting for presets is set to ENABLED then you have the ability to define Transfer-Conference presets that will be available to the agent allowing them to 3-way call these presets or blind transfer calls to these preset numbers. These presets also have an option to hide the number associated with each preset from the agent. + + + + +



    VICIDIAL_USER_GROUPS TABELLA

    @@ -4775,14 +5775,55 @@ if ($ADD==99999)

    - Stato agente Viewable Gruppi - Questa è una lista selezionabile di gruppi di utenti e funzioni di utente a cui i membri di questo gruppo utente può visualizzare lo stato delle chiamate, nonché il trasferimento verso l-interno dello schermo agente. The All-GRUPPI opzione consente agli utenti in questo gruppo da vedere e trasferire le chiamate a qualsiasi utente del sistema. LA CAMPAGNA AGENTI opzione consente agli utenti in questo gruppo da vedere e trasferire le chiamate a qualsiasi utente nella campagna che si è registrato in. + Stato agente Viewable Gruppi - Questa è una lista selezionabile di gruppi di utenti e funzioni di utente a cui i membri di questo gruppo utente può visualizzare lo stato delle chiamate, nonché il trasferimento verso l-interno dello schermo agente. The All-GRUPPI opzione consente agli utenti in questo gruppo da vedere e trasferire le chiamate a qualsiasi utente del sistema. LA CAMPAGNA AGENTI opzione consente agli utenti in questo gruppo da vedere e trasferire le chiamate a qualsiasi utente nella campagna che si è registrato in. The NOT-LOGGED-IN-AGENTS option allows all users in the system to be displayed, even if they are not logged-in curently.

    Visualizza stato agente Time - Questa opzione definisce se l-agente vedrà la quantità di tempo che gli utenti nella loro sidebar agenti sono stati nel loro stato attuale. Di default è N per nulla o portatori di handicap. +
    +
    +
    + Agent Call Log View - This option defines whether the agent will be able to see their call log for calls handled through the ViciDial agent screen. Default is N for no or disabled. + +
    +
    +
    + Agent Transfer Opziones - These options allow for the disabling of specific buttons in the Transfer Conference section of the Agent interface. Default is Y for yes or enabled. + +
    +
    +
    + Agent Fullscreen - This option if set to Y will set the height and width of the ViciDial agent screen to the size of the web browser window without any allowance for the Agenti View, Calls in Queue View or Calls in Session view. Default is N for no or disabled. + +
    +
    +
    + Allowed Report - 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. + 5) + { + ?> +
    +
    +
    + Webphone URL Override - This setting allows you to set an alternate webphone URL just for the members of one user group. Default is empty. + +
    +
    +
    + Webphone System Key Override - This setting allows you to set an alternate webphone System Key just for the members of one user group. Default is empty. + +
    +
    +
    + Webphone Dialpad Override - This setting allows you to activate or deactivate the dialpad on the webphone just for the members of one user group. Default is DISABLED. TOGGLE will allow the user to view and hide the dialpad by clicking a link. + + 0) { ?> @@ -4819,10 +5860,10 @@ if ($ADD==99999)
    - Testo Script - This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id. For example, this sentence would print the persons name in it----

    Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

    This would read----

    Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?

    You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables: + Testo Script - This is where you place the content of a Vicidial Script. Minimum of 2 characters. You can have customer information be auto-populated in this script using "--A--field--B--" where field is one of the following fieldnames: vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, lead_id, campaign, phone_login, group, channel_group, SQLdate, epoch, uniqueid, customer_zap_channel, server_ip, SIPexten, session_id, dialed_number, dialed_label, rank, owner, camp_script, in_script, script_width, script_height, recording_filename, recording_id, user_custom_one, user_custom_two, user_custom_three, user_custom_four, user_custom_five, preset_number_a, preset_number_b, preset_number_c, preset_number_d, preset_number_e, preset_number_f, preset_dtmf_a, preset_dtmf_b, did_id, did_extension, did_pattern, did_description, closecallid, xfercallid, agent_log_id, entry_list_id. For example, this sentence would print the persons name in it----

    Hello, can I speak with --A--first_name--B-- --A--last_name--B-- please? Well hello --A--title--B-- --A--last_name--B-- how are you today?

    This would read----

    Hello, can I speak with John Doe please? Well hello Mr. Doe how are you today?

    You can also use an iframe to load a separate window within the SCRIPT tab, here is an example with prepopulated variables:
    - <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> + <iframe src="http://astguiclient.sf.net/test_VICIDIAL_output.php?lead_id=--A--lead_id--B--&vendor_id=--A--vendor_lead_code--B--&list_id=--A--list_id--B--&gmt_offset_now=--A--gmt_offset_now--B--&phone_code=--A--phone_code--B--&phone_number=--A--phone_number--B--&title=--A--title--B--&first_name=--A--first_name--B--&middle_initial=--A--middle_initial--B--&last_name=--A--last_name--B--&address1=--A--address1--B--&address2=--A--address2--B--&address3=--A--address3--B--&city=--A--city--B--&state=--A--state--B--&province=--A--province--B--&postal_code=--A--postal_code--B--&country_code=--A--country_code--B--&gender=--A--gender--B--&date_of_birth=--A--date_of_birth--B--&alt_phone=--A--alt_phone--B--&email=--A--email--B--&security_phrase=--A--security_phrase--B--&comments=--A--comments--B--&user=--A--user--B--&campaign=--A--campaign--B--&phone_login=--A--phone_login--B--&fronter=--A--fronter--B--&closer=--A--user--B--&group=--A--group--B--&channel_group=--A--group--B--&SQLdate=--A--SQLdate--B--&epoch=--A--epoch--B--&uniqueid=--A--uniqueid--B--&customer_zap_channel=--A--customer_zap_channel--B--&server_ip=--A--server_ip--B--&SIPexten=--A--SIPexten--B--&session_id=--A--session_id--B--&dialed_number=--A--dialed_number--B--&dialed_label=--A--dialed_label--B--&rank=--A--rank--B--&owner=--A--owner--B--&phone=--A--phone--B--&camp_script=--A--camp_script--B--&in_script=--A--in_script--B--&script_width=--A--script_width--B--&script_height=--A--script_height--B--&recording_filename=--A--recording_filename--B--&recording_id=--A--recording_id--B--&user_custom_one=--A--user_custom_one--B--&user_custom_two=--A--user_custom_two--B--&user_custom_three=--A--user_custom_three--B--&user_custom_four=--A--user_custom_four--B--&user_custom_five=--A--user_custom_five--B--&preset_number_a=--A--preset_number_a--B--&preset_number_b=--A--preset_number_b--B--&preset_number_c=--A--preset_number_c--B--&preset_number_d=--A--preset_number_d--B--&preset_number_e=--A--preset_number_e--B--&preset_number_f=--A--preset_number_f--B--&preset_dtmf_a=--A--preset_dtmf_a--B--&preset_dtmf_b=--A--preset_dtmf_b--B--&did_id=--A--did_id--B--&did_extension=--A--did_extension--B--&did_pattern=--A--did_pattern--B--&did_description=--A--did_description--B--&closecallid=--A--closecallid--B--&xfercallid=--A--xfercallid--B--&agent_log_id=--A--agent_log_id--B--&entry_list_id=--A--entry_list_id--B--&" style="width:580;height:290;background-color:transparent;" scrolling="auto" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="460" height="290" STYLE="z-index:17"> </iframe>
    @@ -4887,6 +5928,10 @@ if ($ADD==99999)
    Tiempos del comienzo y de parada del día laborable - estos son lostiempos de encargo por el día que se puede fijar para la definicio`ndel tiempo de la llamada que las mismas reglas se aplican como con lostiempos del comienzo y de parada del defecto. +
    +
    + After Hours Filename Override - These fields allow you to override the After Hours message for inbound groups if it is set to something. Default is empty. +
    Definiciones del tiempo de la llamada del estado - esta es la listade las definiciones específicas del tiempo de la llamada del estadoque se siguen en esta definicio`n del tiempo de la llamada. @@ -4927,7 +5972,7 @@ if ($ADD==99999)



    - Audio Store - Questa utility consente di caricare file audio per il web server in modo che possano essere distribuite a tutti i server ViciDial in un multi-cluster di server. Una nota importante, solo due tipi di file audio funziona, i file. Wav che sono PCM 16bit 8k e file. GSM che sono 8BIT 8K. Si prega di verificare che i file siano correttamente formattato prima di caricarli qui. + Audio Store - This utility allows you to upload audio files to the web server so that they can be distributed to all of the ViciDial servers in a multi-server cluster. An important note, only two audio file types will work, .wav files that are PCM Mono 16bit 8k and .gsm files that are 8bit 8k. Please verify that your files are properly formatted before uploading them here. @@ -4972,6 +6017,10 @@ if ($ADD==99999) Attivo - Questa opzione consente di impostare la voce TTS di attivi o inattivi. +
    +
    + TTS Voice - This is where you define the voice to be used in the TTS generation. Default is Allison-8kHz. +
    TTS Text - Questo è il testo effettivo ai dati Discorso campo che viene inviato al Cepstral per la creazione del file audio da riprodurre al cliente. è possibile utilizzare Speech Synthesis Markup Language-SSML-in questo campo, per esempio, <break time='1000ms'/> per una pausa di 1 secondo. È inoltre possibile utilizzare diverse variabili, quali nome, cognome e titolo come variabili ViciDial proprio come si fa in uno script: - A first_name - - B -. Ecco una lista delle variabili disponibili:lead_id, entry_date, modify_date, status, user, vendor_lead_code, source_id, list_id, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner @@ -5103,7 +6152,27 @@ if ($ADD==99999)

    - Contraseña - la contraseña usada para el usuario del telefono a laconexion a los usos del cliente. IMPORTANTE, questa è la password solo per il web agent login telefono di interfaccia, per cambiare il sip.conf o la password iax.conf, o segreto, per questo dispositivo cellulare è necessario modificare la conf campo segreto più in basso in questa pagina. + Login Password - The password used for the phone user to login to the web-based client applications. IMPORTANT, this is the password only for the agent web interface phone login, to change the sip.conf or iax.conf password, or secret, for this phone device you need to modify the Registrazione Password in the next field. + +
    +
    +
    + Registrazione Password - Questo è il segreto, o la password, per il telefono cellulare in auto o IAX SIP-generated conf file per questo telefono. Limite è dash 20 caratteri alfanumerici e underscore accettato. Di default è di prova. Formerly called Conf file segreto. A strong registration password should be at least 8 characters in length and have lower case and upper case letters as well as at least one number. + +
    +
    +
    + Set As Webphone - Setting this option to Y will attempt to load a web-based phone when the agent logs into their agent screen. Default is N. + +
    +
    +
    + Webphone Dialpad - This setting allows you to activate or deactivate the dialpad for this webphone. Default is Y for enabled. TOGGLE will allow the user to view and hide the dialpad by clicking a link. This feature is not available on all webphone versions. + +
    +
    +
    + Use External IP Server - If using as a web phone, you can set this to Y to use the servers External IP to register to instead of the IP Server. Default is empty.
    @@ -5245,9 +6314,14 @@ if ($ADD==99999) Telefono Contesto - Questo è il contesto dial plan che questo telefono cellulare sarà utilizzato per effettuare chiamate in uscita. Se si esegue un call center e non volete che i vostri agenti per essere in grado di effettuare chiamate in uscita al di fuori della domanda ViciDial per esempio, allora devi impostare questo campo ad un contesto dialplan che non esiste, qualcosa come agente-nodial. di default è di default.
    -
    +
    - Conf file segreto - Questo è il segreto, o la password, per il telefono cellulare in auto o IAX SIP-generated conf file per questo telefono. Limite è dash 20 caratteri alfanumerici e underscore accettato. Di default è di prova. + Allowed Codecs - You can define a comma delimited list of codecs to be set as the default codecs for this phone. Opziones for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Some of these codecs might not be available on your system, like g729 or g726. If the field is empty, then the system default codecs or the phone entry above this one will be used for the allowable codecs. Default is empty. + +
    +
    +
    + Allowed Codecs With Template- Setting this option to 1 will include the codecs defined above even if a conf file template is used. Default is 0.
    @@ -5557,7 +6631,7 @@ if ($ADD==99999)

    - Conf file segreto - Questo è il segreto, o la password, per il server in automatico IAX-generated conf file per questo server su altri server. Limite è dash 20 caratteri alfanumerici e underscore accettato. Di default è di prova. + Conf file segreto - Questo è il segreto, o la password, per il server in automatico IAX-generated conf file per questo server su altri server. Limite è dash 20 caratteri alfanumerici e underscore accettato. Di default è di prova. A strong conf file secret should be at least 8 characters in length and have lower case and upper case letters as well as at least one number.
    @@ -5619,6 +6693,11 @@ if ($ADD==99999)
    Supplente di registrazione IP Server - Questa impostazione è dove si può mettere un server IP o nome di altre macchine che possono essere utilizzati al posto del server_ip tra i link alle registrazioni ai admin pagine web. Il valore di default è vuota. +
    +
    +
    + External IP Server - This setting is where you can put a server IP or other machine name that can be used in place of the server_ip when using a webphone in the agent interface. For this to work you also must have the phones entry set to use the External IP Server. Default is empty. +

    @@ -5659,6 +6738,11 @@ if ($ADD==99999)
    Carrier Logging Attivo - Questa impostazione consente di registrare tutti i codici hangup ritorno per qualsiasi composizione lista delle chiamate in uscita che si sta ponendo. Predefinito è N. +
    +
    +
    + Custom Dialplan Entry - This field allows you to enter in any dialplan elements that you want for the server, the lines will be added to the default context. + @@ -5815,6 +6899,11 @@ if ($ADD==99999)
    Permita el logfile de la transferencia del agente - esta opcio`nregistrará a un logfile del texto en el webserver cada vez que unallamada se transfiere a un agente. El defecto es 0, inhabilitado. +
    +
    +
    + Enable Agent Disposition Logfile - This option will log to a text logfile on the webserver every time a call is dispositioned by an agent. Default is 0, disabled. +

    @@ -5888,6 +6977,11 @@ if ($ADD==99999)
    Suoni Web Directory - Questa auto-generata nome della directory è creata in modo casuale dal sistema come il luogo che l-archivio audio saranno mantenute. Tutti i file audio risiede in questa directory. +
    +
    +
    + Admin Web Directory - This is the directory that your administation web content, like admin.php, are in. Default is vicidial. To figure out your Admin web directory, it is everything that is between the domain name and the admin.php in the URL on this page, without the beginning and ending slashes. +

    @@ -5911,7 +7005,7 @@ if ($ADD==99999)

    - Consentire Custom Dialplan Entries - Questa opzione consente di immettere le linee personalizzate dialplan in Call menu. Di default è 0 per inattivo. + Consentire Custom Dialplan Entries - This option allows you to enter custom dialplan lines into Call Menu, Server and System Settings. Default is 0 for inactive.
    @@ -5928,11 +7022,86 @@ if ($ADD==99999)
    Consentire l-integrazione TTS - Questa impostazione consente di attivare Text To Speech integrazione con Cepstral. Questo è attualmente disponibile solo per le campagne di tipo uscita Indagine. Di default è 0 per disabili. +
    +
    +
    + Enable CallCard - This setting enables the CallCard features with ViciDial to allow for callers to use pin numbers and card_ids that have a balance of minutes and those balances can have agent talk time on customer calls to in-groups deducted. Default is 0 for disabled. + +
    +
    +
    + Enable Custom List Fields - This setting enables the custom list fields feature that allows for custom data fields to be defined in the administration web interface on a per-list basis and then have those fields available in a FORM tab to the agent in the agent web interface. Default is 0 for disabled. + +
    +
    +
    + First Login Trigger - This setting allows for the initial configuration of the server screen to be shown to the administrator when they first log into the system. + +
    +
    +
    + Default Phone Registrazione Password - This is the default registration password used when new phones are added to the system. Default is test. + +
    +
    +
    + Default Login Telefono Password - This is the default phone web login password used when new phones are added to the system. Default is test. + +
    +
    +
    + Default Server Password - This is the default server password used when new servers are added to the system. Default is test. + +
    +
    +
    + Slave Database Server - If you have a MySQL slave database server then enter the local IP address for that server here. This option is currently only used by the selected reports in the next option and has nothing to do with automatically configuring MySQL master-slave replication. Default is empty for disabled. + +
    +
    +
    + Rapporti to use Slave DB - 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 ViciDial system is running on. You must set up the MySQL slave replication before you can enable this option. Default is empty for disabled. + +
    +
    +
    + Default Field Labels - These 19 fields allow you to set the name as it will appear in the ViciDial agent interface as well as the administrative modify lead page. Default is empty which will use the hard-coded defaults in the agent interface. +

    Caratteristiche di Attivo QC - Questa opzione consente di attivare o disattivare la qualità o le caratteristiche di controllo della qualità. Il valore di default è 0 per inattive. +
    +
    +
    + Default Webphone - If set to 1, this option will make all new phones created have Set As Webphone set to Y. Default is 0. + +
    +
    +
    + Webphone System Key - If your system or provider requires it, this is where the System Key for the webphone should be entered in. Default is empty. + +
    +
    +
    + Default Codecs - You can define a comma delimited list of codecs to be set as the default codecs for all systems. Opziones for codecs include ulaw, alaw, gsm, g729, speex, g722, g723, g726, ilbc, ... Default is empty. + +
    +
    +
    + Custom Dialplan Entry - This field allows you to enter in any dialplan elements that you want for all of the asterisk servers, the lines will be added to the default context. + +
    +
    +
    + Default External IP Server - If set to 1, this option will make all new phones created have Use External IP Server set to Y. Default is 0. + +
    +
    +
    + Webphone URL - This is the URL of the webphone that will be used with this system if it is enabled in the phones record that an agent is using. Default is empty. +

    @@ -5973,6 +7142,16 @@ if ($ADD==99999)
    QueueMetrics EnterQueue prepend - este campo se utiliza para permitirprepending de una de las zonas de informaciones del vicidial_listdelante del número de telefono del cliente para los informesmodificados para requisitos particulares de QueueMetrics. El defectono es NINGUNO no poblar cualquier cosa. +
    +
    +
    + QueueMetrics Login-Out - This option affects how vicidial will log the logins and logouts of an agent in the queue_log. Default is STANDARD to use standard AGENTLOGIN AGENTLOGOFF, CALLBACK will use AGENTCALLBACKLOGIN and AGENTCALLBACKLOGOFF that QM will parse differently. + +
    +
    +
    + QueueMetrics CallStatus - This option if set to 0 will not put in the CALLSTATUS entry into queue_log when an agent dispositions a call. Default is 1 for enabled. +

    @@ -6140,6 +7319,8 @@ if ($ADD==7111111) ##### TEST VARIABLES ##### $vendor_lead_code = 'VENDOR:LEAD;CODE'; $list_id = 'LISTID'; + $list_name = 'LISTNAME'; + $list_description = 'LISTDESCRIZIONE'; $gmt_offset_now = 'GMTOFFSET'; $phone_code = '1'; $phone_number = '7275551212'; @@ -6198,6 +7379,14 @@ if ($ADD==7111111) $preset_number_f = 'preset_f'; $preset_dtmf_a = 'preset_dtmf_a'; $preset_dtmf_b = 'preset_dtmf_b'; + $did_id = 'did_id'; + $did_extension = 'did_extension'; + $did_pattern = 'did_pattern'; + $did_description = 'did_description'; + $closecallid = 'closecallid'; + $xfercallid = 'xfercallid'; + $agent_log_id = 'agent_log_id'; + $entry_list_id = 'entry_list_id'; echo "\n"; echo "\n"; @@ -6214,6 +7403,8 @@ if ($ADD==7111111) { $vendor_lead_code = eregi_replace(' ','+',$vendor_lead_code); $list_id = eregi_replace(' ','+',$list_id); + $list_name = eregi_replace(' ','+',$list_name); + $list_description = eregi_replace(' ','+',$list_description); $gmt_offset_now = eregi_replace(' ','+',$gmt_offset_now); $phone_code = eregi_replace(' ','+',$phone_code); $phone_number = eregi_replace(' ','+',$phone_number); @@ -6272,10 +7463,13 @@ if ($ADD==7111111) $preset_number_f = eregi_replace(' ','+',$preset_number_f); $preset_dtmf_a = eregi_replace(' ','+',$preset_dtmf_a); $preset_dtmf_b = eregi_replace(' ','+',$preset_dtmf_b); + $did_description = eregi_replace(' ','+',$did_description); } $script_text = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$script_text); $script_text = eregi_replace('--A--list_id--B--',"$list_id",$script_text); + $script_text = eregi_replace('--A--list_name--B--',"$list_name",$script_text); + $script_text = eregi_replace('--A--list_description--B--',"$list_description",$script_text); $script_text = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$script_text); $script_text = eregi_replace('--A--phone_code--B--',"$phone_code",$script_text); $script_text = eregi_replace('--A--phone_number--B--',"$phone_number",$script_text); @@ -6335,6 +7529,14 @@ if ($ADD==7111111) $script_text = eregi_replace('--A--preset_number_f--B--',"$preset_number_f",$script_text); $script_text = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$script_text); $script_text = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$script_text); + $script_text = eregi_replace('--A--did_id--B--',"$did_id",$script_text); + $script_text = eregi_replace('--A--did_extension--B--',"$did_extension",$script_text); + $script_text = eregi_replace('--A--did_pattern--B--',"$did_pattern",$script_text); + $script_text = eregi_replace('--A--did_description--B--',"$did_description",$script_text); + $script_text = eregi_replace('--A--closecallid--B--',"$closecallid",$script_text); + $script_text = eregi_replace('--A--xfercallid--B--',"$xfercallid",$script_text); + $script_text = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$script_text); + $script_text = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$script_text); $script_text = eregi_replace("\n","
    ",$script_text); @@ -6398,9 +7600,11 @@ if ($ADD=="1") } else { - echo "
    Numero Utente: $NWB#vicidial_users-user$NWE
    Numero Utente: $NWB#vicidial_users-user$NWE
    Password: $NWB#vicidial_users-pass$NWE
    Password: $NWB#vicidial_users-pass$NWE     Strength:
    Nome Completo: $NWB#vicidial_users-full_name$NWE
    Livello Utente:
    Numero Utente: $NWB#vicidial_users-user$NWE
    Numero Utente: $NWB#vicidial_users-user$NWE
    Password: $NWB#vicidial_users-pass$NWE
    Password: $NWB#vicidial_users-pass$NWE     Strength:
    Nome Completo: $NWB#vicidial_users-full_name$NWE
    \n"; if ($voi_count > 0) { @@ -6543,14 +7750,13 @@ if ($ADD==11) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; if ($SSoutbound_autodial_active > 0) { echo "\n"; echo "\n"; - echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; echo "
    Nome Campagna: $NWB#vicidial_campaigns-campaign_name$NWE
    Descrizione Campagna: $NWB#vicidial_campaigns-campaign_description$NWE
    Attivo: $NWB#vicidial_campaigns-active$NWE
    Extension del parking: $NWB#vicidial_campaigns-park_ext$NWE
    Nombre de fichero Del Parking: $NWB#vicidial_campaigns-park_file_name$NWE
    Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
    Permitir Closers: $NWB#vicidial_campaigns-allow_closers$NWE
    Livello Coda Chiamate: $NWB#vicidial_campaigns-hopper_level$NWE
    Livello Auto Dial:
    Livello Auto Dial: $NWB#vicidial_campaigns-campaign_script$NWE
    Esegui all`avvio della telefonata: $NWB#vicidial_campaigns-get_call_launch$NWE
    Esegui all`avvio della telefonata: $NWB#vicidial_campaigns-get_call_launch$NWE
    \n"; } @@ -6671,7 +7879,7 @@ if ($ADD==12) echo "
    Campagna da copiare:
    Descrizione Lista: $NWB#vicidial_lists-list_description$NWE
    Campagna:
    Aggiungere o eliminare:
    \n"; + echo "
    \n"; + + if ($LOGuser_level >= 9) + { + echo "
    Download numbers in this list to a file:
    \n"; + echo "\n"; + echo "
    \n"; + } + } + + +###################### +# ADD=171 display the ADD NUMBER TO Filter Phone Group FORM SCREEN and add a new number +###################### + +if ($ADD==171) + { + echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; echo "
    \n"; + echo ""; + + $stmt="SELECT filter_phone_group_id,filter_phone_group_name from vicidial_filter_phone_groups order by filter_phone_group_id"; + $rslt=mysql_query($stmt, $link); + $vfpg_to_print = mysql_num_rows($rslt); + + $o=0; + while ($vfpg_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $vfpg_list .= "\n"; + $o++; + } + + if (strlen($phone_numbers) > 2) + { + $PN = explode("\n",$phone_numbers); + $PNct = count($PN); + $p=0; + while ($p < $PNct) + { + if ( (ereg('delete',$stage)) and ($LOGdelete_from_dnc > 0) ) + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    FILTER PHONE GROUP NUMBER NOT DELETED - This phone number is not in the Filter Phone Group List: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="DELETE FROM vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
    FILTER PHONE GROUP NUMBER DELETED: $PN[$p] $filter_phone_group_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='FILTERPHONEGROUPS', event_type='DELETE', record_id='$PN[$p]', event_code='ADMIN DELETE NUMBER FROM FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where phone_number='$PN[$p]' and filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    FILTER PHONE GROUP NUMBER NOT ADDED - This phone number is already in the Filter Phone Group List: $PN[$p] $filter_phone_group_id\n";} + else + { + $stmt="INSERT INTO vicidial_filter_phone_numbers (phone_number,filter_phone_group_id) values('$PN[$p]','$filter_phone_group_id');"; + $rslt=mysql_query($stmt, $link); + + echo "
    FILTER PHONE GROUP NUMBER ADDED: $PN[$p] $filter_phone_group_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='FILTERPHONEGROUPS', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD NUMBER TO FILTER PHONE GROUP $filter_phone_group_id', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $p++; + } + } + + if ($LOGdelete_from_dnc > 0) + {echo "
    ADD OR DELETE NUMBERS FROM THE FILTER PHONE GROUP LIST
    \n";} + else + {echo "
    ADD NUMBERS TO THE FILTER PHONE GROUP LIST\n";} + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + if ($LOGdelete_from_dnc > 0) + { + echo "\n"; + } + echo "\n"; + echo "
    Filter Phone Gruppo:
    Numeri di telefono:

    (uno per ogni riga il numero di telefono unico)
    $NWB#vicidial_list-dnc$NWE
    Aggiungere o eliminare:
    \n"; + + if ($LOGuser_level >= 9) + { + echo "
    Download numbers in this list to a file:
    \n"; + echo "\n"; + echo "
    \n"; + } + } @@ -6960,10 +8284,12 @@ if ($ADD==1111) echo "
    Script: $NWB#vicidial_inbound_groups-ingroup_script$NWE
    Esegui all`avvio della telefonata: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    Esegui all`avvio della telefonata: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    \n"; } @@ -7218,6 +8544,34 @@ if ($ADD==1611) } +###################### +# ADD=1711 display the ADD NEW FILTER PHONE GROUP SCREEN +###################### + +if ($ADD==1711) + { + if ($LOGmodify_dids==1) + { + echo "
    \n"; + echo ""; + + echo "
    Add Filter Phone Group
    \n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Filter Phone ID Gruppo: (senza spazi or special characters)$NWB#vicidial_filter_phone_groups-filter_phone_group_id$NWE
    Filter Phone Nome Gruppo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filter Phone Group Descrizione: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    \n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + ###################### # ADD=11111 display the ADD NEW REMOTE AGENTS SCREEN ###################### @@ -7232,7 +8586,7 @@ if ($ADD==11111) echo "
    NUOVO OPERATORE REMOTO\n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "
    Inizio ID Utente: (solo cifre, incremented)$NWB#vicidial_remote_agents-user_start$NWE
    Inizio ID Utente: (solo cifre, incremented, must be an existing vicidial user)$NWB#vicidial_remote_agents-user_start$NWE
    Numero di Linee: (solo cifre)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP Server: \n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; +# echo "\n"; +# echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; +# echo "\n"; +# echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -7796,20 +9200,6 @@ if ($ADD==141111111111) echo "\n"; echo "\n"; @@ -7824,6 +9214,56 @@ if ($ADD==141111111111) } +###################### +# ADD=140111111111 display the ADD COPIED CARRIER SCREEN +###################### + +if ($ADD==140111111111) + { + if ($LOGmodify_servers==1) + { + echo "
    \n"; + echo ""; + + echo "
    Add Extension Group Entry\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Extension Gruppo: (senza spazi)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Estensione: (solo cifre)$NWB#vicidial_extension_groups-extension$NWE
    Rank: $NWB#vicidial_extension_groups-rank$NWE
    Campagnas Groups: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    \n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + ###################### # ADD=111111 display the ADD NEW USERS GROUP SCREEN ###################### @@ -7345,6 +8739,8 @@ if ($ADD==1111111) echo ""; echo ""; echo ""; + echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -7402,6 +8798,14 @@ if ($ADD==1111111) echo ""; echo ""; echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo ""; echo "
    "; # END Insert Field @@ -7603,21 +9007,21 @@ if ($ADD==11111111111) echo "
    Numero De Dial plan: (solo cifre)$NWB#phones-dialplan_number$NWE
    Buzon de voz: (solo cifre)$NWB#phones-voicemail_id$NWE
    CallerID De salida: (solo cifre)$NWB#phones-outbound_cid$NWE
    Direccion IP del telefono: (optional)$NWB#phones-phone_ip$NWE
    Direccion IP del ordenador: (optional)$NWB#phones-computer_ip$NWE
    Phone IP address: (optional)$NWB#phones-phone_ip$NWE
    Computer IP address: (optional)$NWB#phones-computer_ip$NWE
    IP Server: $NWB#phones-server_ip$NWE
    Login: $NWB#phones-login$NWE
    Password: $NWB#phones-pass$NWE
    Login: $NWB#phones-login$NWE
    Login Password: $NWB#phones-pass$NWE
    Registrazione Password: $NWB#phones-conf_secret$NWE     Strength:
    Esito: $NWB#phones-status$NWE
    Cuenta Activa: $NWB#phones-active$NWE
    Tipo Del telefono: $NWB#phones-phone_type$NWE
    Nome Completo: $NWB#phones-fullname$NWE
    Compania: $NWB#phones-company$NWE
    Foto: $NWB#phones-picture$NWE
    Company: $NWB#phones-company$NWE
    Picture: $NWB#phones-picture$NWE
    Protocollo Client: $NWB#phones-protocol$NWE
    Fuso Orario Locale: (No ajustar para el DST)$NWB#phones-local_gmt$NWE
    Dialplan entrata: $NWB#vicidial_server_carriers-dialplan_entry$NWE
    IP Server: $NWB#vicidial_server_carriers-server_ip$NWE
    \n"; + echo ""; + + echo "
    ADD COPIED CARRIER\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + + echo "\n"; + echo "
    Vettore ID: $NWB#vicidial_server_carriers-carrier_id$NWE
    Nome del vettore: $NWB#vicidial_server_carriers-carrier_name$NWE
    IP Server: $NWB#vicidial_server_carriers-server_ip$NWE
    Source Carrier: $NWB#vicidial_server_carriers-carrier_id$NWE
    \n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + + ###################### # ADD=151111111111 display the ADD NEW TTS ENTRY SCREEN ###################### @@ -7932,9 +9372,7 @@ if ($ADD==1111111111111) echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "
    Número de la Conferencia: (solo cifre)$NWB#conferences-conf_exten$NWE
    IP Server: $NWB#conferences-server_ip$NWE
    \n"; @@ -7963,9 +9401,7 @@ if ($ADD==11111111111111) echo "
    \n"; echo "\n"; echo "\n"; echo "\n"; echo "
    Número de la Conferencia: (solo cifre)$NWB#conferences-conf_exten$NWE
    IP Server: $NWB#conferences-server_ip$NWE
    \n"; @@ -8018,10 +9454,10 @@ if ($ADD=="2") { $user = 'AUTOGENERA'; } - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 10) and (!ereg('AUTOGENERA',$user)) ) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user_group) < 2) or ( (strlen($user) > 20) and (!ereg('AUTOGENERA',$user)) ) ) { echo "
    UTENTE NON AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    user id must be between 2 and 10 characters long\n"; + echo "
    user id must be between 2 and 20 characters long\n"; echo "
    il nome e la password devono essere lunghi almeno 2 caratteri\n"; echo "
    è necessario selezionare un gruppo di utenti\n"; } @@ -8118,6 +9554,16 @@ if ($ADD=="2") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8296,10 +9742,10 @@ if ($ADD=="2A") {echo "
    UTENTE NON AGGIUNTO - Esiste gia` un utente nel sistema con questo numero utente\n";} else { - if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 10) ) + if ( (strlen($user) < 2) or (strlen($pass) < 2) or (strlen($full_name) < 2) or (strlen($user) > 20) ) { echo "
    UTENTE NON AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    user id must be between 2 and 10 characters long\n"; + echo "
    user id must be between 2 and 20 characters long\n"; echo "
    il nome e la password devono essere lunghi almeno 2 caratteri\n"; echo "\n"; } @@ -8342,7 +9788,7 @@ if ($ADD=="2A") $stmt="UPDATE system_settings SET auto_user_add_value='$user';"; $rslt=mysql_query($stmt, $link); } - $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user=\"$source_user_id\";"; + $stmt="INSERT INTO vicidial_users (user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password) SELECT \"$user\",\"$pass\",\"$full_name\",user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password from vicidial_users where user=\"$source_user_id\";"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_inbound_group_agents (user,group_id,group_rank,group_weight,calls_today) SELECT \"$user\",group_id,group_rank,group_weight,\"0\" from vicidial_inbound_group_agents where user=\"$source_user_id\";"; @@ -8400,6 +9846,16 @@ if ($ADD=="2A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -8664,7 +10120,7 @@ if ($ADD==20) { echo "
    CAMPAIGN COPIED: $campaign_id copied from $source_campaign_id\n"; - $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$source_campaign_id';"; + $stmt="INSERT INTO vicidial_campaigns (campaign_name,campaign_id,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats) SELECT \"$campaign_name\",\"$campaign_id\",\"N\",dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,\"DISABLED\",campaign_allow_inbound,manual_dial_list_id,default_xfer_group,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,qc_get_record_launch,qc_show_recording,qc_shift_id,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_fourth_digit,survey_third_audio_file,survey_fourth_audio_file,survey_third_status,survey_fourth_status,survey_third_exten,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats from vicidial_campaigns where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$campaign_id');"; @@ -8682,6 +10138,12 @@ if ($ADD==20) $stmtA="INSERT INTO vicidial_pause_codes (pause_code,pause_code_name,billable,campaign_id) SELECT pause_code,pause_code_name,billable,\"$campaign_id\" from vicidial_pause_codes where campaign_id='$source_campaign_id';"; $rslt=mysql_query($stmtA, $link); + $stmtA="INSERT INTO vicidial_xfer_presets (campaign_id,preset_name,preset_number,preset_dtmf,preset_hide_number) SELECT \"$campaign_id\",preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + + $stmtA="INSERT INTO vicidial_xfer_stats (campaign_id,preset_name) SELECT \"$campaign_id\",preset_name from vicidial_xfer_presets where campaign_id='$source_campaign_id';"; + $rslt=mysql_query($stmtA, $link); + ### LOG INSERTION Admin Log Table ### $SQL_log = "$stmt|"; $SQL_log = ereg_replace(';','',$SQL_log); @@ -8967,6 +10429,49 @@ if ($ADD==28) } +###################### +# ADD=201 adds new preset to the campaign presets +###################### +if ($ADD==201) + { + echo ""; + $stmt="SELECT count(*) from vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    PRESET NOT ADDED - there is already an entry for this campaign with this preset\n";} + else + { + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) + { + echo "
    PRESET NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    preset name must be between 1 and 40 characters in length\n"; + echo "
    preset number must be between 2 and 50 characters in length\n"; + } + else + { + echo "
    PRESET ADDED: $campaign_id - $preset_name - $preset_number\n"; + + $stmt="INSERT INTO vicidial_xfer_presets(campaign_id,preset_name,preset_number,preset_dtmf,preset_hide_number) values('$campaign_id','$preset_name','$preset_number','$preset_dtmf','$preset_hide_number');"; + $rslt=mysql_query($stmt, $link); + + $stmt="INSERT INTO vicidial_xfer_stats(campaign_id,preset_name) values('$campaign_id','$preset_name');"; + $rslt=mysql_query($stmt, $link); + + ### 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='CAMPAIGN_PRESET', event_type='ADD', record_id='$campaign_id', event_code='ADMIN AGGIUNGI CAMPAGNA PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $SUB=201; + $ADD=31; + } + + ###################### # ADD=211 adds the new list to the system ###################### @@ -9066,7 +10571,7 @@ if ($ADD==2111) } else { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,web_form_address_two,start_call_url,dispo_call_url) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','');"; + $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,web_form_address_two,start_call_url,dispo_call_url,add_lead_url) values('$group_id','$group_name','$group_color','$active','" . mysql_real_escape_string($web_form_address) . "','$voicemail_ext','$next_agent_call','$fronter_display','$script_id','$get_call_launch','','','','');"; $rslt=mysql_query($stmt, $link); $stmtA="INSERT INTO vicidial_campaign_stats (campaign_id) values('$group_id');"; @@ -9131,7 +10636,7 @@ if ($ADD==2011) } else { - $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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 from vicidial_inbound_groups where group_id=\"$source_group_id\";"; + $stmt="INSERT INTO vicidial_inbound_groups (group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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,ignore_list_script_override,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,timer_action_destination,calculate_estimated_hold_seconds,add_lead_url,eht_minimum_prompt_filename,eht_minimum_prompt_no_block,eht_minimum_prompt_seconds) SELECT \"$group_id\",\"$group_name\",group_color,\"N\",web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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,ignore_list_script_override,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,timer_action_destination,calculate_estimated_hold_seconds,add_lead_url,eht_minimum_prompt_filename,eht_minimum_prompt_no_block,eht_minimum_prompt_seconds from vicidial_inbound_groups where group_id=\"$source_group_id\";"; $rslt=mysql_query($stmt, $link); echo "
    GRUPPO AGGIUNTO: $group_id\n"; @@ -9223,7 +10728,7 @@ if ($ADD==2411) } else { - $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id) SELECT \"$did_pattern\",\"$did_description\",did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id from vicidial_inbound_dids where did_id=\"$source_did\";"; + $stmt="INSERT INTO vicidial_inbound_dids (did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number) SELECT \"$did_pattern\",\"$did_description\",did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number from vicidial_inbound_dids where did_id=\"$source_did\";"; $rslt=mysql_query($stmt, $link); $stmt="SELECT did_id from vicidial_inbound_dids where did_pattern='$did_pattern';"; @@ -9271,31 +10776,45 @@ if ($ADD==2511) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    CALL menu non AGGIUNTI - there is already a CALL MENU in the system with this ID\n";} + { + echo "
    CALL menu non AGGIUNTI - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + if ( (preg_match("/^vicidial$/i",$menu_id)) or (preg_match("/^vicidial-auto$/i",$menu_id)) or (preg_match("/^general$/i",$menu_id)) or (preg_match("/^globals$/i",$menu_id)) or (preg_match("/^default$/i",$menu_id)) or (preg_match("/^trunkinbound$/i",$menu_id)) or (preg_match("/^loopback-no-log$/i",$menu_id)) or (preg_match("/^monitor_exit$/i",$menu_id)) or (preg_match("/^monitor$/i",$menu_id)) ) { echo "
    CALL menu non AGGIUNTI - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    Call Menu ID deve essere compresa tra 2 e 50 caratteri di lunghezza e non contengono ' '.\n"; + echo "
    Call Menu ID cannot use reserved words: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + $ADD=1500; } else { - $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');"; - $rslt=mysql_query($stmt, $link); + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) ) + { + echo "
    CALL menu non AGGIUNTI - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    Call Menu ID deve essere compresa tra 2 e 50 caratteri di lunghezza e non contengono ' '.\n"; + $ADD=1500; + } + else + { + $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name) values('$menu_id','$menu_name');"; + $rslt=mysql_query($stmt, $link); - echo "
    CALL MENU AGGIUNTO: $menu_id $menu_name\n"; + echo "
    CALL MENU AGGIUNTO: $menu_id $menu_name\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='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); + ### 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='CALLMENUS', event_type='ADD', record_id='$menu_id', event_code='ADMIN ADD CALL MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } } } - $ADD=3511; } @@ -9324,34 +10843,87 @@ if ($ADD==2611) $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); if ($row[0] > 0) - {echo "
    CALL menu non AGGIUNTI - there is already a CALL MENU in the system with this ID\n";} + { + echo "
    CALL menu non AGGIUNTI - there is already a CALL MENU in the system with this ID\n"; + $ADD=1500; + } else { - if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + if ( (preg_match("/^vicidial$/i",$menu_id)) or (preg_match("/^vicidial-auto$/i",$menu_id)) or (preg_match("/^general$/i",$menu_id)) or (preg_match("/^globals$/i",$menu_id)) or (preg_match("/^default$/i",$menu_id)) or (preg_match("/^trunkinbound$/i",$menu_id)) or (preg_match("/^loopback-no-log$/i",$menu_id)) or (preg_match("/^monitor_exit$/i",$menu_id)) or (preg_match("/^monitor$/i",$menu_id)) ) { echo "
    CALL menu non AGGIUNTI - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    Call Menu ID deve essere compresa tra 2 e 50 caratteri di lunghezza e non contengono ' '.\n"; + echo "
    Call Menu ID cannot use reserved words: vicidial, vicidial-auto, general, globals, default, trunkinbound, loopback-no-log, monitor_exit, monitor\n"; + $ADD=1500; } else { - $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group) SELECT \"$menu_id\",\"$menu_name\",menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group from vicidial_call_menu where menu_id=\"$source_menu\";"; + if ( (strlen($menu_id) < 2) or (eregi(' ',$menu_id)) or (strlen($source_menu) < 2) or (eregi(' ',$source_menu)) ) + { + echo "
    CALL menu non AGGIUNTI - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    Call Menu ID deve essere compresa tra 2 e 50 caratteri di lunghezza e non contengono ' '.\n"; + $ADD=1500; + } + else + { + $stmt="INSERT INTO vicidial_call_menu (menu_id,menu_name,menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group) SELECT \"$menu_id\",\"$menu_name\",menu_prompt,menu_timeout,menu_timeout_prompt,menu_invalid_prompt,menu_repeat,menu_time_check,call_time_id,track_in_vdac,custom_dialplan_entry,tracking_group from vicidial_call_menu where menu_id=\"$source_menu\";"; + $rslt=mysql_query($stmt, $link); + + $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; + $rslt=mysql_query($stmtA, $link); + + echo "
    CALL MENU AGGIUNTO: $menu_id - $menu_name\n"; + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$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='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ADD=3511; + } + } + } + } + + +###################### +# ADD=2711 adds the new filter phone group to the system +###################### + +if ($ADD==2711) + { + echo ""; + $stmt="SELECT count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    PHONE FILTER GROUP NOT ADDED - there is already a PHONE FILTER GROUP in the system with this ID\n";} + else + { + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_id) > 20) or (eregi(' ',$filter_phone_group_id)) ) + { + echo "
    PHONE FILTER GRUPPO NON AGGIUNTO - per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    Phone Filter L`ID deve essere lungo tra i 2 e i 20 caratteri e non deve contenere ' '.\n"; + } + else + { + $stmt="INSERT INTO vicidial_filter_phone_groups (filter_phone_group_id,filter_phone_group_name,filter_phone_group_description) values('$filter_phone_group_id','$filter_phone_group_name','$filter_phone_group_description');"; $rslt=mysql_query($stmt, $link); - $stmtA="INSERT INTO vicidial_call_menu_options (menu_id,option_value,option_description,option_route,option_route_value,option_route_value_context) SELECT \"$menu_id\",option_value,option_description,option_route,option_route_value,option_route_value_context from vicidial_call_menu_options where menu_id='$source_menu';"; - $rslt=mysql_query($stmtA, $link); - - echo "
    CALL MENU AGGIUNTO: $menu_id - $menu_name\n"; + echo "
    PHONE FILTER GRUPPO AGGIUNTO: $filter_phone_group_id $filter_phone_group_name\n"; ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|$stmtA"; + $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='CALLMENUS', event_type='COPY', record_id='$menu_id', event_code='ADMIN COPY MENU', 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='FILTERPHONEGROUPS', event_type='ADD', record_id='$filter_phone_group_id', event_code='ADMIN AGGIUNGI FILTRO PHONE GROUP', event_sql=\"$SQL_log\", event_notes='$filter_phone_group_name';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=3511; + $ADD=3711; } @@ -9369,30 +10941,94 @@ if ($ADD==21111) {echo "
    AGENTES ALEJADOS NO AGREGADOS - hay ya una entrada alejada de los agentes comenzando con esta ID del usuario\n";} else { - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + ### check for a valid user that will be associated with this account + $stmt="SELECT count(*) from vicidial_users where user='$user_start';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    OPERATORI REMOTI NOT ADDED - you must use a valid user as the user_start for remote agents\n";} + else { - echo "
    AGENTES ALEJADOS NO AGREGADOS - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    El comienzo de la ID del usuario y la extension externa deben ser por lo menos 2 caracteres en longitud\n"; + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start >= '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    OPERATORI REMOTI NOT ADDED - your number of lines overlaps with another remote agent\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
    AGENTES ALEJADOS NO AGREGADOS - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    El comienzo de la ID del usuario y la extension externa deben ser por lo menos 2 caracteres en longitud\n"; + } + else + { + $stmt="INSERT INTO vicidial_remote_agents (user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns) values('$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $rslt=mysql_query($stmt, $link); + + echo "
    OPERATORE REMOTO AGGIUNTO: $user_start\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='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + $ADD=10000; + } + + +###################### +# ADD=22111 adds new extension group entry to the system +###################### + +if ($ADD==22111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    EXTENSION GROUP ENTRY NOT ADDED - there is already an extension group entry with these values\n";} + else + { + if ( (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) ) + { + echo "
    EXTENSION GROUP ENTRY NOT ADDED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    extension group id and extension and rank must be at least 2 characters in length\n"; } else { - $stmt="INSERT INTO vicidial_remote_agents values('','$user_start','$number_of_lines','$server_ip','$conf_exten','$status','$campaign_id','$groups_value');"; + $stmt="INSERT INTO vicidial_extension_groups (extension_group_id,extension,rank,campaign_groups) values('$extension_group_id','$extension','$rank','$campaign_groups');"; $rslt=mysql_query($stmt, $link); - echo "
    OPERATORE REMOTO AGGIUNTO: $user_start\n"; + $stmt="SELECT extension_id from vicidial_extension_groups where extension_group_id='$extension_group_id' and extension='$extension';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + + echo "
    EXTENSION GROUP ENTRY ADDED: $extension_id - $extension_group_id - $extension\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='REMOTEAGENTS', event_type='ADD', record_id='$user_start', event_code='ADMIN ADD REMOTE AGENT', 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='EXTENGROUP', event_type='ADD', record_id='$extension_id', event_code='ADMIN ADD EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } } - $ADD=10000; + $ADD=12000; } + ###################### # ADD=211111 adds new user group to the system ###################### @@ -9830,7 +11466,7 @@ if ($ADD==21111111111) { echo "
    TELEFONO AGGIUNTO\n"; - $stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid');"; + $stmt="INSERT INTO phones (extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,protocol,local_gmt,outbound_cid,conf_secret) values('$extension','$dialplan_number','$voicemail_id','$phone_ip','$computer_ip','$server_ip','$login','$pass','$status','$active','$phone_type','$fullname','$company','$picture','$protocol','$local_gmt','$outbound_cid','$conf_secret');"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -9957,7 +11593,7 @@ if ($ADD==211111111111) { echo "
    SERVER AGGIUNTO\n"; - $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version) values('$server_id','$server_description','$server_ip','$active','$asterisk_version');"; + $stmt="INSERT INTO servers (server_id,server_description,server_ip,active,asterisk_version,conf_secret) values('$server_id','$server_description','$server_ip','$active','$asterisk_version','$SSdefault_server_password');"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y',sounds_update='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -10109,6 +11745,45 @@ if ($ADD==241111111111) } +###################### +# ADD=240111111111 adds copied server carrier to the system +###################### + +if ($ADD==240111111111) + { + echo ""; + $stmt="SELECT count(*) from vicidial_server_carriers where carrier_id='$carrier_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    Vettore non AGGIUNTO - vi è già un elemento portante del sistema con questo ID\n";} + else + { + if ( (strlen($carrier_id) < 2) or (strlen($server_ip) < 7) ) + {echo "
    Vettore non AGGIUNTO - Per favore torna indietro e ricontrolla i dati inseriti\n";} + else + { + echo "
    COPIED CARRIER ADDED\n"; + + $stmt="INSERT INTO vicidial_server_carriers (carrier_id,carrier_name,registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,server_ip,active,carrier_description) SELECT \"$carrier_id\",\"$carrier_name\",registration_string,template_id,account_entry,protocol,globals_string,dialplan_entry,\"$server_ip\",\"N\",carrier_description from vicidial_server_carriers where carrier_id=\"$source_carrier\";"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; + $rslt=mysql_query($stmtA, $link); + + ### 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='CARRIERS', event_type='COPY', record_id='$carrier_id', event_code='ADMIN COPY CARRIER', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + $ADD=341111111111; + } + + ###################### # ADD=251111111111 adds new tts entry to the system ###################### @@ -10461,11 +12136,11 @@ if ($ADD=="4A") } echo "
    UTENTE MODIFICATO - ADMIN: $user\n"; - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',delete_users='$delete_users',delete_user_groups='$delete_user_groups',delete_lists='$delete_lists',delete_campaigns='$delete_campaigns',delete_ingroups='$delete_ingroups',delete_remote_agents='$delete_remote_agents',load_leads='$load_leads',campaign_detail='$campaign_detail',ast_admin_access='$ast_admin_access',ast_delete_phones='$ast_delete_phones',delete_scripts='$delete_scripts',modify_leads='$modify_leads',hotkeys_active='$hotkeys_active',change_agent_campaign='$change_agent_campaign',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',delete_filters='$delete_filters',alter_agent_interface_options='$alter_agent_interface_options',closer_default_blended='$closer_default_blended',delete_call_times='$delete_call_times',modify_call_times='$modify_call_times',modify_users='$modify_users',modify_campaigns='$modify_campaigns',modify_lists='$modify_lists',modify_scripts='$modify_scripts',modify_filters='$modify_filters',modify_ingroups='$modify_ingroups',modify_usergroups='$modify_usergroups',modify_remoteagents='$modify_remoteagents',modify_servers='$modify_servers',view_reports='$view_reports',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',add_timeclock_log='$add_timeclock_log',modify_timeclock_log='$modify_timeclock_log',delete_timeclock_log='$delete_timeclock_log',alter_custphone_override='$alter_custphone_override',vdc_agent_api_access='$vdc_agent_api_access',modify_inbound_dids='$modify_inbound_dids',delete_inbound_dids='$delete_inbound_dids',active='$active',download_lists='$download_lists',agent_shift_enforcement_override='$agent_shift_enforcement_override',manager_shift_enforcement_override='$manager_shift_enforcement_override',export_reports='$export_reports',delete_from_dnc='$delete_from_dnc',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',callcard_admin='$callcard_admin',agent_choose_blended='$agent_choose_blended',realtime_block_user_info='$realtime_block_user_info',custom_fields_modify='$custom_fields_modify',force_change_password='$force_change_password' where user='$user';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmt|"; + $SQL_log = "$stmt|$stmt_grp_values|"; $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='USERS', event_type='MODIFY', record_id='$user', event_code='ADMIN MODIFY USER', event_sql=\"$SQL_log\", event_notes='';"; @@ -10513,6 +12188,16 @@ if ($ADD=="4A") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10694,7 +12379,7 @@ if ($ADD=="4B") } echo "
    UTENTE MODIFICATO - ADMIN: $user\n"; - $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',alter_custphone_override='$alter_custphone_override',active='$active',agent_shift_enforcement_override='$agent_shift_enforcement_override',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five' where user='$user';"; + $stmt="UPDATE vicidial_users set pass='$pass',full_name='$full_name',user_level='$user_level',user_group='$user_group',phone_login='$phone_login',phone_pass='$phone_pass',hotkeys_active='$hotkeys_active',agent_choose_ingroups='$agent_choose_ingroups',closer_campaigns='$groups_value',scheduled_callbacks='$scheduled_callbacks',agentonly_callbacks='$agentonly_callbacks',agentcall_manual='$agentcall_manual',vicidial_recording='$vicidial_recording',vicidial_transfers='$vicidial_transfers',closer_default_blended='$closer_default_blended',vicidial_recording_override='$vicidial_recording_override',alter_custdata_override='$alter_custdata_override',qc_enabled='$qc_enabled',qc_user_level='$qc_user_level',qc_pass='$qc_pass',qc_finish='$qc_finish',qc_commit='$qc_commit',alter_custphone_override='$alter_custphone_override',active='$active',agent_shift_enforcement_override='$agent_shift_enforcement_override',email='$email',user_code='$user_code',territory='$territory',allow_alerts='$allow_alerts',agent_choose_territories='$agent_choose_territories',custom_one='$custom_one',custom_two='$custom_two',custom_three='$custom_three',custom_four='$custom_four',custom_five='$custom_five',voicemail_id='$voicemail_id',agent_call_log_view_override='$agent_call_log_view_override',agent_choose_blended='$agent_choose_blended' where user='$user';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -10746,6 +12431,16 @@ if ($ADD=="4B") $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -10973,6 +12668,16 @@ if ($ADD==4) $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } ###################################### ##### BEGIN Add/Update group info in Vtiger @@ -11265,7 +12970,7 @@ if ($ADD==41) if ( (!ereg("DISABLED",$list_order_mix)) and ($hopper_level < 100) ) {$hopper_level='100';} - $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where campaign_id='$campaign_id';"; + $stmtA="UPDATE vicidial_campaigns set campaign_name='$campaign_name',active='$active',dial_status_a='$dial_status_a',dial_status_b='$dial_status_b',dial_status_c='$dial_status_c',dial_status_d='$dial_status_d',dial_status_e='$dial_status_e',lead_order='$lead_order',allow_closers='$allow_closers',hopper_level='$hopper_level', $adlSQL next_agent_call='$next_agent_call', local_call_time='$local_call_time', voicemail_ext='$voicemail_ext', dial_timeout='$dial_timeout', dial_prefix='$dial_prefix', campaign_cid='$campaign_cid', campaign_vdad_exten='$campaign_vdad_exten', web_form_address='" . mysql_real_escape_string($web_form_address) . "', park_ext='$park_ext', park_file_name='$park_file_name', campaign_rec_exten='$campaign_rec_exten', campaign_recording='$campaign_recording', campaign_rec_filename='$campaign_rec_filename', campaign_script='$script_id', get_call_launch='$get_call_launch', am_message_exten='$am_message_exten', amd_send_to_vmx='$amd_send_to_vmx', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number',xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',lead_filter_id='$lead_filter_id',alt_number_dialing='$alt_number_dialing',scheduled_callbacks='$scheduled_callbacks',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',safe_harbor_exten='$safe_harbor_exten',wrapup_seconds='$wrapup_seconds',wrapup_message='$wrapup_message',closer_campaigns='$groups_value',use_internal_dnc='$use_internal_dnc',allcalls_delay='$allcalls_delay',omit_phone_code='$omit_phone_code',dial_method='$dial_method',available_only_ratio_tally='$available_only_ratio_tally',adaptive_dropped_percentage='$adaptive_dropped_percentage',adaptive_maximum_level='$adaptive_maximum_level',adaptive_latest_server_time='$adaptive_latest_server_time',adaptive_intensity='$adaptive_intensity',adaptive_dl_diff_target='$adaptive_dl_diff_target',concurrent_transfers='$concurrent_transfers',auto_alt_dial='$auto_alt_dial',agent_pause_codes_active='$agent_pause_codes_active',campaign_description='$campaign_description',campaign_changedate='$SQLdate',campaign_stats_refresh='$campaign_stats_refresh',disable_alter_custdata='$disable_alter_custdata',no_hopper_leads_logins='$no_hopper_leads_logins',list_order_mix='$list_order_mix',campaign_allow_inbound='$campaign_allow_inbound',manual_dial_list_id='$manual_dial_list_id',default_xfer_group='$default_xfer_group',xfer_groups='$XFERgroups_value',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',disable_alter_custphone='$disable_alter_custphone',display_queue_count='$display_queue_count',manual_dial_filter='$manual_dial_filter',agent_clipboard_copy='$agent_clipboard_copy',agent_extended_alt_dial='$agent_extended_alt_dial',use_campaign_dnc='$use_campaign_dnc',three_way_call_cid='$three_way_call_cid',three_way_dial_prefix='$three_way_dial_prefix',web_form_target='$web_form_target',vtiger_search_category='$vtiger_search_category',vtiger_create_call_record='$vtiger_create_call_record',vtiger_create_lead_record='$vtiger_create_lead_record',vtiger_screen_login='$vtiger_screen_login',cpd_amd_action='$cpd_amd_action',agent_allow_group_alias='$agent_allow_group_alias',default_group_alias='$default_group_alias',vtiger_search_dead='$vtiger_search_dead',vtiger_status_call='$vtiger_status_call',drop_lockout_time='$drop_lockout_time',quick_transfer_button='$quick_transfer_button',prepopulate_transfer_preset='$prepopulate_transfer_preset',drop_rate_group='$drop_rate_group',view_calls_in_queue='$view_calls_in_queue',view_calls_in_queue_launch='$view_calls_in_queue_launch',grab_calls_in_queue='$grab_calls_in_queue',call_requeue_button='$call_requeue_button',pause_after_each_call='$pause_after_each_call',no_hopper_dialing='$no_hopper_dialing',agent_dial_owner_only='$agent_dial_owner_only',agent_display_dialable_leads='$agent_display_dialable_leads',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',waitforsilence_options='$waitforsilence_options',agent_select_territories='$agent_select_territories',crm_popup_login='$crm_popup_login',crm_login_address='" . mysql_real_escape_string($crm_login_address) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',use_custom_cid='$use_custom_cid',scheduled_callbacks_alert='$scheduled_callbacks_alert',queuemetrics_callstatus_override='$queuemetrics_callstatus',extension_appended_cidname='$extension_appended_cidname',scheduled_callbacks_count='$scheduled_callbacks_count',manual_dial_override='$manual_dial_override',blind_monitor_warning='$blind_monitor_warning',blind_monitor_message='" . mysql_real_escape_string($blind_monitor_message) . "',blind_monitor_filename='$blind_monitor_filename',inbound_queue_no_dial='$inbound_queue_no_dial',timer_action_destination='$timer_action_destination',enable_xfer_presets='$enable_xfer_presets',hide_xfer_number_to_dial='$hide_xfer_number_to_dial',manual_dial_prefix='$manual_dial_prefix',customer_3way_hangup_logging='$customer_3way_hangup_logging',customer_3way_hangup_seconds='$customer_3way_hangup_seconds',customer_3way_hangup_action='$customer_3way_hangup_action',ivr_park_call='$ivr_park_call',ivr_park_call_agi='$ivr_park_call_agi',manual_preview_dial='$manual_preview_dial',realtime_agent_time_stats='$realtime_agent_time_stats' where campaign_id='$campaign_id';"; $rslt=mysql_query($stmtA, $link); if ($reset_hopper == 'Y') @@ -11998,6 +13703,48 @@ if ($ADD==49) } +###################### +# ADD=401 modify campaign preset in the system +###################### + +if ($ADD==401) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) or (strlen($preset_number) < 1) ) + { + echo "
    PRESET NOT MODIFIED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    preset name must be between 1 and 40 characters in length\n"; + echo "
    preset number must be between 2 and 50 characters in length\n"; + } + else + { + echo "
    PRESET MODIFIED: $campaign_id - $preset_name - $preset_number\n"; + + $stmt="UPDATE vicidial_xfer_presets SET preset_dtmf='$preset_dtmf',preset_number='$preset_number',preset_hide_number='$preset_hide_number' where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + + ### 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='CAMPAIGN_PRESET', event_type='MODIFY', record_id='$campaign_id', event_code='ADMIN MODIFY CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name - $preset_number';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } + + ###################### # ADD=411 submit list modifications to the system ###################### @@ -12129,7 +13876,7 @@ if ($ADD==4111) echo "
    GRUPPO MODIFICATO: $group_id\n"; - $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number' where group_id='$group_id';"; + $stmt="UPDATE vicidial_inbound_groups set group_name='$group_name', group_color='$group_color', active='$active', web_form_address='" . mysql_real_escape_string($web_form_address) . "', voicemail_ext='$voicemail_ext', next_agent_call='$next_agent_call', fronter_display='$fronter_display', ingroup_script='$script_id', get_call_launch='$get_call_launch', xferconf_a_dtmf='$xferconf_a_dtmf',xferconf_a_number='$xferconf_a_number', xferconf_b_dtmf='$xferconf_b_dtmf',xferconf_b_number='$xferconf_b_number',drop_action='$drop_action',drop_call_seconds='$drop_call_seconds',drop_exten='$drop_exten',call_time_id='$call_time_id',after_hours_action='$after_hours_action',after_hours_message_filename='$after_hours_message_filename',after_hours_exten='$after_hours_exten',after_hours_voicemail='$after_hours_voicemail',welcome_message_filename='$welcome_message_filename',moh_context='$moh_context',onhold_prompt_filename='$onhold_prompt_filename',prompt_interval='$prompt_interval',agent_alert_exten='$agent_alert_exten',agent_alert_delay='$agent_alert_delay',default_xfer_group='$default_xfer_group',queue_priority='$queue_priority',drop_inbound_group='$drop_inbound_group',ingroup_recording_override='$ingroup_recording_override',ingroup_rec_filename='$ingroup_rec_filename',afterhours_xfer_group='$afterhours_xfer_group',qc_enabled='$qc_enabled',qc_statuses='$QC_statuses',qc_shift_id='$qc_shift_id',qc_get_record_launch='$qc_get_record_launch',qc_show_recording='$qc_show_recording',qc_web_form_address='$qc_web_form_address',qc_script='$qc_script',play_place_in_line='$play_place_in_line',play_estimate_hold_time='$play_estimate_hold_time',hold_time_option='$hold_time_option',hold_time_option_seconds='$hold_time_option_seconds',hold_time_option_exten='$hold_time_option_exten',hold_time_option_voicemail='$hold_time_option_voicemail',hold_time_option_xfer_group='$hold_time_option_xfer_group',hold_time_option_callback_filename='$hold_time_option_callback_filename',hold_time_option_callback_list_id='$hold_time_option_callback_list_id',hold_recall_xfer_group='$hold_recall_xfer_group',no_delay_call_route='$no_delay_call_route',play_welcome_message='$play_welcome_message',answer_sec_pct_rt_stat_one='$answer_sec_pct_rt_stat_one',answer_sec_pct_rt_stat_two='$answer_sec_pct_rt_stat_two',default_group_alias='$default_group_alias',no_agent_no_queue='$no_agent_no_queue',no_agent_action='$no_agent_action',no_agent_action_value='$no_agent_action_value',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',timer_action='$timer_action',timer_action_message='$timer_action_message',timer_action_seconds='$timer_action_seconds',start_call_url='" . mysql_real_escape_string($start_call_url) . "',dispo_call_url='" . mysql_real_escape_string($dispo_call_url) . "',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',ignore_list_script_override='$ignore_list_script_override',extension_appended_cidname='$extension_appended_cidname',uniqueid_status_display='$uniqueid_status_display',uniqueid_status_prefix='$uniqueid_status_prefix',hold_time_option_minimum='$hold_time_option_minimum',hold_time_option_press_filename='$hold_time_option_press_filename',hold_time_option_callmenu='$hold_time_option_callmenu',onhold_prompt_no_block='$onhold_prompt_no_block',onhold_prompt_seconds='$onhold_prompt_seconds',hold_time_option_no_block='$hold_time_option_no_block',hold_time_option_prompt_seconds='$hold_time_option_prompt_seconds',hold_time_second_option='$hold_time_second_option',hold_time_third_option='$hold_time_third_option',wait_hold_option_priority='$wait_hold_option_priority',wait_time_option='$wait_time_option',wait_time_second_option='$wait_time_second_option',wait_time_third_option='$wait_time_third_option',wait_time_option_seconds='$wait_time_option_seconds',wait_time_option_exten='$wait_time_option_exten',wait_time_option_voicemail='$wait_time_option_voicemail',wait_time_option_xfer_group='$wait_time_option_xfer_group',wait_time_option_callmenu='$wait_time_option_callmenu',wait_time_option_callback_filename='$wait_time_option_callback_filename',wait_time_option_callback_list_id='$wait_time_option_callback_list_id',wait_time_option_press_filename='$wait_time_option_press_filename',wait_time_option_no_block='$wait_time_option_no_block',wait_time_option_prompt_seconds='$wait_time_option_prompt_seconds',timer_action_destination='$timer_action_destination',calculate_estimated_hold_seconds='$calculate_estimated_hold_seconds',add_lead_url='" . mysql_real_escape_string($add_lead_url) . "',eht_minimum_prompt_filename='$eht_minimum_prompt_filename',eht_minimum_prompt_no_block='$eht_minimum_prompt_no_block',eht_minimum_prompt_seconds='$eht_minimum_prompt_seconds' where group_id='$group_id';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12169,7 +13916,7 @@ if ($ADD==4311) { echo "
    HA MODIFICATO: $did_pattern\n"; - $stmt="UPDATE vicidial_inbound_dids set did_pattern='$did_pattern',did_description='$did_description',did_active='$did_active',did_route='$did_route',extension='$extension',exten_context='$exten_context',voicemail_ext='$voicemail_ext',phone='$phone',server_ip='$server_ip',user='$user',user_unavailable_action='$user_unavailable_action',user_route_settings_ingroup='$user_route_settings_ingroup',group_id='$group_id',call_handle_method='$call_handle_method',agent_search_method='$agent_search_method',list_id='$list_id',campaign_id='$campaign_id',phone_code='$phone_code',menu_id='$menu_id' where did_id='$did_id';"; + $stmt="UPDATE vicidial_inbound_dids set did_pattern='$did_pattern',did_description='$did_description',did_active='$did_active',did_route='$did_route',extension='$extension',exten_context='$exten_context',voicemail_ext='$voicemail_ext',phone='$phone',server_ip='$server_ip',user='$user',user_unavailable_action='$user_unavailable_action',user_route_settings_ingroup='$user_route_settings_ingroup',group_id='$group_id',call_handle_method='$call_handle_method',agent_search_method='$agent_search_method',list_id='$list_id',campaign_id='$campaign_id',phone_code='$phone_code',menu_id='$menu_id',record_call='$record_call',filter_inbound_number='$filter_inbound_number',filter_phone_group_id='$filter_phone_group_id',filter_url='$filter_url',filter_action='$filter_action',filter_extension='$filter_extension',filter_exten_context='$filter_exten_context',filter_voicemail_ext='$filter_voicemail_ext',filter_phone='$filter_phone',filter_server_ip='$filter_server_ip',filter_user='$filter_user',filter_user_unavailable_action='$filter_user_unavailable_action',filter_user_route_settings_ingroup='$filter_user_route_settings_ingroup',filter_group_id='$filter_group_id',filter_call_handle_method='$filter_call_handle_method',filter_agent_search_method='$filter_agent_search_method',filter_list_id='$filter_list_id',filter_campaign_id='$filter_campaign_id',filter_phone_code='$filter_phone_code',filter_menu_id='$filter_menu_id',filter_clean_cid_number='$filter_clean_cid_number' where did_id='$did_id';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -12231,18 +13978,26 @@ if ($ADD==4511) if ($option_route == "INGROUP") { - if (isset($_GET["IGhandle_method_$h"])) {$IGhandle_method=$_GET["IGhandle_method_$h"];} - elseif (isset($_POST["IGhandle_method_$h"])) {$IGhandle_method=$_POST["IGhandle_method_$h"];} - if (isset($_GET["IGsearch_method_$h"])) {$IGsearch_method=$_GET["IGsearch_method_$h"];} - elseif (isset($_POST["IGsearch_method_$h"])) {$IGsearch_method=$_POST["IGsearch_method_$h"];} - if (isset($_GET["IGlist_id_$h"])) {$IGlist_id=$_GET["IGlist_id_$h"];} - elseif (isset($_POST["IGlist_id_$h"])) {$IGlist_id=$_POST["IGlist_id_$h"];} - if (isset($_GET["IGcampaign_id_$h"])) {$IGcampaign_id=$_GET["IGcampaign_id_$h"];} - elseif (isset($_POST["IGcampaign_id_$h"])) {$IGcampaign_id=$_POST["IGcampaign_id_$h"];} - if (isset($_GET["IGphone_code_$h"])) {$IGphone_code=$_GET["IGphone_code_$h"];} - elseif (isset($_POST["IGphone_code_$h"])) {$IGphone_code=$_POST["IGphone_code_$h"];} + if (isset($_GET["IGhandle_method_$h"])) {$IGhandle_method=$_GET["IGhandle_method_$h"];} + elseif (isset($_POST["IGhandle_method_$h"])) {$IGhandle_method=$_POST["IGhandle_method_$h"];} + if (isset($_GET["IGsearch_method_$h"])) {$IGsearch_method=$_GET["IGsearch_method_$h"];} + elseif (isset($_POST["IGsearch_method_$h"])) {$IGsearch_method=$_POST["IGsearch_method_$h"];} + if (isset($_GET["IGlist_id_$h"])) {$IGlist_id=$_GET["IGlist_id_$h"];} + elseif (isset($_POST["IGlist_id_$h"])) {$IGlist_id=$_POST["IGlist_id_$h"];} + if (isset($_GET["IGcampaign_id_$h"])) {$IGcampaign_id=$_GET["IGcampaign_id_$h"];} + elseif (isset($_POST["IGcampaign_id_$h"])) {$IGcampaign_id=$_POST["IGcampaign_id_$h"];} + if (isset($_GET["IGphone_code_$h"])) {$IGphone_code=$_GET["IGphone_code_$h"];} + elseif (isset($_POST["IGphone_code_$h"])) {$IGphone_code=$_POST["IGphone_code_$h"];} + if (isset($_GET["IGvid_enter_filename_$h"])) {$IGvid_enter_filename=$_GET["IGvid_enter_filename_$h"];} + elseif (isset($_POST["IGvid_enter_filename_$h"])) {$IGvid_enter_filename=$_POST["IGvid_enter_filename_$h"];} + if (isset($_GET["IGvid_id_number_filename_$h"])) {$IGvid_id_number_filename=$_GET["IGvid_id_number_filename_$h"];} + elseif (isset($_POST["IGvid_id_number_filename_$h"])) {$IGvid_id_number_filename=$_POST["IGvid_id_number_filename_$h"];} + if (isset($_GET["IGvid_confirm_filename_$h"])) {$IGvid_confirm_filename=$_GET["IGvid_confirm_filename_$h"];} + elseif (isset($_POST["IGvid_confirm_filename_$h"])) {$IGvid_confirm_filename=$_POST["IGvid_confirm_filename_$h"];} + if (isset($_GET["IGvid_validate_digits_$h"])) {$IGvid_validate_digits=$_GET["IGvid_validate_digits_$h"];} + elseif (isset($_POST["IGvid_validate_digits_$h"])) {$IGvid_validate_digits=$_POST["IGvid_validate_digits_$h"];} - $option_route_value_context = "$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code"; + $option_route_value_context = "$IGhandle_method,$IGsearch_method,$IGlist_id,$IGcampaign_id,$IGphone_code,$IGvid_enter_filename,$IGvid_id_number_filename,$IGvid_confirm_filename,$IGvid_validate_digits"; } if ($non_latin < 1) @@ -12334,32 +14089,32 @@ if ($ADD==4511) ###################### -# ADD=41111 modify remote agents info in the system +# ADD=4711 modify filter phone group info in the system ###################### -if ($ADD==41111) +if ($ADD==4711) { - if ($LOGmodify_remoteagents==1) + if ($LOGmodify_dids==1) { echo ""; - if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + if ( (strlen($filter_phone_group_id) < 2) or (strlen($filter_phone_group_name) < 2) or (strlen($filter_phone_group_name) > 40) ) { - echo "
    AGENTES ALEJADOS NO MODIFICADOS - Per favore torna indietro e ricontrolla i dati inseriti\n"; - echo "
    El comienzo de la ID del usuario y la extension externa deben ser por lo menos 2 caracteres en longitud\n"; + echo "
    FILTER PHONE GRUPO NO MODIFICADO - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    Filter Phone Nome Gruppo and ID must be at least 2 characters in length\n"; } else { - $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value' where remote_agent_id='$remote_agent_id';"; + $stmt="UPDATE vicidial_filter_phone_groups set filter_phone_group_name='$filter_phone_group_name', filter_phone_group_description='$filter_phone_group_description' where filter_phone_group_id='$filter_phone_group_id';"; $rslt=mysql_query($stmt, $link); - echo "
    LOS AGENTES ALEJADOS SE MODIFICARON\n"; + echo "
    FILTER PHONE GRUPPO MODIFICATO\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='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', 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='FILTERPHONEGROUPS', event_type='MODIFY', record_id='$filter_phone_group_id', event_code='ADMIN FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } @@ -12369,10 +14124,108 @@ if ($ADD==41111) echo "Non hai l`autorizzazione per accedere a questa pagina\n"; exit; } + $ADD=3711; # go to filter phone group modification form below + } + + +###################### +# ADD=41111 modify remote agents info in the system +###################### + +if ($ADD==41111) + { + if ($LOGmodify_remoteagents==1) + { + echo ""; + + $stmt="SELECT count(*) from vicidial_users where user='$user_start';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "
    OPERATORI REMOTI NOT MODIFIED - you must use a valid user as the user_start for remote agents\n";} + else + { + ### check for closest remote agents to this account to ensure no overlapping + $user_finish = ($user_start + $number_of_lines); + $stmt="SELECT count(*) from vicidial_remote_agents where user_start > '$user_start' and user_start < '$user_finish';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + if ($row[0] > 0) + {echo "
    OPERATORI REMOTI NOT MODIFIED - your number of lines overlaps with another remote agent\n";} + else + { + if ( (strlen($server_ip) < 2) or (strlen($user_start) < 2) or (strlen($campaign_id) < 2) or (strlen($conf_exten) < 2) ) + { + echo "
    AGENTES ALEJADOS NO MODIFICADOS - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    El comienzo de la ID del usuario y la extension externa deben ser por lo menos 2 caracteres en longitud\n"; + } + else + { + $stmt="UPDATE vicidial_remote_agents set user_start='$user_start', number_of_lines='$number_of_lines', server_ip='$server_ip', conf_exten='$conf_exten', status='$status', campaign_id='$campaign_id', closer_campaigns='$groups_value',extension_group='$extension_group' where remote_agent_id='$remote_agent_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
    LOS AGENTES ALEJADOS SE MODIFICARON\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='REMOTEAGENTS', event_type='MODIFY', record_id='$remote_agent_id', event_code='ADMIN MODIFY REMOTE AGENT', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } $ADD=31111; # go to remote agents modification form below } +###################### +# ADD=42111 modify extenison group entry in the system +###################### + +if ($ADD==42111) + { + if ($LOGmodify_remoteagents==1) + { + echo ""; + + if ( (strlen($extension_id) < 1) or (strlen($extension_group_id) < 2) or (strlen($extension) < 2) or (strlen($rank) < 1) ) + { + echo "
    EXTENSION GROUP ENTRY NOT MODIFIED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    Extension group id and extension must be at least 2 characters in length\n"; + } + else + { + $stmt="UPDATE vicidial_extension_groups set extension_group_id='$extension_group_id', extension='$extension', rank='$rank', campaign_groups='$campaign_groups' where extension_id='$extension_id';"; + $rslt=mysql_query($stmt, $link); + + echo "
    EXTENSION GROUP ENTRY 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='EXTENGROUP', event_type='MODIFY', record_id='$extension_id', event_code='ADMIN MODIFY EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $ADD=32111; # go to extension group modification form below + } + + ###################### # ADD=411111 modify user group info in the system ###################### @@ -12408,8 +14261,17 @@ if ($ADD==411111) $VGROUP_vgroups .= "$agent_status_viewable_groups[$p] "; $p++; } - - $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time' where user_group='$OLDuser_group';"; + $k=0; + $multi_count = count($allowed_reports); + $multi_array = $allowed_reports; + while ($k < $multi_count) + { + $new_field_value .= "$multi_array[$k],"; + $k++; + } + $allowed_reports = preg_replace("/,$/","",$new_field_value); + + $stmt="UPDATE vicidial_user_groups set user_group='$user_group', group_name='$group_name',allowed_campaigns='$campaigns_value',qc_allowed_campaigns='$qc_campaigns_value',qc_allowed_inbound_groups='$qc_groups_value',group_shifts='$GROUP_shifts',forced_timeclock_login='$forced_timeclock_login',shift_enforcement='$shift_enforcement',agent_status_viewable_groups='$VGROUP_vgroups',agent_status_view_time='$agent_status_view_time',agent_call_log_view='$agent_call_log_view',agent_xfer_consultative='$agent_xfer_consultative',agent_xfer_dial_override='$agent_xfer_dial_override',agent_xfer_vm_transfer='$agent_xfer_vm_transfer',agent_xfer_blind_transfer='$agent_xfer_blind_transfer',agent_xfer_dial_with_customer='$agent_xfer_dial_with_customer',agent_xfer_park_customer_dial='$agent_xfer_park_customer_dial',agent_fullscreen='$agent_fullscreen',allowed_reports='$allowed_reports',webphone_url_override='" . mysql_real_escape_string($webphone_url_override) . "',webphone_systemkey_override='$webphone_systemkey_override',webphone_dialpad_override='$webphone_dialpad_override' where user_group='$OLDuser_group';"; $rslt=mysql_query($stmt, $link); echo "
    GRUPPO UTENTI MODIFICATO\n"; @@ -12630,7 +14492,7 @@ if ($ADD==411111111) $ct_friday_stop = preg_replace('/\D/', '', $ct_friday_stop); $ct_saturday_start = preg_replace('/\D/', '', $ct_saturday_start); $ct_saturday_stop = preg_replace('/\D/', '', $ct_saturday_stop); - $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop' where call_time_id='$call_time_id';"; + $stmt="UPDATE vicidial_call_times set call_time_name='$call_time_name', call_time_comments='$call_time_comments', ct_default_start='$ct_default_start', ct_default_stop='$ct_default_stop', ct_sunday_start='$ct_sunday_start', ct_sunday_stop='$ct_sunday_stop', ct_monday_start='$ct_monday_start', ct_monday_stop='$ct_monday_stop', ct_tuesday_start='$ct_tuesday_start', ct_tuesday_stop='$ct_tuesday_stop', ct_wednesday_start='$ct_wednesday_start', ct_wednesday_stop='$ct_wednesday_stop', ct_thursday_start='$ct_thursday_start', ct_thursday_stop='$ct_thursday_stop', ct_friday_start='$ct_friday_start', ct_friday_stop='$ct_friday_stop', ct_saturday_start='$ct_saturday_start', ct_saturday_stop='$ct_saturday_stop', default_afterhours_filename_override='$default_afterhours_filename_override', sunday_afterhours_filename_override='$sunday_afterhours_filename_override', monday_afterhours_filename_override='$monday_afterhours_filename_override', tuesday_afterhours_filename_override='$tuesday_afterhours_filename_override', wednesday_afterhours_filename_override='$wednesday_afterhours_filename_override', thursday_afterhours_filename_override='$thursday_afterhours_filename_override', friday_afterhours_filename_override='$friday_afterhours_filename_override', saturday_afterhours_filename_override='$saturday_afterhours_filename_override' where call_time_id='$call_time_id';"; $rslt=mysql_query($stmt, $link); echo "
    TIEMPO DE LA LLAMADA MODIFICADO\n"; @@ -12783,7 +14645,7 @@ if ($ADD==41111111111) { echo "
    TELEFONO MODIFICATO: $extension\n"; - $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email' where extension='$old_extension' and server_ip='$old_server_ip';"; + $stmt="UPDATE phones set extension='$extension', dialplan_number='$dialplan_number', voicemail_id='$voicemail_id', phone_ip='$phone_ip', computer_ip='$computer_ip', server_ip='$server_ip', login='$login', pass='$pass', status='$status', active='$active', phone_type='$phone_type', fullname='$fullname', company='$company', picture='$picture', protocol='$protocol', local_gmt='$local_gmt', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', login_user='$login_user', login_pass='$login_pass', login_campaign='$login_campaign', park_on_extension='$park_on_extension', conf_on_extension='$conf_on_extension', VICIDIAL_park_on_extension='$VICIDIAL_park_on_extension', VICIDIAL_park_on_filename='$VICIDIAL_park_on_filename', monitor_prefix='$monitor_prefix', recording_exten='$recording_exten', voicemail_exten='$voicemail_exten', voicemail_dump_exten='$voicemail_dump_exten', ext_context='$ext_context', dtmf_send_extension='$dtmf_send_extension', call_out_number_group='$call_out_number_group', client_browser='$client_browser', install_directory='$install_directory', local_web_callerID_URL='" . mysql_real_escape_string($local_web_callerID_URL) . "', VICIDIAL_web_URL='" . mysql_real_escape_string($VICIDIAL_web_URL) . "', AGI_call_logging_enabled='$AGI_call_logging_enabled', user_switching_enabled='$user_switching_enabled', conferencing_enabled='$conferencing_enabled', admin_hangup_enabled='$admin_hangup_enabled', admin_hijack_enabled='$admin_hijack_enabled', admin_monitor_enabled='$admin_monitor_enabled', call_parking_enabled='$call_parking_enabled', updater_check_enabled='$updater_check_enabled', AFLogging_enabled='$AFLogging_enabled', QUEUE_ACTION_enabled='$QUEUE_ACTION_enabled', CallerID_popup_enabled='$CallerID_popup_enabled', voicemail_button_enabled='$voicemail_button_enabled', enable_fast_refresh='$enable_fast_refresh', fast_refresh_rate='$fast_refresh_rate', enable_persistant_mysql='$enable_persistant_mysql', auto_dial_next_number='$auto_dial_next_number', VDstop_rec_after_each_call='$VDstop_rec_after_each_call', DBX_server='$DBX_server', DBX_database='$DBX_database', DBX_user='$DBX_user', DBX_pass='$DBX_pass', DBX_port='$DBX_port', DBY_server='$DBY_server', DBY_database='$DBY_database', DBY_user='$DBY_user', DBY_pass='$DBY_pass', DBY_port='$DBY_port', outbound_cid='$outbound_cid', enable_sipsak_messages='$enable_sipsak_messages', email='$email', template_id='$template_id', conf_override='$conf_override',phone_context='$phone_context',phone_ring_timeout='$phone_ring_timeout',conf_secret='$conf_secret', delete_vm_after_email='$delete_vm_after_email',is_webphone='$is_webphone',use_external_server_ip='$use_external_server_ip',codecs_list='$codecs_list',codecs_with_template='$codecs_with_template',webphone_dialpad='$webphone_dialpad' where extension='$old_extension' and server_ip='$old_server_ip';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y' and server_ip='$server_ip';"; @@ -12916,7 +14778,7 @@ if ($ADD==411111111111) {echo "
    SERVIDOR NO MODIFICADO - Per favore torna indietro e ricontrolla i dati inseriti\n";} else { - $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output', vicidial_balance_active='$vicidial_balance_active',balance_trunks_offlimits='$balance_trunks_offlimits',recording_web_link='$recording_web_link',alt_server_ip='$alt_server_ip',active_asterisk_server='$active_asterisk_server',generate_vicidial_conf='$generate_vicidial_conf',rebuild_conf_files='$rebuild_conf_files',outbound_calls_per_second='$outbound_calls_per_second',sounds_update='$sounds_update',vicidial_recording_limit='$vicidial_recording_limit',carrier_logging_active='$carrier_logging_active',vicidial_balance_rank='$vicidial_balance_rank',rebuild_music_on_hold='$rebuild_music_on_hold',active_agent_login_server='$active_agent_login_server',conf_secret='$conf_secret' where server_id='$old_server_id';"; + $stmt="UPDATE servers set server_id='$server_id',server_description='$server_description',server_ip='$server_ip',active='$active',asterisk_version='$asterisk_version', max_vicidial_trunks='$max_vicidial_trunks', telnet_host='$telnet_host', telnet_port='$telnet_port', ASTmgrUSERNAME='$ASTmgrUSERNAME', ASTmgrSECRET='$ASTmgrSECRET', ASTmgrUSERNAMEupdate='$ASTmgrUSERNAMEupdate', ASTmgrUSERNAMElisten='$ASTmgrUSERNAMElisten', ASTmgrUSERNAMEsend='$ASTmgrUSERNAMEsend', local_gmt='$local_gmt', voicemail_dump_exten='$voicemail_dump_exten', answer_transfer_agent='$answer_transfer_agent', ext_context='$ext_context', sys_perf_log='$sys_perf_log', vd_server_logs='$vd_server_logs', agi_output='$agi_output', vicidial_balance_active='$vicidial_balance_active',balance_trunks_offlimits='$balance_trunks_offlimits',recording_web_link='$recording_web_link',alt_server_ip='$alt_server_ip',active_asterisk_server='$active_asterisk_server',generate_vicidial_conf='$generate_vicidial_conf',rebuild_conf_files='$rebuild_conf_files',outbound_calls_per_second='$outbound_calls_per_second',sounds_update='$sounds_update',vicidial_recording_limit='$vicidial_recording_limit',carrier_logging_active='$carrier_logging_active',vicidial_balance_rank='$vicidial_balance_rank',rebuild_music_on_hold='$rebuild_music_on_hold',active_agent_login_server='$active_agent_login_server',conf_secret='$conf_secret',external_server_ip='$external_server_ip',custom_dialplan_entry='$custom_dialplan_entry' where server_id='$old_server_id';"; $rslt=mysql_query($stmt, $link); $stmtA="UPDATE servers SET rebuild_conf_files='Y',rebuild_music_on_hold='Y' where generate_vicidial_conf='Y' and active_asterisk_server='Y';"; @@ -13096,7 +14958,7 @@ if ($ADD==451111111111) {echo "
    TTS iscrizione non MODIFICATI - Per favore torna indietro e ricontrolla i dati inseriti\n";} else { - $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_text=\"$tts_text\" where tts_id='$tts_id';"; + $stmt="UPDATE vicidial_tts_prompts set tts_name='$tts_name',active='$active',tts_voice='$tts_voice',tts_text=\"$tts_text\" where tts_id='$tts_id';"; $rslt=mysql_query($stmt, $link); echo "
    TTS voce modificata: $tts_id\n"; @@ -13288,7 +15150,7 @@ if ($ADD==4111111111111) { echo "
    CONFERENCIA MODIFICADA: $conf_exten\n"; - $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } } @@ -13325,7 +15187,7 @@ if ($ADD==41111111111111) { echo "
    VICIDIAL CONFERENCIA MODIFICADA: $conf_exten\n"; - $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',server_ip='$server_ip',extension='$extension' where conf_exten='$old_conf_exten';"; + $stmt="UPDATE vicidial_conferences set conf_exten='$conf_exten',extension='$extension' where conf_exten='$old_conf_exten' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); } @@ -13352,7 +15214,17 @@ if ($ADD==411111111111111) echo "
    IMPOSTAZIONI DI SISTEMA MODIFICATE\n"; - $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform';"; + $k=0; + $multi_count = count($reports_use_slave_db); + $multi_array = $reports_use_slave_db; + while ($k < $multi_count) + { + $new_field_value .= "$multi_array[$k],"; + $k++; + } + $reports_use_slave_db = preg_replace("/,$/","",$new_field_value); + + $stmt="UPDATE system_settings set use_non_latin='$use_non_latin',webroot_writable='$webroot_writable',enable_queuemetrics_logging='$enable_queuemetrics_logging',queuemetrics_server_ip='$queuemetrics_server_ip',queuemetrics_dbname='$queuemetrics_dbname',queuemetrics_login='$queuemetrics_login',queuemetrics_pass='$queuemetrics_pass',queuemetrics_url='$queuemetrics_url',queuemetrics_log_id='$queuemetrics_log_id',queuemetrics_eq_prepend='$queuemetrics_eq_prepend',vicidial_agent_disable='$vicidial_agent_disable',allow_sipsak_messages='$allow_sipsak_messages',admin_home_url='$admin_home_url',enable_agc_xfer_log='$enable_agc_xfer_log',timeclock_end_of_day='$timeclock_end_of_day',vdc_header_date_format='$vdc_header_date_format',vdc_customer_date_format='$vdc_customer_date_format',vdc_header_phone_format='$vdc_header_phone_format',vdc_agent_api_active='$vdc_agent_api_active',enable_vtiger_integration='$enable_vtiger_integration',vtiger_server_ip='$vtiger_server_ip',vtiger_dbname='$vtiger_dbname',vtiger_login='$vtiger_login',vtiger_pass='$vtiger_pass',vtiger_url='$vtiger_url',qc_features_active='$qc_features_active',outbound_autodial_active='$outbound_autodial_active',outbound_calls_per_second='$outbound_calls_per_second',enable_tts_integration='$enable_tts_integration',agentonly_callback_campaign_lock='$agentonly_callback_campaign_lock',sounds_central_control_active='$sounds_central_control_active',sounds_web_server='$sounds_web_server',sounds_web_directory='$sounds_web_directory',active_voicemail_server='$active_voicemail_server',auto_dial_limit='$auto_dial_limit',user_territories_active='$user_territories_active',allow_custom_dialplan='$allow_custom_dialplan',enable_second_webform='$enable_second_webform',default_webphone='$default_webphone',default_external_server_ip='$default_external_server_ip',webphone_url='" . mysql_real_escape_string($webphone_url) . "',enable_agc_dispo_log='$enable_agc_dispo_log',custom_dialplan_entry='$custom_dialplan_entry',queuemetrics_loginout='$queuemetrics_loginout',callcard_enabled='$callcard_enabled',queuemetrics_callstatus='$queuemetrics_callstatus',default_codecs='$default_codecs',admin_web_directory='$admin_web_directory',label_title='$label_title',label_first_name='$label_first_name',label_middle_initial='$label_middle_initial',label_last_name='$label_last_name',label_address1='$label_address1',label_address2='$label_address2',label_address3='$label_address3',label_city='$label_city',label_state='$label_state',label_province='$label_province',label_postal_code='$label_postal_code',label_vendor_lead_code='$label_vendor_lead_code',label_gender='$label_gender',label_phone_number='$label_phone_number',label_phone_code='$label_phone_code',label_alt_phone='$label_alt_phone',label_security_phrase='$label_security_phrase',label_email='$label_email',label_comments='$label_comments',custom_fields_enabled='$custom_fields_enabled',slave_db_server='$slave_db_server',reports_use_slave_db='$reports_use_slave_db',webphone_systemkey='$webphone_systemkey',first_login_trigger='$first_login_trigger',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -13770,6 +15642,28 @@ if ($ADD==5511) $ADD='3511'; # go to call menu modification below } +###################### +# ADD=5711 confirmation before deletion of filter phone group +###################### + +if ($ADD==5711) + { + echo ""; + + if ( (strlen($filter_phone_group_id) < 2) or ($LOGdelete_dids < 1) ) + { + echo "
    FILTER PHONE GROUP NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    filter_phone_group_id be at least 2 characters in length\n"; + } + else + { + echo "
    FILTER PHONE GROUP DELETION CONFIRMATION: $filter_phone_group_id\n"; + echo "

    Clicca qui per cancellareFILTER PHONE GROUP $filter_phone_group_id


    \n"; + } + + $ADD='3711'; # go to filter phone group modification below + } + ###################### # ADD=51111 confirmation before deletion of remote agent record ###################### @@ -13792,6 +15686,28 @@ if ($ADD==51111) $ADD='31111'; # go to remote agent modification below } +###################### +# ADD=52111 confirmation before deletion of extension group record +###################### + +if ($ADD==52111) + { + echo ""; + + if ( (strlen($extension_id) < 1) or ($LOGdelete_remote_agents < 1) ) + { + echo "
    EXTENSION GROUP ENTRY NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    extension_id be at least 1 characters in length\n"; + } + else + { + echo "
    EXTENSION GROUP ENTRY DELETION CONFIRMATION: $extension_id\n"; + echo "

    Clicca qui per cancellareextension group entry $extension_id


    \n"; + } + + $ADD='32111'; # go to extension group modification below + } + ###################### # ADD=511111 confirmation before deletion of user group record ###################### @@ -14268,6 +16184,12 @@ if ($ADD==61) $stmt="DELETE from vicidial_campaigns_list_mix where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); + $stmt="DELETE from vicidial_xfer_presets where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE from vicidial_xfer_stats where campaign_id='$campaign_id';"; + $rslt=mysql_query($stmt, $link); + echo "
    QUITAR LOS PLOMOS DE LA TOLVA DE LA LISTA DE VIEJA TOLVA DE LA CAMPAÚA ($campaign_id)\n"; $stmt="DELETE from vicidial_hopper where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); @@ -14425,7 +16347,7 @@ if ($ADD==62) ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "
    $stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -14438,11 +16360,16 @@ if ($ADD==62) $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; + $queuemetrics_loginout = $row[6]; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### if ($enable_queuemetrics_logging > 0) { + $QM_LOGOFF = 'AGENTLOGOFF'; + if ($queuemetrics_loginout=='CALLBACK') + {$QM_LOGOFF = 'AGENTCALLBACKLOGOFF';} + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); @@ -14450,7 +16377,7 @@ if ($ADD==62) $agent_logged_in=''; $time_logged_in=''; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/$VLA_user[$k]' and verb='AGENTLOGIN' order by time_id desc limit 1;"; + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/$VLA_user[$k]' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "
    $stmtB\n";} $qml_ct = mysql_num_rows($rsltB); @@ -14459,12 +16386,13 @@ if ($ADD==62) $row=mysql_fetch_row($rsltB); $agent_logged_in = $row[0]; $time_logged_in = $row[1]; + $phone_logged_in = $row[2]; } $time_logged_in = ($now_date_epoch - $time_logged_in); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='$VLA_user[$k]$agents',data2='$time_logged_in';"; + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; if ($DB) {echo "
    $stmtB\n";} $rsltB=mysql_query($stmtB, $linkB); } @@ -14731,6 +16659,51 @@ if ($ADD==68) $ADD=31; # go to campaign modification form below } + +###################### +# ADD=601 delete preset in the system +###################### + +if ($ADD==601) + { + if ($LOGmodify_campaigns==1) + { + echo ""; + + if ( (strlen($campaign_id) < 2) or (strlen($preset_name) < 1) ) + { + echo "
    CAMPAIGN PRESET NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    preset name must be between 1 and 40 characters in length\n"; + } + else + { + echo "
    CAMPAIGN PRESET DELETED: $campaign_id - $preset_name\n"; + + $stmt="DELETE FROM vicidial_xfer_presets where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + + $stmt="DELETE FROM vicidial_xfer_stats where campaign_id='$campaign_id' and preset_name='$preset_name';"; + $rslt=mysql_query($stmt, $link); + + ### 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='CAMPAIGN_PRESETS', event_type='DELETE', record_id='$campaign_id', event_code='ADMIN DELETE CAMPAIGN PRESET', event_sql=\"$SQL_log\", event_notes='Preset: $preset_name';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + $SUB=201; + $ADD=31; # go to campaign modification form below + } + + ###################### # ADD=611 delete list record and all leads within it ###################### @@ -14884,6 +16857,42 @@ if ($ADD==6511) $ADD='1500'; # go to call menu list } +###################### +# ADD=6711 delete filter phone group record +###################### + +if ($ADD==6711) + { + echo ""; + + if ( (strlen($filter_phone_group_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_dids < 1) ) + { + echo "
    FILTER PHONE GROUP NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    filter_phone_group_id be at least 1 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + $stmtA="DELETE from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmtA, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$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='FILTERPHONEGROUPS', event_type='DELETE', record_id='$filter_phone_group_id', event_code='ADMIN DELETE FILTER PHONE GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    FILTER PHONE GROUP DELETION COMPLETED: $filter_phone_group_id\n"; + echo "

    \n"; + } + + $ADD='1700'; # go to filter phone group list + } + ###################### # ADD=61111 delete remote agent record ###################### @@ -14917,6 +16926,41 @@ if ($ADD==61111) $ADD='10000'; # go to remote agents list } +###################### +# ADD=62111 delete extension group record +###################### + +if ($ADD==62111) + { + echo ""; + + if ( (strlen($extension_id) < 1) or ($CoNfIrM != 'YES') or ($LOGdelete_remote_agents < 1) ) + { + echo "
    EXTENSION GROUP ENTRY NOT DELETED - Per favore torna indietro e ricontrolla i dati inseriti\n"; + echo "
    extension_id be at least 1 characters in length\n"; + } + else + { + $stmt="DELETE from vicidial_extension_groups where extension_id='$extension_id' limit 1;"; + $rslt=mysql_query($stmt, $link); + + ### 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='EXTENGROUP', event_type='DELETE', record_id='$extension_id', event_code='ADMIN DELETE EXTENSION GROUP', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "
    EXTENSION GROUP ENTRY DELETION COMPLETED: $extension_id\n"; + echo "

    \n"; + } + + $ADD='12000'; # go to extension group list + } + + + ###################### # ADD=611111 delete user group record ###################### @@ -15606,7 +17650,7 @@ if ($ADD==3) echo "
    \n"; echo ""; - $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$user';"; + $stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $user_id = $row[0]; @@ -15683,6 +17727,13 @@ if ($ADD==3) $user_custom_three = $row[73]; $user_custom_four = $row[74]; $user_custom_five = $row[75]; + $voicemail_id = $row[76]; + $agent_call_log_view_override = $row[77]; + $callcard_admin = $row[78]; + $agent_choose_blended = $row[79]; + $realtime_block_user_info = $row[80]; + $custom_fields_modify = $row[81]; + $force_change_password = $row[82]; if ( ($user_level >= $LOGuser_level) and ($LOGuser_level < 9) ) { @@ -15700,10 +17751,18 @@ if ($ADD==3) else {echo "\n";} } + if ($SScustom_fields_enabled < 1) + { + echo "\n"; + } + echo "\n"; echo "
    \n"; echo "\n"; - echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -15756,6 +17816,7 @@ if ($ADD==3) { echo "\n"; echo "\n"; + echo "\n"; if ($SSuser_territories_active > 0) { echo "\n"; @@ -15775,6 +17836,7 @@ if ($ADD==3) echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -15808,6 +17870,10 @@ if ($ADD==3) } if ($LOGuser_level > 8) { + echo "\n"; + + echo "\n"; + echo "\n"; #9BB9FB @@ -15830,6 +17896,11 @@ if ($ADD==3) echo "\n"; echo "\n"; + if ($SScustom_fields_enabled > 0) + { + echo "\n"; + } + echo "\n"; echo "\n"; echo "\n"; @@ -15855,6 +17926,7 @@ if ($ADD==3) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -15863,7 +17935,7 @@ if ($ADD==3) echo "\n"; } - echo "\n"; + echo "\n"; echo "
    Numero Utente: $user$NWB#vicidial_users-user$NWE
    Password: $NWB#vicidial_users-pass$NWE
    Password: $NWB#vicidial_users-pass$NWE     Strength:
    Force Change Password: $NWB#vicidial_users-force_change_password$NWE
    Nome Completo: $NWB#vicidial_users-full_name$NWE
    Livello Utente:
    Login Telefono: $NWB#vicidial_users-phone_login$NWE
    Password Telefono: $NWB#vicidial_users-phone_pass$NWE
    Attivo: $NWB#vicidial_users-active$NWE
    Casella Vocale ID: voicemail chooser$NWB#vicidial_users-voicemail_id$NWE
    Email:$NWB#vicidial_users-optional$NWE
    Utente Code: $NWB#vicidial_users-optional$NWE
    Main Territorio: $NWB#vicidial_users-optional$NWE
    OPZIONI INTERFACCIA OPERATORE:
    El Agente Elige Ingroups: $NWB#vicidial_users-agent_choose_ingroups$NWE
    Agent Choose Blended: $NWB#vicidial_users-agent_choose_blended$NWE
    Agente Scegli Territori: $NWB#vicidial_users-agent_choose_territories$NWE
    Agente Alter clienti Sovrascrive Telefono:$NWB#vicidial_users-alter_custphone_override$NWE
    Agente Maiusc esecuzione Sovrascrive: $NWB#vicidial_users-agent_shift_enforcement_override$NWE
    Agent Call Log View Override: $NWB#vicidial_users-agent_call_log_view_override$NWE
    Alert Attivato: $alert_enabled $NWB#vicidial_users-alert_enabled$NWE
    ADMIN REPORT OPTIONS:
    Realtime Block Utente Info: $NWB#vicidial_users-realtime_block_user_info$NWE
    OPZIONI INTERFACCIA AMMINISTRATORE:
    Rapporti Export: $NWB#vicidial_users-export_reports$NWE
    Cancellare dalle liste DNC: $NWB#vicidial_users-delete_from_dnc$NWE
    Custom Fields Modify: $NWB#vicidial_users-custom_fields_modify$NWE
    Modifica Campagne: $NWB#vicidial_users-modify_sections$NWE
    Dettagli Campagna: $NWB#vicidial_users-campaign_detail$NWE
    Cancella Campagne: $NWB#vicidial_users-delete_campaigns$NWE
    Modifique El Tiempo De la Llamadas: $NWB#vicidial_users-modify_call_times$NWE
    EliminareOrari Chiamata: $NWB#vicidial_users-delete_call_times$NWE
    Modifica Server: $NWB#vicidial_users-modify_sections$NWE
    CallCard Access: $NWB#vicidial_users-modify_sections$NWE
    Agente API Accesso:$NWB#vicidial_users-vdc_agent_api_access$NWE
    Aggiungi orologio Entra record: $NWB#vicidial_users-add_timeclock_log$NWE
    Shift Manager esecuzione Sovrascrive: $NWB#vicidial_users-manager_shift_enforcement_override$NWE
    \n"; if ($LOGdelete_users > 0) @@ -15919,7 +17991,7 @@ if ($ADD==31) $enable_vtiger_integration_LU = $row[0]; $vtiger_url_LU = $row[1]; - $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$campaign_id';"; + $stmt="SELECT campaign_id,campaign_name,active,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,park_ext,park_file_name,web_form_address,allow_closers,hopper_level,auto_dial_level,next_agent_call,local_call_time,voicemail_ext,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,amd_send_to_vmx,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,lead_filter_id,drop_call_seconds,drop_action,safe_harbor_exten,display_dialable_count,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,dial_method,available_only_ratio_tally,adaptive_dropped_percentage,adaptive_maximum_level,adaptive_latest_server_time,adaptive_intensity,adaptive_dl_diff_target,concurrent_transfers,auto_alt_dial,auto_alt_dial_statuses,agent_pause_codes_active,campaign_description,campaign_changedate,campaign_stats_refresh,campaign_logindate,dial_statuses,disable_alter_custdata,no_hopper_leads_logins,list_order_mix,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,queue_priority,drop_inbound_group,qc_enabled,qc_statuses,qc_lists,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,survey_first_audio_file,survey_dtmf_digits,survey_ni_digit,survey_opt_in_audio_file,survey_ni_audio_file,survey_method,survey_no_response_action,survey_ni_status,survey_response_digit_map,survey_xfer_exten,survey_camp_record_dir,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,agent_extended_alt_dial,use_campaign_dnc,three_way_call_cid,three_way_dial_prefix,web_form_target,vtiger_search_category,vtiger_create_call_record,vtiger_create_lead_record,vtiger_screen_login,cpd_amd_action,agent_allow_group_alias,default_group_alias,vtiger_search_dead,vtiger_status_call,survey_third_digit,survey_third_audio_file,survey_third_status,survey_third_exten,survey_fourth_digit,survey_fourth_audio_file,survey_fourth_status,survey_fourth_exten,drop_lockout_time,quick_transfer_button,prepopulate_transfer_preset,drop_rate_group,view_calls_in_queue,view_calls_in_queue_launch,grab_calls_in_queue,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,waitforsilence_options,agent_select_territories,campaign_calldate,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,queuemetrics_callstatus_override,extension_appended_cidname,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,inbound_queue_no_dial,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,ivr_park_call_agi,manual_preview_dial,realtime_agent_time_stats from vicidial_campaigns where campaign_id='$campaign_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $campaign_name = $row[1]; @@ -16060,6 +18132,28 @@ if ($ADD==31) $xferconf_c_number = $row[139]; $xferconf_d_number = $row[140]; $xferconf_e_number = $row[141]; + $use_custom_cid = $row[142]; + $scheduled_callbacks_alert = $row[143]; + $queuemetrics_callstatus = $row[144]; + $extension_appended_cidname = $row[145]; + $scheduled_callbacks_count = $row[146]; + $manual_dial_override = $row[147]; + $blind_monitor_warning = $row[148]; + $blind_monitor_message = $row[149]; + $blind_monitor_filename = $row[150]; + $inbound_queue_no_dial = $row[151]; + $timer_action_destination = $row[152]; + $enable_xfer_presets = $row[153]; + $hide_xfer_number_to_dial = $row[154]; + $manual_dial_prefix = $row[155]; + $customer_3way_hangup_logging = $row[156]; + $customer_3way_hangup_seconds = $row[157]; + $customer_3way_hangup_action = $row[158]; + $ivr_park_call = $row[159]; + $ivr_park_call_agi = $row[160]; + $manual_preview_dial = $row[161]; + $realtime_agent_time_stats = $row[162]; + if (ereg("DISABLED",$list_order_mix)) {$DEFlistDISABLE = ''; $DEFstatusDISABLED=0;} @@ -16248,6 +18342,8 @@ if ($ADD==31) else {$camp_listmix_color=$campaigns_color;} if ($SUB=='20A') {$camp_survey_color=$subcamp_color;} else {$camp_survey_color=$campaigns_color;} + if ($SUB==201) {$camp_preset_color=$subcamp_color;} + else {$camp_preset_color=$campaigns_color;} echo "\n"; echo ""; echo ""; @@ -16263,6 +18359,10 @@ if ($ADD==31) echo ""; } echo ""; + if ($enable_xfer_presets == 'ENABLED') + { + echo ""; + } if ($SSqc_features_active > 0) { echo ""; @@ -16284,6 +18384,7 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "
    $row[0]: Basic IndagineCodici PausaPresetsQC
    \n"; echo "\n"; echo "\n"; @@ -16292,7 +18393,7 @@ if ($ADD==31) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; if ($SSenable_second_webform > 0) { @@ -16605,7 +18706,7 @@ if ($ADD==31) while ($DRgroups_to_print > $o) { $DRcampaigns=''; - $stmt="SELECT campaign_id from vicidial_campaigns where drop_rate_group='$DRgroups[$o]';"; + $stmt="SELECT campaign_id from vicidial_campaigns where drop_rate_group='$DRgroups[$o]' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $DRcampaigns_to_print = mysql_num_rows($rslt); $p=0; @@ -16625,7 +18726,7 @@ if ($ADD==31) } echo "$DRgroups_list$NWB#vicidial_campaigns-drop_rate_group$NWE\n"; - + echo "\n"; echo "\n"; } @@ -16643,6 +18744,8 @@ if ($ADD==31) } echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + if ($SSoutbound_autodial_active > 0) { echo "\n"; @@ -16676,10 +18781,12 @@ if ($ADD==31) {echo " LIST OVERRIDE ACTIVE";} echo "\n"; - $eswHTML=''; + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; if ($SSoutbound_autodial_active > 0) { @@ -16727,6 +18844,10 @@ if ($ADD==31) } echo "\n"; + echo "\n"; + + echo "\n"; + if ($SSoutbound_autodial_active > 0) { echo "\n"; @@ -16759,6 +18880,8 @@ if ($ADD==31) echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; @@ -16789,9 +18912,13 @@ if ($ADD==31) echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; @@ -16799,10 +18926,16 @@ if ($ADD==31) { echo "\n"; } - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; if ($agent_allow_group_alias == 'Y') @@ -16857,6 +18990,15 @@ if ($ADD==31) echo "\n"; } + if ($SSenable_queuemetrics_logging > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + echo "\n"; echo "\n"; @@ -16865,6 +19007,14 @@ if ($ADD==31) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + if ($campaign_allow_inbound == 'Y') { echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -18303,384 +20499,452 @@ if ( ($ADD==34) or ($ADD==31) ) ###################### if ($ADD==30) -{ -echo "
    ID Campagna: $row[0]$NWB#vicidial_campaigns-campaign_id$NWE
    Nome Campagna: $NWB#vicidial_campaigns-campaign_name$NWE
    Campagna Login Data: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Campagna Call Date: $campaign_calldate   $NWB#vicidial_campaigns-campaign_calldate$NWE
    Attivo: $NWB#vicidial_campaigns-active$NWE
    Extension del parking: - Filename: $NWB#vicidial_campaigns-park_ext$NWE
    Park Music-on-Hold: moh chooser $NWB#vicidial_campaigns-park_ext$NWE
    Web Form: $NWB#vicidial_campaigns-web_form_address$NWE
    Inbound Queue No Dial: $NWB#vicidial_campaigns-inbound_queue_no_dial$NWE
    El Marcar Auto Del Alt-Nu`mero: $NWB#vicidial_campaigns-auto_alt_dial$NWE
    Prefisso Chiamata: for 91NXXNXXXXXX value would be 9, for no dial prefix use X$NWB#vicidial_campaigns-dial_prefix$NWE
    Manual Prefisso Chiamata: $NWB#vicidial_campaigns-manual_dial_prefix$NWE
    Ometti Prefisso Telefono: $NWB#vicidial_campaigns-omit_phone_code$NWE
    CallerID della Campagna: $NWB#vicidial_campaigns-campaign_cid$NWE\n"; @@ -16653,6 +18756,8 @@ if ($ADD==31) {echo " LIST OVERRIDE ACTIVE";} echo "
    Custom CallerID: $NWB#vicidial_campaigns-use_custom_cid$NWE
    Exten VDAD de La campaña: $NWB#vicidial_campaigns-campaign_vdad_exten$NWE
    Esegui all`avvio della telefonata: $NWB#vicidial_campaigns-get_call_launch$NWE
    Esegui all`avvio della telefonata: $NWB#vicidial_campaigns-get_call_launch$NWE
    Messaggio Segreteria Telefonica: audio chooser $NWB#vicidial_campaigns-am_message_exten$NWE\n"; $stmt="SELECT count(*) from vicidial_lists where campaign_id='$campaign_id' and am_message_exten_override != '' and active='Y';"; @@ -16711,15 +18818,25 @@ if ($ADD==31) echo "
    Transfiera -Conf El Número 5: $NWB#vicidial_campaigns-xferconf_a_dtmf$NWE
    Trasferimento rapido Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
    Enable Transfer Presets: $NWB#vicidial_campaigns-enable_xfer_presets$NWE
    Hide Transfer Number to Dial: $NWB#vicidial_campaigns-hide_xfer_number_to_dial$NWE
    Trasferimento rapido Button: $NWB#vicidial_campaigns-quick_transfer_button$NWE
    Trasferimento PrePopulate Preset: $NWB#vicidial_campaigns-prepopulate_transfer_preset$NWE
    Timer azione: $NWB#vicidial_campaigns-timer_action$NWE
    Park Call IVR: $NWB#vicidial_campaigns-ivr_park_call$NWE
    Timer azione Message: $NWB#vicidial_campaigns-timer_action_message$NWE
    Park Call IVR AGI: $NWB#vicidial_campaigns-ivr_park_call_agi$NWE
    Timer azione Secondi: $NWB#vicidial_campaigns-timer_action_seconds$NWE
    Timer azione: $NWB#vicidial_campaigns-timer_action$NWE
    Timer azione Message: $NWB#vicidial_campaigns-timer_action_message$NWE
    Timer azione Secondi: $NWB#vicidial_campaigns-timer_action_seconds$NWE
    Timer azione Destination: $NWB#vicidial_campaigns-timer_action_destination$NWE
    Servicios repetidos Programar: $NWB#vicidial_campaigns-scheduled_callbacks$NWE
    Scheduled Callbacks Alert: $NWB#vicidial_campaigns-scheduled_callbacks_alert$NWE
    Scheduled Callbacks Count: $NWB#vicidial_campaigns-scheduled_callbacks_count$NWE
    Secondi Abbattimento Telefonata: $NWB#vicidial_campaigns-drop_call_seconds$NWE
    Aggiornamento Statistiche Campagna: $NWB#vicidial_campaigns-campaign_stats_refresh$NWE
    Real-Time Agent Time Stats: $NWB#vicidial_campaigns-realtime_agent_time_stats$NWE
    Disabilita modifica dati clienti: $NWB#vicidial_campaigns-disable_alter_custdata$NWE
    Disattiva Alter Clienti Telefono:$NWB#vicidial_campaigns-disable_alter_custphone$NWE
    Agente di pausa dopo ogni chiamata: $NWB#vicidial_campaigns-pause_after_each_call$NWE
    Manual Dial Override: $NWB#vicidial_campaigns-manual_dial_override$NWE
    ID Lista Chiamate Manuali:$NWB#vicidial_campaigns-manual_dial_list_id$NWE
    Manuale Dial Filtro:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Manuale Dial Filtro:$NWB#vicidial_campaigns-manual_dial_filter$NWE
    Manual Preview Dial: $NWB#vicidial_campaigns-manual_preview_dial$NWE
    Appunti di agente Schermata Copia: $NWB#vicidial_campaigns-agent_clipboard_copy$NWE
    Agente Screen estensione Alt Dial: $NWB#vicidial_campaigns-agent_extended_alt_dial$NWE
    3-Way chiamate in uscita CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
    3-Way chiamate in uscita CallerID: $NWB#vicidial_campaigns-three_way_call_cid$NWE
    3-Way Call Prefisso Chiamata: $NWB#vicidial_campaigns-three_way_dial_prefix$NWE
    Customer 3-Way Hangup Logging: $NWB#vicidial_campaigns-customer_3way_hangup_logging$NWE
    Customer 3-Way Hangup Seconds: $NWB#vicidial_campaigns-customer_3way_hangup_seconds$NWE
    Customer 3-Way Hangup Action: $NWB#vicidial_campaigns-customer_3way_hangup_action$NWE
    Gruppo Alias ammessi: $NWB#vicidial_campaigns-agent_allow_group_alias$NWE
    QM CallStatus Override: $NWB#vicidial_campaigns-queuemetrics_callstatus$NWE
    CRM Popup Login: $NWB#vicidial_campaigns-crm_popup_login$NWE
    CRM Popup Indirizzo: $NWB#vicidial_campaigns-crm_login_address$NWE
    Dispo Call URL: $NWB#vicidial_campaigns-dispo_call_url$NWE
    Extension Append CID: $NWB#vicidial_campaigns-extension_appended_cidname$NWE
    Blind Monitor Warning: $NWB#vicidial_campaigns-blind_monitor_warning$NWE
    Blind Monitor Notice: $NWB#vicidial_campaigns-blind_monitor_message$NWE
    Blind Monitor Filename: audio chooser $NWB#vicidial_campaigns-blind_monitor_filename$NWE
    Grupos De entrada Permitidos:
    "; @@ -17040,7 +19190,7 @@ if ($ADD==31) echo "\n"; echo "\n"; - $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id'"; + $stmt="SELECT status,status_name,selectable,campaign_id,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; $rslt=mysql_query($stmt, $link); $statuses_to_print = mysql_num_rows($rslt); $o=0; @@ -17459,11 +19609,57 @@ if ($ADD==31) } + ##### CAMPAIGN PRESETS ##### + if ($SUB==201) + { + echo "

    PRESETS FOR THIS CAMPAGNA:   $NWB#vicidial_xfer_presets$NWE
    \n"; + echo "
    ESITODESCRIZIONESELEZIONABILERISPOSTA UMANACATEGORIAMODIFY-DELETE
    \n"; + echo "\n"; + + $stmt="SELECT preset_name,preset_number,preset_dtmf,preset_hide_number from vicidial_xfer_presets where campaign_id='$campaign_id' order by preset_name"; + $rslt=mysql_query($stmt, $link); + $presets_to_print = mysql_num_rows($rslt); + $o=0; + while ($presets_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $o++; + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + echo "
    PRESET NAMENUMERODTMFNASCONDIMODIFICACANCELLA
    $rowx[0]\n"; + echo "\n"; + echo "\n"; + echo "  CANCELLA
    \n"; + + echo "
    ADD NEW PRESET
    \n"; + echo "\n"; + echo "\n"; + echo "Preset Name: \n"; + echo "Preset Number:
    \n"; + echo "Preset DTMF: \n"; + echo "   Hide Number: \n"; + echo "
    \n"; + + echo "

    \n"; + } + if ($SUB < 1) { echo "

    \n"; echo "DISCONNETTI TUTTI GLI OPERATORI DI QUESTA CAMPAGNA

    \n"; - echo "EMERGENCY VDAC CLEAR FOR THIS CAMPAIGN

    \n"; + # echo "EMERGENCY VDAC CLEAR FOR THIS CAMPAIGN

    \n"; if ($LOGdelete_campaigns > 0) { @@ -17652,7 +19848,7 @@ if ($ADD==34) echo "
    Campagna Login Data: $campaign_logindate   $NWB#vicidial_campaigns-campaign_logindate$NWE
    Attivo: $NWB#vicidial_campaigns-active$NWE
    Extension del parking: $row[9] - $row[10]$NWB#vicidial_campaigns-park_ext$NWE
    Park Music-on-Hold: $row[10] $NWB#vicidial_campaigns-park_ext$NWE
    Web Form: $row[11]$NWB#vicidial_campaigns-web_form_address$NWE
    Permitir Closers: $row[12] $NWB#vicidial_campaigns-allow_closers$NWE
    Grupo De la Transferencia Del Defecto:$default_xfer_group $NWB#vicidial_campaigns-default_xfer_group$NWE
    \n"; - echo ""; -echo "You do not have permission to view campaign $campaign_id\n"; -} + { + echo "
    \n"; + echo ""; + echo "You do not have permission to view campaign $campaign_id\n"; + } ###################### # ADD=32 display all campaign statuses ###################### if ($ADD==32) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    ELENCO ESITI PERSONALIZZATI PER CAMPAGNA:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    ELENCO ESITI PERSONALIZZATI PER CAMPAGNA:\n"; + echo "
    CAMPAGNANOMEESITIMODIFICA
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAGNANOMEESITIMODIFICA
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NESSUNO";} - echo "MODIFICA ESITI
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT status from vicidial_campaign_statuses where campaign_id='$campaigns_id_list[$o]' order by status"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NESSUNO";} + echo "MODIFICA ESITI
    \n"; + } ###################### # ADD=33 display all campaign hotkeys ###################### if ($ADD==33) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    ELENCO HOTKEY CAMPAGNE:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    ELENCO HOTKEY CAMPAGNE:\n"; + echo "
    CAMPAGNANOMEHOTKEYMODIFICA
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAGNANOMEHOTKEYMODIFICA
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NESSUNO";} - echo "MODIFICA HOTKEY
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT status from vicidial_campaign_hotkeys where campaign_id='$campaigns_id_list[$o]' order by hotkey"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NESSUNO";} + echo "MODIFICA HOTKEY
    \n"; + } ###################### # ADD=35 display all campaign lead recycle entries ###################### if ($ADD==35) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    ELENCO CONTATTI DA RICICLARE:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    ELENCO CONTATTI DA RICICLARE:\n"; + echo "
    CAMPAGNANOMEESITI DA RICICLAREMODIFICA
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAGNANOMEESITI DA RICICLAREMODIFICA
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NESSUNO";} - echo "MODIFICA CONTATTI DA RICICLARE
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT status from vicidial_lead_recycle where campaign_id='$campaigns_id_list[$o]' order by status"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NESSUNO";} + echo "MODIFICA CONTATTI DA RICICLARE
    \n"; + } ###################### # ADD=36 display all campaign auto-alt dial entries ###################### if ($ADD==36) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    ELENCO ESITI PER I QUALI CHIAMARE AUTOMATICAMENTE IL NUMERO ALTERNATIVO:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    ELENCO ESITI PER I QUALI CHIAMARE AUTOMATICAMENTE IL NUMERO ALTERNATIVO:\n"; + echo "
    CAMPAGNANOMECHIAMA-AUTO-NUM-ALTERNMODIFICA
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAGNANOMECHIAMA-AUTO-NUM-ALTERNMODIFICA
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if (strlen($row[0])<3) - {echo "NESSUNO";} - echo "MODIFICA CHIAMA-AUTO-NUM-ALTERN
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT auto_alt_dial_statuses from vicidial_campaigns where campaign_id='$campaigns_id_list[$o]';"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if (strlen($row[0])<3) + {echo "NESSUNO";} + echo "MODIFICA CHIAMA-AUTO-NUM-ALTERN
    \n"; + } ###################### # ADD=37 display all campaign agent pause codes ###################### if ($ADD==37) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    ELENCO CODICI PAUSA OPERATORE PER CAMPAGNA:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    ELENCO CODICI PAUSA OPERATORE PER CAMPAGNA:\n"; + echo "
    CAMPAGNANOMECODICI PAUSAMODIFICA
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAGNANOMECODICI PAUSAMODIFICA
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NESSUNO";} - echo "MODIFICA CODICI PAUSA
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT pause_code from vicidial_pause_codes where campaign_id='$campaigns_id_list[$o]' order by pause_code;"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NESSUNO";} + echo "MODIFICA CODICI PAUSA
    \n"; + } ###################### # ADD=39 display all campaign list mixes ###################### if ($ADD==39) -{ -echo "
    \n"; - echo ""; + { + echo ""; + echo ""; + echo ""; + echo "\n"; + $o++; + } + + echo "
    \n"; + echo ""; -echo "
    LISTADOS DE LA MEZCLA DE LA LISTA DE LA CAMPAÑA:\n"; -echo "
    \n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; -echo "\n"; + echo "
    LISTADOS DE LA MEZCLA DE LA LISTA DE LA CAMPAÑA:\n"; + echo "
    CAMPAGNANOMELIST MIXMODIFICA
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; - $rslt=mysql_query($stmt, $link); - $campaigns_to_print = mysql_num_rows($rslt); - - $o=0; - while ($campaigns_to_print > $o) - { - $row=mysql_fetch_row($rslt); - $campaigns_id_list[$o] = $row[0]; - $campaigns_name_list[$o] = $row[1]; - $o++; - } - - $o=0; - while ($campaigns_to_print > $o) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo ""; - echo ""; - echo ""; - echo "\n"; - $o++; - } -echo "
    CAMPAGNANOMELIST MIXMODIFICA
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; - - $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); - $campstatus_to_print = mysql_num_rows($rslt); - $p=0; - while ( ($campstatus_to_print > $p) and ($p < 10) ) + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) { $row=mysql_fetch_row($rslt); - echo "$row[0] "; - $p++; + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $o++; } - if ($p<1) - {echo "NESSUNO";} - echo "MODIFY LIST MIX
    \n"; -} + $o=0; + while ($campaigns_to_print > $o) + { + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; + $stmt="SELECT vcl_id from vicidial_campaigns_list_mix where campaign_id='$campaigns_id_list[$o]' order by status,vcl_id;"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NESSUNO";} + echo "MODIFY LIST MIX
    \n"; + } + + +###################### +# ADD=301 display all campaign presets +###################### +if ($ADD==301) + { + echo "\n"; echo "
    \n"; + echo ""; + + echo "
    CAMPAIGN PRESET LISTINGS:\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT campaign_id,campaign_name,enable_xfer_presets from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + + $o=0; + while ($campaigns_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $campaigns_id_list[$o] = $row[0]; + $campaigns_name_list[$o] = $row[1]; + $enable_xfer_presets_list[$o] = $row[2]; + $o++; + } + + $o=0; + $k=0; + while ($campaigns_to_print > $o) + { + if ($enable_xfer_presets_list[$o] == 'ENABLED') + { + if (eregi("1$|3$|5$|7$|9$", $k)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo "\n"; + + $k++; + } + $o++; + } + + echo "
    CAMPAGNANOMEPRESETSMODIFICA
    $campaigns_id_list[$o] $campaigns_name_list[$o] "; + + $stmt="SELECT preset_name from vicidial_xfer_presets where campaign_id='$campaigns_id_list[$o]' order by preset_name;"; + $rslt=mysql_query($stmt, $link); + $campstatus_to_print = mysql_num_rows($rslt); + $p=0; + while ( ($campstatus_to_print > $p) and ($p < 10) ) + { + $row=mysql_fetch_row($rslt); + echo "$row[0] "; + $p++; + } + if ($p<1) + {echo "NESSUNO";} + echo "MODIFY PRESETS
    \n"; + } @@ -18791,7 +21055,7 @@ if ($ADD==311) echo "
    Descrizione Lista: $NWB#vicidial_lists-list_description$NWE
    Campagna: \n"; + $users_output .= "\n"; + $users_output .= "\n"; + + echo "$users_output"; + + echo "\n"; + + echo "
    \n"; echo ""; - $stmt="SELECT group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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 from vicidial_inbound_groups where group_id='$group_id';"; + $stmt="SELECT group_id,group_name,group_color,active,web_form_address,voicemail_ext,next_agent_call,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,drop_call_seconds,drop_action,drop_exten,call_time_id,after_hours_action,after_hours_message_filename,after_hours_exten,after_hours_voicemail,welcome_message_filename,moh_context,onhold_prompt_filename,prompt_interval,agent_alert_exten,agent_alert_delay,default_xfer_group,queue_priority,drop_inbound_group,ingroup_recording_override,ingroup_rec_filename,afterhours_xfer_group,qc_enabled,qc_statuses,qc_shift_id,qc_get_record_launch,qc_show_recording,qc_web_form_address,qc_script,play_place_in_line,play_estimate_hold_time,hold_time_option,hold_time_option_seconds,hold_time_option_exten,hold_time_option_voicemail,hold_time_option_xfer_group,hold_time_option_callback_filename,hold_time_option_callback_list_id,hold_recall_xfer_group,no_delay_call_route,play_welcome_message,answer_sec_pct_rt_stat_one,answer_sec_pct_rt_stat_two,default_group_alias,no_agent_no_queue,no_agent_action,no_agent_action_value,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,ignore_list_script_override,extension_appended_cidname,uniqueid_status_display,uniqueid_status_prefix,hold_time_option_minimum,hold_time_option_press_filename,hold_time_option_callmenu,onhold_prompt_no_block,onhold_prompt_seconds,hold_time_option_no_block,hold_time_option_prompt_seconds,hold_time_second_option,hold_time_third_option,wait_hold_option_priority,wait_time_option,wait_time_second_option,wait_time_third_option,wait_time_option_seconds,wait_time_option_exten,wait_time_option_voicemail,wait_time_option_xfer_group,wait_time_option_callmenu,wait_time_option_callback_filename,wait_time_option_callback_list_id,wait_time_option_press_filename,wait_time_option_no_block,wait_time_option_prompt_seconds,timer_action_destination,calculate_estimated_hold_seconds,add_lead_url,eht_minimum_prompt_filename, eht_minimum_prompt_no_block, eht_minimum_prompt_seconds from vicidial_inbound_groups where group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $group_name = $row[1]; @@ -19333,6 +21607,62 @@ if ($ADD==3111) $xferconf_c_number = $row[65]; $xferconf_d_number = $row[66]; $xferconf_e_number = $row[67]; + $ignore_list_script_override = $row[68]; + $extension_appended_cidname = $row[69]; + $uniqueid_status_display = $row[70]; + $uniqueid_status_prefix = $row[71]; + $hold_time_option_minimum = $row[72]; + $hold_time_option_press_filename = $row[73]; + $hold_time_option_callmenu = $row[74]; + $onhold_prompt_no_block = $row[75]; + $onhold_prompt_seconds = $row[76]; + $hold_time_option_no_block = $row[77]; + $hold_time_option_prompt_seconds = $row[78]; + $hold_time_second_option = $row[79]; + $hold_time_third_option = $row[80]; + $wait_hold_option_priority = $row[81]; + $wait_time_option = $row[82]; + $wait_time_second_option = $row[83]; + $wait_time_third_option = $row[84]; + $wait_time_option_seconds = $row[85]; + $wait_time_option_exten = $row[86]; + $wait_time_option_voicemail = $row[87]; + $wait_time_option_xfer_group = $row[88]; + $wait_time_option_callmenu = $row[89]; + $wait_time_option_callback_filename = $row[90]; + $wait_time_option_callback_list_id = $row[91]; + $wait_time_option_press_filename = $row[92]; + $wait_time_option_no_block = $row[93]; + $wait_time_option_prompt_seconds = $row[94]; + $timer_action_destination = $row[95]; + $calculate_estimated_hold_seconds = $row[96]; + $add_lead_url = $row[97]; + $eht_minimum_prompt_filename = $row[98]; + $eht_minimum_prompt_no_block = $row[99]; + $eht_minimum_prompt_seconds = $row[100]; + + + ##### get callmenu listings for dynamic pulldown + $stmt="SELECT menu_id,menu_name from vicidial_call_menu order by menu_id"; + $rslt=mysql_query($stmt, $link); + $Xmenus_to_print = mysql_num_rows($rslt); + $o=0; + $Xmenuslist=''; + while ($Xmenus_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $Xmenuslist .= "\n"; + $o++; + } + if ($Xmenus_selected < 1) + {$Xmenuslist .= "\n";} + ##### get in-groups listings for dynamic pulldown $stmt="SELECT group_id,group_name from vicidial_inbound_groups where group_id NOT IN('AGENTDIRECT') order by group_id"; @@ -19417,6 +21747,8 @@ if ($ADD==3111) echo "
    MODIFICAR UN REGISTRO DE LOS GRUPOS: $row[0]
    \n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "
    \n"; echo "\n"; echo "\n"; @@ -19450,10 +21782,15 @@ if ($ADD==3111) echo "$scripts_list"; echo "\n"; echo "$NWB#vicidial_inbound_groups-ingroup_script$NWE\n"; - $eswHTML=''; + + echo "\n"; + + $eswHTML=''; $cfwHTML=''; if ($SSenable_second_webform > 0) {$eswHTML = '';} - echo "\n"; + if ($SScustom_fields_enabled > 0) + {$cfwHTML = '';} + echo "\n"; echo "\n"; @@ -19469,19 +21806,21 @@ if ($ADD==3111) echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; @@ -19659,6 +22058,13 @@ if ($ADD==3111) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; @@ -19767,16 +22173,17 @@ if ($ADD==3111) } echo "
    ID Gruppo: $row[0]$NWB#vicidial_inbound_groups-group_id$NWE
    Nome Gruppo: $NWB#vicidial_inbound_groups-group_name$NWE
    Ignore List Script Override: $NWB#vicidial_inbound_groups-ignore_list_script_override$NWE
    Esegui all`avvio della telefonata: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    Esegui all`avvio della telefonata: $NWB#vicidial_inbound_groups-get_call_launch$NWE
    Transfiera -Conf DTMF 1: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
    Transfiera -Conf El Número 5: $NWB#vicidial_inbound_groups-xferconf_a_dtmf$NWE
    Timer azione: $NWB#vicidial_inbound_groups-timer_action$NWE
    Timer azione: $NWB#vicidial_inbound_groups-timer_action$NWE
    Timer azione Message: $NWB#vicidial_inbound_groups-timer_action_message$NWE
    Timer azione Secondi: $NWB#vicidial_inbound_groups-timer_action_seconds$NWE
    Timer azione Destination: $NWB#vicidial_inbound_groups-timer_action_destination$NWE
    Secondi Abbattimento Telefonata: $NWB#vicidial_inbound_groups-drop_call_seconds$NWE
    Goccia dazione:$NWB#vicidial_inbound_groups-drop_action$NWE
    Gota Exten: $NWB#vicidial_inbound_groups-drop_exten$NWE
    Casella Vocale: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Casella Vocale: voicemail chooser$NWB#vicidial_inbound_groups-voicemail_ext$NWE
    Trasferimento Drop Group:
    Despue`s De la Accio`n De las Horas:$NWB#vicidial_inbound_groups-after_hours_action$NWE
    Despue`s De Nombre de fichero Del Mensaje De las Horas: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
    Despue`s De Nombre de fichero Del Mensaje De las Horas: audio chooser $NWB#vicidial_inbound_groups-after_hours_message_filename$NWE
    Despue`s De la Extension De las Horas:$NWB#vicidial_inbound_groups-after_hours_exten$NWE
    Despue`s De las Horas Casella Vocale: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
    Despue`s De las Horas Casella Vocale: voicemail chooser$NWB#vicidial_inbound_groups-after_hours_voicemail$NWE
    Dopo ore di trasferimento del gruppo:
    Nombre de fichero Agradable Del Mensaje: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
    Nombre de fichero Agradable Del Mensaje: audio chooser $NWB#vicidial_inbound_groups-welcome_message_filename$NWE
    Lettura del messaggio di benvenuto:$NWB#vicidial_inbound_groups-play_welcome_message$NWE
    Context Musica di Attesa: moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
    Context Musica di Attesa: moh chooser $NWB#vicidial_inbound_groups-moh_context$NWE
    En Nombre de fichero Del Aviso Del Asimiento: audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
    En Nombre de fichero Del Aviso Del Asimiento: audio chooser $NWB#vicidial_inbound_groups-onhold_prompt_filename$NWE
    En Intervalo Del Aviso Del Asimiento:$NWB#vicidial_inbound_groups-prompt_interval$NWE
    On Hold Prompt No Block: $NWB#vicidial_inbound_groups-onhold_prompt_no_block$NWE
    On Hold Prompt Seconds: $NWB#vicidial_inbound_groups-onhold_prompt_seconds$NWE
    Gioca Luogo in Linea:$NWB#vicidial_inbound_groups-play_place_in_line$NWE
    Gioca Tenere Tempo stimato:$NWB#vicidial_inbound_groups-play_estimate_hold_time$NWE
    Tenere Tempo Opzione:$NWB#vicidial_inbound_groups-hold_time_option$NWE
    Calculate Estimated Hold Seconds: $NWB#vicidial_inbound_groups-calculate_estimated_hold_seconds$NWE
    Estimated Hold Time Minimum Filename: audio chooser $NWB#vicidial_inbound_groups-eht_minimum_prompt_filename$NWE
    Estimated Hold Time Minimum Prompt No Block: $NWB#vicidial_inbound_groups-eht_minimum_prompt_no_block$NWE
    Estimated Hold Time Minimum Prompt Seconds: $NWB#vicidial_inbound_groups-eht_minimum_prompt_seconds$NWE
    Wait Time Opzione: $NWB#vicidial_inbound_groups-wait_time_option$NWE
    Wait Time Second Opzione: $NWB#vicidial_inbound_groups-wait_time_second_option$NWE
    Wait Time Third Opzione: $NWB#vicidial_inbound_groups-wait_time_third_option$NWE
    Wait Time Opzione Seconds: $NWB#vicidial_inbound_groups-wait_time_option_seconds$NWE
    Wait Time Opzione Estensione:$NWB#vicidial_inbound_groups-wait_time_option_exten$NWE
    Wait Time Opzione Callmenu: $NWB#vicidial_inbound_groups-wait_time_option_callmenu$NWE
    Wait Time Opzione Casella Vocale: voicemail chooser $NWB#vicidial_inbound_groups-wait_time_option_voicemail$NWE
    Wait Time Opzione Transfer In-Gruppo: $NWB#vicidial_inbound_groups-wait_time_option_xfer_group$NWE
    Wait Time Opzione Press Filename: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_press_filename$NWE
    Wait Time Opzione Press No Block: $NWB#vicidial_inbound_groups-wait_time_option_no_block$NWE
    Wait Time Opzione Press Filename Seconds: $NWB#vicidial_inbound_groups-wait_time_option_prompt_seconds$NWE
    Wait Time Opzione After Press Filename: audio chooser $NWB#vicidial_inbound_groups-wait_time_option_callback_filename$NWE
    Wait Time Opzione Callback ID Lista: $NWB#vicidial_inbound_groups-wait_time_option_callback_list_id$NWE
    Wait Hold Opzione Priority: $NWB#vicidial_inbound_groups-wait_hold_option_priority$NWE
    Estimated Tenere Tempo Opzione:$NWB#vicidial_inbound_groups-hold_time_option$NWE
    Hold Time Second Opzione: $NWB#vicidial_inbound_groups-hold_time_second_option$NWE
    Hold Time Third Opzione: $NWB#vicidial_inbound_groups-hold_time_third_option$NWE
    Tenere Opzione Secondi Tempo:$NWB#vicidial_inbound_groups-hold_time_option_seconds$NWE
    Hold Time Opzione Minimum: $NWB#vicidial_inbound_groups-hold_time_option_minimum$NWE
    Tenere Opzione Tempo Estensione:$NWB#vicidial_inbound_groups-hold_time_option_exten$NWE
    Tenere Tempo Opzione Segreteria: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
    Hold Time Opzione Callmenu: $NWB#vicidial_inbound_groups-hold_time_option_callmenu$NWE
    Tenere Tempo Opzione Segreteria: voicemail chooser $NWB#vicidial_inbound_groups-hold_time_option_voicemail$NWE
    Tenere Opzione Tempo trasferimento in gruppo:$NWB#vicidial_inbound_groups-hold_time_option_xfer_group$NWE
    Tenere il tempo di richiamata Opzione Nome file: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Hold Time Opzione Press Filename: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_press_filename$NWE
    Hold Time Opzione Press No Block: $NWB#vicidial_inbound_groups-hold_time_option_no_block$NWE
    Hold Time Opzione Press Filename Seconds: $NWB#vicidial_inbound_groups-hold_time_option_prompt_seconds$NWE
    Hold Time Opzione After Press Filename: audio chooser $NWB#vicidial_inbound_groups-hold_time_option_callback_filename$NWE
    Tenere Opzione Tempo richiamata Elenco ID:$NWB#vicidial_inbound_groups-hold_time_option_callback_list_id$NWE
    Agente Alert Filename: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
    Agente Alert Filename: audio chooser $NWB#vicidial_inbound_groups-agent_alert_exten$NWE
    La Alarma Del Agente Retrasa:$NWB#vicidial_inbound_groups-agent_alert_delay$NWE
    Dispo Call URL: $NWB#vicidial_inbound_groups-dispo_call_url$NWE
    Add Lead URL: $NWB#vicidial_inbound_groups-add_lead_url$NWE
    Extension Append CID: $NWB#vicidial_inbound_groups-extension_appended_cidname$NWE
    Uniqueid Status Visualizzare: $NWB#vicidial_inbound_groups-uniqueid_status_display$NWE
    Uniqueid Status Prefix: $NWB#vicidial_inbound_groups-uniqueid_status_prefix$NWE
    \n"; - echo "

    \n"; + echo "


    \n"; ### list of agent rank or skill-level for this inbound group + # ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ echo "
    \n"; echo "
    CLASSIFICA OPERATORI PER QUESTO GRUPPO INBOUND:
    \n"; - echo "\n"; - echo "\n"; + echo "
    UTENTE     CLASSIFICA     CHIAMATE OGGI
    \n"; + echo "\n"; - $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;"; + $stmt="SELECT user,full_name,closer_campaigns from vicidial_users where active='Y';"; $rsltx=mysql_query($stmt, $link); $users_to_print = mysql_num_rows($rsltx); @@ -19786,20 +22193,181 @@ if ($ADD==3111) $rowx=mysql_fetch_row($rsltx); $o++; + $ARIG_user[$o] = $rowx[0]; + $ARIG_name[$o] = $rowx[1]; + $ARIG_close[$o] = $rowx[2]; + $ARIG_check[$o] = ''; + if (preg_match("/ $group_id /",$ARIG_close[$o])) + {$ARIG_check[$o] = ' CHECKED';} + } + + $o=0; + $ARIG_changenotes=''; + $stmtDlog=''; + while ($users_to_print > $o) + { + $o++; + $stmt="SELECT group_rank,calls_today from vicidial_inbound_group_agents where group_id='$group_id' and user='$ARIG_user[$o]';"; + $rsltx=mysql_query($stmt, $link); + $viga_to_print = mysql_num_rows($rsltx); + if ($viga_to_print > 0) + { + $rowx=mysql_fetch_row($rsltx); + $ARIG_rank[$o] = $rowx[0]; + $ARIG_calls[$o] = $rowx[1]; + } + else + { + $stmtD="INSERT INTO vicidial_inbound_group_agents set calls_today='0',group_rank='0',group_weight='0',user='$ARIG_user[$o]',group_id='$group_id';"; + $rslt=mysql_query($stmtD, $link); + if ($DB > 0) {echo "|$stmtD|";} + $stmtDlog .= "$stmtD|"; + $ARIG_changenotes .= "added missing user to viga table $ARIG_user[$o]|"; + $ARIG_rank[$o] = '0'; + $ARIG_calls[$o] = '0'; + } + } + if (strlen($ARIG_changenotes) > 10) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtDlog|"; + $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='INGROUPS', event_type='MODIFY', record_id='$group_id', event_code='USER INGROUP VIGA ADD', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + + + if ($stage=='INVIA') + { + $o=0; + while ($users_to_print > $o) + { + $o++; + + $ARIG_checked=''; + $ARIG_ranked=''; + + $checkbox_field="CHECK_$ARIG_user[$o]$US$group_id"; + $rank_field="RANK_$ARIG_user[$o]$US$group_id"; + + if (isset($_GET["$checkbox_field"])) {$ARIG_checked=$_GET["$checkbox_field"];} + elseif (isset($_POST["$checkbox_field"])) {$ARIG_checked=$_POST["$checkbox_field"];} + if (isset($_GET["$rank_field"])) {$ARIG_ranked=$_GET["$rank_field"];} + elseif (isset($_POST["$rank_field"])) {$ARIG_ranked=$_POST["$rank_field"];} + $ARIG_checked = ereg_replace("[^A-Z]","",$ARIG_checked); + $ARIG_ranked = ereg_replace("[^-0-9]","",$ARIG_ranked); + + $stmtA=''; + $stmtB=''; + $stmtC=''; + $ARIG_updated=0; + $ARIG_changenotes=''; + if ( ($ARIG_check[$o]=='') and ($ARIG_checked=='YES') ) + { + if (strlen($ARIG_close[$o]) < 4) {$ARIG_close[$o]=' - ';} + $stmtA="UPDATE vicidial_users set closer_campaigns=' $group_id$ARIG_close[$o]' where user='$ARIG_user[$o]';"; + $rslt=mysql_query($stmtA, $link); + if ($DB > 0) {echo "|$stmtA|";} + $ARIG_updated++; + $ARIG_changenotes .= "added $group_id to selected in-groups|"; + } + if ( ($ARIG_check[$o]==' CHECKED') and ($ARIG_checked=='') ) + { + $ARIG_close[$o] = preg_replace("/ $group_id /",' ',$ARIG_close[$o]); + $stmtB="UPDATE vicidial_users set closer_campaigns='$ARIG_close[$o]' where user='$ARIG_user[$o]';"; + $rslt=mysql_query($stmtB, $link); + if ($DB > 0) {echo "|$stmtB|";} + $ARIG_updated++; + $ARIG_changenotes .= "removed $group_id from selected in-groups|"; + } + if ( ($ARIG_ranked < $ARIG_rank[$o]) or ($ARIG_ranked > $ARIG_rank[$o]) ) + { + $stmtC="UPDATE vicidial_inbound_group_agents set group_rank='$ARIG_ranked',group_weight='$ARIG_ranked' where user='$ARIG_user[$o]' and group_id='$group_id';"; + $rslt=mysql_query($stmtC, $link); + if ($DB > 0) {echo "|$stmtC|";} + $ARIG_updated++; + $ARIG_changenotes .= "changed rank from $ARIG_rank[$o] to $ARIG_ranked|"; + } + if ($ARIG_updated > 0) + { + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmtA|$stmtB|$stmtC|"; + $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='USERS', event_type='MODIFY', record_id='$ARIG_user[$o]', event_code='USER INGROUP SETTINGS', event_sql=\"$SQL_log\", event_notes='$ARIG_changenotes';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + } + } + + $stmt="SELECT vu.user,viga.group_rank,calls_today,full_name,closer_campaigns from vicidial_inbound_group_agents viga, vicidial_users vu where group_id='$group_id' and active='Y' and vu.user=viga.user;"; + $rsltx=mysql_query($stmt, $link); + $users_to_print = mysql_num_rows($rsltx); + + $o=0; + while ($users_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $o++; + + $ARIG_user[$o] = $rowx[0]; + $ARIG_rank[$o] = $rowx[1]; + $ARIG_calls[$o] = $rowx[2]; + $ARIG_name[$o] = $rowx[3]; + $ARIG_close[$o] = $rowx[4]; + $ARIG_check[$o] = ''; + if (preg_match("/ $group_id /",$ARIG_close[$o])) + {$ARIG_check[$o] = ' CHECKED';} + } + } + + $checkbox_count=0; + $o=0; + while ($users_to_print > $o) + { + $o++; + if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - echo "\n"; - } + $checkbox_field="CHECK_$ARIG_user[$o]$US$group_id"; + $rank_field="RANK_$ARIG_user[$o]$US$group_id"; + $checkbox_list .= "|$checkbox_field"; + $checkbox_count++; - echo "
    UTENTESELECTED     CLASSIFICA     CHIAMATE OGGI
    $rowx[0] - $rowx[3]$rowx[1]$rowx[2]

    \n"; + $users_output .= "
    $ARIG_user[$o] - $ARIG_name[$o]   select all  

    \n"; echo "

    \n"; echo "Clicca qui per visualizzare un report per questo gruppo inbound

    \n"; + echo "Click here to see agents logged in to this inbound group

    \n"; + echo "
    \n"; echo "DIDS USING THIS IN-GROUP:
    \n"; @@ -19835,7 +22403,7 @@ if ($ADD==3111) echo "CAMPAGNE DI OFFRIRE IN QUESTO-GROUP:
    \n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\";"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where closer_campaigns LIKE \"% $group_id %\" $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $campin_to_print = mysql_num_rows($rslt); $o=0; @@ -19850,7 +22418,7 @@ if ($ADD==3111) if ($LOGdelete_ingroups > 0) { - echo "

    EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

    \n"; + # echo "

    EMERGENCY VDAC CLEAR FOR THIS IN-GROUP

    \n"; echo "

    CANCELLA QUESTO GRUPPO INBOUND\n"; } if ($LOGuser_level >= 9) @@ -19881,7 +22449,7 @@ if ($ADD==3311) $didSQL = "did_id='$did_id'"; if ( (strlen($did_id)<1) and (strlen($did_pattern)>0) ) {$didSQL = "did_pattern='$did_pattern'";} - $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id from vicidial_inbound_dids where $didSQL;"; + $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,extension,exten_context,voicemail_ext,phone,server_ip,user,user_unavailable_action,user_route_settings_ingroup,group_id,call_handle_method,agent_search_method,list_id,campaign_id,phone_code,menu_id,record_call,filter_inbound_number,filter_phone_group_id,filter_url,filter_action,filter_extension,filter_exten_context,filter_voicemail_ext,filter_phone,filter_server_ip,filter_user,filter_user_unavailable_action,filter_user_route_settings_ingroup,filter_group_id,filter_call_handle_method,filter_agent_search_method,filter_list_id,filter_campaign_id,filter_phone_code,filter_menu_id,filter_clean_cid_number from vicidial_inbound_dids where $didSQL;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -19905,9 +22473,30 @@ if ($ADD==3311) $campaign_id = $row[17]; $phone_code = $row[18]; $menu_id = $row[19]; + $record_call = $row[20]; + $filter_inbound_number = $row[21]; + $filter_phone_group_id = $row[22]; + $filter_url = $row[23]; + $filter_action = $row[24]; + $filter_extension = $row[25]; + $filter_exten_context = $row[26]; + $filter_voicemail_ext = $row[27]; + $filter_phone = $row[28]; + $filter_server_ip = $row[29]; + $filter_user = $row[30]; + $filter_user_unavailable_action = $row[31]; + $filter_user_route_settings_ingroup = $row[32]; + $filter_group_id = $row[33]; + $filter_call_handle_method = $row[34]; + $filter_agent_search_method = $row[35]; + $filter_list_id = $row[36]; + $filter_campaign_id = $row[37]; + $filter_phone_code = $row[38]; + $filter_menu_id = $row[39]; + $filter_clean_cid_number = $row[40]; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -19925,23 +22514,36 @@ if ($ADD==3311) $Xgroups_to_print = mysql_num_rows($rslt); $Xgroups_menu=''; $Xgroups_selected=0; + $FXgroups_menu=''; + $FXgroups_selected=0; $o=0; while ($Xgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Xgroups_menu .= "\n"; + $FXgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $o++; } if ($Xgroups_selected < 1) {$Xgroups_menu .= "\n";} else {$Xgroups_menu .= "\n";} + if ($FXgroups_selected < 1) + {$FXgroups_menu .= "\n";} + else + {$FXgroups_menu .= "\n";} ##### get in-groups listings for dynamic pulldown @@ -19950,23 +22552,36 @@ if ($ADD==3311) $Dgroups_to_print = mysql_num_rows($rslt); $Dgroups_menu=''; $Dgroups_selected=0; + $FDgroups_menu=''; + $FDgroups_selected=0; $o=0; while ($Dgroups_to_print > $o) { $rowx=mysql_fetch_row($rslt); $Dgroups_menu .= "\n"; + $FDgroups_menu .= "value=\"$rowx[0]\">$rowx[0] - $rowx[1]\n"; $o++; } if ($Dgroups_selected < 1) {$Dgroups_menu .= "\n";} else {$Dgroups_menu .= "\n";} + if ($FDgroups_selected < 1) + {$FDgroups_menu .= "\n";} + else + {$FDgroups_menu .= "\n";} echo "
    A MODIFICARE LO RECORD:$row[0]\n"; @@ -19977,6 +22592,7 @@ if ($ADD==3311) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -19986,7 +22602,7 @@ if ($ADD==3311) echo "\n"; echo "$NWB#vicidial_inbound_dids-server_ip$NWE\n"; - $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu;"; + $stmt="select menu_id,menu_name,menu_prompt from vicidial_call_menu order by menu_id;"; $rslt=mysql_query($stmt, $link); $menus_to_print = mysql_num_rows($rslt); $menu_list=''; @@ -20017,11 +22633,67 @@ if ($ADD==3311) echo "$NWB#vicidial_inbound_dids-campaign_id$NWE\n"; echo "\n"; + + echo "\n"; + + echo "\n"; + + $stmt="select filter_phone_group_id,filter_phone_group_name from vicidial_filter_phone_groups order by filter_phone_group_id;"; + $rslt=mysql_query($stmt, $link); + $Fgroups_to_print = mysql_num_rows($rslt); + $Fgroups_list=''; + $i=0; + while ($i < $Fgroups_to_print) + { + $row=mysql_fetch_row($rslt); + $Fgroups_list .= ""; + $i++; + } + + echo "\n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + + + + echo "\n"; echo "
    HA Descrizione:$NWB#vicidial_inbound_dids-did_description$NWE
    Attivo: $NWB#vicidial_inbound_dids-did_active$NWE
    HA Percorso:$NWB#vicidial_inbound_dids-did_route$NWE
    Record Call: $NWB#vicidial_inbound_dids-record_call$NWE
    Estensione:$NWB#vicidial_inbound_dids-extension$NWE
    Estensione Contesto:$NWB#vicidial_inbound_dids-exten_context$NWE
    Buzon de voz: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
    Nel gruppo Codice Telefono:$NWB#vicidial_inbound_dids-phone_code$NWE
    Clean CID Number: $NWB#vicidial_inbound_dids-filter_clean_cid_number$NWE
    Filter Inbound Number: $NWB#vicidial_inbound_dids-filter_inbound_number$NWE
    Filter Phone ID Gruppo: $NWB#vicidial_inbound_dids-filter_phone_group_id$NWE
    Filter URL: $NWB#vicidial_inbound_dids-filter_url$NWE
    Filter Action: $NWB#vicidial_inbound_dids-filter_action$NWE
    Filter Estensione:$NWB#vicidial_inbound_dids-extension$NWE
    Filter Estensione Contesto:$NWB#vicidial_inbound_dids-exten_context$NWE
    Filter Buzon de voz: voicemail chooser$NWB#vicidial_inbound_dids-voicemail_ext$NWE
    Filter Estensione Telefono:$NWB#vicidial_inbound_dids-phone$NWE
    Filter IP Server: $NWB#vicidial_inbound_dids-server_ip$NWE
    Filter Call Menu: $NWB#vicidial_inbound_dids-menu_id$NWE
    Filter Utente Agent:$NWB#vicidial_inbound_dids-user$NWE
    Filter Lutente non disponibile Azione:$NWB#vicidial_inbound_dids-user_unavailable_action$NWE
    Filter Utente percorso Impostazioni In-Group:$NWB#vicidial_inbound_dids-user_route_settings_ingroup$NWE
    Filter In-ID Gruppo: $NWB#vicidial_inbound_dids-group_id$NWE
    Filter Nel gruppo di chiamata Maneggiare Metodo:$NWB#vicidial_inbound_dids-call_handle_method$NWE
    Filter Nel gruppo di agente Metodo di ricerca:$NWB#vicidial_inbound_dids-agent_search_method$NWE
    Filter Nel gruppo Elenco ID:$NWB#vicidial_inbound_dids-list_id$NWE
    Filter Nel gruppo-ID campagna:$NWB#vicidial_inbound_dids-campaign_id$NWE
    Filter Nel gruppo Codice Telefono:$NWB#vicidial_inbound_dids-phone_code$NWE
    \n"; echo "

    \n"; echo "
    Clicca qui per vedere una relazione di traffico per questo DID

    \n"; + echo "
    Click here to see a list of recordings and calls for this DID
    \n"; if ($LOGdelete_dids > 0) { @@ -20184,13 +22856,18 @@ if ($ADD==3511) if ($option_route=='INGROUP') { if (strlen($option_route_value_context) < 10) - {$option_route_value_context = 'CID,LB,998,TESTCAMP,1';} + {$option_route_value_context = 'CID,LB,998,TESTCAMP,1,,,,';} $IGoption_route_value_context = explode(",",$option_route_value_context); - $IGhandle_method = $IGoption_route_value_context[0]; - $IGsearch_method = $IGoption_route_value_context[1]; - $IGlist_id = $IGoption_route_value_context[2]; - $IGcampaign_id = $IGoption_route_value_context[3]; - $IGphone_code = $IGoption_route_value_context[4]; + $IGhandle_method = $IGoption_route_value_context[0]; + $IGsearch_method = $IGoption_route_value_context[1]; + $IGlist_id = $IGoption_route_value_context[2]; + $IGcampaign_id = $IGoption_route_value_context[3]; + $IGphone_code = $IGoption_route_value_context[4]; + $IGvid_enter_filename = $IGoption_route_value_context[5]; + $IGvid_id_number_filename = $IGoption_route_value_context[6]; + $IGvid_confirm_filename = $IGoption_route_value_context[7]; + $IGvid_validate_digits = $IGoption_route_value_context[8]; + echo ""; echo "
    In-Group:"; echo ""; @@ -20198,13 +22875,17 @@ if ($ADD==3511) echo " "; echo "   Handle Method: \n"; + echo "$IGhandle_method_list $NWB#vicidial_call_menu-ingroup_settings$NWE\n"; echo "
    Search Method: \n"; echo "   ID Lista: "; echo "
    ID Campagna: \n"; echo "   Phone Code: "; + echo "
      VID Enter Filename: audio chooser"; + echo "
      VID ID Number Filename: audio chooser"; + echo "
      VID Confirm Filename: audio chooser"; + echo "   VID Digits: "; } if ($option_route=='DID') { @@ -20358,7 +23039,7 @@ if ($ADD==31111) echo "
    \n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id,closer_campaigns,extension_group from vicidial_remote_agents where remote_agent_id='$remote_agent_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $remote_agent_id = $row[0]; @@ -20368,18 +23049,37 @@ if ($ADD==31111) $conf_exten = $row[4]; $status = $row[5]; $campaign_id = $row[6]; + $extension_group = $row[8]; + + ##### get extension group listing for dynamic pulldown + $stmt="SELECT extension_group_id,count(*) from vicidial_extension_groups group by extension_group_id order by extension_group_id;"; + $rsltx=mysql_query($stmt, $link); + $extengrp_to_print = mysql_num_rows($rsltx); + $extengrp_list=''; + $o=0; + while ($extengrp_to_print > $o) + { + $rowx=mysql_fetch_row($rsltx); + $extengrp_list .= "\n"; + $o++; + } echo "
    MODIFICAR UNA ENTRADA DE LOS AGENTES REMOTOS: $row[0]
    \n"; echo "\n"; echo "\n"; echo "
    \n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "
    Inizio ID Utente: (solo cifre, incremented)$NWB#vicidial_remote_agents-user_start$NWE
    Inizio ID Utente: (solo cifre, incremented, must be an existing vicidial user)$NWB#vicidial_remote_agents-user_start$NWE
    Numero di Linee: (solo cifre)$NWB#vicidial_remote_agents-number_of_lines$NWE
    IP Server: $NWB#vicidial_remote_agents-server_ip$NWE
    Numero Di Interno Remoto: (numero del dialplan usato per raggiungere gli operatori)$NWB#vicidial_remote_agents-conf_exten$NWE
    Extension Gruppo: $NWB#vicidial_remote_agents-extension_group$NWE
    Esito: $NWB#vicidial_remote_agents-status$NWE
    Campagna:
    \n"; + echo ""; + + $stmt="SELECT filter_phone_group_id,filter_phone_group_name,filter_phone_group_description from vicidial_filter_phone_groups where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $filter_phone_group_id = $row[0]; + $filter_phone_group_name = $row[1]; + $filter_phone_group_description = $row[2]; + + echo "
    Modifica Filtro Phone Gruppo: $filter_phone_group_id\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Filter Phone ID Gruppo: $filter_phone_group_id $NWB#vicidial_filter_phone_groups-user_start$NWE
    Filter Phone Nome Gruppo: $NWB#vicidial_filter_phone_groups-filter_phone_group_name$NWE
    Filter Phone Group Descrizione: $NWB#vicidial_filter_phone_groups-filter_phone_group_description$NWE
    \n"; + + $stmt="SELECT count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$filter_phone_group_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + echo "

    Numbers in this Filter Phone Gruppo: $row[0]"; + + if ($LOGdelete_dids > 0) + { + echo "

    CANCELLA QUESTO FILTRO PHONE GROUP\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Click here to download the numbers in this filter phone group
    \n"; + + echo "

    Clicca qui per visualizzare Admin chages a questo filtro phone group\n"; + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + +###################### +# ADD=32111 modify extension group entry in the system +###################### + +if ($ADD==32111) + { + if ($LOGmodify_remoteagents==1) + { + echo "
    \n"; + echo ""; + + $stmt="SELECT extension_id,extension_group_id,extension,rank,campaign_groups,call_count_today,last_call_time,last_callerid from vicidial_extension_groups where extension_id='$extension_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $extension_id = $row[0]; + $extension_group_id = $row[1]; + $extension = $row[2]; + $rank = $row[3]; + $campaign_groups = $row[4]; + $call_count_today = $row[5]; + $last_call_time = $row[6]; + $last_callerid = $row[7]; + + echo "
    MODIFY AN EXTENSION GROUP ENTRY: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    Extension Gruppo: (senza spazi)$NWB#vicidial_extension_groups-extension_group_id$NWE
    Estensione: (solo cifre)$NWB#vicidial_extension_groups-extension$NWE
    Rank: $NWB#vicidial_extension_groups-rank$NWE
    Campagnas Groups: (pipe-delimited list)$NWB#vicidial_extension_groups-extension$NWE
    Call Count Today: $call_count_today
    Last Tempo Chiamata: $last_call_time
    Last Call ID: $last_callerid
    \n"; + + if ($LOGdelete_remote_agents > 0) + { + echo "

    DELETE THIS EXTENSION GROUP ENTRY\n"; + } + if ($LOGuser_level >= 9) + { + echo "

    Click here to see Admin chages to this extension group entry
    \n"; + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; + } + } + + ###################### # ADD=311111 modify user group info in the system ###################### @@ -20421,16 +23243,28 @@ if ($ADD==311111) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if (strlen($SSwebphone_url) > 5) + { + echo "\n"; + + echo "\n"; + + echo "\n"; + } + else + { + echo " "; + echo " "; + echo " "; + } + if ($SSqc_features_active > 0) { echo "
    \n"; echo ""; - $stmt="SELECT user_group,group_name,allowed_campaigns,qc_allowed_campaigns,qc_allowed_inbound_groups,group_shifts,forced_timeclock_login,shift_enforcement,agent_status_viewable_groups,agent_status_view_time from vicidial_user_groups where user_group='$user_group';"; + $stmt="SELECT user_group,group_name,allowed_campaigns,qc_allowed_campaigns,qc_allowed_inbound_groups,group_shifts,forced_timeclock_login,shift_enforcement,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial,agent_fullscreen,allowed_reports,webphone_url_override,webphone_systemkey_override,webphone_dialpad_override from vicidial_user_groups where user_group='$user_group';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - $user_group = $row[0]; - $group_name = $row[1]; - $GROUP_shifts = $row[5]; - $forced_timeclock_login = $row[6]; - $shift_enforcement = $row[7]; - $VGROUP_vgroups = $row[8]; - $agent_status_view_time = $row[9]; + $user_group = $row[0]; + $group_name = $row[1]; + $GROUP_shifts = $row[5]; + $forced_timeclock_login = $row[6]; + $shift_enforcement = $row[7]; + $VGROUP_vgroups = $row[8]; + $agent_status_view_time = $row[9]; + $agent_call_log_view = $row[10]; + $agent_xfer_consultative = $row[11]; + $agent_xfer_dial_override = $row[12]; + $agent_xfer_vm_transfer = $row[13]; + $agent_xfer_blind_transfer = $row[14]; + $agent_xfer_dial_with_customer = $row[15]; + $agent_xfer_park_customer_dial = $row[16]; + $agent_fullscreen = $row[17]; + $allowed_reports = $row[18]; + $webphone_url_override = $row[19]; + $webphone_systemkey_override = $row[20]; + $webphone_dialpad_override = $row[21]; echo ""; @@ -20485,6 +23319,10 @@ if ($ADD==311111) if (ereg(" --CAMPAIGN-AGENTS-- ", $VGROUP_vgroups)) {echo " CHECKED";} echo ">CAMPAIGN-AGENTS - All users logged into the same campaign as the agent
    \n"; + echo "NOT-LOGGED-IN-AGENTS - All users in the system, even not logged-in users
    \n"; $stmt="SELECT user_group,group_name from vicidial_user_groups order by user_group"; $rslt=mysql_query($stmt, $link); @@ -20512,6 +23350,52 @@ if ($ADD==311111) echo "
    Visualizza stato agente Time: $NWB#vicidial_user_groups-agent_status_view_time$NWE
    Agent Call Log View: $NWB#vicidial_user_groups-agent_call_log_view$NWE
    Agent Allow Consultative Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Dial Override Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Casella Vocale Message Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Blind Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Dial With Customer Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Allow Park Customer Dial Xfer: $NWB#vicidial_user_groups-agent_xfer_options$NWE
    Agent Fullscreen: $NWB#vicidial_user_groups-agent_fullscreen$NWE
    Allowed Rapporti: $NWB#vicidial_user_groups-allowed_reports$NWE
    Webphone URL Override: $NWB#vicidial_user_groups-webphone_url_override$NWE
    Webphone System Key Override: $NWB#vicidial_user_groups-webphone_systemkey_override$NWE
    Webphone Dialpad Override: $NWB#vicidial_user_groups-webphone_dialpad_override$NWE
    QC ammessi Campagne:
    $NWB#vicidial_user_groups-qc_allowed_campaigns$NWE
    \n"; @@ -20671,6 +23555,14 @@ if ($ADD==3111111) echo ""; echo ""; echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; echo ""; echo "
    "; # END Insert Field @@ -20684,7 +23576,7 @@ if ($ADD==3111111) echo " CAMPAGNE USING THIS SCRIPT:
    \n"; echo "\n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where campaign_script='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20714,7 +23606,7 @@ if ($ADD==3111111) echo " LIST OVERRIDES USING THIS SCRIPT:
    \n"; echo "
    \n"; - $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id';"; + $stmt="SELECT list_id,list_name from vicidial_lists where agent_script_override='$script_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -20776,7 +23668,7 @@ if ($ADD==31111111) echo "
    \n"; ##### get campaigns listing for dynamic pulldown - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); $campaigns_list=''; @@ -20817,7 +23709,7 @@ if ($ADD==31111111) ###################### -# ADD=321111111 modify call time definition info in the system +# ADD=321111111 modify call time definition info in the system, ADD/REMOVE ###################### if ($ADD==321111111) @@ -20872,7 +23764,7 @@ if ($ADD==311111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; $ct_srs=1; @@ -20931,7 +23831,7 @@ if ($ADD==311111111) $stmt="SELECT state_call_time_state,state_call_time_name from vicidial_state_call_times where state_call_time_id='$state_rules[$b]';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); - echo "\n"; + echo "\n"; $srs_SQL .= "'$state_rules[$b]',"; $srs_state_SQL .= "'$row[0]',"; } @@ -20970,7 +23870,7 @@ if ($ADD==311111111) echo "CAMPAGNE CHE UTILIZZANO QUESTO ORARIO:
    \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 from vicidial_call_times where call_time_id='$call_time_id';"; + $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 from vicidial_call_times where call_time_id='$call_time_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $call_time_name = $row[1]; @@ -20894,6 +23786,14 @@ if ($ADD==311111111) $ct_saturday_start = $row[17]; $ct_saturday_stop = $row[18]; $ct_state_call_times = $row[19]; + $default_afterhours_filename_override = $row[20]; + $sunday_afterhours_filename_override = $row[21]; + $monday_afterhours_filename_override = $row[22]; + $tuesday_afterhours_filename_override = $row[23]; + $wednesday_afterhours_filename_override = $row[24]; + $thursday_afterhours_filename_override = $row[25]; + $friday_afterhours_filename_override = $row[26]; + $saturday_afterhours_filename_override = $row[27]; echo ""; @@ -20904,14 +23804,14 @@ if ($ADD==311111111) echo "
    ID Orario Chiamate: $call_time_id$NWB#vicidial_call_times-call_time_id$NWE
    Nome Orario Chiamate: (breve descrizione dell`orario chiamate)$NWB#vicidial_call_times-call_time_name$NWE
    Note Orario Chiamate: $NWB#vicidial_call_times-call_time_comments$NWE
    Inizio di Default: Fine di Default: $NWB#vicidial_call_times-ct_default_start$NWE
    Inizio Domenica: Fine Domenica: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Inizio Lunedi: Fine Lunedi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Inizio Martedi: Fine Martedi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Inizio Mercoledi: Fine Mercoledi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Inizio Giovedi: Fine Giovedi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Inizio Venerdi: Fine Venerdi: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Inizio Sabato: Fine Sabato: $NWB#vicidial_call_times-ct_sunday_start$NWE
    Inizio di Default: Fine di Default: $NWB#vicidial_call_times-ct_default_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Inizio Domenica: Fine Domenica: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Inizio Lunedi: Fine Lunedi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Inizio Martedi: Fine Martedi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Inizio Mercoledi: Fine Mercoledi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Inizio Giovedi: Fine Giovedi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Inizio Venerdi: Fine Venerdi: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    Inizio Sabato: Fine Sabato: $NWB#vicidial_call_times-ct_sunday_start$NWE       AH Override: audio chooser $NWB#vicidial_call_times-default_afterhours_filename_override$NWE
    $state_rules[$b] - REMOVE $row[0] - $row[1]
    $state_rules[$b] - REMOVE $row[0] - $row[1]
    \n"; - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id';"; + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where local_call_time='$call_time_id' $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $camps_to_print = mysql_num_rows($rslt); $o=0; @@ -21223,7 +24123,7 @@ if ($ADD==31111111111) echo "
    \n"; echo "\n"; @@ -21984,13 +24897,14 @@ if ($ADD==351111111111) echo "
    \n"; echo ""; - $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email from phones where extension='$extension' and server_ip='$server_ip';"; + $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,delete_vm_after_email,is_webphone,use_external_server_ip,codecs_list,codecs_with_template,webphone_dialpad from phones where extension='$extension' and server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -21231,6 +24131,9 @@ if ($ADD==31111111111) echo "\n"; echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; echo "\n"; echo "\n"; @@ -21243,8 +24146,12 @@ if ($ADD==31111111111) echo "$servers_list"; echo "\n"; echo "$NWB#phones-server_ip$NWE\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21273,11 +24180,12 @@ if ($ADD==31111111111) 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"; @@ -21332,10 +24240,16 @@ if ($ADD==31111111111) echo "

    Pinchar aquí­ para ver las estadísticas del telefono\n"; + echo "

    Click here for phone call recordings\n"; + if ($LOGast_delete_phones > 0) { echo "

    CANCELLA QUESTO TELEFONO\n"; } + if ($LOGuser_level >= 9) + { + echo "

    Click here to see Admin chages to this phone\n"; + } } else { @@ -21472,7 +24386,7 @@ if ($ADD==311111111111) echo "
    Interno Telefono: $NWB#phones-extension$NWE (Agent Screen Login Telefono)
    Numero De Dial plan: (solo cifre)$NWB#phones-dialplan_number$NWE
    Login: $NWB#phones-login$NWE
    Password: $NWB#phones-pass$NWE
    Login: $NWB#phones-login$NWE
    Login Password: $NWB#phones-pass$NWE
    Registrazione Password: $NWB#phones-conf_secret$NWE     Strength:
    Set As Webphone: $NWB#phones-is_webphone$NWE
    Webphone Dialpad: $NWB#phones-webphone_dialpad$NWE
    Use External IP Server: $NWB#phones-use_external_server_ip$NWE
    Esito: $NWB#phones-status$NWE
    Cuenta Activa: $NWB#phones-active$NWE
    Tipo Del telefono: $NWB#phones-phone_type$NWE
    Exten de VmaiDumpl: $NWB#phones-voicemail_dump_exten$NWE
    Contexto De Exten: $NWB#phones-ext_context$NWE
    Telefono Contesto: $NWB#phones-phone_context$NWE
    Conf file segreto: $NWB#phones-conf_secret$NWE
    Allowed Codecs: $NWB#phones-codecs_list$NWE
    Allowed Codecs With Template: $NWB#phones-codecs_with_template$NWE
    Canal de envío del DTMF: $NWB#phones-dtmf_send_extension$NWE
    Grupo de las llamadas de salida: $NWB#phones-call_out_number_group$NWE
    Localizacio`n del Navegador: $NWB#phones-client_browser$NWE
    Directorio de instalacio`n: $NWB#phones-install_directory$NWE
    URL CallerID: $NWB#phones-local_web_callerID_URL$NWE
    URL por defecto de VICIDIAL: $NWB#phones-VICIDIAL_web_URL$NWE
    Call Logging: $NWB#phones-AGI_call_logging_enabled$NWE
    \n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21555,8 +24471,9 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; echo "\n"; - echo "\n"; + echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; @@ -21565,6 +24482,16 @@ if ($ADD==311111111111) echo "\n"; echo "\n"; + if ($SSallow_custom_dialplan > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + + echo "\n"; echo "
    \n"; echo ""; - $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,local_gmt,voicemail_dump_exten,answer_transfer_agent,ext_context,sys_perf_log,vd_server_logs,agi_output,vicidial_balance_active,balance_trunks_offlimits,recording_web_link,alt_server_ip,active_asterisk_server,generate_vicidial_conf,rebuild_conf_files,outbound_calls_per_second,sysload,channels_total,cpu_idle_percent,disk_usage,sounds_update,vicidial_recording_limit,carrier_logging_active,vicidial_balance_rank,rebuild_music_on_hold,active_agent_login_server,conf_secret from servers where server_id='$server_id' or server_ip='$server_ip';"; + $stmt="SELECT server_id,server_description,server_ip,active,asterisk_version,max_vicidial_trunks,telnet_host,telnet_port,ASTmgrUSERNAME,ASTmgrSECRET,ASTmgrUSERNAMEupdate,ASTmgrUSERNAMElisten,ASTmgrUSERNAMEsend,local_gmt,voicemail_dump_exten,answer_transfer_agent,ext_context,sys_perf_log,vd_server_logs,agi_output,vicidial_balance_active,balance_trunks_offlimits,recording_web_link,alt_server_ip,active_asterisk_server,generate_vicidial_conf,rebuild_conf_files,outbound_calls_per_second,sysload,channels_total,cpu_idle_percent,disk_usage,sounds_update,vicidial_recording_limit,carrier_logging_active,vicidial_balance_rank,rebuild_music_on_hold,active_agent_login_server,conf_secret,external_server_ip,custom_dialplan_entry from servers where server_id='$server_id' or server_ip='$server_ip';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $server_id = $row[0]; @@ -21514,6 +24428,8 @@ if ($ADD==311111111111) $rebuild_music_on_hold = $row[36]; $active_agent_login_server = $row[37]; $conf_secret = $row[38]; + $external_server_ip = $row[39]; + $custom_dialplan_entry = $row[40]; $cpu = (100 - $cpu_idle_percent); $disk_usage = preg_replace("/ /"," - ",$disk_usage); @@ -21546,7 +24462,7 @@ if ($ADD==311111111111) echo "
    Usuario del Updater del Manager: $NWB#servers-ASTmgrUSERNAMEupdate$NWE
    Usuario Listen del Manager: $NWB#servers-ASTmgrUSERNAMElisten$NWE
    Usuario Send del Manager: $NWB#servers-ASTmgrUSERNAMEsend$NWE
    Conf file segreto: $NWB#servers-conf_secret$NWE
    Conf file segreto: $NWB#servers-conf_secret$NWE     Strength:
    Fuso Orario Locale: (No ajustar para el DST)$NWB#servers-local_gmt$NWE
    Extension de Vmail Dump : $NWB#servers-voicemail_dump_exten$NWE
    Extension del AD de VICIDIAL: $NWB#servers-answer_transfer_agent$NWE
    Log Server: $NWB#servers-vd_server_logs$NWE
    Salida de AGI: $NWB#servers-agi_output$NWE
    Carrier Logging Attivo: $NWB#servers-carrier_logging_active$NWE
    Registrazione Web Link: $NWB#servers-recording_web_link$NWE
    Registrazione Web Link: $NWB#servers-recording_web_link$NWE
    Alternate Recording IP Server: $NWB#servers-alt_server_ip$NWE
    External IP Server: $NWB#servers-external_server_ip$NWE
    Attivo Server Asterisk: $NWB#servers-active_asterisk_server$NWE
    Attivo Server Agent: $NWB#servers-active_agent_login_server$NWE
    Genera file di configurazione: $NWB#servers-generate_vicidial_conf$NWE
    Suoni Update: $NWB#servers-sounds_update$NWE
    ViciDial Limite di registrazione: $NWB#servers-vicidial_recording_limit$NWE
    Custom Dialplan entrata: $NWB#servers-custom_dialplan_entry$NWE
    Custom Dialplan entrata: Disabled $NWB#servers-custom_dialplan_entry$NWE
    \n"; @@ -21934,20 +24861,6 @@ if ($ADD==341111111111) echo "
    Dialplan entrata: $NWB#vicidial_server_carriers-dialplan_entry$NWE
    IP Server: $NWB#vicidial_server_carriers-server_ip$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -22264,7 +25179,7 @@ if ($ADD==311111111111111) echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts where tts_id='$tts_id';"; + $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts where tts_id='$tts_id';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $tts_id = $row[0]; $tts_name = $row[1]; $active = $row[2]; $tts_text = $row[3]; + $tts_voice = $row[4]; echo "
    MODIFICA A TTS RECORD: $tts_id
    \n"; echo "\n"; @@ -22000,6 +24914,7 @@ if ($ADD==351111111111) echo "
    TTS ID: $tts_id
    TTS Nome: $NWB#vicidial_tts_prompts-tts_name$NWE
    Attivo: $NWB#vicidial_tts_prompts-active$NWE
    TTS Voice: $NWB#vicidial_tts_prompts-tts_voice$NWE
    TTS Text: $NWB#vicidial_tts_prompts-tts_text$NWE
    \n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; + echo "\n"; echo "\n"; @@ -22458,9 +25399,94 @@ if ($ADD==311111111111111) echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + if ($SSallow_custom_dialplan > 0) + { + echo "\n"; + } + else + { + echo "\n"; + } + + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo "\n"; @@ -22478,6 +25504,13 @@ if ($ADD==311111111111111) echo "\n"; echo "\n"; echo "$NWB#settings-queuemetrics_eq_prepend$NWE\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; echo ""; - $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform from system_settings;"; + $stmt="SELECT version,install_date,use_non_latin,webroot_writable,enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_url,queuemetrics_log_id,queuemetrics_eq_prepend,vicidial_agent_disable,allow_sipsak_messages,admin_home_url,enable_agc_xfer_log,db_schema_version,auto_user_add_value,timeclock_end_of_day,timeclock_last_reset_date,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,vdc_agent_api_active,qc_last_pull_time,enable_vtiger_integration,vtiger_server_ip,vtiger_dbname,vtiger_login,vtiger_pass,vtiger_url,qc_features_active,outbound_autodial_active,outbound_calls_per_second,enable_tts_integration,agentonly_callback_campaign_lock,sounds_central_control_active,sounds_web_server,sounds_web_directory,active_voicemail_server,auto_dial_limit,user_territories_active,allow_custom_dialplan,db_schema_update_date,enable_second_webform,default_webphone,default_external_server_ip,webphone_url,enable_agc_dispo_log,custom_dialplan_entry,queuemetrics_loginout,callcard_enabled,queuemetrics_callstatus,default_codecs,admin_web_directory,label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments,custom_fields_enabled,slave_db_server,reports_use_slave_db,webphone_systemkey,first_login_trigger,default_phone_registration_password,default_phone_login_password,default_server_password from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $version = $row[0]; @@ -22312,6 +25227,44 @@ if ($ADD==311111111111111) $allow_custom_dialplan = $row[42]; $db_schema_update_date = $row[43]; $enable_second_webform = $row[44]; + $default_webphone = $row[45]; + $default_external_server_ip = $row[46]; + $webphone_url = $row[47]; + $enable_agc_dispo_log = $row[48]; + $custom_dialplan_entry = $row[49]; + $queuemetrics_loginout = $row[50]; + $callcard_enabled = $row[51]; + $queuemetrics_callstatus = $row[52]; + $default_codecs = $row[53]; + $admin_web_directory = $row[54]; + $label_title = $row[55]; + $label_first_name = $row[56]; + $label_middle_initial = $row[57]; + $label_last_name = $row[58]; + $label_address1 = $row[59]; + $label_address2 = $row[60]; + $label_address3 = $row[61]; + $label_city = $row[62]; + $label_state = $row[63]; + $label_province = $row[64]; + $label_postal_code = $row[65]; + $label_vendor_lead_code = $row[66]; + $label_gender = $row[67]; + $label_phone_number = $row[68]; + $label_phone_code = $row[69]; + $label_alt_phone = $row[70]; + $label_security_phrase = $row[71]; + $label_email = $row[72]; + $label_comments = $row[73]; + $custom_fields_enabled = $row[74]; + $slave_db_server = $row[75]; + $reports_use_slave_db = $row[76]; + $webphone_systemkey = $row[77]; + $first_login_trigger = $row[78]; + $default_phone_registration_password = $row[79]; + $default_phone_login_password = $row[80]; + $default_server_password = $row[81]; + echo "
    MODIFICA IMPOSTAZIONI DI SISTEMA\n"; echo "\n"; @@ -22334,6 +25287,7 @@ if ($ADD==311111111111111) echo "
    Permetti messaggi SIPSAK: $NWB#settings-allow_sipsak_messages$NWE
    URL Home Amministrazione: $NWB#settings-admin_home_url$NWE
    Permita El Logfile De la Transferencia Del Agente: $NWB#settings-enable_agc_xfer_log$NWE
    Enable Agent Disposition Logfile: $NWB#settings-enable_agc_dispo_log$NWE
    Orologio End of Day:$NWB#settings-timeclock_end_of_day$NWE
    Ultimo Logout orologio automatico: $timeclock_last_reset_date
    Agente Screen Formato Data Header:
    Centrale Sound Control Attivo: $NWB#settings-sounds_central_control_active$NWE
    Suoni Web Server: $NWB#settings-sounds_web_server$NWE
    Suoni Web Directory: $sounds_web_directory $NWB#settings-sounds_web_directory$NWE
    Admin Web Directory: $NWB#settings-admin_web_directory$NWE
    Attivo Server Casella Vocale: $NWB#settings-active_voicemail_server$NWE
    Consentire l-integrazione TTS: $NWB#settings-enable_tts_integration$NWE
    Enable CallCard: $NWB#settings-callcard_enabled$NWE
    Enable Custom List Fields: $NWB#settings-custom_fields_enabled$NWE
    First Login Trigger: $first_login_trigger   $NWB#settings-first_login_trigger$NWE
    Default Phone Registrazione Password: $NWB#settings-default_phone_registration_password$NWE     Strength:
    Default Login Telefono Password: $NWB#settings-default_phone_login_password$NWE     Strength:
    Default Server Password: $NWB#settings-default_server_password$NWE     Strength:
    Slave Database Server: $NWB#settings-slave_db_server$NWE
    Rapporti to use Slave DB: $NWB#settings-reports_use_slave_db$NWE
    Custom Dialplan entrata: $NWB#settings-custom_dialplan_entry$NWE
    Custom Dialplan entrata: Disabled $NWB#settings-custom_dialplan_entry$NWE
    Label Title: $NWB#settings-default_field_labels$NWE
    Label Nome: $NWB#settings-default_field_labels$NWE
    Label Secondo Nome: $NWB#settings-default_field_labels$NWE
    Label Cognome: $NWB#settings-default_field_labels$NWE
    Label Address1: $NWB#settings-default_field_labels$NWE
    Label Address2: $NWB#settings-default_field_labels$NWE
    Label Address3: $NWB#settings-default_field_labels$NWE
    Label Citta`: $NWB#settings-default_field_labels$NWE
    Label State: $NWB#settings-default_field_labels$NWE
    Label Provincia: $NWB#settings-default_field_labels$NWE
    Label CAP: $NWB#settings-default_field_labels$NWE
    Label Vendor Lead Code: $NWB#settings-default_field_labels$NWE
    Label Sesso: $NWB#settings-default_field_labels$NWE
    Label Numero di Telefono: $NWB#settings-default_field_labels$NWE
    Label Phone Code: $NWB#settings-default_field_labels$NWE
    Label Alt Phone: $NWB#settings-default_field_labels$NWE
    Label Frase De Seguridad: $NWB#settings-default_field_labels$NWE
    Label Email:$NWB#settings-default_field_labels$NWE
    Label Note: $NWB#settings-default_field_labels$NWE
    QC Attivo Caratteristiche: $NWB#settings-qc_features_active$NWE
    QC Ultimo Tirare Tempo: $qc_last_pull_time
    Default Codecs: $NWB#settings-default_codecs$NWE
    Default Webphone: $NWB#settings-default_webphone$NWE
    Default External IP Server: $NWB#settings-default_external_server_ip$NWE
    Webphone URL: $NWB#settings-webphone_url$NWE
    Webphone System Key: $NWB#settings-webphone_systemkey$NWE
    Permita La Registracion De QueueMetrics: $NWB#settings-enable_queuemetrics_logging$NWE
    IP Del Servidor De QueueMetrics: $NWB#settings-queuemetrics_server_ip$NWE
    Nombre del DB De QueueMetrics: $NWB#settings-queuemetrics_dbname$NWE
    QueueMetrics Login-Out: $NWB#settings-queuemetrics_loginout$NWE
    QueueMetrics CallEsito: $NWB#settings-queuemetrics_callstatus$NWE
    Attiva Vtiger Integrazione: $NWB#settings-enable_vtiger_integration$NWE\n"; echo "   Clicca qui per sincronizzare gli utenti con Vtiger\n"; @@ -22494,7 +25527,7 @@ if ($ADD==311111111111111) echo "\n"; if ($LOGuser_level >= 9) { - echo "

    Clicca qui per visualizzare Admin chages per le impostazioni di sistema\n"; + echo "

    Clicca qui per visualizzare Admin chages per le impostazioni di sistema\n"; } } else @@ -23156,7 +26189,7 @@ if ($ADD==10) echo "
    \n"; echo ""; - $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns order by campaign_id"; + $stmt="SELECT campaign_id,campaign_name,active,dial_method,auto_dial_level,lead_order,dial_statuses from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id"; $rslt=mysql_query($stmt, $link); $campaigns_to_print = mysql_num_rows($rslt); @@ -23225,7 +26258,7 @@ if ($ADD==100) if (eregi("CAMPAIGNDOWN",$stage)) {$SQLorder='order by campaign_id desc'; $CAMPAIGNlink='stage=CAMPAIGNUP';} if (eregi("CALLDATEUP",$stage)) {$SQLorder='order by list_lastcalldate asc'; $CALLDATElink='stage=CALLDATEDOWN';} if (eregi("CALLDATEDOWN",$stage)) {$SQLorder='order by list_lastcalldate desc'; $CALLDATElink='stage=CALLDATEUP';} - $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id group by list_id $SQLorder"; + $stmt="SELECT vls.list_id,list_name,list_description,count(*) as tally,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists vls,vicidial_list vl where vls.list_id=vl.list_id $LOGallowed_campaignsSQL group by list_id $SQLorder"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); @@ -23265,7 +26298,7 @@ if ($ADD==100) $o++; } - $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'');"; + $stmt="SELECT list_id,list_name,list_description,0,active,list_lastcalldate,campaign_id,reset_time from vicidial_lists where list_id NOT IN($lists_printed'') $LOGallowed_campaignsSQL;"; $rslt=mysql_query($stmt, $link); $lists_to_print = mysql_num_rows($rslt); $o=0; @@ -23292,7 +26325,6 @@ if ($ADD==100) } - ###################### # ADD=1000 display all inbound groups ###################### @@ -23347,7 +26379,7 @@ if ($ADD==1300) echo "\n"; echo ""; echo ""; + echo ""; echo "\n"; echo "\n"; @@ -23375,6 +26408,7 @@ if ($ADD==1300) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23442,6 +26476,69 @@ if ($ADD==1500) } +###################### +# ADD=1700 display all filter phone groups +###################### +if ($ADD==1700) + { + echo "
    \n"; echo ""; - $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route from vicidial_inbound_dids order by did_pattern"; + $stmt="SELECT did_id,did_pattern,did_description,did_active,did_route,record_call from vicidial_inbound_dids order by did_pattern"; $rslt=mysql_query($stmt, $link); $dids_to_print = mysql_num_rows($rslt); @@ -23359,6 +26391,7 @@ if ($ADD==1300) echo "DESCRIZIONEATTIVOROUTERECMODIFICA
    $row[2] $row[3] $row[4] $row[5]MODIFICA
    \n"; + echo ""; + + $stmt="SELECT vfpg.filter_phone_group_id,filter_phone_group_name,filter_phone_group_description,count(*) as tally from vicidial_filter_phone_groups vfpg,vicidial_filter_phone_numbers vfpn where vfpg.filter_phone_group_id=vfpn.filter_phone_group_id group by filter_phone_group_id order by filter_phone_group_id"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + + echo "
    FILTER PHONE GROUP LISTINGS:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $lists_printed = ''; + $o=0; + while ($lists_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 "\n"; + $groups_printed .= "'$row[0]',"; + $o++; + } + + $stmt="SELECT filter_phone_group_id,filter_phone_group_name,filter_phone_group_description,0 from vicidial_filter_phone_groups where filter_phone_group_id NOT IN($groups_printed'') order by filter_phone_group_id;"; + $rslt=mysql_query($stmt, $link); + $lists_to_print = mysql_num_rows($rslt); + $o=0; + while ($lists_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 "\n"; + $o++; + } + + echo "
    FPG IDFPG NAMEDESCRIZIONEPHONES COUNTMODIFICA
    $row[0] $row[1] $row[2] $row[3]MODIFICA
    $row[0] $row[1] $row[2] $row[3]MODIFICA
    \n"; + } + + ###################### # ADD=10000 display all remote agents ###################### @@ -23450,7 +26547,7 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo ""; echo "\n"; @@ -23479,6 +26577,7 @@ if ($ADD==10000) echo ""; echo ""; echo ""; + echo ""; echo "\n"; $o++; } @@ -23487,6 +26586,53 @@ if ($ADD==10000) } +###################### +# ADD=12000 display all extension group entries +###################### +if ($ADD==12000) + { + echo "
    \n"; echo ""; - $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,status,campaign_id from vicidial_remote_agents order by server_ip,campaign_id,user_start"; + $stmt="SELECT remote_agent_id,user_start,number_of_lines,server_ip,conf_exten,extension_group,status,campaign_id from vicidial_remote_agents $whereLOGallowed_campaignsSQL order by server_ip,campaign_id,user_start"; $rslt=mysql_query($stmt, $link); $remoteagents_to_print = mysql_num_rows($rslt); @@ -23461,6 +26558,7 @@ if ($ADD==10000) echo "LINESSERVER   CONF-EXTEN   GROUP   STATUS   CAMPAIGN   MODIFICA
    $row[4] $row[5] $row[6] $row[7]MODIFICA
    \n"; + echo ""; + + $stmt="SELECT extension_id,extension_group_id,extension,rank,campaign_groups,call_count_today,last_call_time,last_callerid from vicidial_extension_groups order by extension_group_id,rank,extension"; + $rslt=mysql_query($stmt, $link); + $extensiongroups_to_print = mysql_num_rows($rslt); + + echo "
    EXTENSION GROUP LISTINGS:\n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + + $o=0; + while ($extensiongroups_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 "
    GRUPPOINTERNORANK   RESTRICT   COUNT   LAST CALL   LAST ID   MODIFICA
    $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7]MODIFICA
    \n"; + } + + ###################### # ADD=100000 display all user groups ###################### @@ -24002,7 +27148,7 @@ if ($ADD==150000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo "\n"; @@ -24030,6 +27177,7 @@ if ($ADD==150000000000) echo ""; echo ""; echo ""; + echo ""; echo ""; echo "\n"; $o++; @@ -24387,73 +27535,82 @@ if ($ADD==710000000000000) if ($ADD==720000000000000) { - echo "
    \n"; echo ""; - $stmt="SELECT tts_id,tts_name,active,tts_text from vicidial_tts_prompts order by tts_id"; + $stmt="SELECT tts_id,tts_name,active,tts_text,tts_voice from vicidial_tts_prompts order by tts_id"; $rslt=mysql_query($stmt, $link); $tts_to_print = mysql_num_rows($rslt); @@ -24012,6 +27158,7 @@ if ($ADD==150000000000) echo "TTS IDTTS NomeAttivoTTS VoiceTTS TextMODIFICA
    $row[0]$row[1]$row[2]$row[4]$row[3]MODIFICA
    \n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - echo "
    ADMIN Change Log: Sezione Records - $category - $stage\n"; - echo "
    \n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - $logs_printed = ''; - $o=0; - while ($logs_to_print > $o) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); + echo "
    IDDATE TIMEUTENTEIPSECTIONTYPERECORD IDDESCRIZIONEGOTO
    "; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - echo "\n"; - $logs_printed .= "'$row[0]',"; - $o++; + echo "
    ADMIN Change Log: Sezione Records - $category - $stage\n"; + echo "
    \n"; + echo ""; - if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} - if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} - if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} - if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} - if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} - if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} - if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} - if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} - if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} - if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} - if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} - if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} - if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} - if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} - if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} - if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} - if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} - if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} - if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} + $stmt="SELECT admin_log_id,event_date,user,ip_address,event_section,event_type,record_id,event_code from vicidial_admin_log where event_section='$category' and record_id='$stage' order by event_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - echo "
    $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO
    \n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + $logs_printed = ''; + $o=0; + while ($logs_to_print > $o) + { + $row=mysql_fetch_row($rslt); + + if (eregi("USER|AGENT",$row[4])) {$record_link = "$PHP_SELF?ADD=3&user=$row[6]";} + if (eregi('CAMPAIGN',$row[4])) {$record_link = "$PHP_SELF?ADD=31&campaign_id=$row[6]";} + if (eregi('LIST',$row[4])) {$record_link = "$PHP_SELF?ADD=311&list_id=$row[6]";} + if (eregi('SCRIPT',$row[4])) {$record_link = "$PHP_SELF?ADD=3111111&script_id=$row[6]";} + if (eregi('FILTER',$row[4])) {$record_link = "$PHP_SELF?ADD=31111111&lead_filter_id=$row[6]";} + if (eregi('INGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=3111&group_id=$row[6]";} + if (eregi('DID',$row[4])) {$record_link = "$PHP_SELF?ADD=3311&did_id=$row[6]";} + if (eregi('USERGROUP',$row[4])) {$record_link = "$PHP_SELF?ADD=311111&user_group=$row[6]";} + 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('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]";} + if (eregi('SERVER',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111&server_id=$row[6]";} + if (eregi('CONFERENCE',$row[4])) {$record_link = "$PHP_SELF?ADD=1000000000000";} + if (eregi('SYSTEM',$row[4])) {$record_link = "$PHP_SELF?ADD=311111111111111";} + if (eregi('CATEGOR',$row[4])) {$record_link = "$PHP_SELF?ADD=331111111111111";} + if (eregi('GROUPALIAS',$row[4])) {$record_link = "$PHP_SELF?ADD=33111111111&group_alias_id=$row[6]";} + if (eregi('LEADS',$row[4])) {$record_link = "./admin_modify_lead.php?lead_id=$row[6]";} + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "\n"; + $logs_printed .= "'$row[0]',"; + $o++; + } + echo "
    IDDATE TIMEUTENTEIPSECTIONTYPERECORD IDDESCRIZIONEGOTO
    $row[0] $row[1] $row[2] $row[3] $row[4] $row[5] $row[6] $row[7] GOTO


    \n"; + echo "\n"; + echo "
    \n"; + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; } - echo "


    \n"; - echo "\n"; - echo "\n"; } @@ -24463,53 +27620,62 @@ if ($ADD==720000000000000) if ($ADD==730000000000000) { - echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; @@ -186,12 +237,33 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo ""; echo ""; - echo ""; + echo ""; echo "\n"; echo ""; - echo ""; + echo ""; echo ""; + + ### Log search + echo "
    \n"; + echo "
    "; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "\n"; + echo ""; + echo ""; + echo ""; + + echo "
    \n"; - echo ""; - - $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - if ($logs_to_print > 0) + if ($LOGuser_level >= 9) { - $row=mysql_fetch_row($rslt); - echo "
    ADMIN Change Log: Record Dettagliata - $stage

    \n"; - echo "
    \n"; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - echo ""; - echo ""; - echo "\n"; - $row[9] = eregi_replace("',","' ,",$row[9]); - echo ""; - echo ""; - echo "\n"; - echo "
    ID: $row[0]
    DATE TIME: $row[1]
    USER: $row[2] - $row[10]
    IP: $row[3]
    SECTION: $row[4]
    TYPE: $row[5]
    RECORD ID: $row[6]
    DESCRIZIONE: $row[7]
    NOTES: $row[8]
    SQL:

    $row[9]



    \n"; - echo "\n"; - echo "
    \n"; + echo "
    \n"; + echo ""; + + $stmt="SELECT admin_log_id,event_date,val.user,ip_address,event_section,event_type,record_id,event_code,event_notes,event_sql,full_name from vicidial_admin_log val, vicidial_users vu where admin_log_id='$stage' and val.user=vu.user;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + if ($logs_to_print > 0) + { + $row=mysql_fetch_row($rslt); + echo "
    ADMIN Change Log: Record Dettagliata - $stage

    \n"; + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + echo ""; + echo ""; + echo "\n"; + $row[9] = eregi_replace("',","' ,",$row[9]); + $row[9] = preg_replace("/\|/","
    ",$row[9]); + echo ""; + echo ""; + echo "\n"; + echo "
    ID: $row[0]
    DATE TIME: $row[1]
    USER: $row[2] - $row[10]
    IP: $row[3]
    SECTION: $row[4]
    TYPE: $row[5]
    RECORD ID: $row[6]
    DESCRIZIONE: $row[7]
    NOTES: $row[8]
    SQL:

    $row[9]



    \n"; + echo "\n"; + echo "
    \n"; + } + } + else + { + echo "Non hai l`autorizzazione per accedere a questa pagina\n"; + exit; } } @@ -24564,54 +27730,79 @@ if ($ADD==999999)
          - Real-Time Rapporti
    -
    - Inbound and Outbound Calling Rapporti
    - \n"; + echo "
    \n"; + echo "      \n"; + echo "\n"; + echo "Agent Rapporti
    \n"; + echo "
      \n"; + if ( (preg_match("/Agente Time Dettagliata/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Agente Time Dettagliata\n";} + if ( (preg_match("/Agent Status Dettagliata/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Agent Status Dettagliata\n";} + if ( (preg_match("/Agent Performance Dettagliata/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Agent Performance Dettagliata\n";} + if ( (preg_match("/Single Agent Daily/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Single Agent Daily\n";} + if ( (preg_match("/Statistiche utente/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Statistiche utente\n";} + if ( (preg_match("/Utente Time Sheet/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Utente Time Sheet\n";} + echo "

    \n"; + echo "Time Clock Rapporti
    \n"; + echo "
      \n"; + if ( (preg_match("/UtenteOrologio Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • UtenteOrologio Report\n";} + if ( (preg_match("/Gruppo UtenteOrologio Status Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Gruppo UtenteOrologio Status Report\n";} + if ( (preg_match("/UtenteOrologio Dettagliata Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • UtenteOrologio Dettagliata Report\n";} + echo "

    \n"; + echo "Other Report and Links
    \n"; + echo "
      \n"; + if ( (preg_match("/Server Performance Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + {echo "
    • Server Performance Report\n";} -
    -       - - Agent Rapporti
    -
    - Time Clock Rapporti
    -
    - Other Report and Links
    -
      -
    • Server Perforrmance Report - = 9) + if ( ($LOGuser_level >= 9) and ( (preg_match("/Administration Change Log/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) ) { echo "
    • Administration Change Log\n"; } @@ -24623,58 +27814,112 @@ if ($ADD==999999) { echo "
    • VtigerCRM Home\n"; } - if ($list_update_count > 0) + if ( ($list_update_count > 0) and ( (preg_match("/List Update Stats/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) ) { echo "
    • List Update Stats\n"; } - ?> -
    -
    - - -
    
    -		
    -		 $o)
    +		if ($SScallcard_enabled > 0)
     			{
    -			$cpu = (100 - $cpu_idle_percent[$o]);
    -			$disk = '';
    -			$disk_ary = explode('|',$disk_usage[$o]);
    -			$disk_ary_ct = count($disk_ary);
    -			$k=0;
    -			while ($k < $disk_ary_ct)
    -				{
    -				$disk_ary[$k] = preg_replace("/^\d* /","",$disk_ary[$k]);
    -				if ($k<1) {$disk = "$disk_ary[$k]";}
    -				else
    -					{
    -					if ($disk_ary[$k] > $disk) {$disk = "$disk_ary[$k]";}
    -					}
    -				$k++;
    -				}
    -			$disk = "$disk%";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			echo "\n";
    -			$o++;
    +			if ( (preg_match("/CallCard Search/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) )
    +				{echo "
  • CallCard Search\n";} } - echo "
  • SERVERDESCRIZIONEIPACTLOADCHANDISKOUTBOUNDINBOUND
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$diskLINKLINK
    \n"; + echo "\n"; + echo "
    \n"; + + if ( (file_exists('custom_report_links.html')) and ( (preg_match("/Custom Report Links/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) ) ) + { + readfile('custom_report_links.html'); + } + + + if ($reports_only_user < 1) + { + echo "
    \n";
    +
    +			if ($stage == 'TIME')
    +				{
    +				echo "";
    +				echo "\n";
    +				}
    +			else
    +				{
    +				echo "";
    +				echo "\n";
    +				}
    +
    +			$o=0;
    +			while ($servers_to_print > $o)
    +				{
    +				$cpu = (100 - $cpu_idle_percent[$o]);
    +				$disk = '';
    +				$disk_ary = explode('|',$disk_usage[$o]);
    +				$disk_ary_ct = count($disk_ary);
    +				$k=0;
    +				while ($k < $disk_ary_ct)
    +					{
    +					$disk_ary[$k] = preg_replace("/^\d* /","",$disk_ary[$k]);
    +					if ($k<1) {$disk = "$disk_ary[$k]";}
    +					else
    +						{
    +						if ($disk_ary[$k] > $disk) {$disk = "$disk_ary[$k]";}
    +						}
    +					$k++;
    +					}
    +				$disk = "$disk%";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				echo "\n";
    +				if ($stage == 'TIME')
    +					{
    +					$stmt="select last_update from server_updater where server_ip='$server_ip[$o]';";
    +					$rslt=mysql_query($stmt, $link);
    +					if ($DB) {echo "$stmt\n";}
    +					$servertime_to_print = mysql_num_rows($rslt);
    +					if ($servertime_to_print)
    +						{
    +						$row=mysql_fetch_row($rslt);
    +						echo "";
    +						}
    +					}
    +				else
    +					{
    +					if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORT/",$LOGallowed_reports)) )
    +						{
    +						echo "\n";
    +						echo "\n";
    +						}
    +					else
    +						{
    +						echo "\n";
    +						echo "\n";
    +						}
    +					}
    +				echo "\n";
    +				$o++;
    +				}
    +
    +			if ($stage == 'TIME')
    +				{
    +				echo "";
    +
    +				$stmt="select NOW();";
    +				$rslt=mysql_query($stmt, $link);
    +				if ($DB) {echo "$stmt\n";}
    +				$dbtime_to_print = mysql_num_rows($rslt);
    +				if ($dbtime_to_print)
    +					{
    +					$row=mysql_fetch_row($rslt);
    +					echo "";
    +					}
    +				}
    +			echo "
    SERVER -DESCRIZIONEIPACTLOADCHANDISKTIME
    SERVER +DESCRIZIONEIPACTLOADCHANDISKOUTBOUNDINBOUND
    $server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$disk$row[0]LINKLINK    
      PHP Time   " . date("Y-m-d H:i:s") . "
      DB Time   $row[0]
    \n"; + } } else { @@ -24682,6 +27927,244 @@ if ($ADD==999999) exit; } } +##### END report links ##### + + +###################### +# ADD=999998 display admin links page +###################### +if ($ADD==999998) + { + ?> + + + + + + Administration: Admin + Administration

    +
    + \n"; + echo "   \n"; + } +##### END admin links ##### + + +###################### +# ADD=999997 - user force change password page +###################### +if ($ADD==999997) + { + $show_form=1; + if ($stage=='INVIA') + { + if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) ) + {echo "Password has not been changed, please try again |1|" . strlen($pass);} + else + { + $stmt="select count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "Password has not been changed, please try again |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "Password has not been changed, please try again |3|$row[0]";} + else + { + $show_form=0; + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and force_change_password='Y' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + ### 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='USERS', event_type='MODIFY', record_id='$user', event_code='USER FORCE CHANGE PASSWORD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Password has been updated, you may now continue\n"; + } + } + } + } + if ($show_form > 0) + { + echo ""; + $call_log .= ""; + $call_log .= ""; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + $call_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_agent_log records ##### + $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Alogs_to_print = mysql_num_rows($rslt); + + $y=0; + $agent_log = ''; + $Alog_campaign = ''; + while ($Alogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= ""; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + $agent_log .= "\n"; + + $campaign_id = $row[5]; + } + + ##### grab vicidial_closer_log records ##### + $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $Clogs_to_print = mysql_num_rows($rslt); + + $y=0; + $closer_log = ''; + $Clog_campaign = ''; + while ($Clogs_to_print > $y) + { + $row=mysql_fetch_row($rslt); + if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $y)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $y++; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= ""; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + $closer_log .= "\n"; + + $campaign_id = $row[3]; + } + + ##### grab vicidial_list data for lead ##### + $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $row=mysql_fetch_row($rslt); + if (strlen($row[0]) > 0) + {$lead_id = $row[0];} + $dispo = $row[3]; + $tsr = $row[4]; + $vendor_id = $row[5]; + $list_id = $row[7]; + $gmt_offset_now = $row[8]; + $phone_code = $row[10]; + $phone_number = $row[11]; + $title = $row[12]; + $first_name = $row[13]; + $middle_initial = $row[14]; + $last_name = $row[15]; + $address1 = $row[16]; + $address2 = $row[17]; + $address3 = $row[18]; + $city = $row[19]; + $state = $row[20]; + $province = $row[21]; + $postal_code = $row[22]; + $country_code = $row[23]; + $gender = $row[24]; + $date_of_birth = $row[25]; + $alt_phone = $row[26]; + $email = $row[27]; + $security = $row[28]; + $comments = $row[29]; + $called_count = $row[30]; + $last_local_call_time = $row[31]; + $rank = $row[32]; + $owner = $row[33]; + $entry_list_id = $row[34]; + + echo "
    Informazioni Chiamata: $first_name $last_name - $phone_number

    \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 ""; + + echo "
    CHANGE PASSWORD
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    New Password:     Strength:
    You are required to change your password before you can continue on to Administration. A strong password has both lower case and upper case letters as well as at least one number. Your password must be from 2 to 20 characters in length and cannot contain any characters that are not letters or numbers. Be sure that this password is something that you can remember, because as soon as you make this change you will be prompted to enter your new password to log back in to Administration
    \n"; + } + } +##### END user force change password page ##### + + +###################### +# ADD=999996 - initial install welcome page +###################### +if ($ADD==999996) + { + if ($SSfirst_login_trigger=='Y') + { + $show_form=1; + if ($stage=='INVIA') + { + if ( (strlen($pass) > 20) or (strlen($pass) < 2) or ($pass==$PHP_AUTH_PW) ) + {echo "Password has not been changed, please try again |1|" . strlen($pass);} + else + { + $stmt="select count(*) from vicidial_users where user='$user' and pass='$PHP_AUTH_PW' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $userpass_to_print = mysql_num_rows($rslt); + if ($userpass_to_print < 1) + {echo "Password has not been changed, please try again |2|$userpass_to_print";} + else + { + $row=mysql_fetch_row($rslt); + if ($row[0] < 1) + {echo "Password has not been changed, please try again |3|$row[0]";} + else + { + $show_form=0; + + if (strlen($default_phone_registration_password) < 2) {$default_phone_registration_password = $SSdefault_phone_registration_password;} + if (strlen($default_phone_login_password) < 2) {$default_phone_login_password = $SSdefault_phone_login_password;} + if (strlen($default_server_password) < 2) {$default_server_password = $SSdefault_server_password;} + + $stmt="UPDATE vicidial_users SET pass='$pass',force_change_password='N' where user='$user' and active='Y' and user_level > 6;"; + $rslt=mysql_query($stmt, $link); + + $stmtA="UPDATE system_settings SET first_login_trigger='N',default_phone_registration_password='$default_phone_registration_password',default_phone_login_password='$default_phone_login_password',default_server_password='$default_server_password';"; + $rslt=mysql_query($stmtA, $link); + + $stmtB="UPDATE phones SET conf_secret='$default_phone_registration_password',pass='$default_phone_login_password';"; + $rslt=mysql_query($stmtB, $link); + + $stmtC="UPDATE servers SET conf_secret='$default_server_password',rebuild_conf_files='Y';"; + $rslt=mysql_query($stmtC, $link); + + ### LOG INSERTION Admin Log Table ### + $SQL_log = "$stmt|$stmtA|$stmtB|$stmtC|"; + $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='USERS', event_type='MODIFY', record_id='$user', event_code='INITIAL SETTINGS UPDATE', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + echo "Passwords have been updated, you may now continue on into Administration.

    You may want to start by reading the ViciDial Manager Manual available at vicidial.org (there is a free version available)\n"; + } + } + } + } + if ($show_form > 0) + { + echo "\n"; echo "\n";echo "\n"; -$stmt="SELECT admin_home_url,enable_tts_integration from system_settings;"; +$stmt="SELECT admin_home_url,enable_tts_integration,callcard_enabled,custom_fields_enabled from system_settings;"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); -$admin_home_url_LU = $row[0]; +$admin_home_url_LU = $row[0]; $SSenable_tts_integration = $row[1]; +$SScallcard_enabled = $row[2]; +$SScustom_fields_enabled = $row[3]; ?>
    @@ -911,6 +1011,8 @@ $SSenable_tts_integration = $row[1]; VICIDIAL logo ADMINISTRATION
    \n"; + echo ""; + + echo "
    Benvenuto to ViciDial, initial setup screen

    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
    You are required to change your password before you can continue on to Administration. A strong password has both lower case and upper case letters as well as at least one number. Your password must be from 2 to 20 characters in length and cannot contain any characters that are not letters or numbers. Be sure that this password is something that you can remember, because as soon as you complete this initial setup screen you will be prompted to enter your new password in again to log back in to Administration
    New Password:     Strength:
     
    The next three default passwords are defined in the Impostazioni di Sistema section, and you can change them after you define them here. It is a good idea to make these passwords strong so that no one can hack into your phone accounts and place phone calls without you knowing. The default registration password used when new phones are added to the system as the SIP or IAX VOIP phone password. The default phone web login password used when new phones are added to the system, as the phone password that an agent would use in the ViciDial Agent Interface. The default server password used when new servers are added to the system for servers to communicate with each other.
    Default Phone Registrazione Password:     Strength:
    Default Login Telefono Password:     Strength:
    Default Server Password:     Strength:
     
    \n"; + } + } + } +##### END initial install welcome page ##### + + +###################### +# ADD=999995 - copyright trademark license page +###################### +if ($ADD==999995) + { + echo "
    \n"; + echo ""; + + echo "
    Benvenuti to ViciDial: copyright, trademark and license page

    \n"; + echo "
    \n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "\n"; + + echo "
    Copyright:   The ViciDial Call Center Suite is maintained by the ViciDial Group, © 2010
    Trademark:   \"VICIDIAL\" is a registered trademark of the ViciDial Group. Here is our trademark use policy
    License:   The ViciDial Call Center Suite is released under the AGPLv2 open source license
    Source Code:   The ViciDial Call Center Suite software is available for download, and for use, free of cost. You can download the easy to install ViciBox CD ISO version, or only the source code
    \n"; + if ($first_login_link > 0) + { + echo "

    "; + echo "
    Continue on to the Initial Setup

      \n"; + } + } +##### END copyright trademark license page ##### echo "
    \n"; @@ -24695,8 +28178,10 @@ echo "
    \n"; echo "

    "; echo "VERSIONE: $admin_version
    "; -echo "BUILD: $build
    \n"; - +echo "BUILD: $build\n"; +if (!preg_match("/_BUILD_/",$SShosted_settings)) + {echo "
    © 2010 ViciDial Group
    ";} +echo "\n"; ?>
    @@ -25047,7 +28532,7 @@ if (isset($camp_lists)) } else {$active_leads = '0';} - echo "|$DB|\n"; + if ($DB > 0) {echo "|$DB|\n";} echo "Questa campagna ha $active_leads contatti da chiamare in queste liste\n"; } else diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin_header.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin_header.php index 371554a2..9c33758f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/admin_header.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin_header.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES @@ -18,6 +18,15 @@ # 90904-1534 - Added launch_moh_chooser # 90916-2334 - Added Voicemail options # 91223-1030 - Added VIDPROMPT options for in-group routing in Call Menus +# 100311-2210 - Added callcard_enabled Admin element +# 100428-1039 - Added custom fields display +# 100507-1339 - Added copy carrier submenu +# 100616-2350 - Added VIDPROMPT call menu options +# 100728-0904 - Changed Lead Loader link to the new 3rd gen lead loader +# 100802-2127 - Changed Admin to point to links page instead of Phones listings +# 100831-2255 - Added password strength checking function +# 100914-1311 - Removed other links for reports-only users +# 101022-1323 - Added IGU_selectall function # @@ -27,15 +36,23 @@ if($short_header) ?> + - + - + + + +
        Utenti     Campagnas     Liste     Script     Filtri     In-Groups     Inbound     Gruppi Utenti     Operatori Remoti     Admin     Admin         Rapporti  
    @@ -319,34 +336,72 @@ if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_c + var weak = Image(); + weak.src = "images/weak.png"; + var medium = Image(); + medium.src = "images/medium.png"; + var strong = Image(); + strong.src = "images/strong.png"; - function openNewWindow(url) { - window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); - } - function scriptInsertField() { + function pwdChanged(pwd_field_str, pwd_img_str) + { + var pwd_field = document.getElementById(pwd_field_str); + var pwd_img = document.getElementById(pwd_img_str); + + var strong_regex = new RegExp( "^(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])", "g" ); + var medium_regex = new RegExp( "^(?=.{6,})(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9]))).*$", "g" ); + + if (strong_regex.test(pwd_field.value) ) + { + if (pwd_img.src != strong.src) + {pwd_img.src = strong.src;} + } + else if (medium_regex.test( pwd_field.value) ) + { + if (pwd_img.src != medium.src) + {pwd_img.src = medium.src;} + } + else + { + if (pwd_img.src != weak.src) + {pwd_img.src = weak.src;} + } + } + + function openNewWindow(url) + { + window.open (url,"",'width=620,height=300,scrollbars=yes,menubar=yes,address=yes'); + } + function scriptInsertField() + { openField = '--A--'; closeField = '--B--'; var textBox = document.scriptForm.script_text; var scriptIndex = document.getElementById("selectedField").selectedIndex; var insValue = document.getElementById('selectedField').options[scriptIndex].value; - if (document.selection) { - //IE - textBox = document.scriptForm.script_text; - insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; - textBox.focus(); - sel = document.selection.createRange(); - sel.text = openField + insValue + closeField; - } else if (textBox.selectionStart || textBox.selectionStart == 0) { - //Mozilla - var startPos = textBox.selectionStart; - var endPos = textBox.selectionEnd; - textBox.value = textBox.value.substring(0, startPos) - + openField + insValue + closeField - + textBox.value.substring(endPos, textBox.value.length); - } else { - textBox.value += openField + insValue + closeField; - } - } + if (document.selection) + { + //IE + textBox = document.scriptForm.script_text; + insValue = document.scriptForm.selectedField.options[document.scriptForm.selectedField.selectedIndex].text; + textBox.focus(); + sel = document.selection.createRange(); + sel.text = openField + insValue + closeField; + } + else if (textBox.selectionStart || textBox.selectionStart == 0) + { + //Mozilla + var startPos = textBox.selectionStart; + var endPos = textBox.selectionEnd; + textBox.value = textBox.value.substring(0, startPos) + + openField + insValue + closeField + + textBox.value.substring(endPos, textBox.value.length); + } + else + { + textBox.value += openField + insValue + closeField; + } + } + function IGU_selectall(temp_count,temp_fields) + { + var fields_array=temp_fields.split('|'); + var inc=0; + while (temp_count >= inc) + { + if (fields_array[inc].length > 0) + { + document.getElementById(fields_array[inc]).checked=true; + // document.admin_form.fields_array[inc].checked=true; + } + inc++; + } + } + + '; new_content = new_content + '   Handle Method: '; + new_content = new_content + '   AIUTO'; new_content = new_content + '
    Search Method: '; new_content = new_content + '   ID Lista: '; new_content = new_content + '
    ID Campagna: '; new_content = new_content + '   Phone Code: '; + new_content = new_content + "
      VID Enter Filename: audio chooser"; + new_content = new_content + "
      VID ID Number Filename: audio chooser"; + new_content = new_content + "
      VID Confirm Filename: audio chooser"; + new_content = new_content + '   VID Digits: '; } if (selected_route=='DID') { @@ -782,14 +871,18 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 if (selected_route=='INGROUP') { if ( (route != selected_route) || (value.length < 10) ) - {value = 'SALESLINE,CID,LB,998,TESTCAMP,1';} + {value = 'SALESLINE,CID,LB,998,TESTCAMP,1,,,,';} var value_split = value.split(","); - var IGgroup_id = value_split[0]; - var IGhandle_method = value_split[1]; - var IGsearch_method = value_split[2]; - var IGlist_id = value_split[3]; - var IGcampaign_id = value_split[4]; - var IGphone_code = value_split[5]; + var IGgroup_id = value_split[0]; + var IGhandle_method = value_split[1]; + var IGsearch_method = value_split[2]; + var IGlist_id = value_split[3]; + var IGcampaign_id = value_split[4]; + var IGphone_code = value_split[5]; + var IGvid_enter_filename = value_split[6]; + var IGvid_id_number_filename = value_split[7]; + var IGvid_confirm_filename = value_split[8]; + var IGvid_validate_digits = value_split[9]; if (route == selected_route) { @@ -807,6 +900,11 @@ if ( ($ADD==3111) or ($ADD==2111) or ($ADD==2011) or ($ADD==4111) or ($ADD==5111 new_content = new_content + '
    ID Campagna: '; new_content = new_content + '   Phone Code: '; + // new_content = new_content + "
      VID Enter Filename: audio chooser"; + // new_content = new_content + "
      VID ID Number Filename: audio chooser"; + // new_content = new_content + "
      VID Confirm Filename: audio chooser"; + // new_content = new_content + '   VID Digits: '; + } if (selected_route=='DID') { @@ -896,11 +994,13 @@ echo "\n"; echo "\n"; echo "\n"; echo "
    English Italiano
    + > @@ -989,6 +1093,8 @@ $SSenable_tts_integration = $row[1]; ?> > + > + @@ -998,22 +1104,35 @@ $SSenable_tts_integration = $row[1]; ?> 1) { - if ($LOGdelete_from_dnc > 0) {$DNClink = 'Add-Eliminare numero da DNC';} - else {$DNClink = 'Add Number To DNC';} + if (strlen($lists_hh) > 1) + { + if ($LOGdelete_from_dnc > 0) {$DNClink = 'Add-EliminareDNC Number';} + else {$DNClink = 'Add DNC Number';} ?> - >>>>> - >>>>>>> + @@ -1051,11 +1170,13 @@ $SSenable_tts_integration = $row[1]; ?> 1) - { + { + if ($LOGdelete_from_dnc > 0) {$FPGlink = 'Add-EliminareFPG Number';} + else {$FPGlink = 'Add FPG Number';} ?> >>>>>> @@ -1109,12 +1236,16 @@ $SSenable_tts_integration = $row[1]; > Visualizza Operatori Remoti >>> 1) @@ -1145,6 +1276,8 @@ $SSenable_tts_integration = $row[1]; else {$vm_sh=''; $vm_fc='BLACK';} if ($sh=='tts') {$tts_sh="bgcolor=\"$tts_color\""; $tts_fc="$tts_font";} else {$tts_sh=''; $tts_fc='BLACK';} + if ($sh=='cc') {$cc_sh="bgcolor=\"$cc_color\""; $cc_fc="$cc_font";} + else {$cc_sh=''; $cc_fc='BLACK';} ?> > @@ -1185,8 +1318,16 @@ $SSenable_tts_integration = $row[1]; SIZE=> Text To Speech + 0) + { ?> + > + + > + > 1) and (strlen($admin_hh) > 1) ) { ?> > 1) and (strlen($admin_hh) > 1) ) { + ?> + > + 1) and (strlen($admin_hh) > 1) ) { ?> > diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin_modify_lead.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin_modify_lead.php index ddb5baff..d199d2b9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/admin_modify_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin_modify_lead.php @@ -1,5 +1,5 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -33,6 +33,12 @@ # 90708-1549 - Added phone number dialed to outbound log # 90721-1246 - Added rank and owner as vicidial_list fields # 90917-2355 - Added extended alt phone entries +# 100405-1333 - Changed to show logs of non-found leads +# 100618-0148 - Added Middle name modify and fixes statuses list +# 100622-0945 - Added field labels +# 100703-1122 - Added custom fields display/edit +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100924-1431 - Added Called Count display # require("dbconnect.php"); @@ -48,8 +54,12 @@ if (isset($_GET["old_phone"])) {$old_phone=$_GET["old_phone"];} elseif (isset($_POST["old_phone"])) {$old_phone=$_POST["old_phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["title"])) {$title=$_GET["title"];} + elseif (isset($_POST["title"])) {$title=$_POST["title"];} if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} +if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} + elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} @@ -131,8 +141,8 @@ if (isset($_GET["modify_agent_logs"])) {$modify_agent_logs=$_GET["modify_agent if (isset($_GET["add_closer_record"])) {$add_closer_record=$_GET["add_closer_record"];} elseif (isset($_POST["add_closer_record"])) {$add_closer_record=$_POST["add_closer_record"];} -$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); -$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); +$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); +$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $STARTtime = date("U"); $TODAY = date("Y-m-d"); @@ -140,26 +150,34 @@ $NOW_TIME = date("Y-m-d H:i:s"); ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; } ##### END SETTINGS LOOKUP ##### ########################################### if ($non_latin < 1) { + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); + $old_phone = ereg_replace("[^0-9]","",$old_phone); $phone_number = ereg_replace("[^0-9]","",$phone_number); $alt_phone = ereg_replace("[^0-9]","",$alt_phone); + } # end of non_latin +else + { + $PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); + $PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); } + if (strlen($phone_number)<6) {$phone_number=$old_phone;} $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';"; @@ -210,6 +228,50 @@ else } } +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Citta`'; +$label_state = 'State'; +$label_province = 'Provincia'; +$label_postal_code = 'CAP'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Sesso'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Note'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + ?> @@ -224,7 +286,7 @@ echo "ADMINISTRATION: Registro del Lead modi if ($end_call > 0) { ### update the lead record in the vicidial_list table - $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',first_name='" . mysql_real_escape_string($first_name) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; + $stmt="UPDATE vicidial_list set status='" . mysql_real_escape_string($status) . "',title='" . mysql_real_escape_string($title) . "',first_name='" . mysql_real_escape_string($first_name) . "',middle_initial='" . mysql_real_escape_string($middle_initial) . "',last_name='" . mysql_real_escape_string($last_name) . "',address1='" . mysql_real_escape_string($address1) . "',address2='" . mysql_real_escape_string($address2) . "',address3='" . mysql_real_escape_string($address3) . "',city='" . mysql_real_escape_string($city) . "',state='" . mysql_real_escape_string($state) . "',province='" . mysql_real_escape_string($province) . "',postal_code='" . mysql_real_escape_string($postal_code) . "',country_code='" . mysql_real_escape_string($country_code) . "',alt_phone='" . mysql_real_escape_string($alt_phone) . "',phone_number='$phone_number',phone_code='$phone_code',email='" . mysql_real_escape_string($email) . "',security_phrase='" . mysql_real_escape_string($security) . "',comments='" . mysql_real_escape_string($comments) . "',rank='" . mysql_real_escape_string($rank) . "',owner='" . mysql_real_escape_string($owner) . "' where lead_id='" . mysql_real_escape_string($lead_id) . "'"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); @@ -366,271 +428,6 @@ else $alts_output .= "\n"; } - ##### grab vicidial_log records ##### - $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $logs_to_print = mysql_num_rows($rslt); - - $u=0; - $call_log = ''; - $log_campaign = ''; - while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (strlen($log_campaign)<1) {$log_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - $call_log .= ""; - $call_log .= ""; - $call_log .= ""; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - $call_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_agent_log records ##### - $stmt="select agent_log_id,user,server_ip,event_time,lead_id,campaign_id,pause_epoch,pause_sec,wait_epoch,wait_sec,talk_epoch,talk_sec,dispo_epoch,dispo_sec,status,user_group,comments,sub_status from vicidial_agent_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by agent_log_id desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Alogs_to_print = mysql_num_rows($rslt); - - $y=0; - $agent_log = ''; - $Alog_campaign = ''; - while ($Alogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= ""; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - $agent_log .= "\n"; - - $campaign_id = $row[5]; - } - - ##### grab vicidial_closer_log records ##### - $stmt="select closecallid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,queue_seconds,user_group,xfercallid,term_reason,uniqueid,agent_only from vicidial_closer_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by closecallid desc limit 500;"; - $rslt=mysql_query($stmt, $link); - $Clogs_to_print = mysql_num_rows($rslt); - - $y=0; - $closer_log = ''; - $Clog_campaign = ''; - while ($Clogs_to_print > $y) - { - $row=mysql_fetch_row($rslt); - if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} - if (eregi("1$|3$|5$|7$|9$", $y)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $y++; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= ""; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - $closer_log .= "\n"; - - $campaign_id = $row[3]; - } - - ##### grab vicidial_list data for lead ##### - $stmt="SELECT lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where lead_id='" . mysql_real_escape_string($lead_id) . "'"; - $rslt=mysql_query($stmt, $link); - if ($DB) {echo "$stmt\n";} - $row=mysql_fetch_row($rslt); - $lead_id = "$row[0]"; - $dispo = "$row[3]"; - $tsr = "$row[4]"; - $vendor_id = "$row[5]"; - $list_id = "$row[7]"; - $gmt_offset_now = "$row[8]"; - $phone_code = "$row[10]"; - $phone_number = "$row[11]"; - $title = "$row[12]"; - $first_name = "$row[13]"; - $middle_initial = "$row[14]"; - $last_name = "$row[15]"; - $address1 = "$row[16]"; - $address2 = "$row[17]"; - $address3 = "$row[18]"; - $city = "$row[19]"; - $state = "$row[20]"; - $province = "$row[21]"; - $postal_code = "$row[22]"; - $country_code = "$row[23]"; - $gender = "$row[24]"; - $date_of_birth = "$row[25]"; - $alt_phone = "$row[26]"; - $email = "$row[27]"; - $security = "$row[28]"; - $comments = "$row[29]"; - $called_count = "$row[30]"; - $last_local_call_time = "$row[31]"; - $rank = "$row[32]"; - $owner = "$row[33]"; - - echo "
    Informazioni Chiamata: $first_name $last_name - $phone_number

    \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 "
    WIDTH=160> SIZE=>Utenti @@ -966,6 +1068,8 @@ $SSenable_tts_integration = $row[1]; else {$pause_sh=''; $pause_fc='BLACK';} if ($sh=='listmix') {$listmix_sh="bgcolor=\"$subcamp_color\""; $listmix_fc="$subcamp_font";} else {$listmix_sh=''; $listmix_fc='BLACK';} + if ($sh=='preset') {$preset_sh="bgcolor=\"$subcamp_color\""; $preset_fc="$subcamp_font";} + else {$preset_sh=''; $preset_fc='BLACK';} ?>
    >   SIZE=>Codici Pausa
    >   SIZE=>Presets
    > SIZE=>Liste
      - > Visualizza Liste -
      - > Nuova Lista -
      - > Ricerca Contatti -
      - > -
      - > Carica Nuovi Contatti -
      + > Visualizza Liste +
      + > Nuova Lista +
      + > Ricerca Contatti +
      + > +
      + > Carica Nuovi Contatti + 0) + { + ?> +
      + > List Custom Fields +
      + > CopiaCustom Fields + +
    > - SIZE=> Gruppi Inbound + SIZE=> Inbound
      > Visualizza Gruppi Inbound @@ -1074,7 +1195,13 @@ $SSenable_tts_integration = $row[1];
      > Aggiungi un nuovo menu Call
      - > Copia Call Menu + > Copia Call Menu
    +
      + > Filter Phone Groups +
      + > Add Filter Phone Group +
      + >
      >Aggiungi Operatore Remoto +
      + > Show Extension Groups +
      + > Add Extension Group
    > - SIZE=> Admin + SIZE=> Admin
    >   + SIZE=> CallCard Admin
    > @@ -1245,12 +1386,16 @@ $SSenable_tts_integration = $row[1]; 1) and (strlen($admin_hh) > 1) ) { ?> -
      > Show Vettori   |   > Add A New Carrier
      > Show Vettori   |   > Add A New Carrier   |   > CopiaA Carrier
      > Mostra TTS Entries   |   > Aggiungere una nuova voce TTS
      > CallCard Summary   |   > Runs   |   > Batches   |   > CallCard Search   |   > CallCard Log Export   |   > CallCard Generate New Numbers
      > Mostra MOH Entries   |   > Aggiungere una nuova voce MOH
    $row[4]
    $u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
    $y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
    $y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - - - echo "\n"; - echo "
    Vendor ID: $vendor_id     Lead ID: $lead_id
    Fronter: $tsr     ID Lista: $list_id
    Nome:   \n"; - echo " Cognome:
    Indirizzo 1 :
    Indirizzo 2 :
    Indirizzo 3 :
    Citta` :
    Estado:   \n"; - echo " CAP:
    Provincia :
    Stato :
    Main Phone :
    Numero Alt :
    Email :
    Seguridad:
    Rank :
    Owner :
    Note :
    Esito: (with $log_campaign statuses)
    Modificarevicidial log
    Modificareagent log
    Modificarecloser log
    Add closer log record
    \n"; - echo "


    \n"; - - if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) - { - ### find any vicidial_callback records for this lead - $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $CB_to_print = mysql_num_rows($rslt); - $rowx=mysql_fetch_row($rslt); - - if ($CB_to_print>0) - { - if ($rowx[9] == 'USERONLY') - { - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

    \n"; - - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UtenteID: \n"; - echo "

    \n"; - } - else - { - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "New Callback Owner UtenteID: \n"; - echo "

    \n"; - } - } - else - { - echo "
    No Callback records found
    \n"; - } - } } else { @@ -638,6 +435,288 @@ else # echo "Close this window\n

    \n"; } + ##### grab vicidial_log records ##### + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by uniqueid desc limit 500;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + $call_log = ''; + $log_campaign = ''; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (strlen($log_campaign)<1) {$log_campaign = $row[3];} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + $call_log .= "
    $u$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1] $row[15]   $row[10]
    $y$row[3] $row[5] $row[1] $row[7] $row[9] $row[11] $row[13]   $row[14]   $row[15]   $row[17]
    $y$row[4] $row[7] $row[8] $row[11] $row[3] $row[2] $row[1]   $row[14]   $row[17]
    \n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "
    $label_vendor_lead_code: $vendor_id     Lead ID: $lead_id
    Fronter: $tsr     ID Lista: $list_id     Called Count: $called_count
    $label_title:   \n"; + echo "$label_first_name:
    $label_middle_initial:   \n"; + echo " $label_last_name:
    $label_address1 :
    $label_address2 :
    $label_address3 :
    $label_city :
    $label_state:   \n"; + echo " $label_postal_code:
    $label_province :
    Stato :
    $label_phone_number :
    $label_phone_code :
    $label_alt_phone :
    $label_email :
    $label_security_phrase :
    Rank :
    Owner :
    $label_comments :
    Esito: (with $list_campaign statuses)
    Modificarevicidial log
    Modificareagent log
    Modificarecloser log
    Add closer log record
    \n"; + echo "


    \n"; + + if ( ($dispo == 'CALLBK') or ($dispo == 'CBHOLD') ) + { + ### find any vicidial_callback records for this lead + $stmt="select callback_id,lead_id,list_id,campaign_id,status,entry_time,callback_time,modify_date,user,recipient,comments,user_group from vicidial_callbacks where lead_id='" . mysql_real_escape_string($lead_id) . "' and status IN('ACTIVE','LIVE') order by callback_id desc LIMIT 1;"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + $CB_to_print = mysql_num_rows($rslt); + $rowx=mysql_fetch_row($rslt); + + if ($CB_to_print>0) + { + if ($rowx[9] == 'USERONLY') + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "

    \n"; + + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UtenteID: \n"; + echo "

    \n"; + } + else + { + echo "
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "New Callback Owner UtenteID: \n"; + echo "

    \n"; + } + } + else + { + echo "
    No Callback records found
    \n"; + } + } echo "

    \n"; @@ -656,6 +735,37 @@ else echo "

    \n"; } + + + ### iframe for custom fields display/editing + if ($custom_fields_enabled > 0) + { + $CLlist_id = $list_id; + if (strlen($entry_list_id) > 2) + {$CLlist_id = $entry_list_id;} + $stmt="MOSTRA TABELLAS LIKE \"custom_$CLlist_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from custom_$CLlist_id where lead_id='$lead_id';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + echo "CUSTOM FIELDS FOR THIS LEAD:
    \n"; + echo "\n"; + echo "

    "; + } + } + } + + echo "CHIAMATE VERSO QUESTO CONTATTO:\n"; echo "\n"; echo "\n"; @@ -692,6 +802,7 @@ else $stmt="select recording_id,channel,server_ip,extension,start_time,start_epoch,end_time,end_epoch,length_in_sec,length_in_min,filename,location,lead_id,user,vicidial_id from recording_log where lead_id='" . mysql_real_escape_string($lead_id) . "' order by recording_id desc limit 500;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); + if ($DB) {echo "$logs_to_print|$stmt|\n";} $u=0; while ($logs_to_print > $u) @@ -731,7 +842,7 @@ else {$locat = substr($location,0,27); $locat = "$locat...";} else {$locat = $location;} - if (eregi("http",$location)) + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) {$location = "$locat";} else {$location = $locat;} @@ -750,7 +861,21 @@ else } - echo "
    # DATE/TIME LENGTH STATUS TSR CAMPAGNA LIST LEAD HANGUP REASON PHONE
    \n"; + echo "


    \n"; + + + $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 9 and modify_leads='1';"; + if ($DB) {echo "|$stmt|\n";} + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $admin_display=$row[0]; + if ($admin_display > 0) + { + echo "Click here to see Lead Modificarechanges to this lead\n"; + } + + echo "
    \n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/admin_search_lead.php b/agc_2-X/trunk/LANG_www/vicidial_it/admin_search_lead.php index 6e3cdc4a..941ccfe8 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/admin_search_lead.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/admin_search_lead.php @@ -1,5 +1,5 @@ LICENSE: AGPLv2 # @@ -22,6 +22,8 @@ # 90917-2307 - Added alternate phone number searching option # 90921-0713 - Removed SELECT STAR # 100224-1621 - Added first/last name search and changed format of the page +# 100405-1331 - Added log search ability +# 100622-0928 - Added field labels # require("dbconnect.php"); @@ -39,6 +41,10 @@ if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["log_phone"])) {$log_phone=$_GET["log_phone"];} + elseif (isset($_POST["log_phone"])) {$log_phone=$_POST["log_phone"];} +if (isset($_GET["log_lead_id"])) {$log_lead_id=$_GET["log_lead_id"];} + elseif (isset($_POST["log_lead_id"])) {$log_lead_id=$_POST["log_lead_id"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} @@ -141,13 +147,58 @@ $subcamp_color = '#C6C6C6'; require("admin_header.php"); +$label_title = 'Title'; +$label_first_name = 'First'; +$label_middle_initial = 'MI'; +$label_last_name = 'Last'; +$label_address1 = 'Address1'; +$label_address2 = 'Address2'; +$label_address3 = 'Address3'; +$label_city = 'Citta`'; +$label_state = 'State'; +$label_province = 'Provincia'; +$label_postal_code = 'CAP'; +$label_vendor_lead_code = 'Vendor ID'; +$label_gender = 'Sesso'; +$label_phone_number = 'Phone'; +$label_phone_code = 'DialCode'; +$label_alt_phone = 'Alt. Phone'; +$label_security_phrase = 'Show'; +$label_email = 'Email'; +$label_comments = 'Note'; + +### find any custom field labels +$stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +if (strlen($row[0])>0) {$label_title = $row[0];} +if (strlen($row[1])>0) {$label_first_name = $row[1];} +if (strlen($row[2])>0) {$label_middle_initial = $row[2];} +if (strlen($row[3])>0) {$label_last_name = $row[3];} +if (strlen($row[4])>0) {$label_address1 = $row[4];} +if (strlen($row[5])>0) {$label_address2 = $row[5];} +if (strlen($row[6])>0) {$label_address3 = $row[6];} +if (strlen($row[7])>0) {$label_city = $row[7];} +if (strlen($row[8])>0) {$label_state = $row[8];} +if (strlen($row[9])>0) {$label_province = $row[9];} +if (strlen($row[10])>0) {$label_postal_code = $row[10];} +if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} +if (strlen($row[12])>0) {$label_gender = $row[12];} +if (strlen($row[13])>0) {$label_phone_number = $row[13];} +if (strlen($row[14])>0) {$label_phone_code = $row[14];} +if (strlen($row[15])>0) {$label_alt_phone = $row[15];} +if (strlen($row[16])>0) {$label_security_phrase = $row[16];} +if (strlen($row[17])>0) {$label_email = $row[17];} +if (strlen($row[18])>0) {$label_comments = $row[18];} + echo " Lead search: $vendor_id $phone $lead_id $status $list_id $user\n"; echo date("l F j, Y G:i:s A"); echo "
    \n"; -if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) +if ( (!$vendor_id) and (!$phone) and (!$lead_id) and (!$log_phone) and (!$log_lead_id) and ( (strlen($status)<1) and (strlen($list_id)<1) and (strlen($user)<1) ) and ( (strlen($first_name)<1) and (strlen($last_name)<1) )) { + ### Lead search echo "
    \n"; echo "
    \n"; echo "\n"; @@ -156,16 +207,16 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and echo "
    Ricerca Contatti Opziones:
    Vendor ID(co`digo del vendedor del Lead):   $label_vendor_lead_code(co`digo del vendedor del Lead):  
     
    Home Numero di Telefono:   $label_phone_number:  
    Alt phone search:   $label_alt_phone search:  
     
     
    Nome:   $label_first_name:  
    Cognome:   $label_last_name:  
     
    Log Search Opziones:
    Lead ID:  
     
    $label_phone_number Dialed:  
     
    \n"; echo "\n\n"; echo "\n"; @@ -200,6 +272,189 @@ if ( (!$vendor_id) and (!$phone) and (!$lead_id) and ( (strlen($status)<1) and else { + ##### BEGIN Log search ##### + if ( (strlen($log_lead_id)>0) or (strlen($log_phone)>0) ) + { + if (strlen($log_lead_id)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where lead_id='" . mysql_real_escape_string($log_lead_id) . "'"; + } + if (strlen($log_phone)>0) + { + $stmtA="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec,alt_dial from vicidial_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtB="SELECT lead_id,phone_number,campaign_id,call_date,status,user,list_id,length_in_sec from vicidial_closer_log where phone_number='" . mysql_real_escape_string($log_phone) . "'"; + $stmtC="SELECT extension,caller_id_number,did_id,call_date from vicidial_did_log where caller_id_number='" . mysql_real_escape_string($log_phone) . "'"; + } + + $rslt=mysql_query("$stmtA", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "There are no outbound calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    OUTBOUND LOG RESULTS: $results_to_print
    \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"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + 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 "
    #LEAD ID  PHONE  CAMPAGNA  CALL DATA  ESITO  UTENTE  ID LISTA  LENGTH  DIAL
    $o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]$row[8]
    \n"; + } + + $rslt=mysql_query("$stmtB", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "There are no inbound calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    INBOUND LOG RESULTS: $results_to_print
    \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"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #LEAD ID  PHONE  INGROUP  CALL DATA  ESITO  UTENTE  ID LISTA  LENGTH  
    $o$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]$row[7]
    \n"; + } + + if (strlen($stmtC) > 10) + { + $rslt=mysql_query("$stmtC", $link); + $results_to_print = mysql_num_rows($rslt); + if ( ($results_to_print < 1) and ($results_to_printX < 1) ) + { + echo "\n

    \n"; + echo "There are no inbound did calls matching your search criteria

    \n"; + echo "
    \n"; + } + else + { + echo "
    INBOUND DID LOG RESULTS: $results_to_print
    \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $o=0; + while ($results_to_print > $o) + { + $row=mysql_fetch_row($rslt); + $o++; + $search_lead = $row[0]; + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + echo "
    #DID  PHONE  DID ID  CALL DATA  
    $o$row[0]$row[1]$row[2]$row[3]
    \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='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); + + $ENDtime = date("U"); + + $RUNtime = ($ENDtime - $STARTtime); + + echo "\n\n\n


    \nNUOVA RICERCA"; + + echo "\n\n\n


    \nTempo Esecuzione Script: $RUNtime seconds"; + + echo "\n\n\n"; + + exit; + } + ##### END Log search ##### + + + + + + ##### BEGIN Lead search ##### if ($vendor_id) { $stmt="SELECT $vicidial_list_fields from vicidial_list where vendor_lead_code='" . mysql_real_escape_string($vendor_id) . "'"; @@ -365,6 +620,7 @@ else if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); } + ##### END Lead search ##### diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/audio_store.php b/agc_2-X/trunk/LANG_www/vicidial_it/audio_store.php index 4f8941ea..1a8e7bcb 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/audio_store.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/audio_store.php @@ -1,17 +1,18 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # Central Audio Storage script # # CHANGES # 90511-1325 - First build # 90618-0640 - Fix for users going through proxy or tunnel +# 100401-1037 - remove spaces and special characters from filenames, admin log uploads # -$version = '2.2.0-2'; -$build = '90618-0640'; +$version = '2.2.0-3'; +$build = '100401-1037'; $MT[0]=''; @@ -191,8 +192,12 @@ if ($action == "LIST") # curl 'http://10.0.0.4/vicidial/audio_store.php?action=AUTOUPLOAD' -F "audiofile=@/var/lib/asterisk/sounds/beep.gsm" if ($action == "AUTOUPLOAD") { - if ($audiofile) + if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -277,6 +282,10 @@ if ($action == "MANUALUPLOAD") { if ($audiofile) { + $AF_path = preg_replace("/ /",'\ ',$AF_path); + $AF_path = preg_replace("/@/",'\@',$AF_path); + $audiofile_name = preg_replace("/ /",'',$audiofile_name); + $audiofile_name = preg_replace("/@/",'',$audiofile_name); copy($AF_path, "$WeBServeRRooT/$sounds_web_directory/$audiofile_name"); chmod("$WeBServeRRooT/$sounds_web_directory/$audiofile_name", 0766); @@ -284,6 +293,14 @@ if ($action == "MANUALUPLOAD") $stmt="UPDATE servers SET sounds_update='Y';"; $rslt=mysql_query($stmt, $link); + + ### 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=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; + if ($DB) {echo "|$stmt|\n";} + $rslt=mysql_query($stmt, $link); } else { @@ -309,8 +326,18 @@ if ($action == "MANUALUPLOAD")
      Audio Store-     VERSION:     BUILD:    


    -
    We STRONGLY recommend uploading only 16bit 8k PCM WAV audio files(.wav) -

    -audio file list
    +
    We STRONGLY recommend uploading only 16bit Mono 8k PCM WAV audio files(.wav) +

    All spaces will be stripped from uploaded audio file names

    +audio file list
    + + + +




    \n"; + +echo "


    Click here to see a log of the uploads to the audio store
    \n"; + +?>
    diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/call_report_export.php b/agc_2-X/trunk/LANG_www/vicidial_it/call_report_export.php index f4599238..a3d3f05f 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/call_report_export.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/call_report_export.php @@ -17,6 +17,14 @@ # 100119-1039 - Filtered comments for \n newlines # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100507-1413 - Added headers for export +# 100702-1332 - Added custom fields option +# 100712-1324 - Added system setting slave server option +# 100713-0101 - Added recordings fields option (for filename, recording ID and URL) +# 100713-1050 - Fixed minor custom fields issue +# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links +# Allow level 7 users to view this report # require("dbconnect.php"); @@ -42,6 +50,12 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["run_export"])) {$run_export=$_GET["run_export"];} elseif (isset($_POST["run_export"])) {$run_export=$_POST["run_export"];} +if (isset($_GET["header_row"])) {$header_row=$_GET["header_row"];} + elseif (isset($_POST["header_row"])) {$header_row=$_POST["header_row"];} +if (isset($_GET["rec_fields"])) {$rec_fields=$_GET["rec_fields"];} + elseif (isset($_POST["rec_fields"])) {$rec_fields=$_POST["rec_fields"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} @@ -49,30 +63,52 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (strlen($shift)<2) {$shift='ALL';} +$report_name = 'Export Calls Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $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]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and export_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -81,6 +117,38 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +$LOGallowed_campaignsSQL=''; +$whereLOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) + { + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; + $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; + } +$regexLOGallowed_campaigns = " $LOGallowed_campaigns "; + ##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE ##### if ($run_export > 0) @@ -110,8 +178,11 @@ if ($run_export > 0) $i=0; while($i < $campaign_ct) { - $campaign_string .= "$campaign[$i]|"; - $campaign_SQL .= "'$campaign[$i]',"; + if ( (preg_match("/ $campaign[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) ) + { + $campaign_string .= "$campaign[$i]|"; + $campaign_SQL .= "'$campaign[$i]',"; + } $i++; } if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) @@ -218,7 +289,7 @@ if ($run_export > 0) $k=0; if ($RUNcampaign > 0) { - $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id from vicidial_users vu,vicidial_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $outbound_to_print = mysql_num_rows($rslt); @@ -236,8 +307,11 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; $i++; $k++; @@ -248,7 +322,7 @@ if ($run_export > 0) if ($RUNgroup > 0) { - $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; + $stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by vl.call_date limit 100000;"; $rslt=mysql_query($stmtA, $link); if ($DB) {echo "$stmt\n";} $inbound_to_print = mysql_num_rows($rslt); @@ -266,8 +340,11 @@ if ($run_export > 0) $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - $export_status[$k] = $row[2]; - $export_list_id[$k] = $row[8]; + $export_status[$k] = $row[2]; + $export_list_id[$k] = $row[8]; + $export_lead_id[$k] = $row[35]; + $export_vicidial_id[$k] = $row[36]; + $export_entry_list_id[$k] = $row[37]; $export_rows[$k] = "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]\t$row[35]\t"; $i++; $k++; @@ -299,9 +376,28 @@ if ($run_export > 0) ob_clean(); flush(); + if ($header_row=='YES') + { + $CFheader = ''; + $RFheader = ''; + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + {$CFheader = "\tcustom_fields";} + if ($rec_fields=='ID') + {$RFheader = "\trecording_id";} + if ($rec_fields=='FILENAME') + {$RFheader = "\trecording_filename";} + if ($rec_fields=='LOCATION') + {$RFheader = "\trecording_location";} + if ($rec_fields=='ALL') + {$RFheader = "\trecording_id\trecording_filename\trecording_location";} + + echo "call_date\tphone_number\tstatus\tuser\tfull_name\tcampaign_id\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tlength_in_sec\tuser_group\talt_dial\trank\towner\tlead_id\tlist_name\tlist_description\tstatus_name$RFheader$CFheader\r\n"; + } + $i=0; while ($k > $i) { + $custom_data=''; $ex_list_name=''; $ex_list_description=''; $stmt = "SELECT list_name,list_description FROM vicidial_lists where list_id='$export_list_id[$i]';"; @@ -338,7 +434,85 @@ if ($run_export > 0) } } - echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name\r\n"; + $rec_data=''; + if ( ($rec_fields=='ID') or ($rec_fields=='FILENAME') or ($rec_fields=='LOCATION') or ($rec_fields=='ALL') ) + { + $rec_id=''; + $rec_filename=''; + $rec_location=''; + $stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $recordings_ct = mysql_num_rows($rslt); + $u=0; + while ($recordings_ct > $u) + { + $row=mysql_fetch_row($rslt); + $rec_id .= "$row[0]|"; + $rec_filename .= "$row[1]|"; + $rec_location .= "$row[2]|"; + + $u++; + } + $rec_id = preg_replace("/.$/",'',$rec_id); + $rec_filename = preg_replace("/.$/",'',$rec_filename); + $rec_location = preg_replace("/.$/",'',$rec_location); + + if ($rec_fields=='ID') + {$rec_data = "\t$rec_id";} + if ($rec_fields=='FILENAME') + {$rec_data = "\t$rec_filename";} + if ($rec_fields=='LOCATION') + {$rec_data = "\t$rec_location";} + if ($rec_fields=='ALL') + {$rec_data = "\t$rec_id\t$rec_filename\t$rec_location";} + } + + if ( ($custom_fields_enabled > 0) and ($custom_fields=='YES') ) + { + $CF_list_id = $export_list_id[$i]; + if ($export_entry_list_id[$i] > 99) + {$CF_list_id = $export_entry_list_id[$i];} + $stmt="SHOW TABLES LIKE \"custom_$CF_list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt = "describe custom_$CF_list_id;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + $u++; + } + if ($columns_ct > 1) + { + $stmt = "SELECT * from custom_$CF_list_id where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data .= "\t$row[$t]"; + $t++; + } + } + } + $custom_data = preg_replace("/\r\n/",'!N',$custom_data); + $custom_data = preg_replace("/\n/",'!N',$custom_data); + } + } + + echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$custom_data\r\n"; $i++; } } @@ -360,7 +534,7 @@ else if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} - $stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; + $stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -405,7 +579,7 @@ else $i++; } - $stmt="select list_id from vicidial_lists order by list_id;"; + $stmt="select list_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $lists_to_print = mysql_num_rows($rslt); @@ -435,7 +609,7 @@ else $i++; } - $stmt="select distinct status from vicidial_campaign_statuses order by status;"; + $stmt="select distinct status from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $Cstatuses_to_print = mysql_num_rows($rslt); @@ -455,7 +629,7 @@ else echo "\n"; echo "\n"; - echo "ADMINISTRATION: Export Calls Report"; + echo "<TITLE>ADMINISTRATION: $report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '100'; @@ -518,6 +692,30 @@ else </script> <?php + echo "<BR><BR>\n"; + + echo "Header Row:<BR>\n"; + echo "<select size=1 name=header_row><option selected>YES</option><option>NO</option></select>\n"; + + echo "<BR><BR>\n"; + + echo "Recording Fields:<BR>\n"; + echo "<select size=1 name=rec_fields>"; + echo "<option>ID</option>"; + echo "<option>FILENAME</option>"; + echo "<option>LOCATION</option>"; + echo "<option>ALL</option>"; + echo "<option selected>NONE</option>"; + echo "</select>\n"; + + if ($custom_fields_enabled > 0) + { + echo "<BR><BR>\n"; + + echo "Custom Fields:<BR>\n"; + echo "<select size=1 name=custom_fields><option>YES</option><option selected>NO</option></select>\n"; + } + echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n"; echo "<font class=\"select_bold\"><B>Campaigns:</B></font><BR><CENTER>\n"; echo "<SELECT SIZE=15 NAME=campaign[] multiple>\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/dbconnect.php b/agc_2-X/trunk/LANG_www/vicidial_it/dbconnect.php index dca45485..c6011134 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/dbconnect.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/dbconnect.php @@ -1,50 +1,63 @@ <?php # -# dbconnect.php version 2.2.0 +# dbconnect.php version 2.4 # # database connection settings and some global web settings # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # +# CHANGES +# 100712-1430 - Added slave server option for connection +# + if ( file_exists("/etc/astguiclient.conf") ) -{ -$DBCagc = file("/etc/astguiclient.conf"); -foreach ($DBCagc as $DBCline) { - $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); - if (ereg("^PATHlogs", $DBCline)) - {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} - if (ereg("^PATHweb", $DBCline)) - {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} - if (ereg("^VARserver_ip", $DBCline)) - {$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);} - if (ereg("^VARDB_server", $DBCline)) - {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} - if (ereg("^VARDB_database", $DBCline)) - {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} - if (ereg("^VARDB_user", $DBCline)) - {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} - if (ereg("^VARDB_pass", $DBCline)) - {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} - if (ereg("^VARDB_port", $DBCline)) - {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + $DBCagc = file("/etc/astguiclient.conf"); + foreach ($DBCagc as $DBCline) + { + $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); + if (ereg("^PATHlogs", $DBCline)) + {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} + if (ereg("^PATHweb", $DBCline)) + {$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} + if (ereg("^VARserver_ip", $DBCline)) + {$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);} + if (ereg("^VARDB_server", $DBCline)) + {$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);} + if (ereg("^VARDB_database", $DBCline)) + {$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);} + if (ereg("^VARDB_user", $DBCline)) + {$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);} + if (ereg("^VARDB_pass", $DBCline)) + {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);} + if (ereg("^VARDB_custom_user", $DBCline)) + {$VARDB_custom_user = $DBCline; $VARDB_custom_user = preg_replace("/.*=/","",$VARDB_custom_user);} + if (ereg("^VARDB_custom_pass", $DBCline)) + {$VARDB_custom_pass = $DBCline; $VARDB_custom_pass = preg_replace("/.*=/","",$VARDB_custom_pass);} + if (ereg("^VARDB_port", $DBCline)) + {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} + } + } +else + { + #defaults for DB connection + $VARDB_server = 'localhost'; + $VARDB_port = '3306'; + $VARDB_user = 'cron'; + $VARDB_pass = '1234'; + $VARDB_custom_user = 'custom'; + $VARDB_custom_pass = 'custom1234'; + $VARDB_database = '1234'; + $WeBServeRRooT = '/usr/local/apache2/htdocs'; } -} -else -{ -#defaults for DB connection -$VARDB_server = 'localhost'; -$VARDB_user = 'cron'; -$VARDB_pass = '1234'; -$VARDB_database = '1234'; -$WeBServeRRooT = '/usr/local/apache2/htdocs'; -} - -$link=mysql_connect("$VARDB_server", "$VARDB_user", "$VARDB_pass"); -if (!$link) { +if ( ($use_slave_server > 0) and (strlen($slave_db_server)>5) ) + {$VARDB_server = $slave_db_server;} +$link=mysql_connect("$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass"); +if (!$link) + { die('MySQL connect ERROR: ' . mysql_error()); -} + } mysql_select_db("$VARDB_database"); $local_DEF = 'Local/'; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/fcstats.php b/agc_2-X/trunk/LANG_www/vicidial_it/fcstats.php index a4b3c14e..8c587aaf 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/fcstats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/fcstats.php @@ -14,6 +14,9 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -39,12 +42,48 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; + +$report_name = 'Fronter - Closer Report'; +$db_source = 'M'; + +############################################# +##### START SYSTEM_SETTINGS LOOKUP ##### +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;"; +$rslt=mysql_query($stmt, $link); +if ($DB) {echo "$stmt\n";} +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) + { + $row=mysql_fetch_row($rslt); + $non_latin = $row[0]; + $outbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + } +##### END SETTINGS LOOKUP ##### +########################################### + +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -53,6 +92,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -88,7 +148,7 @@ while ($i < $groups_to_print) <?php echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; -echo "<TITLE>In-Group Fronter-Closer Stats Report\n"; +echo "$report_name\n"; $short_header=1; @@ -605,7 +665,7 @@ echo "+--------------------------+--------+------+------+------+------+-------+\ $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); -if ($DB) {echo "\nRun Time: $RUNtime seconds\n";} +if ($DB) {echo "\nRun Time: $RUNtime seconds|$db_source\n";} } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/list_download.php b/agc_2-X/trunk/LANG_www/vicidial_it/list_download.php index c9115190..05540718 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/list_download.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/list_download.php @@ -12,6 +12,14 @@ # 90508-0644 - Changed to PHP long tags # 90721-1238 - Added rank and owner as vicidial_list fields # 100119-1039 - Filtered comments for \n newlines +# 100508-1439 - Added header row to output +# 100702-1335 - Added custom fields +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100804-1745 - Added option to download DNC and FPGN lists +# 100924-1609 - Added ALL-LISTS option for downloading everything +# 100929-1919 - Fixed ALL-LISTS download option to include custom fields +# 101004-2108 - Added generic custom column headers for custom fields # require("dbconnect.php"); @@ -27,12 +35,20 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} + elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} +if (isset($_GET["download_type"])) {$download_type=$_GET["download_type"];} + elseif (isset($_POST["download_type"])) {$download_type=$_POST["download_type"];} if (strlen($shift)<2) {$shift='ALL';} +if ($group_id=='SYSTEM_INTERNAL') {$download_type='systemdnc';} + +$report_name = 'Download List'; +$db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -40,14 +56,27 @@ if ($qm_conf_ct > 0) { $row=mysql_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]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); +# echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); @@ -62,23 +91,182 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } -$stmt="select count(*) from vicidial_list where list_id='$list_id';"; +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $link); -if ($DB) {echo "$stmt\n";} -$count_to_print = mysql_num_rows($rslt); -if ($count_to_print > 0) +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) { - $row=mysql_fetch_row($rslt); - $leads_count =$row[0]; - $i++; + # Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + # Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; } -if ($leads_count < 1) +$LOGallowed_campaignsSQL=''; +if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) { - echo "There are no leads in list_id: $list_id\n"; - exit; + $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); + $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); + $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; } +if ($download_type == 'systemdnc') + { + ##### System DNC list validation ##### + $event_code_type='SYSTEM INTERNAL DNC'; + if (strlen($LOGallowed_campaignsSQL) > 2) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_dnc;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "There are no phone numbers in list: SYSTEM INTERNAL DNC\n"; + exit; + } + } +elseif ($download_type == 'dnc') + { + ##### Campagna DNC list validation ##### + $event_code_type='CAMPAIGN DNC'; + $stmt="select count(*) from vicidial_campaigns where campaign_id='$group_id' $LOGallowed_campaignsSQL;"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_campaign_dnc where campaign_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "There are no leads in Campagna DNC list: $group_id\n"; + exit; + } + } +elseif ($download_type == 'fpgn') + { + ##### Filter Phone Group list validation ##### + $event_code_type='FILTER PHONE GROUP'; + $stmt="select count(*) from vicidial_filter_phone_groups where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $group_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "There are no leads in this filter phone gruppo: $group_id\n"; + exit; + } + } +else + { + ##### list download validation ##### + $event_code_type='LIST'; + $stmt="select count(*) from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;"; + if ($list_id=='ALL-LISTE') + {$stmt="select count(*) from vicidial_lists where list_id > 0 $LOGallowed_campaignsSQL;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $lists_allowed =$row[0]; + $i++; + } + + if ($lists_allowed < 1) + { + echo "You are not allowed to download this list: $list_id\n"; + exit; + } + + $stmt="select count(*) from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTE') + {$stmt="select count(*) from vicidial_list where list_id > 0;";} + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $count_to_print = mysql_num_rows($rslt); + if ($count_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $leads_count =$row[0]; + $i++; + } + + if ($leads_count < 1) + { + echo "There are no leads in list_id: $list_id\n"; + exit; + } + } + + $US='_'; $MT[0]=''; $ip = getenv("REMOTE_ADDR"); @@ -90,16 +278,41 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -### LOG INSERTION Admin Log Table ### -$SQL_log = "$stmt|$stmtA|"; -$SQL_log = ereg_replace(';','',$SQL_log); -$SQL_log = addslashes($SQL_log); -$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT LIST', event_sql=\"$SQL_log\", event_notes='';"; -if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_query($stmt, $link); - -$TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; +if ($download_type == 'systemdnc') + { + $TXTfilename = "SYSTEM_DNC_$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_dnc;"; + } +elseif ($download_type == 'dnc') + { + $TXTfilename = "DNC_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_campaign_dnc where campaign_id='$group_id';"; + } +elseif ($download_type == 'fpgn') + { + $TXTfilename = "FPGN_$group_id$US$FILE_TIME.txt"; + $header_row = "phone_number"; + $header_columns=''; + $stmt="select phone_number from vicidial_filter_phone_numbers where filter_phone_group_id='$group_id';"; + } +else + { + $TXTfilename = "LIST_$list_id$US$FILE_TIME.txt"; + $list_id_header=''; + $stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + if ($list_id=='ALL-LISTE') + { + $list_id_header="list_id\t"; + $stmt="select list_id,lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id > 0;"; + } + $header_row = $list_id_header . "lead_id\tentry_date\tmodify_date\tstatus\tuser\tvendor_lead_code\tsource_id\tlist_id\tgmt_offset_now\tcalled_since_last_reset\tphone_code\tphone_number\ttitle\tfirst_name\tmiddle_initial\tlast_name\taddress1\taddress2\taddress3\tcity\tstate\tprovince\tpostal_code\tcountry_code\tgender\tdate_of_birth\talt_phone\temail\tsecurity_phrase\tcomments\tcalled_count\tlast_local_call_time\trank\towner"; + $header_columns=''; + } // We'll be outputting a TXT file header('Content-type: application/octet-stream'); @@ -112,7 +325,8 @@ header('Pragma: public'); ob_clean(); flush(); -$stmt="select lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner from vicidial_list where list_id='$list_id';"; + + $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $leads_to_print = mysql_num_rows($rslt); @@ -121,9 +335,166 @@ while ($i < $leads_to_print) { $row=mysql_fetch_row($rslt); - $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); + if ( ($download_type == 'systemdnc') or ($download_type == 'dnc') or ($download_type == 'fpgn') ) + { + $row_data[$i] .= "$row[0]"; + } + else + { + $row[29] = preg_replace("/\n|\r/",'!N',$row[29]); - echo "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\r\n"; + if ($list_id=='ALL-LISTE') + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]\t$row[34]"; + $export_list_id[$i] = $row[0]; + $export_lead_id[$i] = $row[1]; + } + else + { + $row_data[$i] .= "$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]\t$row[5]\t$row[6]\t$row[7]\t$row[8]\t$row[9]\t$row[10]\t$row[11]\t$row[12]\t$row[13]\t$row[14]\t$row[15]\t$row[16]\t$row[17]\t$row[18]\t$row[19]\t$row[20]\t$row[21]\t$row[22]\t$row[23]\t$row[24]\t$row[25]\t$row[26]\t$row[27]\t$row[28]\t$row[29]\t$row[30]\t$row[31]\t$row[32]\t$row[33]"; + $export_list_id[$i] = $list_id; + $export_lead_id[$i] = $row[0]; + } + } + $i++; + } + +$ch=0; +if ( ($custom_fields_enabled > 0) and ($event_code_type=='LIST') ) + { + $valid_custom_table=0; + if ($list_id=='ALL-LISTE') + { + $stmtA = "SELECT list_id from vicidial_lists;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $lists_ct = mysql_num_rows($rslt); + $u=0; + while ($lists_ct > $u) + { + $row=mysql_fetch_row($rslt); + $custom_list_id[$u] = $row[0]; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $stmt="MOSTRA TABELLAS LIKE \"custom_$custom_list_id[$u]\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + $custom_tablecount[$u] = $tablecount_to_print; + $u++; + } + $u=0; + while ($lists_ct > $u) + { + $custom_columns[$u]=0; + if ($custom_tablecount[$u] > 0) + { + $stmtA = "describe custom_$custom_list_id[$u];"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $custom_columns[$u] = $columns_ct; + } + if ($DB) {echo "$custom_list_id[$u]|$custom_tablecount[$u]|$custom_columns[$u]\n";} + $u++; + } + $valid_custom_table=1; + } + else + { + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmtA = "describe custom_$list_id;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$stmtA\n";} + $columns_ct = mysql_num_rows($rslt); + $u=0; + while ($columns_ct > $u) + { + $row=mysql_fetch_row($rslt); + $column = $row[0]; + if ($u > 0) + {$header_columns .= "\t$column";} + $u++; + } + if ($columns_ct > 1) + { + $valid_custom_table=1; + } + } + } + if ($valid_custom_table > 0) + { + $i=0; + while ($i < $leads_to_print) + { + if ($list_id=='ALL-LISTE') + { + $valid_custom_table=0; + $u=0; + while ($lists_ct > $u) + { + if ( ($export_list_id[$i] == "$custom_list_id[$u]") and ($custom_columns[$u] > 1) ) + { + $valid_custom_table=1; + $columns_ct = $custom_columns[$u]; + } + $u++; + } + } + if ($valid_custom_table > 0) + { + $stmtA = "SELECT * from custom_$export_list_id[$i] where lead_id='$export_lead_id[$i]' limit 1;"; + $rslt=mysql_query($stmtA, $link); + if ($DB) {echo "$columns_ct|$stmtA\n";} + $customfield_ct = mysql_num_rows($rslt); + if ($customfield_ct > 0) + { + $row=mysql_fetch_row($rslt); + $t=1; + while ($columns_ct > $t) + { + $custom_data[$i] .= "\t$row[$t]"; + if ($ch <= $t) + { + $ch++; + $header_columns .= "\tcustom$ch"; + } + $t++; + } + } + + $custom_data[$i] = preg_replace("/\r\n/",'!N',$custom_data[$i]); + $custom_data[$i] = preg_replace("/\n/",'!N',$custom_data[$i]); + } + $i++; + } + } + } + + +### LOG INSERTION Admin Log Table ### +$SQL_log = "$stmt|$stmtA|"; +$SQL_log = ereg_replace(';','',$SQL_log); +$SQL_log = addslashes($SQL_log); +$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT $event_code_type', event_sql=\"$SQL_log\", event_notes='';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); + + +echo "$header_row$header_columns\r\n"; + +$i=0; +while ($i < $leads_to_print) + { + echo "$row_data[$i]$custom_data[$i]\r\n"; $i++; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/listloader.pl b/agc_2-X/trunk/LANG_www/vicidial_it/listloader.pl index 72094d84..f660d140 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/listloader.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_it/listloader.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl # -# listloader.pl version 2.2.0 +# listloader.pl version 2.4 # # Copyright (C) 2010 Matt Florell,Joe Johnson LICENSE: AGPLv2 # @@ -22,6 +22,8 @@ # 90721-1425 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0537 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,6 +273,38 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][24]; if ($oWkC) {$owner=$oWkC->Value; } + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; + if (length($forcelistid) > 0) { $list_id = $forcelistid; # set list_id to override value @@ -426,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -640,20 +674,30 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } $bad++; } $total++; @@ -666,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/listloader_super.pl b/agc_2-X/trunk/LANG_www/vicidial_it/listloader_super.pl index 93bfa20e..dc30c6bd 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/listloader_super.pl +++ b/agc_2-X/trunk/LANG_www/vicidial_it/listloader_super.pl @@ -21,6 +21,8 @@ # 90721-1341 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0539 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # ### begin parsing run-time options ### @@ -271,7 +273,37 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { $oWkC = $oWkS->{Cells}[$iR][$xls_fields[24]]; if ($oWkC) {$owner=$oWkC->Value; } - + $entry_date =~ s/\'|\\|\"|;|\`|\224//gi; + $modify_date =~ s/\'|\\|\"|;|\`|\224//gi; + $status =~ s/\'|\\|\"|;|\`|\224//gi; + $user =~ s/\'|\\|\"|;|\`|\224//gi; + $vendor_lead_code =~ s/\'|\\|\"|;|\`|\224//gi; + $source_id =~ s/\'|\\|\"|;|\`|\224//gi; + $list_id =~ s/\'|\\|\"|;|\`|\224//gi; + $gmt_offset =~ s/\'|\\|\"|;|\`|\224//gi; + $called_since_last_reset =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_code =~ s/\'|\\|\"|;|\`|\224//gi; + $phone_number =~ s/\'|\\|\"|;|\`|\224//gi; + $title =~ s/\'|\\|\"|;|\`|\224//gi; + $first_name =~ s/\'|\\|\"|;|\`|\224//gi; + $middle_initial =~ s/\'|\\|\"|;|\`|\224//gi; + $last_name =~ s/\'|\\|\"|;|\`|\224//gi; + $address1 =~ s/\'|\\|\"|;|\`|\224//gi; + $address2 =~ s/\'|\\|\"|;|\`|\224//gi; + $address3 =~ s/\'|\\|\"|;|\`|\224//gi; + $city =~ s/\'|\\|\"|;|\`|\224//gi; + $state =~ s/\'|\\|\"|;|\`|\224//gi; + $province =~ s/\'|\\|\"|;|\`|\224//gi; + $postal_code =~ s/\'|\\|\"|;|\`|\224//gi; + $country =~ s/\'|\\|\"|;|\`|\224//gi; + $gender =~ s/\'|\\|\"|;|\`|\224//gi; + $date_of_birth =~ s/\'|\\|\"|;|\`|\224//gi; + $alt_phone =~ s/\'|\\|\"|;|\`|\224//gi; + $email =~ s/\'|\\|\"|;|\`|\224//gi; + $security_phrase =~ s/\'|\\|\"|;|\`|\224//gi; + $comments =~ s/\'|\\|\"|;|\`|\224//gi; + $rank =~ s/\'|\\|\"|;|\`|\224//gi; + $owner =~ s/\'|\\|\"|;|\`|\224//gi; if (length($forcelistid) > 0) { @@ -428,7 +460,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } } - if ( (length($phone_number)>6) && ($dup_lead < 1) ) + if ( (length($phone_number)>6) && ($dup_lead < 1) && ($list_id >= 100)) { if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) {$phone_list .= "$alt_phone$title$US$list_id|";} @@ -642,21 +674,31 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; $multistmt=''; $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 10000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| $dup_lead_list\n";} - $bad++; + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID LIST ID\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } + $bad++; } $total++; if ($total%100==0) { @@ -668,7 +710,7 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { } if ($multi_insert_counter > 0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values ".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values ".substr($multistmt, 0, -1).";"; $affected_rows = $dbhA->do($stmtZ); print STMT_FILE $stmtZ."\r\n"; } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/new_listloader_superL.php b/agc_2-X/trunk/LANG_www/vicidial_it/new_listloader_superL.php index fe330845..91937186 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/new_listloader_superL.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/new_listloader_superL.php @@ -30,11 +30,15 @@ # 90721-1339 - Added rank and owner as vicidial_list fields # 91112-0616 - Added title/alt-phone duplicate checking # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100621-1026 - Added admin_web_directory variable +# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field +# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.2.0-34'; -$build = '100118-0543'; +$version = '2.4-37'; +$build = '100712-1416'; require("dbconnect.php"); @@ -127,22 +131,28 @@ if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} elseif (isset($_POST["phone_code_override"])) {$phone_code_override=$_POST["phone_code_override"];} $phone_code_override = (preg_replace("/\D/","",$phone_code_override)); +if (isset($_GET["DB"])) {$DB=$_GET["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} # $country_field=$_GET["country_field"]; if (!$country_field) {$country_field=$_POST["country_field"];} +### REGEX to prevent weird characters from ending up in the fields +$field_regx = "['\"`\\;]"; + +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|entry_list_id|'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $i++; + $non_latin = $row[0]; + $admin_web_directory = $row[1]; + $custom_fields_enabled = $row[2]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -348,6 +358,7 @@ echo "
    ";
    method=post onSubmit="ParseFileName()" enctype="multipart/form-data"> + @@ -384,7 +395,7 @@ echo "
    - +
    ";
            
            TORNA AD AMMINISTRAZIONELIST LOADER-     VERSIONE:     BUILD:    
            TORNA AD AMMINISTRAZIONE         3rd Gen Lead Loader     LIST LOADER-     VERSIONE:     BUILD:    
    @@ -409,7 +420,7 @@ echo "
    "; if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); print "
    Elaborazione in corso$delim_name-delimited file...\n"; @@ -445,7 +456,6 @@ echo "
    "; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -466,6 +476,36 @@ echo "
    "; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -477,6 +517,69 @@ echo "
    "; $phone_code = $phone_code_override; } + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) + { + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -603,7 +706,7 @@ echo "
    "; } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -614,23 +717,54 @@ echo "
    "; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; - $multi_insert_counter=0; - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good record into vicidial_list table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID LISTA\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } $bad++; } $total++; @@ -642,7 +776,7 @@ echo "
    "; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -666,7 +800,7 @@ echo "
    "; { print "

    SOVRASCRITTURA DEL CODICE TELEFONO PER QUESTO FILE: $phone_code_override

    \n"; } - # print "|$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; + # print "|$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --lead_file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -674,13 +808,13 @@ echo "
    "; if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { # copy($leadfile, "./vicidial_temp_file.csv"); $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "
    Elaborazione in corsoCSV file... \n"; if (strlen($list_id_override)>0) @@ -708,7 +842,6 @@ echo "
    "; $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); - $USarea = substr($phone_number, 0, 3); $title = $row[$title_field]; $first_name = $row[$first_name_field]; $middle_initial = $row[$middle_initial_field]; @@ -729,18 +862,112 @@ echo "
    "; $comments = trim($row[$comments_field]); $rank = $row[$rank_field]; $owner = $row[$owner_field]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); - if (strlen($rank)<1) {$rank='0';} - if (strlen($list_id_override)>0) + if (strlen($rank)<1) {$rank='0';} + + if (strlen($list_id_override)>0) + { + $list_id = $list_id_override; + } + if (strlen($phone_code_override)>0) + { + $phone_code = $phone_code_override; + } + + ##### BEGIN custom fields columns list ### + $custom_SQL=''; + if ($custom_fields_enabled > 0) { - $list_id = $list_id_override; - } - if (strlen($phone_code_override)>0) - { - $phone_code = $phone_code_override; - } + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + $A_field_value[$o] = ''; + + $field_name_id = $A_field_label[$o] . "_field"; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + if ($form_field_value >= 0) + { + $A_field_value[$o] = $row[$form_field_value]; + # replace ' " ` \ ; with nothing + $A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); + + $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + } + $o++; + } + } + } + } + ##### END custom fields columns list ### + + $custom_SQL = preg_replace("/,$/","",$custom_SQL); + + ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### if (eregi("DUPCAMP",$dupcheck)) { @@ -865,7 +1092,7 @@ echo "
    "; } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -878,23 +1105,53 @@ echo "
    "; $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); - if ($multi_insert_counter > 8) { - ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; - $rslt=mysql_query($stmtZ, $link); - if ($WeBRooTWritablE > 0) - {fwrite($stmt_file, $stmtZ."\r\n");} - $multistmt=''; - $multi_insert_counter=0; - - } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; - $multi_insert_counter++; - } + if (strlen($custom_SQL)>3) + { + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','$list_id');"; + $rslt=mysql_query($stmtZ, $link); + $affected_rows = mysql_affected_rows($link); + $lead_id = mysql_insert_id($link); + if ($DB > 0) {echo "";} + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $custom_SQL_query = "INSERT INTO custom_$list_id_override SET lead_id='$lead_id',$custom_SQL;"; + $rslt=mysql_query($custom_SQL_query, $link); + $affected_rows = mysql_affected_rows($link); + if ($DB > 0) {echo "";} + } + else + { + if ($multi_insert_counter > 8) + { + ### insert good deal into pending_transactions table ### + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; + $rslt=mysql_query($stmtZ, $link); + if ($WeBRooTWritablE > 0) + {fwrite($stmt_file, $stmtZ."\r\n");} + $multistmt=''; + $multi_insert_counter=0; + } + else + { + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; + $multi_insert_counter++; + } + } $good++; } else { - if ($bad < 1000000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID LISTA\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } $bad++; } $total++; @@ -905,7 +1162,7 @@ echo "
    "; } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -932,7 +1189,7 @@ if ($leadfile) { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); $lead_file = "./vicidial_temp_file.txt"; } else @@ -942,7 +1199,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -951,7 +1208,7 @@ if ($leadfile) { if ($tab_count>$pipe_count) {$delimiter="\t"; $delim_name="tab";} else {$delimiter="|"; $delim_name="pipe";} $field_check=explode($delimiter, $buffer); - if (count($field_check)>=5) { + if (count($field_check)>=2) { flush(); $file=fopen("$lead_file", "r"); $total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list=''; @@ -985,7 +1242,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1006,6 +1262,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1140,7 +1426,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1155,7 +1441,7 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1163,13 +1449,23 @@ if ($leadfile) { $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID LISTA\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } $bad++; } $total++; @@ -1181,7 +1477,7 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1196,8 +1492,8 @@ if ($leadfile) { { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1206,7 +1502,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); - # echo "|$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1214,15 +1510,15 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1231,7 +1527,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "
    Elaborazione in corsoCSV file... \n"; @@ -1258,7 +1554,6 @@ if ($leadfile) { $called_since_last_reset='N'; $phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_number = eregi_replace("[^0-9]", "", $row[4]); - $USarea = substr($phone_number, 0, 3); $title = $row[5]; $first_name = $row[6]; $middle_initial = $row[7]; @@ -1279,6 +1574,36 @@ if ($leadfile) { $comments = trim($row[22]); $rank = $row[23]; $owner = $row[24]; + + # replace ' " ` \ ; with nothing + $vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); + $source_code = eregi_replace($field_regx, "", $source_code); + $source_id = eregi_replace($field_regx, "", $source_id); + $list_id = eregi_replace($field_regx, "", $list_id); + $phone_code = eregi_replace($field_regx, "", $phone_code); + $phone_number = eregi_replace($field_regx, "", $phone_number); + $title = eregi_replace($field_regx, "", $title); + $first_name = eregi_replace($field_regx, "", $first_name); + $middle_initial = eregi_replace($field_regx, "", $middle_initial); + $last_name = eregi_replace($field_regx, "", $last_name); + $address1 = eregi_replace($field_regx, "", $address1); + $address2 = eregi_replace($field_regx, "", $address2); + $address3 = eregi_replace($field_regx, "", $address3); + $city = eregi_replace($field_regx, "", $city); + $state = eregi_replace($field_regx, "", $state); + $province = eregi_replace($field_regx, "", $province); + $postal_code = eregi_replace($field_regx, "", $postal_code); + $country_code = eregi_replace($field_regx, "", $country_code); + $gender = eregi_replace($field_regx, "", $gender); + $date_of_birth = eregi_replace($field_regx, "", $date_of_birth); + $alt_phone = eregi_replace($field_regx, "", $alt_phone); + $email = eregi_replace($field_regx, "", $email); + $security_phrase = eregi_replace($field_regx, "", $security_phrase); + $comments = eregi_replace($field_regx, "", $comments); + $rank = eregi_replace($field_regx, "", $rank); + $owner = eregi_replace($field_regx, "", $owner); + + $USarea = substr($phone_number, 0, 3); if (strlen($list_id_override)>0) { @@ -1413,7 +1738,7 @@ if ($leadfile) { } } - if ( (strlen($phone_number)>6) and ($dup_lead<1) ) + if ( (strlen($phone_number)>6) and ($dup_lead<1) and ($list_id >= 100 )) { if (strlen($phone_code)<1) {$phone_code = '1';} @@ -1427,7 +1752,7 @@ if ($leadfile) { if ($multi_insert_counter > 8) { ### insert good deal into pending_transactions table ### - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner');"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');"; $rslt=mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1435,13 +1760,23 @@ if ($leadfile) { $multi_insert_counter=0; } else { - $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner'),"; + $multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0'),"; $multi_insert_counter++; } $good++; } else { - if ($bad < 1000000) {print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead\n";} + if ($bad < 1000000) + { + if ( $list_id < 100 ) + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| INVALID ID LISTA\n"; + } + else + { + print "
    record $total BAD- PHONE: $phone_number ROW: |$row[0]| DUP: $dup_lead $dup_lead_list\n"; + } + } $bad++; } $total++; @@ -1452,7 +1787,7 @@ if ($leadfile) { } } if ($multi_insert_counter!=0) { - $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner) values".substr($multistmt, 0, -1).";"; + $stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";"; mysql_query($stmtZ, $link); if ($WeBRooTWritablE > 0) {fwrite($stmt_file, $stmtZ."\r\n");} @@ -1464,6 +1799,7 @@ if ($leadfile) { print ""; } else { + ##### BEGIN field chooser ##### print "
    "; flush(); print "\r\n"; @@ -1472,15 +1808,67 @@ if ($leadfile) { print " \r\n"; print " \r\n"; - $rslt=mysql_query("select vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1", $link); - + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner from vicidial_list limit 1"; + + ##### BEGIN custom fields columns list ### + if ($custom_fields_enabled > 0) + { + $stmt="MOSTRA TABELLAS LIKE \"custom_$list_id_override\";"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $stmt="SELECT count(*) from vicidial_lists_fields where list_id='$list_id_override';"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fieldscount_to_print = mysql_num_rows($rslt); + if ($fieldscount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_records_count = $rowx[0]; + + $custom_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id_override' order by field_rank,field_order,field_label;"; + if ($DB>0) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $A_field_label[$o] = $rowx[1]; + $A_field_type[$o] = $rowx[6]; + + if ($DB>0) {echo "$A_field_label[$o]|$A_field_type[$o]\n";} + + if ( ($A_field_type[$o]!='DISPLAY') and ($A_field_type[$o]!='SCRIPT') ) + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $custom_SQL .= ",$A_field_label[$o]"; + } + } + $o++; + } + + $fields_stmt = "SELECT vendor_lead_code, source_id, list_id, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, rank, owner $custom_SQL from vicidial_list, custom_$list_id_override limit 1"; + + } + } + } + ##### END custom fields columns list ### + + + $rslt=mysql_query("$fields_stmt", $link); if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.txt"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt"; } else { @@ -1489,7 +1877,7 @@ if ($leadfile) { } $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} $buffer=fgets($file, 4096); $tab_count=substr_count($buffer, "\t"); @@ -1538,8 +1926,8 @@ if ($leadfile) { { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.xls"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls"; } else { @@ -1547,7 +1935,7 @@ if ($leadfile) { $lead_file = "/tmp/vicidial_temp_file.xls"; } - # echo "|$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file|"; + # echo "|$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file|"; $dupcheckCLI=''; $postalgmtCLI=''; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} @@ -1555,14 +1943,14 @@ if ($leadfile) { if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} - passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); + passthru("$WeBServeRRooT/$admin_web_directory/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { if ($WeBRooTWritablE > 0) { - copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"); - $lead_file = "$WeBServeRRooT/vicidial/vicidial_temp_file.csv"; + copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"); + $lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv"; } else { @@ -1572,7 +1960,7 @@ if ($leadfile) { $file=fopen("$lead_file", "r"); if ($WeBRooTWritablE > 0) - {$stmt_file=fopen("$WeBServeRRooT/vicidial/listloader_stmts.txt", "w");} + {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} print "
    Elaborazione in corsoCSV file... \n"; @@ -1617,6 +2005,8 @@ if ($leadfile) { print "
    Dati File
    \r\n"; # } print ""; + + ##### END field chooser ##### } #} else if (filesize($leadfile)>8388608) { # print "
    ERROR: File exceeds the 8MB limit.
    "; @@ -1638,7 +2028,7 @@ exit; function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code) { -require("dbconnect.php"); +global $link; $postalgmt_found=0; if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) ) diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/non_agent_api.php b/agc_2-X/trunk/LANG_www/vicidial_it/non_agent_api.php index faecfc20..6be8f1f4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/non_agent_api.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/non_agent_api.php @@ -9,7 +9,7 @@ # required variables: # - $user # - $pass -# - $function - ('add_lead','version') +# - $function - ('add_lead','update_lead','version','sounds_list','moh_list','vm_list','blind_monitor','agent_ingroup_info') # - $source - ('vtiger','webform','adminweb') # - $format - ('text','debug') @@ -31,10 +31,16 @@ # 91203-1140 - Added agent_ingroup_info feature # 91216-0331 - Added duplication check features to add_lead function # 100118-0543 - Added new Australian and New Zealand DST schemes (FSO-FSA and LSS-FSA) +# 100704-1148 - Added custom fields inserts to the add_lead function +# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any +# 100718-0245 - Added update_lead function to update existing leads +# 100723-1333 - Added no_update option to the update_lead function +# 100728-1952 - Added delete_lead option to the update_lead function +# 100924-1403 - Added called_count as an update_lead option # -$version = '2.2.0-17'; -$build = '100118-0543'; +$version = '2.4-23'; +$build = '100924-1403'; require("dbconnect.php"); @@ -129,6 +135,31 @@ if (isset($_GET["agent_user"])) {$agent_user=$_GET["agent_user"];} elseif (isset($_POST["agent_user"])) {$agent_user=$_POST["agent_user"];} if (isset($_GET["duplicate_check"])) {$duplicate_check=$_GET["duplicate_check"];} elseif (isset($_POST["duplicate_check"])) {$duplicate_check=$_POST["duplicate_check"];} +if (isset($_GET["custom_fields"])) {$custom_fields=$_GET["custom_fields"];} + elseif (isset($_POST["custom_fields"])) {$custom_fields=$_POST["custom_fields"];} +if (isset($_GET["search_method"])) {$search_method=$_GET["search_method"];} + elseif (isset($_POST["search_method"])) {$search_method=$_POST["search_method"];} +if (isset($_GET["insert_if_not_found"])) {$insert_if_not_found=$_GET["insert_if_not_found"];} + elseif (isset($_POST["insert_if_not_found"])) {$insert_if_not_found=$_POST["insert_if_not_found"];} +if (isset($_GET["records"])) {$records=$_GET["records"];} + elseif (isset($_POST["records"])) {$records=$_POST["records"];} +if (isset($_GET["search_location"])) {$search_location=$_GET["search_location"];} + elseif (isset($_POST["search_location"])) {$search_location=$_POST["search_location"];} +if (isset($_GET["status"])) {$status=$_GET["status"];} + elseif (isset($_POST["status"])) {$status=$_POST["status"];} +if (isset($_GET["user_field"])) {$user_field=$_GET["user_field"];} + elseif (isset($_POST["user_field"])) {$user_field=$_POST["user_field"];} +if (isset($_GET["list_id_field"])) {$list_id_field=$_GET["list_id_field"];} + elseif (isset($_POST["list_id_field"])) {$list_id_field=$_POST["list_id_field"];} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} +if (isset($_GET["no_update"])) {$no_update=$_GET["no_update"];} + elseif (isset($_POST["no_update"])) {$no_update=$_POST["no_update"];} +if (isset($_GET["delete_lead"])) {$delete_lead=$_GET["delete_lead"];} + elseif (isset($_POST["delete_lead"])) {$delete_lead=$_POST["delete_lead"];} +if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} + elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -136,13 +167,14 @@ header ("Pragma: no-cache"); // HTTP/1.0 ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin FROM system_settings;"; +$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;"; $rslt=mysql_query($stmt, $link); $qm_conf_ct = mysql_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; + $non_latin = $row[0]; + $custom_fields_enabled = $row[1]; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -208,6 +240,17 @@ if ($non_latin < 1) $rank = ereg_replace("[^0-9]","",$rank); $owner = ereg_replace("[^-_0-9a-zA-Z]","",$owner); $duplicate_check = ereg_replace("[^-_0-9a-zA-Z]","",$duplicate_check); + $custom_fields = ereg_replace("[^0-9a-zA-Z]","",$custom_fields); + $search_method = ereg_replace("[^-_0-9a-zA-Z]","",$search_method); + $insert_if_not_found = ereg_replace("[^A-Z]","",$insert_if_not_found); + $records = ereg_replace("[^0-9]","",$records); + $search_location = ereg_replace("[^A-Z]","",$search_location); + $user_field = ereg_replace("[^-_0-9a-zA-Z]","",$user_field); + $list_id_field = ereg_replace("[^0-9]","",$list_id_field); + $lead_id = ereg_replace("[^0-9]","",$lead_id); + $no_update = ereg_replace("[^A-Z]","",$no_update); + $delete_lead = ereg_replace("[^A-Z]","",$delete_lead); + $called_count=ereg_replace("[^0-9]","",$called_count); } else { @@ -216,12 +259,10 @@ else $source = ereg_replace("'|\"|\\\\|;","",$source); } -if (strlen($list_id)<1) {$list_id='999';} -if (strlen($phone_code)<1) {$phone_code='1';} $USarea = substr($phone_number, 0, 3); if (strlen($hopper_priority)<1) {$hopper_priority=0;} -if (strlen($gender)<1) {$gender='U';} -if (strlen($rank)<1) {$rank='0';} +if ($hopper_priority < -99) {$hopper_priority=-99;} +if ($hopper_priority > 99) {$hopper_priority=99;} $StarTtime = date("U"); $NOW_DATE = date("Y-m-d"); @@ -233,6 +274,7 @@ $postalgmt=''; $api_script = 'non-agent'; $api_logging = 1; +$vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_now|called_since_last_reset|phone_code|phone_number|title|first_name|middle_initial|last_name|address1|address2|address3|city|state|province|postal_code|country_code|gender|date_of_birth|alt_phone|email|security_phrase|comments|called_count|last_local_call_time|rank|owner|'; $secX = date("U"); $hour = date("H"); @@ -1167,6 +1209,11 @@ if ($function == 'add_lead') } else { + if (strlen($gender)<1) {$gender='U';} + if (strlen($rank)<1) {$rank='0';} + if (strlen($list_id)<3) {$list_id='999';} + if (strlen($phone_code)<1) {$phone_code='1';} + if ( (strlen($phone_number)<6) || (strlen($phone_number)>16) ) { $result = 'ERROR'; @@ -1419,7 +1466,7 @@ if ($function == 'add_lead') ### insert a new lead in the system with this phone number - $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='NEW',user='$user',vendor_lead_code='$vendor_lead_code',source_id='$source_id',gmt_offset_now='$gmt_offset',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',country_code='$country_code',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',called_since_last_reset='N',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',rank='$rank',owner='$owner';"; + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='NEW',user='$user',vendor_lead_code='$vendor_lead_code',source_id='$source_id',gmt_offset_now='$gmt_offset',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',country_code='$country_code',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',called_since_last_reset='N',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',rank='$rank',owner='$owner',entry_list_id='0';"; if ($DB>0) {echo "DEBUG: add_lead query - $stmt\n";} $rslt=mysql_query($stmt, $link); $affected_rows = mysql_affected_rows($link); @@ -1470,6 +1517,114 @@ if ($function == 'add_lead') api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); } + ### BEGIN custom fields insert section ### + if ($custom_fields == 'Y') + { + if ($custom_fields_enabled > 0) + { + $stmt="SHOW TABLES LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $CFinsert_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $new_field_value=''; + $form_field_value=''; + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_type[$o] = $rowx[6]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_required[$o] = $rowx[12]; + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o]; + + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + $A_field_value[$o] = $form_field_value; + + if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') ) + { + $A_field_value[$o]='----IGNORE----'; + } + else + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $CFinsert_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + $o++; + } + + if (strlen($CFinsert_SQL)>3) + { + $CFinsert_SQL = preg_replace("/,$/","",$CFinsert_SQL); + $custom_table_update_SQL = "INSERT INTO custom_$list_id SET lead_id='$lead_id',$CFinsert_SQL;"; + $rslt=mysql_query($custom_table_update_SQL, $link); + $custom_insert_count = mysql_affected_rows($link); + if ($custom_insert_count > 0) + { + # Update vicidial_list entry to put list_id as entry_list_id + $vl_table_entry_update_SQL = "UPDATE vicidial_list SET entry_list_id='$list_id' where lead_id='$lead_id';"; + $rslt=mysql_query($vl_table_entry_update_SQL, $link); + $vl_table_entry_update_count = mysql_affected_rows($link); + + $result = 'NOTICE'; + $result_reason = "add_lead CUSTOM FIELDS VALUES ADDED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id|$vl_table_entry_update_count\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + else + { + $result = 'NOTICE'; + $result_reason = "add_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "add_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "add_lead CUSTOM FIELDS NOT ADDED, NO CUSTOM FIELDS DEFINED FOR THIS LIST"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "add_lead CUSTOM FIELDS NOT ADDED, CUSTOM FIELDS DISABLED"; + echo "$result: $result_reason - $phone_number|$lead_id|$custom_fields|$custom_fields_enabled\n"; + $data = "$phone_number|$lead_id|$custom_fields|$custom_fields_enabled"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + ### END custom fields insert section ### + if ($add_to_hopper == 'Y') { $dialable=1; @@ -1542,6 +1697,569 @@ if ($function == 'add_lead') + + +################################################################################ +### update_lead - updates a lead in the vicidial_list table +################################################################################ +if ($function == 'update_lead') + { + if(strlen($source)<2) + { + $result = 'ERROR'; + $result_reason = "Invalid Source"; + echo "$result: $result_reason - $source\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + echo "ERROR: Invalid Source: |$source|\n"; + exit; + } + else + { + $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access='1' and modify_leads='1' and user_level > 7;"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $modify_leads=$row[0]; + + if ($modify_leads < 1) + { + $result = 'ERROR'; + $result_reason = "update_lead USER DOES NOT HAVE PERMISSION TO UPDATE LEADS IN THE SYSTEM"; + echo "$result: $result_reason: |$user|$modify_leads|\n"; + $data = "$modify_leads"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + $search_SQL=''; + $lead_id_SQL=''; + $vendor_lead_code_SQL=''; + $phone_number_SQL=''; + $find_lead_id=0; + $find_vendor_lead_code=0; + $find_phone_number=0; + if ( (strlen($search_location)<4) or ($list_id < 99) or (strlen($list_id)<3) ) + {$search_location='SYSTEM';} + if (strlen($search_method)<6) + {$search_method='LEAD_ID';} + if (strlen($records)<1) + {$records='1';} + if ( (preg_match("/LEAD_ID/",$search_method)) and (strlen($lead_id)>0) ) + { + $find_lead_id=1; + $lead_id_SQL = "lead_id='$lead_id'"; + } + if ( (preg_match("/VENDOR_LEAD_CODE/",$search_method)) and (strlen($vendor_lead_code)>0) ) + { + $find_vendor_lead_code=1; + $vendor_lead_code_SQL = "vendor_lead_code='$vendor_lead_code'"; + } + if ( (preg_match("/PHONE_NUMBER/",$search_method)) and (strlen($phone_number)>5) and (strlen($phone_number)<19) ) + { + $find_phone_number=1; + $phone_number_SQL = "phone_number='$phone_number'"; + } + if ( ($find_lead_id<1) and ($find_vendor_lead_code<1) and ($find_phone_number<1) ) + { + $result = 'ERROR'; + $result_reason = "update_lead NO VALID SEARCH METHOD"; + $data = "$search_method|$lead_id|$vendor_lead_code|$phone_number"; + echo "$result: $result_reason - $user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + if (eregi("CAMPAIGN",$search_location)) # find lists within campaign + { + $stmt="SELECT campaign_id from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $ci_recs = mysql_num_rows($rslt); + if ($ci_recs > 0) + { + $row=mysql_fetch_row($rslt); + $search_camp = $row[0]; + + $stmt="select list_id from vicidial_lists where campaign_id='$search_camp';"; + $rslt=mysql_query($stmt, $link); + $li_recs = mysql_num_rows($rslt); + if ($li_recs > 0) + { + $L=0; + while ($li_recs > $L) + { + $row=mysql_fetch_row($rslt); + $search_lists .= "'$row[0]',"; + $L++; + } + $search_lists = eregi_replace(",$",'',$search_lists); + $search_SQL = "and list_id IN($search_lists)"; + } + } + } + if (eregi("LIST",$search_location)) # search check within list + { + $search_SQL = "and list_id='$list_id'"; + } + + $search_found=0; + if ($find_lead_id > 0) # search for the lead_id + { + if ($DB>0) {echo "DEBUG: Checking for lead_id - $lead_id\n";} + $stmt="SELECT lead_id,list_id,entry_list_id from vicidial_list where $lead_id_SQL $search_SQL order by entry_date desc limit $records;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + $n=0; + while ($pc_recs > $n) + { + $row=mysql_fetch_row($rslt); + $search_lead_id[$n] = $row[0]; + $search_lead_list[$n] = $row[1]; + $search_entry_list[$n] = $row[2]; + $n++; + $search_found++; + } + } + if ( ($find_vendor_lead_code > 0) and ($search_found < 1) ) # search for the vendor_lead_code + { + if ($DB>0) {echo "DEBUG: Checking for vendor_lead_code - $vendor_lead_code\n";} + $stmt="SELECT lead_id,list_id,entry_list_id from vicidial_list where $vendor_lead_code_SQL $search_SQL order by entry_date desc limit $records;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + $n=0; + while ($pc_recs > $n) + { + $row=mysql_fetch_row($rslt); + $search_lead_id[$n] = $row[0]; + $search_lead_list[$n] = $row[1]; + $search_entry_list[$n] = $row[2]; + $n++; + $search_found++; + } + } + if ( ($find_phone_number > 0) and ($search_found < 1) ) # search for the phone_number + { + if ($DB>0) {echo "DEBUG: Checking for phone_number - $phone_number\n";} + $stmt="SELECT lead_id,list_id,entry_list_id from vicidial_list where $phone_number_SQL $search_SQL order by entry_date desc limit $records;"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + $n=0; + while ($pc_recs > $n) + { + $row=mysql_fetch_row($rslt); + $search_lead_id[$n] = $row[0]; + $search_lead_list[$n] = $row[1]; + $search_entry_list[$n] = $row[2]; + $n++; + $search_found++; + } + } + ### END searching ### + + if ($no_update=='Y') + { + if ($search_found > 0) + { + $result = 'NOTICE'; + $result_reason = "update_lead LEADS FOUND IN THE SYSTEM"; + $data = "$lead_id|$vendor_lead_code|$phone_number|$search_lead_list[0]|$search_entry_list[0]"; + echo "$result: $result_reason: |$user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead NO MATCHES FOUND IN THE SYSTEM"; + $data = "$lead_id|$vendor_lead_code|$phone_number"; + echo "$result: $result_reason: |$user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + exit; + } + else + { + if ($search_found > 0) + { + $VL_update_SQL=''; + ##### BEGIN update lead information in the system ##### + if (strlen($user_field)>0) {$VL_update_SQL .= "user='$user_field',";} + if (strlen($list_id_field)>0) {$VL_update_SQL .= "list_id='$list_id_field',";} + if (strlen($status)>0) {$VL_update_SQL .= "status='$status',";} + if (strlen($vendor_lead_code)>0) {$VL_update_SQL .= "vendor_lead_code='$vendor_lead_code',";} + if (strlen($source_id)>0) {$VL_update_SQL .= "source_id='$source_id',";} + if (strlen($gmt_offset_now)>0) {$VL_update_SQL .= "gmt_offset_now='$gmt_offset_now',";} + if (strlen($title)>0) {$VL_update_SQL .= "title='$title',";} + if (strlen($first_name)>0) {$VL_update_SQL .= "first_name='$first_name',";} + if (strlen($middle_initial)>0) {$VL_update_SQL .= "middle_initial='$middle_initial',";} + if (strlen($last_name)>0) {$VL_update_SQL .= "last_name='$last_name',";} + if (strlen($address1)>0) {$VL_update_SQL .= "address1='$address1',";} + if (strlen($address2)>0) {$VL_update_SQL .= "address2='$address2',";} + if (strlen($address3)>0) {$VL_update_SQL .= "address3='$address3',";} + if (strlen($city)>0) {$VL_update_SQL .= "city='$city',";} + if (strlen($state)>0) {$VL_update_SQL .= "state='$state',";} + if (strlen($province)>0) {$VL_update_SQL .= "province='$province',";} + if (strlen($postal_code)>0) {$VL_update_SQL .= "postal_code='$postal_code',";} + if (strlen($country_code)>0) {$VL_update_SQL .= "country_code='$country_code',";} + if (strlen($gender)>0) {$VL_update_SQL .= "gender='$gender',";} + if (strlen($date_of_birth)>0) {$VL_update_SQL .= "date_of_birth='$date_of_birth',";} + if (strlen($alt_phone)>0) {$VL_update_SQL .= "alt_phone='$alt_phone',";} + if (strlen($email)>0) {$VL_update_SQL .= "email='$email',";} + if (strlen($security_phrase)>0) {$VL_update_SQL .= "security_phrase='$security_phrase',";} + if (strlen($comments)>0) {$VL_update_SQL .= "comments='$comments',";} + if (strlen($rank)>0) {$VL_update_SQL .= "rank='$rank',";} + if (strlen($owner)>0) {$VL_update_SQL .= "owner='$owner',";} + if (strlen($called_count)>0) {$VL_update_SQL .= "called_count='$called_count',";} + $VL_update_SQL = preg_replace("/,$/","",$VL_update_SQL); + $VL_update_SQL = preg_replace("/'--BLANK--'/","''",$VL_update_SQL); + $VL_update_SQL = preg_replace("/\n/","!N",$VL_update_SQL); + + $n=0; + while ($search_found > $n) + { + $VLaffected_rows=0; + $CFaffected_rows=0; + if ( (strlen($VL_update_SQL)>6) or ($delete_lead=='Y') ) + { + if ($delete_lead=='Y') + { + $stmt = "DELETE from vicidial_list where lead_id='$search_lead_id[$n]';"; + $result_reason = "update_lead LEAD HAS BEEN DELETED"; + } + else + { + $stmt = "UPDATE vicidial_list SET $VL_update_SQL where lead_id='$search_lead_id[$n]';"; + $result_reason = "update_lead LEAD HAS BEEN UPDATED"; + } + if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $VLaffected_rows = mysql_affected_rows($link); + + $result = 'SUCCESS'; + echo "$result: $result_reason - $user|$search_lead_id[$n]\n"; + $data = "$phone_number|$list_id|$lead_id|$gmt_offset"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + ##### BEGIN custom fields update query build ##### + if ($custom_fields=='Y') + { + $lead_custom_list = $search_lead_list[$n]; + if ($search_entry_list[$n] > 99) {$lead_custom_list = $search_entry_list[$n];} + $update_sent=0; + $CFoutput=''; + $stmt="SHOW TABLES LIKE \"custom_$lead_custom_list\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $update_SQL=''; + $VL_update_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$lead_custom_list' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $new_field_value=''; + $form_field_value=''; + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_type[$o] = $rowx[6]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_required[$o] = $rowx[12]; + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o]; + + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + $A_field_value[$o] = $form_field_value; + + if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') ) + { + $A_field_value[$o]='----IGNORE----'; + } + else + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $update_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + $o++; + } + + $custom_update_count=0; + if (strlen($update_SQL)>3) + { + $custom_record_lead_count=0; + $stmt="SELECT count(*) from custom_$lead_custom_list where lead_id='$search_lead_id[$n]';"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $fieldleadcount_to_print = mysql_num_rows($rslt); + if ($fieldleadcount_to_print > 0) + { + $rowx=mysql_fetch_row($rslt); + $custom_record_lead_count = $rowx[0]; + } + $update_SQL = preg_replace("/,$/","",$update_SQL); + $custom_table_update_SQL = "INSERT INTO custom_$lead_custom_list SET lead_id='$search_lead_id[$n]',$update_SQL;"; + if ($custom_record_lead_count > 0) + {$custom_table_update_SQL = "UPDATE custom_$lead_custom_list SET $update_SQL where lead_id='$search_lead_id[$n]';";} + + $rslt=mysql_query($custom_table_update_SQL, $link); + $custom_update_count = mysql_affected_rows($link); + if ($DB) {echo "$custom_update_count|$custom_table_update_SQL\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS VALUES UPDATED"; + echo "$result: $result_reason - $phone_number|$search_lead_id[$n]|$search_lead_list[$n]|$search_entry_list[$n]|$lead_custom_list|$custom_update_count\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + + $update_sent++; + } + + if ($custom_update_count > 0) + { + $list_table_update_SQL = "UPDATE vicidial_list SET entry_list_id='$lead_custom_list' where lead_id='$search_lead_id[$n]';"; + $rslt=mysql_query($list_table_update_SQL, $link); + $list_update_count = mysql_affected_rows($link); + if ($DB) {echo "$list_update_count|$list_table_update_SQL\n";} + if (!$rslt) {die('Could not execute: ' . mysql_error());} + } + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO CUSTOM FIELDS DEFINED FOR THIS LIST"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + ##### END custom fields update query build ##### + + $n++; + } + + ##### END update lead information in the system ##### + } + else + { + $result = 'ERROR'; + if ($insert_if_not_found=='Y') + {$result = 'NOTICE';} + $result_reason = "update_lead NO MATCHES FOUND IN THE SYSTEM"; + $data = "$lead_id|$vendor_lead_code|$phone_number"; + echo "$result: $result_reason: |$user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + if ($insert_if_not_found!='Y') + {exit;} + else + { + if (strlen($list_id_field)>0) {$list_id=$list_id_field;} + ##### BEGIN insert not-found lead into the system ##### + if ( (strlen($phone_number)<6) or (strlen($phone_number)>18) or (strlen($phone_code)<1) or (strlen($list_id)<3) ) + { + $result = 'ERROR'; + $result_reason = "update_lead INVALID DATA FOR LEAD INSERTION"; + $data = "$phone_number|$phone_code|$list_id|$insert_if_not_found"; + echo "$result: $result_reason - $user|$data\n"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + exit; + } + else + { + ### get current gmt_offset of the phone_number + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); + + if (strlen($status)<1) + {$status='NEW';} + ### insert a new lead in the system with this phone number + $stmt = "INSERT INTO vicidial_list SET phone_code='$phone_code',phone_number='$phone_number',list_id='$list_id',status='$status',user='$user',vendor_lead_code='$vendor_lead_code',source_id='$source_id',gmt_offset_now='$gmt_offset',title='$title',first_name='$first_name',middle_initial='$middle_initial',last_name='$last_name',address1='$address1',address2='$address2',address3='$address3',city='$city',state='$state',province='$province',postal_code='$postal_code',country_code='$country_code',gender='$gender',date_of_birth='$date_of_birth',alt_phone='$alt_phone',email='$email',security_phrase='$security_phrase',comments='$comments',called_since_last_reset='N',entry_date='$ENTRYdate',last_local_call_time='$NOW_TIME',rank='$rank',owner='$owner',entry_list_id='0';"; + if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $affected_rows = mysql_affected_rows($link); + if ($affected_rows > 0) + { + $lead_id = mysql_insert_id($link); + + $result = 'SUCCESS'; + $result_reason = "update_lead LEAD HAS BEEN ADDED"; + echo "$result: $result_reason - $phone_number|$list_id|$lead_id|$gmt_offset|$user\n"; + $data = "$phone_number|$list_id|$lead_id|$gmt_offset"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + + if (strlen($multi_alt_phones) > 5) + { + $map=$MT; $ALTm_phone_code=$MT; $ALTm_phone_number=$MT; $ALTm_phone_note=$MT; + $map = explode('!', $multi_alt_phones); + $map_count = count($map); + if ($DB>0) {echo "DEBUG: update_lead multi-al-entry - $a|$map_count|$multi_alt_phones\n";} + $g++; + $r=0; $s=0; $inserted_alt_phones=0; + while ($r < $map_count) + { + $s++; + $ncn=$MT; + $ncn = explode('_', $map[$r]); + print "$ncn[0]|$ncn[1]|$ncn[2]"; + + if (strlen($forcephonecode) > 0) + {$ALTm_phone_code[$r] = $forcephonecode;} + else + {$ALTm_phone_code[$r] = $ncn[1];} + if (strlen($ALTm_phone_code[$r]) < 1) + {$ALTm_phone_code[$r]='1';} + $ALTm_phone_number[$r] = $ncn[0]; + $ALTm_phone_note[$r] = $ncn[2]; + $stmt = "INSERT INTO vicidial_list_alt_phones (lead_id,phone_code,phone_number,alt_phone_note,alt_phone_count) values('$lead_id','$ALTm_phone_code[$r]','$ALTm_phone_number[$r]','$ALTm_phone_note[$r]','$s');"; + if ($DB>0) {echo "DEBUG: update_lead query - $stmt\n";} + $rslt=mysql_query($stmt, $link); + $Zaffected_rows = mysql_affected_rows($link); + $inserted_alt_phones = ($inserted_alt_phones + $Zaffected_rows); + $r++; + } + $result = 'NOTICE'; + $result_reason = "update_lead MULTI-ALT-PHONE NUMBERS LOADED"; + echo "$result: $result_reason - $inserted_alt_phones|$lead_id|$user\n"; + $data = "$inserted_alt_phones|$lead_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + + + ### BEGIN custom fields insert section ### + if ($custom_fields == 'Y') + { + if ($custom_fields_enabled > 0) + { + $stmt="SHOW TABLES LIKE \"custom_$list_id\";"; + if ($DB>0) {echo "$stmt";} + $rslt=mysql_query($stmt, $link); + $tablecount_to_print = mysql_num_rows($rslt); + if ($tablecount_to_print > 0) + { + $CFinsert_SQL=''; + $stmt="SELECT field_id,field_label,field_name,field_description,field_rank,field_help,field_type,field_options,field_size,field_max,field_default,field_cost,field_required,multi_position,name_position,field_order from vicidial_lists_fields where list_id='$list_id' order by field_rank,field_order,field_label;"; + $rslt=mysql_query($stmt, $link); + $fields_to_print = mysql_num_rows($rslt); + $fields_list=''; + $o=0; + while ($fields_to_print > $o) + { + $new_field_value=''; + $form_field_value=''; + $rowx=mysql_fetch_row($rslt); + $A_field_id[$o] = $rowx[0]; + $A_field_label[$o] = $rowx[1]; + $A_field_name[$o] = $rowx[2]; + $A_field_type[$o] = $rowx[6]; + $A_field_size[$o] = $rowx[8]; + $A_field_max[$o] = $rowx[9]; + $A_field_required[$o] = $rowx[12]; + $A_field_value[$o] = ''; + $field_name_id = $A_field_label[$o]; + + if (isset($_GET["$field_name_id"])) {$form_field_value=$_GET["$field_name_id"];} + elseif (isset($_POST["$field_name_id"])) {$form_field_value=$_POST["$field_name_id"];} + + $A_field_value[$o] = $form_field_value; + + if ( ($A_field_type[$o]=='DISPLAY') or ($A_field_type[$o]=='SCRIPT') ) + { + $A_field_value[$o]='----IGNORE----'; + } + else + { + if (!preg_match("/\|$A_field_label[$o]\|/",$vicidial_list_fields)) + { + $CFinsert_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; + } + } + $o++; + } + + if (strlen($CFinsert_SQL)>3) + { + $CFinsert_SQL = preg_replace("/,$/","",$CFinsert_SQL); + $custom_table_update_SQL = "INSERT INTO custom_$list_id SET lead_id='$lead_id',$CFinsert_SQL;"; + $rslt=mysql_query($custom_table_update_SQL, $link); + $custom_insert_count = mysql_affected_rows($link); + if ($custom_insert_count > 0) + { + # Update vicidial_list entry to put list_id as entry_list_id + $vl_table_entry_update_SQL = "UPDATE vicidial_list SET entry_list_id='$list_id' where lead_id='$lead_id';"; + $rslt=mysql_query($vl_table_entry_update_SQL, $link); + $vl_table_entry_update_count = mysql_affected_rows($link); + + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS VALUES ADDED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id|$vl_table_entry_update_count\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO FIELDS DEFINED"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS NOT ADDED, NO CUSTOM FIELDS DEFINED FOR THIS LIST"; + echo "$result: $result_reason - $phone_number|$lead_id|$list_id\n"; + $data = "$phone_number|$lead_id|$list_id"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + else + { + $result = 'NOTICE'; + $result_reason = "update_lead CUSTOM FIELDS NOT ADDED, CUSTOM FIELDS DISABLED"; + echo "$result: $result_reason - $phone_number|$lead_id|$custom_fields|$custom_fields_enabled\n"; + $data = "$phone_number|$lead_id|$custom_fields|$custom_fields_enabled"; + api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); + } + } + ### END custom fields insert section ### + } + } + ##### END insert not-found lead into the system ##### + } + } + } + } + } + exit; + } + } +################################################################################ +### END update_lead +################################################################################ + + + + + $result = 'ERROR'; $result_reason = "NO FUNCTION SPECIFIED"; echo "$result: $result_reason\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_report.php b/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_report.php index 78443177..b6078623 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_report.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_report.php @@ -12,6 +12,9 @@ # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically # 100216-0042 - Added popup date selector +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # require("dbconnect.php"); @@ -42,9 +45,12 @@ if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} if (strlen($shift)<2) {$shift='ALL';} if (strlen($order)<2) {$order='hours_down';} +$report_name = 'UtenteOrologio Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -52,22 +58,39 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $SSoutbound_autodial_active = $row[2]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($DB) {echo "|$stmt|\n";} if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); @@ -76,6 +99,27 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) exit; } +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); @@ -139,9 +183,10 @@ while ($i < $user_groups_to_print) -UtenteOrologio Report +<TITLE> <?php +echo "$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -373,20 +418,6 @@ echo "</TR>\n"; echo "</TABLE>\n"; -echo "\n"; - -/* - $TOTavgWAIT_M = ( ($TOTtotWAIT / $TOTcalls) / 60); - $TOTavgWAIT_M = round($TOTavgWAIT_M, 2); - $TOTavgWAIT_M_int = intval("$TOTavgWAIT_M"); - $TOTavgWAIT_S = ($TOTavgWAIT_M - $TOTavgWAIT_M_int); - $TOTavgWAIT_S = ($TOTavgWAIT_S * 60); - $TOTavgWAIT_S = round($TOTavgWAIT_S, 0); - if ($TOTavgWAIT_S < 10) {$TOTavgWAIT_S = "0$TOTavgWAIT_S";} - $TOTavgWAIT_MS = "$TOTavgWAIT_M_int:$TOTavgWAIT_S"; - $TOTavgWAIT_MS = sprintf("%6s", $TOTavgWAIT_MS); - while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1);} -*/ ?> </CENTER> </BODY></HTML> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_status.php b/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_status.php index c1be37e9..81793af4 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/timeclock_status.php @@ -10,6 +10,9 @@ # 90310-2103 - Added admin header # 90508-0644 - Changed to PHP long tags # 100214-1421 - Sort menu alphabetically +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # header ("Content-type: text/html; charset=utf-8"); @@ -35,9 +38,12 @@ if (isset($_GET["INVIA"])) {$INVIA=$_GET["INVIA"];} elseif (isset($_POST["INVIA"])) {$INVIA=$_POST["INVIA"];} +$report_name = 'Gruppo UtenteOrologio Status Report'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day,outbound_autodial_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,webroot_writable,timeclock_end_of_day FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -45,13 +51,24 @@ if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $webroot_writable = $row[1]; - $timeclock_end_of_day = $row[2]; - $SSoutbound_autodial_active = $row[3]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $webroot_writable = $row[4]; + $timeclock_end_of_day = $row[5]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); @@ -68,12 +85,18 @@ else $EoDdate = date("Y-m-d H:i:s", $EoD); -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); @@ -86,32 +109,28 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } -else + +$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGuser_group = $row[0]; + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) { - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - } - else - { - if ($webroot_writable > 0) - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - } - } - + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; } - $stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -141,8 +160,9 @@ if (strlen($user_group) > 0) <html> <head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION:Orologio Status +<title>ADMINISTRATION: <?php +echo "$report_name"; ##### BEGIN Set variables to make header show properly ##### $ADD = '311111'; @@ -399,7 +419,7 @@ $RUNtime = ($ENDtime - $STARTtime); echo "\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds</font>"; +echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds|$db_source</font>"; ?> @@ -523,7 +543,7 @@ $RUNtime = ($ENDtime - $STARTtime); echo "\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds</font>"; +echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds|$db_source</font>"; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/user_stats.php b/agc_2-X/trunk/LANG_www/vicidial_it/user_stats.php index c27a9a86..81759c84 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/user_stats.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/user_stats.php @@ -20,8 +20,14 @@ # 90508-0644 - Changed to PHP long tags # 90524-2009 - Changed time display to use functions.php # 91130-2037 - Added user closer log manager flag display +# 100126-0847 - Added DID log display options # 100203-1008 - Added agent activity log section # 100216-0042 - Added popup date selector +# 100425-0115 - Added more login data +# 100712-1324 - Added system setting slave server option +# 100802-2347 - Added User Group Allowed Reports option validation +# 100908-1205 - Added customer 3way hangup flags to user calls display +# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # header ("Content-type: text/html; charset=utf-8"); @@ -29,25 +35,44 @@ header ("Content-type: text/html; charset=utf-8"); require("dbconnect.php"); require("functions.php"); + +$report_name = 'Statistiche utente'; +$db_source = 'M'; + ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,outbound_autodial_active,user_territories_active FROM system_settings;"; +$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} -$ss_conf_ct = mysql_num_rows($rslt); -if ($ss_conf_ct > 0) +$qm_conf_ct = mysql_num_rows($rslt); +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); - $non_latin = $row[0]; - $SSoutbound_autodial_active = $row[1]; - $user_territories_active = $row[2]; + $non_latin = $row[0]; + $SSoutbound_autodial_active = $row[1]; + $slave_db_server = $row[2]; + $reports_use_slave_db = $row[3]; + $user_territories_active = $row[4]; } ##### END SETTINGS LOOKUP ##### ########################################### +if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) + { + mysql_close($link); + $use_slave_server=1; + $db_source = 'S'; + require("dbconnect.php"); + echo "<!-- Using slave server $slave_db_server $db_source -->\n"; + } + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; +if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} + elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} +if (isset($_GET["did"])) {$did=$_GET["did"];} + elseif (isset($_POST["did"])) {$did=$_POST["did"];} if (isset($_GET["begin_date"])) {$begin_date=$_GET["begin_date"];} elseif (isset($_POST["begin_date"])) {$begin_date=$_POST["begin_date"];} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} @@ -72,12 +97,18 @@ $TODAY = date("Y-m-d"); if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;} -$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level='7' and view_reports='1' and active='Y';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$reports_only_user=$row[0]; + $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); @@ -90,27 +121,40 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } + +$stmt="SELECT full_name,user_group from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGfullname = $row[0]; +$LOGuser_group = $row[1]; + +fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); +fclose($fp); + +$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$LOGallowed_campaigns = $row[0]; +$LOGallowed_reports = $row[1]; + +if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORT/",$LOGallowed_reports)) ) + { + Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); + Header("HTTP/1.0 401 Unauthorized"); + echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n"; + exit; + } + +if ($did > 0) + { + $stmt="SELECT did_description from vicidial_inbound_dids where did_pattern='$user';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $full_name = $row[0]; + } else { - - if($auth>0) - { - $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $LOGfullname=$row[0]; - - fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n"); - fclose($fp); - } - else - { - fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n"); - fclose($fp); - echo "Utentename/Password non validi: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; - exit; - } - $stmt="SELECT full_name from vicidial_users where user='$user';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -128,9 +172,14 @@ else <link rel="stylesheet" href="calendar.css"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"> -<title>ADMINISTRATION: Statistiche utente <?php +if ($did > 0) + {echo "<title>ADMINISTRATION: DID Call Stats";} +else + {echo "<title>ADMINISTRATION: $report_name";} + + ##### BEGIN Set variables to make header show properly ##### $ADD = '3'; @@ -148,6 +197,14 @@ $users_color = '#FFFF99'; $users_font = 'BLACK'; $users_color = '#E6E6E6'; $subcamp_color = '#C6C6C6'; +if ($did > 0) + { + $hh = 'ingroups'; + $ADD = '3311'; + $ingroups_color = '#FFFF99'; + $ingroups_font = 'BLACK'; + $ingroups_color = '#E6E6E6'; + } ##### END Set variables to make header show properly ##### require("admin_header.php"); @@ -155,17 +212,25 @@ require("admin_header.php"); ?> -<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2><B>   Statistiche utente for <?php echo $user ?></TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> - - - - +<TABLE WIDTH=770 BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=0><TR BGCOLOR=#E6E6E6><TD ALIGN=LEFT><FONT FACE="ARIAL,HELVETICA" SIZE=2> <?php +if ($did > 0) + {echo "<B>   DID Call Stats for $user";} +else + {echo "<B>   Statistiche utente for $user";} + +?> +</TD><TD ALIGN=RIGHT><FONT FACE="ARIAL,HELVETICA" SIZE=2>   </TD></TR> +<?php + + echo "<TR BGCOLOR=\"#F0F5FE\"><TD ALIGN=LEFT COLSPAN=2><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><B>   \n"; echo "<form action=$PHP_SELF method=POST name=vicidial_report id=vicidial_report>\n"; echo "<input type=hidden name=DB value=\"$DB\">\n"; +echo "<input type=hidden name=did_id value=\"$did_id\">\n"; +echo "<input type=hidden name=did value=\"$did\">\n"; echo "<input type=text name=begin_date value=\"$begin_date\" size=10 maxsize=10>"; ?> @@ -197,19 +262,27 @@ o_cal.a_tpl.yearscroll = false; <?php if (strlen($user)>1) - {echo "  <input type=hidden name=user value=\"$user\">\n";} + {echo "<input type=hidden name=user value=\"$user\">\n";} else - {echo "  <input type=text name=user size=12 maxlength=10>\n";} + {echo "<input type=text name=user size=12 maxlength=10>\n";} echo "<input type=submit name=submit value=submit>\n"; echo "           $user - $full_name<BR><BR>\n"; echo "<center>\n"; -echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Time Sheet</a>\n"; -echo " | <a href=\"./user_status.php?user=$user\">Status Utente</a>\n"; -echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modifica Utente</a>\n"; -echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Utente multiple day status detail report</a>"; +if ($did > 0) + { + echo "<a href=\"./AST_DIDstats.php?group[0]=$did_id&query_date=$begin_date&end_date=$end_date\">DID traffic report</a>\n"; + echo " | <a href=\"./admin.php?ADD=3311&did_id=$did_id\">ModificareDID</a>\n"; + } +else + { + echo "<a href=\"./AST_agent_time_sheet.php?agent=$user\">Agent Time Sheet</a>\n"; + echo " | <a href=\"./user_status.php?user=$user\">Status Utente</a>\n"; + echo " | <a href=\"./admin.php?ADD=3&user=$user\">Modifica Utente</a>\n"; + echo " | <a href=\"./AST_agent_days_detail.php?user=$user&query_date=$begin_date&end_date=$end_date&group[]=--ALL--&shift=ALL\">Utente multiple day status detail report</a>"; + } echo "</center>\n"; @@ -218,324 +291,332 @@ echo "<TR><TD ALIGN=LEFT COLSPAN=2>\n"; echo "<br><center>\n"; -##### vicidial agent talk time and status ##### -echo "<B>AGENT TEMPO DI CHIAMATA E ESITO:</B>\n"; - -echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ESITO</td><td align=right><font size=2>CUENTA</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VLstatuses_to_print = mysql_num_rows($rslt); -$total_calls=0; -$o=0; $p=0; -while ($VLstatuses_to_print > $o) +if ($did < 1) { - $row=mysql_fetch_row($rslt); - $counts[$p] = $row[0]; - $status[$p] = $row[1]; - $call_sec[$p] = $row[2]; - $p++; - $o++; - } + ##### vicidial agent talk time and status ##### + echo "<B>AGENT TEMPO DI CHIAMATA E ESITO:</B>\n"; -$stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; -$rslt=mysql_query($stmt, $link); -$VCLstatuses_to_print = mysql_num_rows($rslt); -$o=0; -while ($VCLstatuses_to_print > $o) - { - $status_match=0; - $r=0; - $row=mysql_fetch_row($rslt); - while ($VLstatuses_to_print > $r) - { - if ($status[$r] == $row[1]) - { - $counts[$r] = ($counts[$r] + $row[0]); - $call_sec[$r] = ($call_sec[$r] + $row[2]); - $status_match++; - } - $r++; - } - if ($status_match < 1) + echo "<center><TABLE width=300 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=2>ESITO</td><td align=right><font size=2>CUENTA</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; + $rslt=mysql_query($stmt, $link); + $VLstatuses_to_print = mysql_num_rows($rslt); + $total_calls=0; + $o=0; $p=0; + while ($VLstatuses_to_print > $o) { + $row=mysql_fetch_row($rslt); $counts[$p] = $row[0]; $status[$p] = $row[1]; $call_sec[$p] = $row[2]; - $VLstatuses_to_print++; $p++; + $o++; } - $o++; - } -$o=0; -$total_sec=0; -while ($o < $p) - { - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $call_hours_minutes = sec_convert($call_sec[$o],'H'); - - echo "<tr $bgcolor><td><font size=2>$status[$o]</td>"; - echo "<td align=right><font size=2> $counts[$o]</td>\n"; - echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; - $total_calls = ($total_calls + $counts[$o]); - $total_sec = ($total_sec + $call_sec[$o]); - $call_seconds=0; - $o++; - } - -$call_hours_minutes = sec_convert($total_sec,'H'); - -echo "<tr><td><font size=2>TOTALE CHIAMATE </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; -echo "</TABLE></center>\n"; - - -##### Login and Logout time from vicidial agent interface ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>AGENT TIEMPO LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=500 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - - $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $stmt="SELECT count(*),status, sum(length_in_sec) from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' group by status order by status"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); - - $total_calls=0; + $VCLstatuses_to_print = mysql_num_rows($rslt); $o=0; - $event_start_seconds=''; - $event_stop_seconds=''; - while ($events_to_print > $o) { + while ($VCLstatuses_to_print > $o) + { + $status_match=0; + $r=0; $row=mysql_fetch_row($rslt); - if (eregi("LOGIN", $row[0])) + while ($VLstatuses_to_print > $r) + { + if ($status[$r] == $row[1]) + { + $counts[$r] = ($counts[$r] + $row[0]); + $call_sec[$r] = ($call_sec[$r] + $row[2]); + $status_match++; + } + $r++; + } + if ($status_match < 1) + { + $counts[$p] = $row[0]; + $status[$p] = $row[1]; + $call_sec[$p] = $row[2]; + $VLstatuses_to_print++; + $p++; + } + $o++; + } + + $o=0; + $total_sec=0; + while ($o < $p) + { + if (eregi("1$|3$|5$|7$|9$", $o)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - if (ereg("LOGIN", $row[0])) - { - $event_start_seconds = $row[1]; - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - if (ereg("LOGOUT", $row[0])) - { - if ($event_start_seconds) + $call_hours_minutes = sec_convert($call_sec[$o],'H'); + + echo "<tr $bgcolor><td><font size=2>$status[$o]</td>"; + echo "<td align=right><font size=2> $counts[$o]</td>\n"; + echo "<td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + $total_calls = ($total_calls + $counts[$o]); + $total_sec = ($total_sec + $call_sec[$o]); + $call_seconds=0; + $o++; + } + + $call_hours_minutes = sec_convert($total_sec,'H'); + + echo "<tr><td><font size=2>TOTALE CHIAMATE </td><td align=right><font size=2> $total_calls</td><td align=right><font size=2> $call_hours_minutes</td></tr>\n"; + echo "</TABLE></center>\n"; + + + ##### Login and Logout time from vicidial agent interface ##### + + echo "<br><br>\n"; + + echo "<center>\n"; + + echo "<B>AGENT TIEMPO LOGIN/LOGOUT:</B>\n"; + echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td><td align=right><font size=2>SESSION</td><td align=right><font size=2>SERVER</td><td align=right><font size=2>PHONE</td><td align=right><font size=2>COMPUTER</td></tr>\n"; + + $stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip from vicidial_user_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59'"; + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_calls=0; + $o=0; + $event_start_seconds=''; + $event_stop_seconds=''; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if (eregi("LOGIN", $row[0])) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if (ereg("LOGIN", $row[0])) { - - $event_stop_seconds = $row[1]; - $event_seconds = ($event_stop_seconds - $event_start_seconds); - $total_login_time = ($total_login_time + $event_seconds); - $event_hours_minutes = sec_convert($event_seconds,'H'); - + $event_start_seconds = $row[1]; echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; echo "<td align=right><font size=2> $row[2]</td>\n"; echo "<td align=right><font size=2> $row[3]</td>\n"; echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes</td></tr>\n"; - $event_start_seconds=''; - $event_stop_seconds=''; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> $row[5] </td>\n"; + echo "<td align=right><font size=2> $row[6] </td>\n"; + echo "<td align=right><font size=2> $row[7] </td>\n"; + echo "<td align=right><font size=2> $row[8] </td></tr>\n"; } - else + if (ereg("LOGOUT", $row[0])) { - echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; + if ($event_start_seconds) + { + + $event_stop_seconds = $row[1]; + $event_seconds = ($event_stop_seconds - $event_start_seconds); + $total_login_time = ($total_login_time + $event_seconds); + $event_hours_minutes = sec_convert($event_seconds,'H'); + + echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> $row[3]</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; + echo "<td align=right><font size=2> $event_hours_minutes</td>\n"; + echo "<td align=right colspan=4><font size=2>  </td></tr>\n"; + $event_start_seconds=''; + $event_stop_seconds=''; + } + else + { + echo "<tr $bgcolor><td><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> $row[3]</td>\n"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right colspan=5><font size=2>  </td></tr>\n"; + } + } + + $total_calls = ($total_calls + $row[0]); + + $call_seconds=0; + $o++; + } + + $total_login_hours_minutes = sec_convert($total_login_time,'H'); + + echo "<tr><td><font size=2>TOTALE</td>"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; + + echo "</TABLE></center>\n"; + + + + + + ##### vicidial_timeclock log records for user ##### + + $total_login_time=0; + $SQday_ARY = explode('-',$begin_date); + $EQday_ARY = explode('-',$end_date); + $SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); + $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); + + echo "<br><br>\n"; + + echo "<center>\n"; + + echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; + echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; + + $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; + if ($DB>0) {echo "|$stmt|";} + $rslt=mysql_query($stmt, $link); + $events_to_print = mysql_num_rows($rslt); + + $total_logs=0; + $o=0; + while ($events_to_print > $o) { + $row=mysql_fetch_row($rslt); + if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $TC_log_date = date("Y-m-d H:i:s", $row[1]); + + $manager_edit=''; + if (strlen($row[6])>0) {$manager_edit = ' * ';} + + if (ereg("LOGIN", $row[0])) + { + $login_sec=''; + echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + echo "<td align=right><font size=2>$manager_edit</td>"; + echo "<td align=right><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $TC_log_date</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $row[3]</td>\n"; echo "<td align=right><font size=2> </td></tr>\n"; } - } + if (ereg("LOGOUT", $row[0])) + { + $login_sec = $row[3]; + $total_login_time = ($total_login_time + $login_sec); + $event_hours_minutes = sec_convert($login_sec,'H'); - $total_calls = ($total_calls + $row[0]); + echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; + echo "<td align=right><font size=2>$manager_edit</td>"; + echo "<td align=right><font size=2>$row[0]</td>"; + echo "<td align=right><font size=2> $TC_log_date</td>\n"; + echo "<td align=right><font size=2> $row[4]</td>\n"; + echo "<td align=right><font size=2> $row[2]</td>\n"; + echo "<td align=right><font size=2> $event_hours_minutes"; + if ($DB) {echo " - $total_login_time - $login_sec";} + echo "</td></tr>\n"; + } + $o++; + } + if (strlen($login_sec)<1) + { + $login_sec = ($STARTtime - $row[1]); + $total_login_time = ($total_login_time + $login_sec); + if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} + } + $total_login_hours_minutes = sec_convert($total_login_time,'H'); - $call_seconds=0; - $o++; - } + if ($DB) {echo " - $total_login_time - $login_sec";} -$total_login_hours_minutes = sec_convert($total_login_time,'H'); + echo "<tr><td align=right><font size=2> </td>"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2> </td>\n"; + echo "<td align=right><font size=2><font size=2>TOTALE </td>\n"; + echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; -echo "<tr><td><font size=2>TOTALE</td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes</td></tr>\n"; - -echo "</TABLE></center>\n"; + echo "</TABLE></center>\n"; + ##### closer in-group selection logs ##### + echo "<br><br>\n"; -##### vicidial_timeclock log records for user ##### + echo "<center>\n"; -$total_login_time=0; -$SQday_ARY = explode('-',$begin_date); -$EQday_ARY = explode('-',$end_date); -$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]); -$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]); + echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n"; + echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAGNA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>TIMECLOCK TIEMPO LOGIN/LOGOUT:</B>\n"; -echo "<TABLE width=550 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=2>ID </td><td><font size=2>EDIT </td><td align=right><font size=2>EVENTO </td><td align=right><font size=2> DATA</td><td align=right><font size=2> IP ADDRESS</td><td align=right><font size=2> GROUP</td><td align=right><font size=2>HOURS:MM:SS</td></tr>\n"; - - $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='" . mysql_real_escape_string($user) . "' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';"; - if ($DB>0) {echo "|$stmt|";} + $stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; $rslt=mysql_query($stmt, $link); - $events_to_print = mysql_num_rows($rslt); + $logs_to_print = mysql_num_rows($rslt); - $total_logs=0; - $o=0; - while ($events_to_print > $o) { + $u=0; + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); - if ( ($row[0]=='START') or ($row[0]=='LOGIN') ) + if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $TC_log_date = date("Y-m-d H:i:s", $row[1]); + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$row[2]</td>"; + echo "<td align=left><font size=2> $row[1]</td>\n"; + echo "<td align=left><font size=2> $row[3]</td>\n"; + echo "<td align=left><font size=2> $row[4] </td>\n"; + echo "<td align=left><font size=2> $row[5]</td>\n"; + echo "</tr>\n"; + } - $manager_edit=''; - if (strlen($row[6])>0) {$manager_edit = ' * ';} - if (ereg("LOGIN", $row[0])) - { - $login_sec=''; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> </td></tr>\n"; - } - if (ereg("LOGOUT", $row[0])) - { - $login_sec = $row[3]; - $total_login_time = ($total_login_time + $login_sec); - $event_hours_minutes = sec_convert($login_sec,'H'); + echo "</TABLE><BR><BR>\n"; - echo "<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; - echo "<td align=right><font size=2>$manager_edit</td>"; - echo "<td align=right><font size=2>$row[0]</td>"; - echo "<td align=right><font size=2> $TC_log_date</td>\n"; - echo "<td align=right><font size=2> $row[4]</td>\n"; - echo "<td align=right><font size=2> $row[2]</td>\n"; - echo "<td align=right><font size=2> $event_hours_minutes"; - if ($DB) {echo " - $total_login_time - $login_sec";} - echo "</td></tr>\n"; - } - $o++; + + ##### vicidial agent outbound calls for this time period ##### + + echo "<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; + echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; + + $stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); + + $u=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$row[4]</td>"; + echo "<td align=left><font size=2> $row[7]</td>\n"; + echo "<td align=left><font size=2> $row[8]</td>\n"; + echo "<td align=left><font size=2> $row[10] </td>\n"; + echo "<td align=right><font size=2> $row[3] </td>\n"; + echo "<td align=right><font size=2> $row[14] </td>\n"; + echo "<td align=right><font size=2> $row[2] </td>\n"; + echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; + echo "<td align=right><font size=2> $row[15] </td></tr>\n"; + } + + + echo "</TABLE><BR><BR>\n"; } -if (strlen($login_sec)<1) - { - $login_sec = ($STARTtime - $row[1]); - $total_login_time = ($total_login_time + $login_sec); - if ($DB) {echo "LOGIN ONLY - $total_login_time - $login_sec";} - } -$total_login_hours_minutes = sec_convert($total_login_time,'H'); - -if ($DB) {echo " - $total_login_time - $login_sec";} - -echo "<tr><td align=right><font size=2> </td>"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2> </td>\n"; -echo "<td align=right><font size=2><font size=2>TOTALE </td>\n"; -echo "<td align=right><font size=2> $total_login_hours_minutes </td></tr>\n"; - -echo "</TABLE></center>\n"; - - - -##### closer in-group selection logs ##### - -echo "<br><br>\n"; - -echo "<center>\n"; - -echo "<B>CLOSER IN-GROUP SELECTION LOGS:</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CAMPAGNA</td><td align=left><font size=2>BLEND</td><td align=left><font size=2> GROUPS</td><td align=left><font size=2> MANAGER</td></tr>\n"; - -$stmt="select user,campaign_id,event_date,blended,closer_campaigns,manager_change from vicidial_user_closer_log where user='" . mysql_real_escape_string($user) . "' and event_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by event_date desc limit 1000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[2]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[3]</td>\n"; - echo "<td align=left><font size=2> $row[4] </td>\n"; - echo "<td align=left><font size=2> $row[5]</td>\n"; - echo "</tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - - -##### vicidial agent outbound calls for this time period ##### - -echo "<B>OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=670 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> GROUP</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; - -$stmt="select uniqueid,lead_id,list_id,campaign_id,call_date,start_epoch,end_epoch,length_in_sec,status,phone_code,phone_number,user,comments,processed,user_group,term_reason,alt_dial from vicidial_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -while ($logs_to_print > $u) - { - $row=mysql_fetch_row($rslt); - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[4]</td>"; - echo "<td align=left><font size=2> $row[7]</td>\n"; - echo "<td align=left><font size=2> $row[8]</td>\n"; - echo "<td align=left><font size=2> $row[10] </td>\n"; - echo "<td align=right><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[14] </td>\n"; - echo "<td align=right><font size=2> $row[2] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[1]\" target=\"_blank\">$row[1]</A> </td>\n"; - echo "<td align=right><font size=2> $row[15] </td></tr>\n"; - } - - -echo "</TABLE><BR><BR>\n"; - ##### vicidial agent inbound calls for this time period ##### @@ -544,6 +625,10 @@ echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>LENGTH</td><td align=left><font size=2> STATUS</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> WAIT (S)</td><td align=right><font size=2> AGENT (S)</td><td align=right><font size=2> LIST</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> HANGUP REASON</td></tr>\n"; $stmt="select call_date,length_in_sec,status,phone_number,campaign_id,queue_seconds,list_id,lead_id,term_reason from vicidial_closer_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; +if ($did > 0) + { + $stmt="select start_time,length_in_sec,0,caller_code,0,0,0,extension,0 from call_log where channel_group='DID_INBOUND' and number_dialed='" . mysql_real_escape_string($user) . "' and start_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and start_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by start_time desc limit 10000;"; + } $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); @@ -558,6 +643,16 @@ while ($logs_to_print > $u) else {$bgcolor='bgcolor="#9BB9FB"';} + if ($did > 0) + { + if (strlen($row[7]) > 17) + { + $row[7] = substr($row[7], -9); + $row[7] = ($row[7] + 0); + } + else + {$row[7]='0';} + } $TOTALinSECONDS = ($TOTALinSECONDS + $row[1]); $AGENTseconds = ($row[1] - $row[5]); if ($AGENTseconds < 0) @@ -590,99 +685,124 @@ echo "</TABLE></center><BR><BR>\n"; ##### vicidial agent activity records for this time period ##### -echo "<B>AGENT ACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1>   </td></tr>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; - -$stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; -$rslt=mysql_query($stmt, $link); -$logs_to_print = mysql_num_rows($rslt); - -$u=0; -$TOTALpauseSECONDS=0; -$TOTALwaitSECONDS=0; -$TOTALtalkSECONDS=0; -$TOTALdispoSECONDS=0; -$TOTALdeadSECONDS=0; -$TOTALcustomerSECONDS=0; -while ($logs_to_print > $u) +if ($did < 1) { - $row=mysql_fetch_row($rslt); - $event_time = $row[0]; - $lead_id = $row[1]; - $campaign_id = $row[2]; - $pause_sec = $row[3]; - $wait_sec = $row[4]; - $talk_sec = $row[5]; - $dispo_sec = $row[6]; - $dead_sec = $row[7]; - $status = $row[8]; - $pause_code = $row[9]; - $user_group = $row[10]; - $customer_sec = ($talk_sec - $dead_sec); - if ($customer_sec < 0) - {$customer_sec=0;} + echo "<B>AGENT ACTIVITY FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; + echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td colspan=2><font size=1>   </td><td colspan=6 align=center bgcolor=white><font size=1>these fields are in seconds </td><td colspan=4><font size=1>   </td></tr>\n"; + echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2>PAUSE</td><td align=left><font size=2> WAIT</td><td align=left><font size=2> TALK</td><td align=right><font size=2> DISPO</td><td align=right><font size=2> DEAD</td><td align=right><font size=2> CUSTOMER</td><td align=right><font size=2> STATUS</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CAMPAGNA</td><td align=right><font size=2> PAUSE CODE</td></tr>\n"; - if (eregi("1$|3$|5$|7$|9$", $u)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} + $stmt="select event_time,lead_id,campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec,dead_sec,status,sub_status,user_group from vicidial_agent_log where user='" . mysql_real_escape_string($user) . "' and event_time >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and event_time <= '" . mysql_real_escape_string($end_date) . " 23:59:59' and ( (pause_sec > 0) or (wait_sec > 0) or (talk_sec > 0) or (dispo_sec > 0) ) order by event_time desc limit 10000;"; + $rslt=mysql_query($stmt, $link); + $logs_to_print = mysql_num_rows($rslt); - $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); - $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); - $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); - $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); - $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); - $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + $u=0; + $TOTALpauseSECONDS=0; + $TOTALwaitSECONDS=0; + $TOTALtalkSECONDS=0; + $TOTALdispoSECONDS=0; + $TOTALdeadSECONDS=0; + $TOTALcustomerSECONDS=0; + while ($logs_to_print > $u) + { + $row=mysql_fetch_row($rslt); + $event_time = $row[0]; + $lead_id = $row[1]; + $campaign_id = $row[2]; + $pause_sec = $row[3]; + $wait_sec = $row[4]; + $talk_sec = $row[5]; + $dispo_sec = $row[6]; + $dead_sec = $row[7]; + $status = $row[8]; + $pause_code = $row[9]; + $user_group = $row[10]; + $customer_sec = ($talk_sec - $dead_sec); + if ($customer_sec < 0) + {$customer_sec=0;} + if (eregi("1$|3$|5$|7$|9$", $u)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$event_time</td>"; - echo "<td align=right><font size=2> $pause_sec</td>\n"; - echo "<td align=right><font size=2> $wait_sec</td>\n"; - echo "<td align=right><font size=2> $talk_sec </td>\n"; - echo "<td align=right><font size=2> $dispo_sec </td>\n"; - echo "<td align=right><font size=2> $dead_sec </td>\n"; - echo "<td align=right><font size=2> $customer_sec </td>\n"; - echo "<td align=right><font size=2> $status </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; - echo "<td align=right><font size=2> $campaign_id </td>\n"; - echo "<td align=right><font size=2> $pause_code </td></tr>\n"; + $TOTALpauseSECONDS = ($TOTALpauseSECONDS + $pause_sec); + $TOTALwaitSECONDS = ($TOTALwaitSECONDS + $wait_sec); + $TOTALtalkSECONDS = ($TOTALtalkSECONDS + $talk_sec); + $TOTALdispoSECONDS = ($TOTALdispoSECONDS + $dispo_sec); + $TOTALdeadSECONDS = ($TOTALdeadSECONDS + $dead_sec); + $TOTALcustomerSECONDS = ($TOTALcustomerSECONDS + $customer_sec); + + if ($DB > 0) + { + $DBtotal_sec = ($pause_sec + $wait_sec + $talk_sec + $dispo_sec); + $DBdatetime = explode(" ",$event_time); + $DBdate = explode("-",$DBdatetime[0]); + $DBtime = explode(":",$DBdatetime[1]); + + $DBcall_end_sec = mktime($DBtime[0], $DBtime[1], ($DBtime[2] + $DBtotal_sec), $DBdate[1], $DBdate[2], $DBdate[0]); + $DBcall_end = date("Y-m-d H:i:s",$DBcall_end_sec); + echo "<tr $bgcolor>"; + echo "<td><font size=1>  </td>"; + echo "<td><font size=2>$DBcall_end</td>"; + echo "<td align=right><font size=2> $DBtotal_sec </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td>\n"; + echo "<td align=right><font size=2>   </td></tr>\n"; + } + + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$event_time</td>"; + echo "<td align=right><font size=2> $pause_sec</td>\n"; + echo "<td align=right><font size=2> $wait_sec</td>\n"; + echo "<td align=right><font size=2> $talk_sec </td>\n"; + echo "<td align=right><font size=2> $dispo_sec </td>\n"; + echo "<td align=right><font size=2> $dead_sec </td>\n"; + echo "<td align=right><font size=2> $customer_sec </td>\n"; + echo "<td align=right><font size=2> $status </td>\n"; + echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$lead_id\" target=\"_blank\">$lead_id</A> </td>\n"; + echo "<td align=right><font size=2> $campaign_id </td>\n"; + echo "<td align=right><font size=2> $pause_code </td></tr>\n"; + } + + echo "<tr bgcolor=white>"; + echo "<td colspan=2><font size=2>TOTALI</td>"; + echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; + echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; + echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; + echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; + echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; + echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; + echo "<td colspan=4><font size=2>   </td></tr>\n"; + + $TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); + $TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); + $TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); + $TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); + $TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); + $TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); + + echo "<tr bgcolor=white>"; + echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>"; + echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; + echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; + echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; + echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; + echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; + echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; + echo "<td colspan=4><font size=2>   </td></tr>\n"; + + echo "</TABLE></center><BR><BR>\n"; } -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=2>TOTALI</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDS</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDS</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -$TOTALpauseSECONDShh = sec_convert($TOTALpauseSECONDS,'H'); -$TOTALwaitSECONDShh = sec_convert($TOTALwaitSECONDS,'H'); -$TOTALtalkSECONDShh = sec_convert($TOTALtalkSECONDS,'H'); -$TOTALdispoSECONDShh = sec_convert($TOTALdispoSECONDS,'H'); -$TOTALdeadSECONDShh = sec_convert($TOTALdeadSECONDS,'H'); -$TOTALcustomerSECONDShh = sec_convert($TOTALcustomerSECONDS,'H'); - -echo "<tr bgcolor=white>"; -echo "<td colspan=2><font size=1>(in HH:MM:SS)</td>"; -echo "<td align=right><font size=2> $TOTALpauseSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALwaitSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALtalkSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdispoSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALdeadSECONDShh</td>\n"; -echo "<td align=right><font size=2> $TOTALcustomerSECONDShh</td>\n"; -echo "<td colspan=4><font size=2>   </td></tr>\n"; - -echo "</TABLE></center><BR><BR>\n"; - - ##### vicidial recordings for this time period ##### @@ -732,7 +852,7 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon {$locat = substr($location,0,27); $locat = "$locat...";} else {$locat = $location;} - if (eregi("http",$location)) + if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) {$location = "<a href=\"$location\">$locat</a>";} else {$location = $locat;} @@ -746,50 +866,56 @@ echo "<tr><td><font size=1># </td><td align=left><font size=2> LEAD</td><td><fon echo "<td align=center><font size=2> $row[10] </td>\n"; echo "<td align=right><font size=2> $location   </td>\n"; echo "</tr>\n"; - } - echo "</TABLE><BR><BR>\n"; -##### vicidial agent outbound user manual calls for this time period ##### +if ($did < 1) + { + ##### vicidial agent outbound user manual calls for this time period ##### -echo "<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; -echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; -echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td></tr>\n"; + echo "<B>MANUAL OUTBOUND CALLS FOR THIS TIME PERIOD: (10000 record limit)</B>\n"; + echo "<TABLE width=750 cellspacing=0 cellpadding=1>\n"; + echo "<tr><td><font size=1># </td><td><font size=2>DATE/TIME </td><td align=left><font size=2> CALL TYPE</td><td align=left><font size=2> SERVER</td><td align=left><font size=2> PHONE</td><td align=right><font size=2> DIALED</td><td align=right><font size=2> LEAD</td><td align=right><font size=2> CALLERID</td><td align=right><font size=2> ALIAS</td><td align=right><font size=2> PRESET</td><td align=right><font size=2>C3HU</td></tr>\n"; - $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; + $stmt="select call_date,call_type,server_ip,phone_number,number_dialed,lead_id,callerid,group_alias_id,preset_name,customer_hungup,customer_hungup_seconds from user_call_log where user='" . mysql_real_escape_string($user) . "' and call_date >= '" . mysql_real_escape_string($begin_date) . " 0:00:01' and call_date <= '" . mysql_real_escape_string($end_date) . " 23:59:59' order by call_date desc limit 10000;"; $rslt=mysql_query($stmt, $link); $logs_to_print = mysql_num_rows($rslt); $u=0; - while ($logs_to_print > $u) { + while ($logs_to_print > $u) + { $row=mysql_fetch_row($rslt); if (eregi("1$|3$|5$|7$|9$", $u)) {$bgcolor='bgcolor="#B9CBFD"';} else {$bgcolor='bgcolor="#9BB9FB"';} - $u++; - echo "<tr $bgcolor>"; - echo "<td><font size=1>$u</td>"; - echo "<td><font size=2>$row[0]</td>"; - echo "<td align=left><font size=2> $row[1]</td>\n"; - echo "<td align=left><font size=2> $row[2]</td>\n"; - echo "<td align=left><font size=2> $row[3] </td>\n"; - echo "<td align=right><font size=2> $row[4] </td>\n"; - echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; - echo "<td align=right><font size=2> $row[6] </td>\n"; - echo "<td align=right><font size=2> $row[7] </td></tr>\n"; + $C3HU=''; + if ($row[9]=='BEFORE_CALL') {$row[9]='BC';} + if ($row[9]=='DURING_CALL') {$row[9]='DC';} + if (strlen($row[9]) > 1) + {$C3HU = "$row[9] $row[10]";} + $u++; + echo "<tr $bgcolor>"; + echo "<td><font size=1>$u</td>"; + echo "<td><font size=2>$row[0]</td>"; + echo "<td align=left><font size=2> $row[1]</td>\n"; + echo "<td align=left><font size=2> $row[2]</td>\n"; + echo "<td align=left><font size=2> $row[3] </td>\n"; + echo "<td align=right><font size=2> $row[4] </td>\n"; + echo "<td align=right><font size=2> <A HREF=\"admin_modify_lead.php?lead_id=$row[5]\" target=\"_blank\">$row[5]</A> </td>\n"; + echo "<td align=right><font size=2> $row[6] </td>\n"; + echo "<td align=right><font size=2> $row[7] </td>\n"; + echo "<td align=right><font size=2> $row[8] </td>\n"; + echo "<td align=right NOWRAP><font size=2> $C3HU </td></tr>\n"; + } + echo "</TABLE><BR><BR>\n"; } -echo "</TABLE><BR><BR>\n"; - - - $ENDtime = date("U"); $RUNtime = ($ENDtime - $STARTtime); @@ -797,7 +923,7 @@ $RUNtime = ($ENDtime - $STARTtime); echo "\n\n\n<br><br><br>\n\n"; -echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds</font>"; +echo "<font size=0>\n\n\n<br><br><br>\nTempo Esecuzione Script: $RUNtime seconds|$db_source</font>"; ?> diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/user_status.php b/agc_2-X/trunk/LANG_www/vicidial_it/user_status.php index 37f215b0..e315f93c 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/user_status.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/user_status.php @@ -1,7 +1,7 @@ <?php # user_status.php # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # @@ -14,6 +14,7 @@ # 91012-0536 - Added selected territories display # 91130-2039 - Added user closer log manager flag display # 91212-0656 - Added more complete logging of Emergency Logout process +# 100309-0544 - Added queuemetrics_loginout option # header ("Content-type: text/html; charset=utf-8"); @@ -338,7 +339,7 @@ if ($stage == "log_agent_out") ############################################# ##### START QUEUEMETRICS LOGGING LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id FROM system_settings;"; + $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,queuemetrics_loginout FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "<BR>$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); @@ -351,11 +352,16 @@ if ($stage == "log_agent_out") $queuemetrics_login = $row[3]; $queuemetrics_pass = $row[4]; $queuemetrics_log_id = $row[5]; + $queuemetrics_loginout = $row[6]; } ##### END QUEUEMETRICS LOGGING LOOKUP ##### ########################################### if ($enable_queuemetrics_logging > 0) { + $QM_LOGOFF = 'AGENTLOGOFF'; + if ($queuemetrics_loginout=='CALLBACK') + {$QM_LOGOFF = 'AGENTCALLBACKLOGOFF';} + $linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); mysql_select_db("$queuemetrics_dbname", $linkB); @@ -363,7 +369,7 @@ if ($stage == "log_agent_out") $agent_logged_in=''; $time_logged_in=''; - $stmtB = "SELECT agent,time_id FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb='AGENTLOGIN' order by time_id desc limit 1;"; + $stmtB = "SELECT agent,time_id,data1 FROM queue_log where agent='Agent/" . mysql_real_escape_string($user) . "' and verb IN('AGENTLOGIN','AGENTCALLBACKLOGIN') order by time_id desc limit 1;"; $rsltB=mysql_query($stmtB, $linkB); if ($DB) {echo "<BR>$stmtB\n";} $qml_ct = mysql_num_rows($rsltB); @@ -372,12 +378,13 @@ if ($stage == "log_agent_out") $row=mysql_fetch_row($rsltB); $agent_logged_in = $row[0]; $time_logged_in = $row[1]; + $phone_logged_in = $row[2]; } $time_logged_in = ($now_date_epoch - $time_logged_in); if ($time_logged_in > 1000000) {$time_logged_in=1;} - $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='AGENTLOGOFF',serverid='$queuemetrics_log_id',data1='" . mysql_real_escape_string($user) . "$agents',data2='$time_logged_in';"; + $stmtB = "INSERT INTO queue_log SET partition='P01',time_id='$now_date_epoch',call_id='NONE',queue='NONE',agent='$agent_logged_in',verb='$QM_LOGOFF',serverid='$queuemetrics_log_id',data1='$phone_logged_in',data2='$time_logged_in';"; if ($DB) {echo "<BR>$stmtB\n";} $rsltB=mysql_query($stmtB, $linkB); } diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/vtiger_search.php b/agc_2-X/trunk/LANG_www/vicidial_it/vtiger_search.php index 6636a431..19fd5b30 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/vtiger_search.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/vtiger_search.php @@ -616,7 +616,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Vtiger no longer use auto increment for vtiger_crmentity crmid, vtiger_crmentity_seq is used instead to list next aviable entity ID - # Get next aviable id to use as crmid in vtiger_crmentity + # Get next available id to use as crmid in vtiger_crmentity $stmt="SELECT id from vtiger_crmentity_seq ;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -624,7 +624,7 @@ if ($lead_search > 0) $leadid = ($row[0] + 1); if (!$rslt) {die('Could not execute: ' . mysql_error());} - # Increase next aviable crmid with 1 so next record gets proper id + # Increase next available crmid with 1 so next record gets proper id $stmt="UPDATE vtiger_crmentity_seq SET id = '$leadid';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_query($stmt, $linkV); @@ -644,7 +644,7 @@ if ($lead_search > 0) if (!$rslt) {die('Could not execute: ' . mysql_error());} #Insert values into vtiger_leaddetails - $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$province','$country','$phone','$alt_phone','$address1 $address2');"; + $stmt = "INSERT INTO vtiger_leadaddress (leadaddressid,city,code,state,country,phone,mobile,lane) values('$leadid','$city','$postal_code','$state','$country','$phone','$alt_phone','$address1 $address2');"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_query($stmt, $linkV); if (!$rslt) {die('Could not execute: ' . mysql_error());} diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/vtiger_user.php b/agc_2-X/trunk/LANG_www/vicidial_it/vtiger_user.php index f53a989a..a7d062f9 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/vtiger_user.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/vtiger_user.php @@ -3,12 +3,13 @@ # vicidial_users table into the Vtiger system as well as # the groups from VICIDIAL to Vtiger # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # # CHANGES # 81231-1307 - First build # 90228-2152 - Added Groups support # 90508-0644 - Changed to PHP long tags +# 100127-0616 - Added Vtiger ViciDial user_level role lookup # header ("Content-type: text/html; charset=utf-8"); @@ -183,15 +184,25 @@ while ($i < $VD_users_ct) $roleid = 'H5'; $status = 'Active'; $groupid = '1'; - if ($user_level[$i] >= 7) {$roleid = 'H4';} - if ($user_level[$i] >= 8) {$roleid = 'H3';} - if ($user_level[$i] >= 9) {$roleid = 'H2';} - if ($user_level[$i] >= 9) {$is_admin = 'on';} - if (ereg('N',$active[$i])) {$status = 'Inactive';} + if ($user_level[$i] >= 7) {$roleid = 'H4';} + if ($user_level[$i] >= 8) {$roleid = 'H3';} + if ($user_level[$i] >= 9) {$roleid = 'H2';} + if ($user_level[$i] >= 9) {$is_admin = 'on';} + if (ereg('N',$active[$i])) {$status = 'Inactive';} $salt = substr($user_name, 0, 2); $salt = '$1$' . $salt . '$'; $encrypted_password = crypt($user_password, $salt); $i++; + ### search for role in ViciDial + $stmt = "SELECT vtiger_role FROM vtiger_vicidial_roles where user_level='$user_level';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {echo "$stmt\n";} + $vvr_ct = mysql_num_rows($rslt); + if ($vvr_ct > 0) + { + $row=mysql_fetch_row($rslt); + $roleid = $row[0]; + } $j=0; $all_VICIDIAL_groups_SQL=''; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/welcome_demo.php b/agc_2-X/trunk/LANG_www/vicidial_it/welcome_demo.php index 238cf5cf..3b48ee07 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/welcome_demo.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/welcome_demo.php @@ -2,7 +2,7 @@ # welcome_demo.php - VICIDIAL welcome Demo page # # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,9 @@ echo "<font size=3><b>   <a href=\"../agc_nl/vicidial.php?relogin=YES&VD_lo echo "</TD></TR>\n"; echo "<TR><TD ALIGN=LEFT >"; echo "<font size=3><b>   <a href=\"../agc_tw/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/tw.gif\" border=0> Chinese(T) Agent Login</a>"; +echo "</TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT >"; +echo "<font size=3><b>   <a href=\"../agc_se/vicidial.php?relogin=YES&VD_login=6666&VD_campaign=TESTCAMP&phone_login=phone&phone_pass=phone&VD_pass=1234\"><IMG SRC=\"../agc/images/se.gif\" border=0> Swedish Agent Login</a>"; echo "</TD></TR></TABLE>\n"; echo "</TD><TD VALIGN=TOP>\n"; @@ -78,6 +81,9 @@ echo "<font size=3><b>   <a href=\"../vicidial_el/admin.php\"><IMG SRC=\".. echo "</TD></TR>\n"; echo "<TR><TD ALIGN=LEFT >"; echo "<font size=3><b>   <a href=\"../vicidial_fr/admin.php\"><IMG SRC=\"../agc/images/fr.gif\" border=0> French Administration</a>"; +echo "</TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT >"; +echo "<font size=3><b>   <a href=\"../vicidial_br/admin.php\"><IMG SRC=\"../agc/images/br.gif\" border=0> Brazilian Portuguese Administration</a>"; echo "</TD></TR></TABLE>\n"; echo "<TR><TD ALIGN=LEFT ><font size=1>   </TD></TR>\n"; echo "</TABLE>\n"; diff --git a/agc_2-X/trunk/LANG_www/vicidial_it/welcome_languages.php b/agc_2-X/trunk/LANG_www/vicidial_it/welcome_languages.php index d53707a9..4fe6d387 100644 --- a/agc_2-X/trunk/LANG_www/vicidial_it/welcome_languages.php +++ b/agc_2-X/trunk/LANG_www/vicidial_it/welcome_languages.php @@ -1,8 +1,8 @@ <?php -# welcome_demo.php - VICIDIAL welcome Demo page +# welcome_languages.php - VICIDIAL welcome Languages page # # -# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 +# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: GPLv2 # header ("Content-type: text/html; charset=utf-8"); @@ -56,6 +56,9 @@ echo "<font size=3><b>   <a href=\"../agc_nl/vicidial.php\"><IMG SRC=\"../a echo "</TD></TR>\n"; echo "<TR><TD ALIGN=LEFT >"; echo "<font size=3><b>   <a href=\"../agc_tw/vicidial.php\"><IMG SRC=\"../agc/images/tw.gif\" border=0> Chinese(T) Agent Login</a>"; +echo "</TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT >"; +echo "<font size=3><b>   <a href=\"../agc_se/vicidial.php\"><IMG SRC=\"../agc/images/se.gif\" border=0> Swedish Agent Login</a>"; echo "</TD></TR></TABLE>\n"; echo "</TD><TD VALIGN=TOP>\n"; @@ -78,6 +81,9 @@ echo "<font size=3><b>   <a href=\"../vicidial_el/admin.php\"><IMG SRC=\".. echo "</TD></TR>\n"; echo "<TR><TD ALIGN=LEFT >"; echo "<font size=3><b>   <a href=\"../vicidial_fr/admin.php\"><IMG SRC=\"../agc/images/fr.gif\" border=0> French Administration</a>"; +echo "</TD></TR>\n"; +echo "<TR><TD ALIGN=LEFT >"; +echo "<font size=3><b>   <a href=\"../vicidial_br/admin.php\"><IMG SRC=\"../agc/images/br.gif\" border=0> Brazilian Portuguese Administration</a>"; echo "</TD></TR></TABLE>\n"; echo "<TR><TD ALIGN=LEFT ><font size=1>   </TD></TR>\n"; echo "</TABLE>\n";