Added ALT Multi Dispo URL option to restrict URL sending by list ID

git-svn-id: svn://192.168.202.10@2573 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2016-08-01 11:36:54 +00:00
parent 04e3300140
commit 1a83039d94
6 changed files with 31 additions and 16 deletions
+2
View File
@@ -282,6 +282,8 @@ OTHER CHANGES:
76. Added recording filename option to update filename post-call with select
variable values, uses options in AST_CRON_audio_1_move_VDonly.pl script
77. Added ALT Multi Dispo URL option to restrict URL sending by list ID.
+2 -1
View File
@@ -3351,6 +3351,7 @@ url_rank SMALLINT(5) default '1',
url_statuses VARCHAR(1000) default '',
url_description VARCHAR(255) default '',
url_address TEXT,
url_lists VARCHAR(1000) default '',
PRIMARY KEY (url_id),
KEY vicidial_url_multi_campaign_id_key (campaign_id)
) ENGINE=MyISAM CHARSET=utf8 COLLATE=utf8_unicode_ci;
@@ -3783,4 +3784,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1463',db_schema_update_date=NOW(),reload_timestamp=NOW();
UPDATE system_settings SET db_schema_version='1464',db_schema_update_date=NOW(),reload_timestamp=NOW();
+4
View File
@@ -634,3 +634,7 @@ ALTER TABLE vicidial_campaigns ADD manual_auto_next SMALLINT(5) UNSIGNED default
ALTER TABLE vicidial_campaigns ADD manual_auto_show ENUM('Y','N') default 'N';
UPDATE system_settings SET db_schema_version='1463',db_schema_update_date=NOW() where db_schema_version < 1463;
ALTER TABLE vicidial_url_multi ADD url_lists VARCHAR(1000) default '';
UPDATE system_settings SET db_schema_version='1464',db_schema_update_date=NOW() where db_schema_version < 1464;
+6 -4
View File
@@ -408,10 +408,11 @@
# 160510-0840 - Added callback_lead_status as dispo_call_url variable
# 160706-1437 - Added font styles to text in many places
# 160714-1503 - Added called_count as a dispo_call_url variable
# 160801-0717 - Added lists option to ALT dispo call url functions
#
$version = '2.12-302';
$build = '160714-1503';
$version = '2.12-303';
$build = '160801-0717';
$php_script = 'vdc_db_query.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=654;
@@ -11103,7 +11104,7 @@ if ($ACTION == 'updateDISPO')
{
if ($dispo_call_url == 'ALT')
{
$stmt="SELECT url_rank,url_statuses,url_address from vicidial_url_multi where campaign_id='$DUcampaign_id' and entry_type='$DUentry_type' and url_type='dispo' and active='Y' order by url_rank limit 1000;";
$stmt="SELECT url_rank,url_statuses,url_address,url_lists from vicidial_url_multi where campaign_id='$DUcampaign_id' and entry_type='$DUentry_type' and url_type='dispo' and active='Y' order by url_rank limit 1000;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00634',$user,$server_ip,$session_name,$one_mysql_log);}
@@ -11115,8 +11116,9 @@ if ($ACTION == 'updateDISPO')
$url_rank = $row[0];
$url_statuses = " $row[1] ";
$url_address = $row[2];
$url_lists = " $row[3] ";
if ( (preg_match("/---ALL---/",$url_statuses)) or ( (strlen($url_statuses)>2) and (preg_match("/ $dispo_choice /",$url_statuses)) ) )
if ( ( (preg_match("/---ALL---/",$url_statuses)) or ( (strlen($url_statuses)>2) and (preg_match("/ $dispo_choice /",$url_statuses)) ) ) and ( (strlen($url_lists)<3) or ( (strlen($url_lists)>2) and (preg_match("/ $list_id /",$url_lists)) ) ) )
{
$dispo_call_urlARY[$dispo_call_url_count] = $url_address;
$dispo_call_url_count++;
+16 -10
View File
@@ -13,10 +13,11 @@
# 150709-0612 - First Build
# 160331-2203 - Made URL form input fields longer
# 160508-0815 - Added colors features
# 160801-0657 - Added lists qualifier fields
#
$admin_version = '2.12-3';
$build = '160508-0815';
$admin_version = '2.12-4';
$build = '160801-0657';
require("dbconnect_mysqli.php");
require("functions.php");
@@ -42,6 +43,8 @@ if (isset($_GET["url_rank"])) {$url_rank=$_GET["url_rank"];}
elseif (isset($_POST["url_rank"])) {$url_rank=$_POST["url_rank"];}
if (isset($_GET["url_statuses"])) {$url_statuses=$_GET["url_statuses"];}
elseif (isset($_POST["url_statuses"])) {$url_statuses=$_POST["url_statuses"];}
if (isset($_GET["url_lists"])) {$url_lists=$_GET["url_lists"];}
elseif (isset($_POST["url_lists"])) {$url_lists=$_POST["url_lists"];}
if (isset($_GET["url_description"])) {$url_description=$_GET["url_description"];}
elseif (isset($_POST["url_description"])) {$url_description=$_POST["url_description"];}
if (isset($_GET["url_address"])) {$url_address=$_GET["url_address"];}
@@ -82,6 +85,7 @@ if ($non_latin < 1)
$url_type = preg_replace('/[^_0-9a-zA-Z]/','',$url_type);
$url_rank = preg_replace('/[^-0-9]/','',$url_rank);
$url_statuses = preg_replace('/[^- _0-9a-zA-Z]/','',$url_statuses);
$url_lists = preg_replace('/[^- _0-9]/','',$url_lists);
$url_description = preg_replace('/[^- \.\,\_0-9a-zA-Z]/','',$url_description);
} # end of non_latin
else
@@ -270,7 +274,7 @@ if ($camp_multi < 1)
if ($DB > 0)
{
echo "$DB,$action,$campaign_id,$url_id,$entry_type,$active,$url_type,$url_rank,$url_statuses,$url_description\n<BR>";
echo "$DB,$action,$campaign_id,$url_id,$entry_type,$active,$url_type,$url_rank,$url_statuses,$url_lists,$url_description\n<BR>";
}
@@ -325,7 +329,7 @@ if ($action == "URL_MULTI_MODIFY")
echo _QXZ("ERROR: URL entry does not exist").": |$url_id|$campaign_id|$entry_type|$url_type|\n<BR>";
exit;
}
$stmt="UPDATE vicidial_url_multi SET active='$active',url_rank='$url_rank',url_statuses='$url_statuses',url_description='$url_description',url_address='" . mysqli_real_escape_string($link, $url_address) . "' where campaign_id='$campaign_id' and entry_type='$entry_type' and url_type='$url_type' and url_id='$url_id';";
$stmt="UPDATE vicidial_url_multi SET active='$active',url_rank='$url_rank',url_statuses='$url_statuses',url_lists='$url_lists',url_description='$url_description',url_address='" . mysqli_real_escape_string($link, $url_address) . "' where campaign_id='$campaign_id' and entry_type='$entry_type' and url_type='$url_type' and url_id='$url_id';";
$rslt=mysql_to_mysqli($stmt, $link);
$affected_rows = mysqli_affected_rows($link);
if ($DB > 0) {echo "$affected_rows|$stmt\n<BR>";}
@@ -404,10 +408,10 @@ if ($action == "BLANK")
echo "<tr><td align=center colspan=2>\n";
echo "<br><b>"._QXZ("Alternate %1s URLs for %2s",0,'',$url_type,$entry_type).": <a href=\"./admin.php?$mod_link$campaign_id\">$campaign_id</a></b> &nbsp; $NWB#alt_multi_urls$NWE\n";
echo "<TABLE width=700 cellspacing=3>\n";
echo "<tr><td>#</td><td>"._QXZ("ACTIVE")."</td><td>"._QXZ("RANK")."</td><td>"._QXZ("STATUSES")."</td><td>"._QXZ("DESCRIPTION")."</td><td>"._QXZ("SUBMIT")."</td></tr>\n";
echo "<TABLE width=740 cellspacing=3>\n";
echo "<tr><td>#</td><td>"._QXZ("ACTIVE")."</td><td>"._QXZ("RANK")."</td><td>"._QXZ("STATUSES")."</td><td>"._QXZ("LISTS")."</td><td>"._QXZ("DESCRIPTION")."</td><td>"._QXZ("SUBMIT")."</td></tr>\n";
$stmt="SELECT url_id,active,url_rank,url_statuses,url_description,url_address from vicidial_url_multi where campaign_id='$campaign_id' and entry_type='$entry_type' and url_type='$url_type' order by url_rank limit 1000;";
$stmt="SELECT url_id,active,url_rank,url_statuses,url_description,url_address,url_lists from vicidial_url_multi where campaign_id='$campaign_id' and entry_type='$entry_type' and url_type='$url_type' order by url_rank limit 1000;";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$types_to_print = mysqli_num_rows($rslt);
@@ -422,6 +426,7 @@ if ($action == "BLANK")
$Rurl_statuses = $rowx[3];
$Rurl_description = $rowx[4];
$Rurl_address = $rowx[5];
$Rurl_lists = $rowx[6];
if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#'. $SSstd_row2_background .'"';}
@@ -440,8 +445,9 @@ if ($action == "BLANK")
echo "<td><font size=1>$o</td>";
echo "<td><font size=1><select size=1 name=active><option value='Y'>"._QXZ("Y")."</option><option value='N'>"._QXZ("N")."</option><option SELECTED>$Ractive</option></select></td>";
echo "<td><font size=1><input type=text size=4 maxlength=3 name=url_rank value=\"$Rurl_rank\"></td>";
echo "<td><font size=1><input type=text size=30 maxlength=1000 name=url_statuses value=\"$Rurl_statuses\"></td>";
echo "<td><font size=1><input type=text size=30 maxlength=255 name=url_description value=\"$Rurl_description\"></td>";
echo "<td><font size=1><input type=text size=24 maxlength=1000 name=url_statuses value=\"$Rurl_statuses\"></td>";
echo "<td><font size=1><input type=text size=24 maxlength=1000 name=url_lists value=\"$Rurl_lists\"></td>";
echo "<td><font size=1><input type=text size=24 maxlength=255 name=url_description value=\"$Rurl_description\"></td>";
echo "<td rowspan=2><font size=1><input type=submit name=SUBMIT value='"._QXZ("SUBMIT")."'>";
echo "<BR><BR>";
if ($Ractive == 'N')
@@ -451,7 +457,7 @@ if ($action == "BLANK")
echo "</td>";
echo "</tr>";
echo "<tr $bgcolor>";
echo "<td colspan=5><font size=1>"._QXZ("URL").":<input type=text size=80 maxlength=5000 name=url_address value=\"$Rurl_address\"></td>";
echo "<td colspan=6><font size=1>"._QXZ("URL").":<input type=text size=100 maxlength=5000 name=url_address value=\"$Rurl_address\"></td>";
echo "</form>\n";
echo "</tr>\n";
}
+1 -1
View File
@@ -6207,7 +6207,7 @@ if ($SSqc_features_active > 0)
<A NAME="alt_multi_urls">
<B><FONT SIZE=3><?php echo _QXZ("Alternate Multi URLs"); ?></FONT></B><BR><BR>
<?php echo _QXZ("This page allows you to define Alternate URLs with conditions in place of the simple URL option for Dispo, Start, Add Lead or No Agent URLs. The RANK field will define the order in which the URLs are requested, this is important because if you have a URL that may take a few seconds to run ranked as 1, that will mean that any URLs ranked after it will have to wait to be run until that first URL request receives a response. The ACTIVE field will determine whether the specific URL is run. The STATUSES field only works for the Dispo URLs and will determine which disposition statuses will trigger the URL being run, if you want to run the entry for all statuses just fill in ---ALL--- in this field. The URL field works the same as it would in the URL option in campaigns, in-groups and lists, and it is also limited to 2000 characters in length. If you want to delete a URL, it must first be set to not active, then you can click on the DELETE link below the SUBMIT button for that URL entry."); ?>
<?php echo _QXZ("This page allows you to define Alternate URLs with conditions in place of the simple URL option for Dispo, Start, Add Lead or No Agent URLs. The RANK field will define the order in which the URLs are requested, this is important because if you have a URL that may take a few seconds to run ranked as 1, that will mean that any URLs ranked after it will have to wait to be run until that first URL request receives a response. The ACTIVE field will determine whether the specific URL is run. The STATUSES field only works for the Dispo URLs and will determine which disposition statuses will trigger the URL being run, if you want to run the entry for all statuses just fill in ---ALL--- in this field, if you want only a few statuses, separate them by spaces. If populated, the LISTS field will limit the calls that the URL is run from to only the list IDs listed in this field. To have it run for all lists, leave the field blank, if you want only a few lists, separate them by spaces. The URL field works the same as it would in the URL option in campaigns, in-groups and lists, and it is also limited to 2000 characters in length. If you want to delete a URL, it must first be set to not active, then you can click on the DELETE link below the SUBMIT button for that URL entry."); ?>
<BR><BR><BR><BR>