diff --git a/www/vicidial/help_documentation.txt b/www/vicidial/help_documentation.txt
index 9309d619..35dca158 100644
--- a/www/vicidial/help_documentation.txt
+++ b/www/vicidial/help_documentation.txt
@@ -1,4 +1,4 @@
-# version: 20210217145101
+# version: 20210303100701
users-user User ID This field is where you put the users ID number, can be up to 8 digits in length, Must be at least 2 characters in length.
users-pass Password This field is where you put the users password. Must be at least 2 characters in length. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.
users-force_change_password 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 or the agent screen. Default is N.
@@ -1382,3 +1382,13 @@ USERADD User Bulk Copy This will copy a sequential number of users beginnin
USERDELETE User Bulk Delete This will delete the selected users from your system. For obvious reasons, you cannot delete the user you are logged in as. You can also not delete any users that are actively logged in as agents.
ACCIDADD AC-CID Bulk Add This allows you to paste in a listing of CIDs to insert into a campaign AC-CID list or CID Group list. There are three methods to choose from:
STATE LOOKUP - This will take a list of CIDs and insert them as Area Code Caller IDs into the selected campaign. The area code lookup is designed to work only with numbers in the North American Numbering Plan as it uses the first three digits of each CID. The description will automatically be filled with the appropriate US state abbreviation corresponding to the given CIDs 3-digit area code.
CSV - This will take a comma separated list in the format of NPA,CID,DESCRIPTION,ACTIVE and insert each line into the specified campaigns AC-CID list using the supplied values. For example, given a listing of 813,7271234567,Florida,Y will result in an AC-CID entry for area code 813 using the CID 7271234567 and a description of -Florida- with the status being active. Descriptions are limited to 50 characters. For CID Groups of a STATE type, use this format for CSV- STATE,CID,DESCRIPTION,ACTIVE. The -ACTIVE- column will only be used if the Active select list above is set to -Input-.
STATE FILL - Similar to the STATE LOOKUP method above, this will take a list of CIDs and insert them as AC-CIDs in the specified campaign but will also make an entry for each area code in a state based off the state the CID is in. For example, if given the CID 7271234567, 19 CID entries will be created with the same CID, one each for every area code in Florida. If you are inserting into a CID Group that is a STATE type, then you will not want to use the STATE FILL method.
CIDs must be between 6 and 20 digits in length and only digits 0-9 are allowed. Optionally, you can have the AC-CIDs set to active upon insertion.
ACCIDDELETE AC-CID Bulk Delete This will delete the Areacode Caller ID entries you select from the next screen based on the campaign or CID group you select here. Setting Clear All CIDs to YES will bypass the AC-CID selection and wipe all AC-CIDs for the selected campaign or CID group.
+lead_export_report-date_field Date Field This option will determine if the data exported will be by call log date or the entry date of when the lead was added to the system.
+lead_export_report-header_row Header Row If enabled, the first line in the exported data file will be a list of the headers for the data in the file.
+lead_export_report-rec_fields Recording Fields If enabled, the recordings for the latest phone call for the selected leads will be included in the export. If there is more than one recording, they will be pipe-delimited.
+lead_export_report-custom_fields Custom Fields If Custom List Fields is enabled on your system, and the leads you are exporting have custom fields values stored in the database, they will be included in the export.
+lead_export_report-call_notes Per Call Notes If enabled at the campaign level, any Per Call Notes for the latest phone calls for the selected leads will be included in the export.
+lead_export_report-did_filter Use DID Filter If enabled, this will only affect selection of leads from inbound calls, and will allow you to have only the leads that have inbound calls that arrived through the selected Inbound DIDs.
+lead_export_report-vlc_filter VLC Filter If enabled, you will be able to have only the leads with the vendor_lead_code values you have selected be exported. We do not recommend using this option if you have unique VLC values for most of your leads.
+lead_export_report-export_fields Export Fields STANDARD will include all of the lead fields that agents normally have access to, EXTENDED will include the following extra lead fields: entry_date, called_count, last_local_call_time, modify_date, called_since_last_reset. NOTE: If you have selected to use Entry Date or DID Filtering, EXTENDED will be automaticaly used.
+lead_export_report-exclude_call_log_data Exclude Call Log Data If you only want to export lead data, and no log or user information associated with the leads, then set this option to YES, change the -Date Field- to Entry Date and select -Lists-, -Statuses- and a -Campaign-, even though the Campaign will be ignored.
+lead_export_report-search_archived_data Search Archived Data If you want to pull data from older leads and-or call logs that have been archived on your system, then you can select either or both of those options here.
diff --git a/www/vicidial/lead_report_export.php b/www/vicidial/lead_report_export.php
index b5b4fc0a..45ba8923 100644
--- a/www/vicidial/lead_report_export.php
+++ b/www/vicidial/lead_report_export.php
@@ -5,7 +5,7 @@
# vicidial_log 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) 2021 Matt Florell LICENSE: AGPLv2
#
# CHANGES
#
@@ -34,6 +34,7 @@
# 180610-1634 - Added option to allow --ALL-- as a campaign value
# 190610-2036 - Fixed admin hide phone issue
# 190926-0926 - Fixes for PHP7
+# 210302-0839 - Added exclude_call_log_data option
#
$startMS = microtime();
@@ -92,6 +93,9 @@ if (isset($_GET["vicidial_list_archive_only"])) {$vicidial_list_archive_only=
elseif (isset($_POST["vicidial_list_archive_only"])) {$vicidial_list_archive_only=$_POST["vicidial_list_archive_only"];}
if (isset($_GET["VLC_enabled"])) {$VLC_enabled=$_GET["VLC_enabled"];}
elseif (isset($_POST["VLC_enabled"])) {$VLC_enabled=$_POST["VLC_enabled"];}
+if (isset($_GET["exclude_call_log_data"])) {$exclude_call_log_data=$_GET["exclude_call_log_data"];}
+ elseif (isset($_POST["exclude_call_log_data"])) {$exclude_call_log_data=$_POST["exclude_call_log_data"];}
+
if (strlen($shift)<2) {$shift='ALL';}
@@ -581,6 +585,10 @@ if ($run_export > 0)
if ($RUNcampaign > 0)
{
$stmt = "SELECT vl.call_date,vl.phone_number,vi.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,UNIX_TIMESTAMP(vl.call_date)$export_fields_SQL from vicidial_users vu,".$vicidial_log_table." vl,".$vicidial_list_table." vi where ".$date_field." >= '$query_date 00:00:00' and ".$date_field." <= '$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 $vlc_SQL order by ".$date_field." desc limit 500000;";
+ if ($exclude_call_log_data == 'YES')
+ {
+ $stmt = "SELECT '0000-00-00 00:00:00',vi.phone_number,vi.status,vi.user,'','',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,'0','','',vi.rank,vi.owner,vi.lead_id,'',vi.entry_list_id,''$export_fields_SQL from ".$vicidial_list_table." vi where ".$date_field." >= '$query_date 00:00:00' and ".$date_field." <= '$end_date 23:59:59' $list_SQL $status_SQL $vlc_SQL order by ".$date_field." desc limit 500000;";
+ }
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {echo "****$stmt****\n";}
$outbound_to_print = mysqli_num_rows($rslt);
@@ -1428,7 +1436,11 @@ else
echo "\n";
echo "\n";
+ echo "\n";
echo "\n";
+ echo "\n";
+
+ echo "";
echo "\n";
echo ""._QXZ("ADMINISTRATION").": "._QXZ("$report_name");
@@ -1451,10 +1463,11 @@ else
$lists_color = '#E6E6E6';
$subcamp_color = '#C6C6C6';
##### END Set variables to make header show properly #####
+ $NWB = "";
require("admin_header.php");
-
echo "
\n";
echo ""._QXZ("Export Leads Report")." \n";
echo ""._QXZ("This report pulls lead information for calls dialed in the selected date range. A lead is only exported once no matter how many calls were handled. The current lead status is used.")."