diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 8bedae03..055dbcf2 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -240,6 +240,8 @@ OTHER CHANGES: 62. Added List Override setting for Default Transfer Group +63. Added lead_status_search Non-Agent API function + diff --git a/agc_2-X/trunk/www/vicidial/AST_IVRfilter.php b/agc_2-X/trunk/www/vicidial/AST_IVRfilter.php index 30f3dfa7..2438ff11 100644 --- a/agc_2-X/trunk/www/vicidial/AST_IVRfilter.php +++ b/agc_2-X/trunk/www/vicidial/AST_IVRfilter.php @@ -609,11 +609,6 @@ if ($file_download == 0 || !$file_download) { echo "$CSV_text"; -# $CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); -# fwrite($CSV_report, $CSV_header); -# fwrite($CSV_report, $CSV_lines); -# fwrite($CSV_report, $CSV_total); - } if ($db_source == 'S') diff --git a/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php b/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php index 044cd313..b2e85406 100644 --- a/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php +++ b/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php @@ -1684,10 +1684,6 @@ else } if ($file_download>0) { -# $CSV_report=fopen("AST_OUTBOUNDsummary_interval.csv", "w"); -# $CSV_text=preg_replace('/\s+,/', ',', $CSV_main.$CSV_subreports); -# fwrite($CSV_report, $CSV_text); -# fclose($CSV_report); $CSVfilename = "AST_OUTBOUNDsummary_interval$US$FILE_TIME.csv"; $CSV_text=$CSV_main.$CSV_subreports; $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php index 78baf7ee..b468477a 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php @@ -1615,11 +1615,11 @@ if ($show_percentages) { $CSV_total=preg_replace('/\s/', '', "\"\",\"\",\""._QXZ("TOTALS")."\",\""._QXZ("AGENTS").":$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses\n\n"); } +$FILE_TIME = date("Ymd-His"); +$CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; + if ($file_download == 1) { - $FILE_TIME = date("Ymd-His"); - $CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; - // We'll be outputting a TXT file header('Content-type: application/octet-stream'); @@ -1655,11 +1655,11 @@ if ($file_download == 1) exit; } -$CSV_report=fopen("AST_agent_performance_detail.csv", "w"); -fwrite($CSV_report, $CSV_header); -fwrite($CSV_report, $CSV_lines); -fwrite($CSV_report, $CSV_total); - +#$CSV_report=fopen($CSVfilename, "w"); +#fwrite($CSV_report, $CSV_header); +#fwrite($CSV_report, $CSV_lines); +#fwrite($CSV_report, $CSV_total); +#fclose($CSV_report); $ASCII_text.="\n\n"; @@ -2095,11 +2095,11 @@ $JS_text.="\n"; $CSV_total=preg_replace('/\s/', '', "\"\",\"\",\""._QXZ("TOTALS")."\",\""._QXZ("AGENTS").":$TOT_AGENTS\",\"$TOTtotTOTAL_MS\",\"$TOTtotNONPAUSE_MS\",\"$TOTtotPAUSE_MS\",$CSVSUMstatuses"); +$FILE_TIME = date("Ymd-His"); +$CSVfilename = "AST_PAUSE_CODE_BREAKDOWN$US$FILE_TIME.csv"; + if ($file_download == 2) { - $FILE_TIME = date("Ymd-His"); - $CSVfilename = "AST_PAUSE_CODE_BREAKDOWN$US$FILE_TIME.csv"; - // We'll be outputting a TXT file header('Content-type: application/octet-stream'); @@ -2134,10 +2134,12 @@ if ($file_download == 2) exit; } -$CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); -fwrite($CSV_report, $CSV_header); -fwrite($CSV_report, $CSV_lines); -fwrite($CSV_report, $CSV_total); + +#$CSV_report=fopen($CSVfilename, "w"); +#fwrite($CSV_report, $CSV_header); +#fwrite($CSV_report, $CSV_lines); +#fwrite($CSV_report, $CSV_total); +#fclose($CSV_report); if ($report_display_type=="HTML") { diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail_SALES.php b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail_SALES.php index 2572a386..37f0baed 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail_SALES.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail_SALES.php @@ -1186,11 +1186,11 @@ $GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3; $CSV_total=preg_replace('/\s/', '', "\"\",\"\",\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$STOTsales_per_call\",\"$STOTsales_per_hour\",\"$Sgrand_total_sales\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses"); +$FILE_TIME = date("Ymd-His"); +$CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; + if ($file_download == 1) { - $FILE_TIME = date("Ymd-His"); - $CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; - // We'll be outputting a TXT file header('Content-type: application/octet-stream'); @@ -1226,11 +1226,11 @@ if ($file_download == 1) exit; } -$CSV_report=fopen("AST_agent_performance_detail.csv", "w"); -fwrite($CSV_report, $CSV_header); -fwrite($CSV_report, $CSV_lines); -fwrite($CSV_report, $CSV_total); - +#$CSV_report=fopen($CSVfilename, "w"); +#fwrite($CSV_report, $CSV_header); +#fwrite($CSV_report, $CSV_lines); +#fwrite($CSV_report, $CSV_total); +#fclose($CSV_report); $ASCII_text.="\n\n"; @@ -1581,11 +1581,11 @@ $GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3.$max; $CSV_total=preg_replace('/\s/', '', "\"\",\"\",\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTtotTOTAL_MS\",\"$TOTtotNONPAUSE_MS\",\"$TOTtotPAUSE_MS\",$CSVSUMstatuses"); +$FILE_TIME = date("Ymd-His"); +$CSVfilename = "AST_PAUSE_CODE_BREAKDOWN$US$FILE_TIME.csv"; + if ($file_download == 2) { - $FILE_TIME = date("Ymd-His"); - $CSVfilename = "AST_PAUSE_CODE_BREAKDOWN$US$FILE_TIME.csv"; - // We'll be outputting a TXT file header('Content-type: application/octet-stream'); @@ -1620,10 +1620,12 @@ if ($file_download == 2) exit; } -$CSV_report=fopen("AST_pause_code_breakdown.csv", "w"); -fwrite($CSV_report, $CSV_header); -fwrite($CSV_report, $CSV_lines); -fwrite($CSV_report, $CSV_total); + +#$CSV_report=fopen($CSVfilename, "w"); +#fwrite($CSV_report, $CSV_header); +#fwrite($CSV_report, $CSV_lines); +#fwrite($CSV_report, $CSV_total); +#fclose($CSV_report); if ($report_display_type=="HTML") { diff --git a/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php b/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php index e950388e..834d2df5 100644 --- a/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php +++ b/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php @@ -920,11 +920,11 @@ $CSV_text.="\n"; $ASCII_text.=$ASCII_header2; +$FILE_TIME = date("Ymd-His"); +$CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; + if ($file_download == 1) { - $FILE_TIME = date("Ymd-His"); - $CSVfilename = "AGENT_PERFORMACE_DETAIL$US$FILE_TIME.csv"; - // We'll be outputting a TXT file header('Content-type: application/octet-stream'); @@ -960,11 +960,11 @@ if ($file_download == 1) exit; } -$CSV_report=fopen("AST_agent_performance_detail.csv", "w"); -fwrite($CSV_report, $CSV_header); -fwrite($CSV_report, $CSV_lines); -fwrite($CSV_report, $CSV_total); - +#$CSV_report=fopen($CSVfilename, "w"); +#fwrite($CSV_report, $CSV_header); +#fwrite($CSV_report, $CSV_lines); +#fwrite($CSV_report, $CSV_total); +#fclose($CSV_report); $ASCII_text.="\n\n"; diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index a87c9cdf..2697f38b 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -128,6 +128,22 @@ $Vtables = 'NONE,log_noanswer,did_agent_log,contact_information'; $APIfunctions = 'ALL_FUNCTIONS add_group_alias add_lead add_list add_phone add_phone_alias add_user agent_ingroup_info agent_stats_export agent_status audio_playback blind_monitor call_agent callid_info change_ingroups check_phone_number did_log_export external_add_lead external_dial external_hangup external_pause external_status in_group_status logout moh_list park_call pause_code preview_dial_action ra_call_control recording recording_lookup send_dtmf server_refresh set_timer_action sounds_list st_get_agent_active_lead st_login_log transfer_conference update_fields update_lead update_list update_log_entry update_phone update_phone_alias update_user user_group_status vm_list webphone_url webserver logged_in_agents update_campaigns lead_field_info phone_number_log switch_lead ccc_lead_info'; + +### BEGIN housecleaning of old static report files, if not done before ### +if (!file_exists('old_clear')) + { + array_map('unlink', glob("./*.csv")); + array_map('unlink', glob("./*.xls")); + array_map('unlink', glob("./ploticus/*")); + unlink('project_auth_entries.txt'); + + $clear_file=fopen('old_clear', "w"); + fwrite($clear_file, '1'); + fclose($clear_file); + } +### END housecleaning of old static report files ### + + ###################################################################################################### ###################################################################################################### ####### Form variable declaration @@ -4215,12 +4231,13 @@ else # 171130-0036 - Added agent_screen_time_display campaign setting # 171214-2045 - Added PREVIEW_ options for get_call_launch # 171224-1220 - Added List default_xfer_group override +# 171229-2309 - Added housecleaning code # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.14-646a'; -$build = '171224-1220'; +$admin_version = '2.14-647a'; +$build = '171229-2309'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); diff --git a/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php b/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php index c8cd3b08..d837a47c 100644 --- a/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php +++ b/agc_2-X/trunk/www/vicidial/admin_listloader_fourth_gen.php @@ -1290,7 +1290,7 @@ if ($OK_to_process) $affected_rows = mysqli_affected_rows($link); $lead_id = mysqli_insert_id($link); if ($DB > 0) {echo "";} - if ($webroot_writable > 0) + if ( ($webroot_writable > 0) and ($DB>0) ) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; @@ -1306,7 +1306,7 @@ if ($OK_to_process) ### 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_to_mysqli($stmtZ, $link); - if ($webroot_writable > 0) + if ( ($webroot_writable > 0) and ($DB>0) ) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; @@ -1354,7 +1354,7 @@ if ($OK_to_process) { $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_to_mysqli($stmtZ, $link); - if ($webroot_writable > 0) + if ( ($webroot_writable > 0) and ($DB>0) ) {fwrite($stmt_file, $stmtZ."\r\n");} } @@ -1822,7 +1822,7 @@ if (($leadfile) && ($LF_path)) ### 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_to_mysqli($stmtZ, $link); - if ($webroot_writable > 0) + if ( ($webroot_writable > 0) and ($DB>0) ) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; */ $multi_insert_counter=0; @@ -1831,7 +1831,7 @@ if (($leadfile) && ($LF_path)) $affected_rows = mysqli_affected_rows($link); $lead_id = mysqli_insert_id($link); if ($DB > 0) {echo "";} - if ($webroot_writable > 0) + if ( ($webroot_writable > 0) and ($DB>0) ) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; @@ -1887,7 +1887,7 @@ if (($leadfile) && ($LF_path)) $custom_rslt=mysql_to_mysqli($custom_ins_stmt, $link); $affected_rows = mysqli_affected_rows($link); echo "\n"; - if ($webroot_writable > 0) + if ( ($webroot_writable > 0) and ($DB>0) ) {fwrite($stmt_file, $custom_ins_stmt."\r\n");} /* } @@ -1946,7 +1946,7 @@ if (($leadfile) && ($LF_path)) { $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_to_mysqli($stmtZ, $link); - if ($webroot_writable > 0) + if ( ($webroot_writable > 0) and ($DB>0) ) {fwrite($stmt_file, $stmtZ."\r\n");} $custom_ins_stmt="INSERT INTO $custom_table("; @@ -1962,7 +1962,7 @@ if (($leadfile) && ($LF_path)) } $custom_ins_stmt=substr($custom_ins_stmt, 0, -1).") VALUES".substr($custom_multistmt, 0, -1); mysql_to_mysqli($custom_ins_stmt, $link); - if ($webroot_writable > 0) + if ( ($webroot_writable > 0) and ($DB>0) ) {fwrite($stmt_file, $custom_ins_stmt."\r\n");} } ### LOG INSERTION Admin Log Table ### @@ -2375,7 +2375,7 @@ if (($leadfile) && ($LF_path)) ### 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_to_mysqli($stmtZ, $link); - if ($webroot_writable > 0) + if ( ($webroot_writable > 0) and ($DB>0) ) {fwrite($stmt_file, $stmtZ."\r\n");} $multistmt=''; $multi_insert_counter=0; @@ -2422,7 +2422,7 @@ if (($leadfile) && ($LF_path)) { $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_to_mysqli($stmtZ, $link); - if ($webroot_writable > 0) + if ( ($webroot_writable > 0) and ($DB>0) ) {fwrite($stmt_file, $stmtZ."\r\n");} } ### LOG INSERTION Admin Log Table ### @@ -2628,6 +2628,7 @@ if (($leadfile) && ($LF_path)) print " \r\n"; print " \r\n"; print " \r\n"; + print " \r\n"; print "
| "; |