From 06b424c6763a5509a9a1fdaab552216ae0fabad2 Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 2 Aug 2013 10:55:43 +0000 Subject: [PATCH] Added status deduplicate checking for web-based lead loader without having to use templates Fixed small admin.php bug with state call times git-svn-id: svn://192.168.202.10@2007 3d104415-ff17-0410-8863-d5cf3c621b8a --- UPGRADE | 2 +- .../TO_BE_TRANSLATED_2.8.txt | 4 + www/vicidial/admin.php | 7 +- www/vicidial/admin_listloader_fourth_gen.php | 163 +++++++++++++++--- www/vicidial/leadloader_template_display.php | 21 +++ 5 files changed, 175 insertions(+), 22 deletions(-) diff --git a/UPGRADE b/UPGRADE index 704958eb..60f5d8fb 100644 --- a/UPGRADE +++ b/UPGRADE @@ -111,7 +111,7 @@ OTHER CHANGES: more information on the dialplan changes necessary to use this script. 12. Added the ability to deduplicate leads based upon statuses in the web based - lead loader using templates only. + lead loader using templates and the basic web lead loader. diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.8.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.8.txt index 6a32838d..769cc743 100644 --- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.8.txt +++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.8.txt @@ -222,6 +222,10 @@ Calls Ringing|| Active || Inactive || Total || +Status Duplicate Check|| +OMITTING DUPLICATES AGAINST FOLLOWING STATUSES ONLY|| +Duplicate Checking|| +The duplicate options allow you to check for duplicate entries as you load the leads into the system. You can select to check for duplicates within only the same list, only the same campaign lists or within the entire system. If you have chosen a duplicate check method, you can also optionally select the only specific statuses that you want to duplicate check against|| ########################## CHANGES TO EXISTING PHRASES IN ADMIN TRANSLATION diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 349670ad..63e69de9 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -7599,6 +7599,11 @@ if ($ADD==99999)
NOTES: The Excel Lead loader functionality is enabled by a series of perl scripts and needs to have a properly configured /etc/astguiclient.conf file in place on the web server. Also, a couple perl modules must be loaded for it to work as well - OLE-Storage_Lite and Spreadsheet-ParseExcel. You can check for runtime errors in these by looking at your apache error_log file. Also, for duplication checks against gampaign lists, the list that has new leads going into it does need to be created in the system before you start to load the leads. +
+ +
+ Duplicate Checking - The duplicate options allow you to check for duplicate entries as you load the leads into the system. You can select to check for duplicates within only the same list, only the same campaign lists or within the entire system. If you have chosen a duplicate check method, you can also optionally select the only specific statuses that you want to duplicate check against. +

