Skip to content

Commit

Permalink
ticket: Fix auto-claim from canned auto-reply
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Hancock committed Aug 18, 2015
1 parent 4f71f00 commit eca531f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/class.ticket.php
Expand Up @@ -1903,7 +1903,7 @@ function postCannedReply($canned, $msgId, $alert=true) {
'cannedattachments' => $files);

$errors = array();
if(!($response=$this->postReply($info, $errors, false)))
if (!($response=$this->postReply($info, $errors, false, false)))
return null;

$this->markUnAnswered();
Expand Down Expand Up @@ -1941,11 +1941,10 @@ function postCannedReply($canned, $msgId, $alert=true) {
}

/* public */
function postReply($vars, &$errors, $alert = true) {
function postReply($vars, &$errors, $alert=true, $claim=true) {
global $thisstaff, $cfg;


if(!$vars['poster'] && $thisstaff)
if (!$vars['poster'] && $thisstaff)
$vars['poster'] = $thisstaff;

if(!$vars['staffId'] && $thisstaff)
Expand All @@ -1964,10 +1963,11 @@ function postReply($vars, &$errors, $alert = true) {
$this->setStatus($vars['reply_status_id']);

// Claim on response bypasses the department assignment restrictions
if($thisstaff && $this->isOpen() && !$this->getStaffId()
&& $cfg->autoClaimTickets())
if ($claim && $thisstaff && $this->isOpen() && !$this->getStaffId()
&& $cfg->autoClaimTickets()
) {
$this->setStaffId($thisstaff->getId()); //direct assignment;

}

$this->onResponse($response, array('assignee' => $assignee)); //do house cleaning..

Expand Down Expand Up @@ -2302,7 +2302,7 @@ function lookup($id) { //Assuming local ID is the only lookup used!
}

function lookupByNumber($number, $email=null) {
return self::lookup(self:: getIdByNumber($number, $email));
return self::lookup(self::getIdByNumber($number, $email));
}

static function isTicketNumberUnique($number) {
Expand Down

0 comments on commit eca531f

Please sign in to comment.