From a42161ccadcaec5a47f49f6737779c3cd4eed0b4 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Tue, 14 Jul 2015 10:06:48 -0500
Subject: [PATCH] ticket: Auto show "Post Internal Note" tab for limited access
 agents

---
 include/staff/templates/task-view.tmpl.php | 2 +-
 include/staff/ticket-view.inc.php          | 2 +-
 scp/js/thread.js                           | 4 ++++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/staff/templates/task-view.tmpl.php b/include/staff/templates/task-view.tmpl.php
index f1efebc3a..69eb3095c 100644
--- a/include/staff/templates/task-view.tmpl.php
+++ b/include/staff/templates/task-view.tmpl.php
@@ -322,7 +322,7 @@ if ($ticket)
 else
     $action = 'tasks.php?id='.$task->getId();
 ?>
-<div id="task_response_options" class="<?php echo $ticket ? 'ticket_task_actions' : ''; ?> sticky bar stop">
+<div id="task_response_options" class="<?php echo $ticket ? 'ticket_task_actions' : ''; ?> sticky bar stop actions">
     <ul class="tabs">
         <?php
         if ($role->hasPerm(TaskModel::PERM_REPLY)) { ?>
diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php
index 609e21475..1728c4803 100644
--- a/include/staff/ticket-view.inc.php
+++ b/include/staff/ticket-view.inc.php
@@ -448,7 +448,7 @@ $tcount = $ticket->getThreadEntries($types)->count();
     <div id="msg_warning"><?php echo $warn; ?></div>
 <?php } ?>
 
-<div class="sticky bar stop" id="response_options">
+<div class="sticky bar stop actions" id="response_options">
     <ul class="tabs">
         <?php
         if ($role->hasPerm(TicketModel::PERM_REPLY)) { ?>
diff --git a/scp/js/thread.js b/scp/js/thread.js
index 62568ce27..4b1ce02dc 100644
--- a/scp/js/thread.js
+++ b/scp/js/thread.js
@@ -172,6 +172,10 @@ var thread = {
         $('div.thread-body a', $container).each(function() {
             $(this).attr('target', '_blank');
         });
+
+        // Open first response option tab if not already active
+        if (!document.location.hash)
+            $('.actions .tabs li:visible:first:not(.active) a', $container).trigger('click');
     }
 };
 
-- 
GitLab