@@ -30725,7 +30730,7 @@ if ($ADD==3111111111) echo "Friday Start: Friday Stop: $NWB#call_times-ct_sunday_start$NWE\n"; echo "Saturday Start: Saturday Stop: $NWB#call_times-ct_sunday_start$NWE\n"; echo "\n"; - echo " \n"; + echo " \n"; diff --git a/www/vicidial/admin_listloader_fourth_gen.php b/www/vicidial/admin_listloader_fourth_gen.php index 5dbe78bb..28ed2bb3 100644 --- a/www/vicidial/admin_listloader_fourth_gen.php +++ b/www/vicidial/admin_listloader_fourth_gen.php @@ -51,10 +51,11 @@ # 130610-0920 - Finalized changing of all ereg instances to preg # 130621-1817 - Added filtering of input to prevent SQL injection attacks and new user auth # 130719-1914 - Added SQL to filter by template statuses, if template has specific statuses to dedupe against +# 130802-0619 - Added status deduping option without template # -$version = '2.8-49'; -$build = '130719-1914'; +$version = '2.8-50'; +$build = '130802-0619'; require("dbconnect.php"); require("functions.php"); @@ -137,6 +138,10 @@ if (isset($_GET["lead_file"])) {$lead_file=$_GET["lead_file"];} elseif (isset($_POST["lead_file"])) {$lead_file=$_POST["lead_file"];} if (isset($_GET["dupcheck"])) {$dupcheck=$_GET["dupcheck"];} elseif (isset($_POST["dupcheck"])) {$dupcheck=$_POST["dupcheck"];} +if (isset($_GET["dedupe_statuses"])) {$dedupe_statuses=$_GET["dedupe_statuses"];} + elseif (isset($_POST["dedupe_statuses"])) {$dedupe_statuses=$_POST["dedupe_statuses"];} +if (isset($_GET["dedupe_statuses_override"])) {$dedupe_statuses_override=$_GET["dedupe_statuses_override"];} + elseif (isset($_POST["dedupe_statuses_override"])) {$dedupe_statuses_override=$_POST["dedupe_statuses_override"];} if (isset($_GET["postalgmt"])) {$postalgmt=$_GET["postalgmt"];} elseif (isset($_POST["postalgmt"])) {$postalgmt=$_POST["postalgmt"];} if (isset($_GET["phone_code_override"])) {$phone_code_override=$_GET["phone_code_override"];} @@ -149,7 +154,9 @@ if (isset($_GET["template_id"])) {$template_id=$_GET["template_id"];} if (isset($_GET["usacan_check"])) {$usacan_check=$_GET["usacan_check"];} elseif (isset($_POST["usacan_check"])) {$usacan_check=$_POST["usacan_check"];} - +if (strlen($dedupe_statuses_override)>0) { + $dedupe_statuses=explode(",", $dedupe_statuses_override); +} # if the didnt select an over ride wipe out in_file if ( $list_id_override == "in_file" ) { $list_id_override = ""; } if ( $phone_code_override == "in_file" ) { $phone_code_override = ""; } @@ -411,6 +418,37 @@ function TemplateSpecs() { delete xmlhttp; } } +function PopulateStatuses(list_id) { + + var xmlhttp=false; + try { + xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); + } catch (e) { + try { + xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); + } catch (E) { + xmlhttp = false; + } + } + if (!xmlhttp && typeof XMLHttpRequest!='undefined') { + xmlhttp = new XMLHttpRequest(); + } + if (xmlhttp) { + var vs_query = "&form_action=no_template&list_id="+list_id; + xmlhttp.open('POST', 'leadloader_template_display.php'); + xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); + xmlhttp.send(vs_query); + xmlhttp.onreadystatechange = function() { + if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { + var StatSpanText = null; + StatSpanText = xmlhttp.responseText; + document.getElementById("statuses_display").innerHTML = StatSpanText; + } + } + delete xmlhttp; + } + +} ADMINISTRATION: Lead Loader @@ -450,15 +488,15 @@ if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard" && $file_l if ($file_layout!="custom") { ?> - +
- + - + @@ -516,7 +554,7 @@ if ( (!$OK_to_process) or ( ($leadfile) and ($file_layout!="standard" && $file_l echo ""; } ?> - template builder
View template info + template builder
View template info + + + + + \r\n"; print " \r\n"; } - } + } + print " \r\n"; + print " \r\n"; print " \r\n"; print " \r\n"; print " \r\n"; diff --git a/www/vicidial/leadloader_template_display.php b/www/vicidial/leadloader_template_display.php index 409bc35c..591ca4bf 100644 --- a/www/vicidial/leadloader_template_display.php +++ b/www/vicidial/leadloader_template_display.php @@ -10,6 +10,7 @@ # 130610-1101 - Finalized changing of all ereg instances to preg # 130619-0902 - Added filtering of input to prevent SQL injection attacks and new user auth # 130719-1914 - Added SQL to show template statuses to dedupe against, fixed issue where list IDs should be disabled until lead file for template is uploaded +# 130802-0623 - Added select list query for status deduping # require("dbconnect.php"); @@ -184,6 +185,26 @@ if ($form_action=="prime_file" && $sample_template_file_name) $field_check=explode($delimiter, $buffer); flush(); } +else if ($list_id && $form_action=="no_template") + { + $campaign_stmt="select campaign_id from vicidial_lists where list_id='$list_id'"; + $campaign_rslt=mysql_query($campaign_stmt, $link); + if (mysql_num_rows($campaign_rslt)>0) + { + $campaign_row=mysql_fetch_row($campaign_rslt); + $campaign_id=$campaign_row[0]; + } + $stmt="select status, status_name from vicidial_statuses UNION select status, status_name from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status, status_name asc"; + $rslt=mysql_query($stmt, $link); + + echo "\n"; + } else if ($form_action=="update_template") { echo "Hi";
Load leads from this file:
List ID Override: -
File layout to use:Standard Format    Custom layout    Custom Template Standard Format    Custom layout    Custom Template
Custom template to use:
Lead Duplicate Check:
Status Duplicate Check: + + + +
USA-Canada Check: