From e61d737f500bd2c616cf7085cdb4bfafdd222aeb Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Mon, 18 Nov 2013 15:25:46 -0600
Subject: [PATCH] Save extra from from help topic on web ticket open

---
 open.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/open.php b/open.php
index 5c71e29fa..0035c38e8 100644
--- a/open.php
+++ b/open.php
@@ -30,7 +30,7 @@ if($_POST):
             $errors['captcha']='Invalid - try again!';
     }
 
-    $interest = array('subject');
+    $form = false;
     if ($topic = Topic::lookup($vars['topicId'])) {
         if ($form = DynamicForm::lookup($topic->ht['form_id'])) {
             $form = $form->instanciate();
@@ -52,6 +52,11 @@ if($_POST):
     if(($ticket=Ticket::create($vars, $errors, SOURCE))){
         $msg='Support ticket request created';
         Draft::deleteForNamespace('ticket.client.'.substr(session_id(), -12));
+        // Save the form data from the help-topic form, if any
+        if ($form) {
+            $form->setTicketId($ticket->getId());
+            $form->save();
+        }
         //Logged in...simply view the newly created ticket.
         if($thisclient && $thisclient->isValid()) {
             if(!$cfg->showRelatedTickets())
-- 
GitLab