Adding of list_desc on add_list func on non_agent API

Discussions about new features or changes in existing features

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Adding of list_desc on add_list func on non_agent API

Postby paolo » Mon Sep 16, 2019 8:46 am

Hi,

We noticed that adding a list_description on the non_agent api is not available on the add_list function so we added a piece of code and edited some original codes to accommodate adding a list_description on the add_list function.

----getters
if (isset($_GET["list_description"])) {$list_description=$_GET["list_description"];}
elseif (isset($_POST["list_description"])) {$list_description=$_POST["list_description"];}

---preg replace
$list_description=preg_replace('/[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$list_description);

----for error checking
if ( (strlen($list_id)<2) or (strlen($list_id)>14) or (strlen($campaign_id)<1) or (strlen($campaign_id)>8) or (strlen($list_description)<1) or (strlen($list_description)>255) or (strlen($list_name)<6) or (strlen($list_name)>30) )

----to capture data

if (strlen($list_description) > 0)
{
if (preg_match("/%3A%2F%2F/",$list_description))
{
$list_description = urldecode($list_description);
$list_description = preg_replace("/ /",'+',$list_description);
}
if ($list_description == '--BLANK--')
{$listdescriptionSQL = " ,list_description=''";}
else
{$listdescriptionSQL = " ,list_description='$list_description'";}
}

----to insert data

$stmt="INSERT INTO vicidial_lists SET list_id='$list_id', list_name='$list_name', list_description='$list_description', campaign_id='$campaign_id', active='$active', campaign_cid_override='$outbound_cid', agent_script_override='$script', am_message_exten_override='$am_message', drop_inbound_group_override='$drop_inbound_group', reset_time='$reset_time', expiration_date='$expiration_date' $webformSQL $webformtwoSQL $webformthreeSQL;";
MyCallCloud.com - Cool Vici Customizations - Hosted - Configured - Supported
Web: https://mycallcloud.com
P: 888-663-0760
E: sales@mycallcloud.com
paolo
 
Posts: 48
Joined: Wed Oct 08, 2014 11:38 am

Re: Adding of list_desc on add_list func on non_agent API

Postby mflorell » Mon Sep 16, 2019 4:51 pm

Please post code contributions to the Issue Tracker and post a link here.
mflorell
Site Admin
 
Posts: 18384
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Adding of list_desc on add_list func on non_agent API

Postby paolo » Mon Sep 16, 2019 5:03 pm

Hi Matt,

I added it already on the issue tracker

http://www.vicidial.org/VICIDIALmantis/view.php?id=1183
MyCallCloud.com - Cool Vici Customizations - Hosted - Configured - Supported
Web: https://mycallcloud.com
P: 888-663-0760
E: sales@mycallcloud.com
paolo
 
Posts: 48
Joined: Wed Oct 08, 2014 11:38 am


Return to Features

Who is online

Users browsing this forum: No registered users and 16 guests