Added MIN LENGTH to the Dispo Call URL ALT admin screen, allowing for a minimum call time threshold before a Dispo Call URL will trigger.

git-svn-id: svn://192.168.202.10@3539 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2021-11-18 03:29:56 +00:00
parent 833dd0ef10
commit 7c2df7c241
6 changed files with 70 additions and 46 deletions
+26 -10
View File
@@ -1,7 +1,7 @@
<?php
# admin_url_multi.php
#
# Copyright (C) 2018 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# this screen will control the *url* settings needed when the Campaign or
# In-Group or List URL setting is set to "ALT". This screen allows for multiple
@@ -16,10 +16,11 @@
# 160801-0657 - Added lists qualifier fields
# 170409-1545 - Added IP List validation code
# 180503-2215 - Added new help display
# 211117-2006 - Added minimum call length field
#
$admin_version = '2.14-6';
$build = '180503-2215';
$admin_version = '2.14-7';
$build = '211117-2006';
require("dbconnect_mysqli.php");
require("functions.php");
@@ -52,6 +53,8 @@ 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"];}
elseif (isset($_POST["url_address"])) {$url_address=$_POST["url_address"];}
if (isset($_GET["url_call_length"])) {$url_call_length=$_GET["url_call_length"];}
elseif (isset($_POST["url_call_length"])) {$url_call_length=$_POST["url_call_length"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
@@ -91,11 +94,22 @@ if ($non_latin < 1)
$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);
$url_call_length = preg_replace('/[^0-9]/','',$url_call_length);
} # end of non_latin
else
{
$PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
$PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
$url_id = preg_replace('/[^0-9]/','',$url_id);
$campaign_id = preg_replace('/[^-_0-9\p{L}]/u','',$campaign_id);
$entry_type = preg_replace('/[^_0-9\p{L}]/u','',$entry_type);
$active = preg_replace('/[^A-Z]/','',$active);
$url_type = preg_replace('/[^_0-9\p{L}]/u','',$url_type);
$url_rank = preg_replace('/[^-0-9]/','',$url_rank);
$url_statuses = preg_replace('/[^- _0-9\p{L}]/u','',$url_statuses);
$url_lists = preg_replace('/[^- _0-9]/','',$url_lists);
$url_description = preg_replace('/[^- \.\,\_0-9\p{L}]/u','',$url_description);
$url_call_length = preg_replace('/[^0-9]/','',$url_call_length);
}
$STARTtime = date("U");
@@ -356,7 +370,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_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';";
$stmt="UPDATE vicidial_url_multi SET active='$active',url_rank='$url_rank',url_statuses='$url_statuses',url_lists='$url_lists',url_call_length='$url_call_length',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>";}
@@ -431,14 +445,14 @@ if ($action == "BLANK")
echo "<TABLE><TR><TD>\n";
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
echo "<br>"._QXZ("Alternate URL Form");
echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<center><TABLE width=920 cellspacing=3>\n";
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=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";
echo "<TABLE width=900 cellspacing=3>\n";
echo "<tr><td><font size=2><b>#</td><td><font size=2><b>"._QXZ("ACTIVE")."</td><td><font size=2><b>"._QXZ("RANK")."</td><td><font size=2><b>"._QXZ("STATUSES")."</td><td><font size=2><b>"._QXZ("LISTS")."</td><td><font size=2><b>"._QXZ("MIN LENGTH")."</td><td><font size=2><b>"._QXZ("DESCRIPTION")."</td><td><font size=2><b>"._QXZ("SUBMIT")."</td></tr>\n";
$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;";
$stmt="SELECT url_id,active,url_rank,url_statuses,url_description,url_address,url_lists,url_call_length 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);
@@ -454,6 +468,7 @@ if ($action == "BLANK")
$Rurl_description = $rowx[4];
$Rurl_address = $rowx[5];
$Rurl_lists = $rowx[6];
$Rurl_call_length = $rowx[7];
if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#'. $SSstd_row2_background .'"';}
@@ -474,6 +489,7 @@ if ($action == "BLANK")
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=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=5 maxlength=5 name=url_call_length value=\"$Rurl_call_length\"></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>";
@@ -484,7 +500,7 @@ if ($action == "BLANK")
echo "</td>";
echo "</tr>";
echo "<tr $bgcolor>";
echo "<td colspan=6><font size=1>"._QXZ("URL").":<input type=text size=100 maxlength=5000 name=url_address value=\"$Rurl_address\"></td>";
echo "<td colspan=7 NOWRAP><font size=1>"._QXZ("URL").":<input type=text size=110 maxlength=5000 name=url_address value=\"$Rurl_address\"></td>";
echo "</form>\n";
echo "</tr>\n";
}
@@ -509,7 +525,7 @@ if ($action == "BLANK")
echo "<td rowspan=2><font size=1><input type=submit name=SUBMIT value='"._QXZ("SUBMIT")."'></td>";
echo "</tr>";
echo "<tr $bgcolor>";
echo "<td colspan=3><font size=1>"._QXZ("URL").":<input type=text size=80 maxlength=5000 name=url_address value=\"\"></td>";
echo "<td colspan=3><font size=1>"._QXZ("URL").":<input type=text size=100 maxlength=5000 name=url_address value=\"\"></td>";
echo "</form>\n";
echo "</tr>\n";
echo "</table></center><br>\n";