From c1781bf6609dbd43342d7d2006d9bdf7cb444546 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@enhancesoft.com>
Date: Tue, 20 Mar 2018 12:24:41 +0000
Subject: [PATCH] Thread Entry Action: New Ticket

Add thread entry action to create a new ticket. The entry is used to seed
ticket data like user, message (issue details) and attachments
---
 include/class.thread_actions.php  | 2 +-
 include/staff/ticket-open.inc.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/class.thread_actions.php b/include/class.thread_actions.php
index 1a1e1a39f..8cc2d785d 100644
--- a/include/class.thread_actions.php
+++ b/include/class.thread_actions.php
@@ -136,7 +136,7 @@ class TEA_EditThreadEntry extends ThreadEntryAction {
             )
             || ($T instanceof Ticket
                 && ($role = $thisstaff->getRole($T->getDeptId(), $T->isAssigned($thisstaff)))
-               && $role->hasPerm(ThreadEntry::PERM_EDIT)
+                && $role->hasPerm(ThreadEntry::PERM_EDIT)
             )
         );
     }
diff --git a/include/staff/ticket-open.inc.php b/include/staff/ticket-open.inc.php
index a299117e8..d19138676 100644
--- a/include/staff/ticket-open.inc.php
+++ b/include/staff/ticket-open.inc.php
@@ -14,7 +14,7 @@ if (!$user && $_GET['tid'] && ($entry = ThreadEntry::lookup($_GET['tid']))) {
     else
 
      $_SESSION[':form-data']['message'] = Format::htmlchars($entry->getBody());
-     if (($m= TicketForm::getInstance()->getField('subject'))) {
+     if (($m= TicketForm::getInstance()->getField('message'))) {
          $k = 'attach:'.$m->getId();
         foreach ($entry->getAttachments() as $a)
             if (!$a->inline && $a->file)
-- 
GitLab