From ba3334ea3376c55ac80fc2109f040b77c0ec3ec7 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Fri, 25 Apr 2014 12:55:28 -0500 Subject: [PATCH] notes: Add icon to indicate type of note --- include/class.note.php | 13 +++++++++++++ include/staff/templates/note.tmpl.php | 5 ++--- scp/css/scp.css | 11 +++++++++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/include/class.note.php b/include/class.note.php index 55cee2c26..4b0d36303 100644 --- a/include/class.note.php +++ b/include/class.note.php @@ -52,6 +52,19 @@ class QuickNote extends QuickNoteModel { return static::$types[$this->ext_id[0]]; } + function getExtIconClass() { + switch ($this->ext_id[0]) { + case 'U': + return 'user'; + case 'O': + return 'building'; + } + } + + function getIconTitle() { + return sprintf("%s Note", static::$types[$this->ext_id[0]]); + } + static function forUser($user, $org=false) { if ($org) return static::objects()->filter(array('ext_id__in' => diff --git a/include/staff/templates/note.tmpl.php b/include/staff/templates/note.tmpl.php index 2d8156128..f14fbe696 100644 --- a/include/staff/templates/note.tmpl.php +++ b/include/staff/templates/note.tmpl.php @@ -1,14 +1,13 @@ <div class="quicknote" data-id="<?php echo $note->id; ?>"> <div class="header"> <div class="header-left"> + <i class="note-type icon-<?php echo $note->getExtIconClass(); ?>"i + title="<?php echo $note->getIconTitle(); ?>"></i> <?php echo $note->getFormattedTime(); ?> </div> <div class="header-right"> <?php echo $note->getStaff()->getName(); -if ($ext_id && $note->ext_id != $ext_id) { ?> - <span class="label label-info"><?php echo $note->getExtType(); ?></span> -<?php } if (isset($show_options) && $show_options) { ?> <div class="options"> <a href="#" class="action edit-note no-pjax" title="edit"><i class="icon-pencil"></i></a> diff --git a/scp/css/scp.css b/scp/css/scp.css index cd6e093bb..3d73c45cd 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -1666,8 +1666,8 @@ tr.disabled th { } .quicknote .header .options { display: inline-block; - padding-left: 5px; - margin-left: 10px; + padding-left: 10px; + margin-left: 5px; white-space: nowrap; border-left: 1px solid rgba(0,0,0,0.2); } @@ -1732,6 +1732,13 @@ tr.disabled th { padding-right: 5px; } +i.note-type { + color: #2a67ac; + opacity: 0.8; + border-right: 1px solid rgba(0, 0, 0, 0.2); + padding-right: 8px; +} + table.custom-info th { background: transparent; border: none; -- GitLab