From a20e98ed98cc5a2213c9c05b4eb8461a362f8918 Mon Sep 17 00:00:00 2001
From: aydreeihn <adriane@enhancesoft.com>
Date: Wed, 26 Sep 2018 15:11:13 -0500
Subject: [PATCH] Ticket Sources

This commit ensures that we will always have the correct display of values for the Ticket Source regardless of if the key and value differ.
Ex: if we had a Ticket Source that contained a space in the value, the key would be camelcased
---
 include/class.ticket.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/class.ticket.php b/include/class.ticket.php
index 27b7e6710..550785e5c 100644
--- a/include/class.ticket.php
+++ b/include/class.ticket.php
@@ -534,7 +534,8 @@ implements RestrictedAccess, Threadable, Searchable {
     }
 
     function getSource() {
-        return $this->source;
+        $sources = $this->getSources();
+        return $sources[$this->source] ?: $this->source;
     }
 
     function getIP() {
@@ -549,7 +550,7 @@ implements RestrictedAccess, Threadable, Searchable {
         global $cfg;
 
         return array(
-            'source'    => $this->getSource(),
+            'source'    => $this->source,
             'topicId'   => $this->getTopicId(),
             'slaId'     => $this->getSLAId(),
             'user_id'   => $this->getOwnerId(),
@@ -1028,7 +1029,7 @@ implements RestrictedAccess, Threadable, Searchable {
                         'id' => $fid,
                         'name' => 'source',
                         'label' => __('Ticket Source'),
-                        'default' => $this->getSource(),
+                        'default' => $this->source,
                         'choices' => Ticket::getSources()
                         ));
             break;
-- 
GitLab