From ff8c41b22ed68105d47797ef2eab51ab13dab6c0 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Wed, 7 Oct 2015 20:10:45 -0400
Subject: [PATCH] queue: Fixup some styles

---
 include/class.forms.php                       |  2 +-
 include/class.queue.php                       |  8 +++----
 include/class.search.php                      |  3 ++-
 .../staff/templates/queue-preview.tmpl.php    |  2 +-
 .../staff/templates/queue-tickets.tmpl.php    |  2 +-
 scp/css/scp.css                               | 21 +++++++++++++------
 6 files changed, 24 insertions(+), 14 deletions(-)

diff --git a/include/class.forms.php b/include/class.forms.php
index 516c7db9f..e71d132fe 100644
--- a/include/class.forms.php
+++ b/include/class.forms.php
@@ -2311,7 +2311,7 @@ class PriorityField extends ChoiceField {
     function display($prio) {
         if (!$prio instanceof Priority)
             return parent::display($prio);
-        return sprintf('<span style="padding: 2px; background-color: %s">%s</span>',
+        return sprintf('<span class="fill" style="padding: 2px; background-color: %s">%s</span>',
             $prio->getColor(), Format::htmlchars($prio->getDesc()));
     }
 
diff --git a/include/class.queue.php b/include/class.queue.php
index 07b4a1902..7f3facb5d 100644
--- a/include/class.queue.php
+++ b/include/class.queue.php
@@ -152,11 +152,11 @@ class CustomQueue extends SavedSearch {
         if (!$this->id)
             return;
 
-        $path = $this->id;
+        $path = '';
         if ($this->parent) {
-            $path = sprintf('%s/%d', $this->parent->getPath(), $path);
+            $path = rtrim($this->parent->getPath(), '/');
         }
-        return $path;
+        return $path . "/{$this->id}/";
     }
 
     function getFullName() {
@@ -553,7 +553,7 @@ class QueueColumnCondition {
                     $V = current($V);
                 $style[] = "{$css}:{$V}";
             }
-            $text = sprintf('<span style="%s">%s</span>',
+            $text = sprintf('<span class="fill" style="%s">%s</span>',
                 implode(';', $style), $text);
         }
         return $text;
diff --git a/include/class.search.php b/include/class.search.php
index 6626f1225..141f5a0fe 100644
--- a/include/class.search.php
+++ b/include/class.search.php
@@ -675,7 +675,8 @@ class SavedSearch extends VerySimpleModel {
         return static::objects()->filter(Q::any(array(
             'staff_id' => $agent->getId(),
             'flags__hasbit' => self::FLAG_PUBLIC,
-        )));
+        )))
+        ->exclude(array('flags__hasbit'=>self::FLAG_QUEUE));
     }
 
     function getName() {
diff --git a/include/staff/templates/queue-preview.tmpl.php b/include/staff/templates/queue-preview.tmpl.php
index 645925fce..18e231160 100644
--- a/include/staff/templates/queue-preview.tmpl.php
+++ b/include/staff/templates/queue-preview.tmpl.php
@@ -29,7 +29,7 @@ foreach ($columns as $C) {
 foreach ($tickets as $T) {
     echo '<tr>';
     foreach ($columns as $C) {
-        echo "<td>";
+        echo '<td class="offset">';
         echo $C->render($T);
         echo "</td>";
     }
diff --git a/include/staff/templates/queue-tickets.tmpl.php b/include/staff/templates/queue-tickets.tmpl.php
index ad14667fe..373c0a1b5 100644
--- a/include/staff/templates/queue-tickets.tmpl.php
+++ b/include/staff/templates/queue-tickets.tmpl.php
@@ -104,7 +104,7 @@ foreach ($columns as $C) {
 foreach ($tickets as $T) {
     echo '<tr>';
     foreach ($columns as $C) {
-        echo "<td>";
+        echo '<td class="offset">';
         echo $C->render($T);
         echo "</td>";
     }
diff --git a/scp/css/scp.css b/scp/css/scp.css
index 41f235442..bcb53c5b7 100644
--- a/scp/css/scp.css
+++ b/scp/css/scp.css
@@ -302,11 +302,17 @@ a time {
 }
 
 /* Custom queue fields with background color should fill cell */
-table.queue.list > tbody > tr > td > [style*=background] {
+.offset {
+    position: relative;
+}
+.offset .fill {
     display: block;
-    padding: 4px !important;
-    margin: -4px;
-    height: 100%;
+    padding: 4px!important;
+    position: absolute;
+    left: 0;
+    top: 0;
+    right: 0;
+    bottom: 0;
 }
 
 /***********************************************************************
@@ -366,12 +372,12 @@ table.queue.list > tbody > tr > td > [style*=background] {
     text-decoration: none;
 }
 
-#sub_nav a.active, #sub_nav li.active,
+#sub_nav a.active, #sub_nav li.active > a,
 #customQ_nav .jb-overflowmenu-menu-primary li.item > a.active {
     font-weight:bold;
 }
 
-#sub_nav li.child.active {
+#sub_nav li.child.active > a {
     font-weight: 500;
 }
 
@@ -414,6 +420,9 @@ table.queue.list > tbody > tr > td > [style*=background] {
     text-decoration:none;
     text-transform:capitalize;
 }
+.customQ-dropdown a.truncate {
+    min-width: 140px;
+}
 
 .customQ-dropdown ul li {
     list-style:none;
-- 
GitLab