Skip to content
Snippets Groups Projects
Commit 50e0df5d authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #1435 from stevepacker/patch-1


createTicket respects alert/autorespond negatives

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 1e686f7d 5d0ddb65
No related branches found
No related tags found
No related merge requests found
......@@ -118,9 +118,11 @@ class TicketApiController extends ApiController {
function createTicket($data) {
# Pull off some meta-data
$alert = $data['alert'] ? $data['alert'] : true;
$autorespond = $data['autorespond'] ? $data['autorespond'] : true;
$data['source'] = $data['source'] ? $data['source'] : 'API';
$alert = (bool) (isset($data['alert']) ? $data['alert'] : true);
$autorespond = (bool) (isset($data['autorespond']) ? $data['autorespond'] : true);
# Assign default value to source if not defined, or defined as NULL
$data['source'] = isset($data['source']) ? $data['source'] : 'API';
# Create the ticket with the data (attempt to anyway)
$errors = array();
......
......@@ -330,9 +330,9 @@ class ApiXmlDataParser extends XmlDataParser {
if ($key == "phone" && is_array($value)) {
$value = $value[":text"];
} else if ($key == "alert") {
$value = (bool)$value;
$value = (bool) (strtolower($value) === 'false' ? false : $value);
} else if ($key == "autorespond") {
$value = (bool)$value;
$value = (bool) (strtolower($value) === 'false' ? false : $value);
} else if ($key == "message") {
if (!is_array($value)) {
$value = array(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment