From aff5badc2bc5cb60211157e297e0956e4c0dc51e Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Wed, 6 Nov 2013 22:15:55 +0000
Subject: [PATCH] Fix slight regression on new ticket by staff

The typeahead for user email address was dropped somewhere along the way
---
 include/class.dynamic_forms.php   | 13 ++++++++++---
 include/staff/ticket-open.inc.php |  2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/include/class.dynamic_forms.php b/include/class.dynamic_forms.php
index 6df00e2b4..89c8950e7 100644
--- a/include/class.dynamic_forms.php
+++ b/include/class.dynamic_forms.php
@@ -132,6 +132,7 @@ class DynamicForm extends VerySimpleModel {
 
 class UserForm extends DynamicForm {
     static $instance;
+    static $form;
 
     static function objects() {
         $os = parent::objects();
@@ -154,11 +155,17 @@ class UserForm extends DynamicForm {
         return $fields;
     }
 
-    static function getInstance() {
-        if (!isset(static::$instance)) {
+    static function getUserForm() {
+        if (!isset(static::$form)) {
             $o = static::objects();
-            static::$instance = $o[0]->instanciate();
+            static::$form = $o[0];
         }
+        return static::$form;
+    }
+
+    static function getInstance() {
+        if (!isset(static::$instance))
+            static::$instance = static::getForm()->instanciate();
         return static::$instance;
     }
 }
diff --git a/include/staff/ticket-open.inc.php b/include/staff/ticket-open.inc.php
index 1b1ed786a..0bbaa7691 100644
--- a/include/staff/ticket-open.inc.php
+++ b/include/staff/ticket-open.inc.php
@@ -18,7 +18,7 @@ $info=Format::htmlchars(($errors && $_POST)?$_POST:$info);
     </thead>
     <tbody>
         <?php
-        $uf = UserForm::getInstance();
+        $uf = UserForm::getUserForm();
         $uf->render();
         if($cfg->notifyONNewStaffTicket()) {  ?>
         <tr>
-- 
GitLab