From 4b80ecdae9c01c076a7b40887a2adac773e9c1f8 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 15 Jan 2020 17:00:17 +0000 Subject: [PATCH] For call_report_export.php: Added ALTERNATE_2 export option with alternate header option in options.php git-svn-id: svn://192.168.202.10@3186 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../trunk/www/vicidial/call_report_export.php | 33 ++++++++++++++++--- .../trunk/www/vicidial/options-example.php | 6 +++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/agc_2-X/trunk/www/vicidial/call_report_export.php b/agc_2-X/trunk/www/vicidial/call_report_export.php index 49ca78a1..1bca1319 100644 --- a/agc_2-X/trunk/www/vicidial/call_report_export.php +++ b/agc_2-X/trunk/www/vicidial/call_report_export.php @@ -5,7 +5,7 @@ # and/or vicidial_closer_log information by status, list_id and date range. # downloads to a flat text file that is tab delimited # -# Copyright (C) 2019 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2020 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -58,6 +58,7 @@ # 190610-2035 - Fixed admin hide phone issue # 190926-0925 - Fixes for PHP7 # 191119-1731 - Fix for alternate server url for recordings, issue #1175 +# 200115-1151 - Added ALTERNATE_2 export option with alternate header option in options.php # $startMS = microtime(); @@ -705,7 +706,12 @@ if ($run_export > 0) {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t";} if ($export_fields == 'EXTENDED_3') {$export_fieldsDATA = "$row[39]\t$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t";} - $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$export_fieldsDATA"; + if ($export_fields == 'ALTERNATE_2') + {$export_rows[$k] = "$row[18]\t$row[13]\t$row[15]\t$row[11]\t!STATUS_DESCRIPTION!\t$row[0]";} + else + { + $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$export_fieldsDATA"; + } } $i++; $k++; @@ -842,7 +848,12 @@ if ($run_export > 0) {$export_fieldsDATA = "$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t$row[45]\t";} if ($export_fields == 'EXTENDED_3') {$export_fieldsDATA = "$row[40]\t$row[41]\t$row[42]\t$row[43]\t$row[44]\t$row[45]\t";} - $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$export_fieldsDATA"; + if ($export_fields == 'ALTERNATE_2') + {$export_rows[$k] = "$row[18]\t$row[13]\t$row[15]\t$row[11]\t!STATUS_DESCRIPTION!\t$row[0]";} + else + { + $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$export_fieldsDATA"; + } } $i++; $k++; @@ -866,6 +877,11 @@ if ($run_export > 0) ob_clean(); flush(); + if (file_exists('options.php')) + { + require('options.php'); + } + if ($header_row=='YES') { $RFheader = ''; @@ -902,6 +918,10 @@ if ($run_export > 0) { echo "call_date|phone_number_dialed|status|campaign_id|vendor_lead_code|source_id|first_name|last_name|length_in_sec$EFheader$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; } + else if ($export_fields == 'ALTERNATE_2') + { + echo $call_export_report_ALTERNATE_2_header; + } else { echo "call_date\tphone_number_dialed\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$EFheader\tlist_name\tlist_description\tstatus_name$RFheader$EXheader$NFheader$IVRheader$CFheader\r\n"; @@ -1344,6 +1364,11 @@ if ($run_export > 0) { echo "$export_rows[$i]$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; } + else if ($export_fields=='ALTERNATE_2') + { + $export_rows[$i]=preg_replace('/!STATUS_DESCRIPTION!/', "$ex_status_name", $export_rows[$i]); + echo "$export_rows[$i]\r\n"; + } else { echo "$export_rows[$i]$ex_list_name\t$ex_list_description\t$ex_status_name$rec_data$extended_data$notes_data$ivr_data$custom_data\r\n"; @@ -1590,7 +1615,7 @@ else echo "

\n"; echo ""._QXZ("Export Fields").":
\n"; - echo "\n"; + echo "\n"; if ($archives_available=="Y") diff --git a/agc_2-X/trunk/www/vicidial/options-example.php b/agc_2-X/trunk/www/vicidial/options-example.php index 63359966..4e4ea661 100644 --- a/agc_2-X/trunk/www/vicidial/options-example.php +++ b/agc_2-X/trunk/www/vicidial/options-example.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2020 Matt Florell LICENSE: AGPLv2 # # rename this file to options.php for the settings here to go into effect # @@ -25,6 +25,7 @@ # 190420-1722 - Added RS_ListenBarge # 190503-1544 - Added enable_status_mismatch_leadloader_option # 190525-2145 - Added RS_agentWAIT option +# 100115-1157 - Added call report export ALTERNATE_2 header # # used by the realtime_report.php script @@ -112,4 +113,7 @@ $graph_canvas_size=600; # enable the leadloader's duplicate-with-status-mismatch setting $enable_status_mismatch_leadloader_option=0; +# call report export ALTERNATE_2 header +$call_export_report_ALTERNATE_2_header="address3\tfirst_name\tlast_name\tphone_number\tstatus_name\tstatus_date\r\n"; + ?>