[Bps-public-commit] RT-Extension-PriorityAsString branch, master, updated. 1.01-1-g8c14acd

Alex Vandiver alexmv at bestpractical.com
Mon Sep 29 13:00:11 EDT 2014


The branch, master has been updated
       via  8c14acd3c92f6322195d050edd568e07af5d61cb (commit)
      from  536457d1218284886a4e18c079d3afb59f35b04d (commit)

Summary of changes:
 html/Ticket/Elements/ShowPriority | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 8c14acd3c92f6322195d050edd568e07af5d61cb
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Sep 29 12:59:17 2014 -0400

    For compatibility with RT 4.0, provide our own copy of CSSClass

diff --git a/html/Ticket/Elements/ShowPriority b/html/Ticket/Elements/ShowPriority
index c8f48f6..c906a3b 100644
--- a/html/Ticket/Elements/ShowPriority
+++ b/html/Ticket/Elements/ShowPriority
@@ -3,12 +3,19 @@
 % } else {
 % my $current = $Ticket->PriorityAsString || '';
 % my $final = $Ticket->FinalPriorityAsString || '';
-<span class="ticket-info-priority-<% CSSClass(lc($current)) %>"><% loc($current) %></span>/\
-<span class="ticket-info-final-priority-<% CSSClass(lc($final)) %>"><% loc($final) %></span>
+<span class="ticket-info-priority-<% $CSSClass->(lc($current)) %>"><% loc($current) %></span>/\
+<span class="ticket-info-final-priority-<% $CSSClass->(lc($final)) %>"><% loc($final) %></span>
 % }
 <%ARGS>
 $Ticket => undef
 </%ARGS>
 <%INIT>
 my %queues = RT->Config->Get('PriorityAsStringQueues');
+
+my $CSSClass = sub {
+    my $value = shift;
+    return '' unless defined $value;
+    $value =~ s/[^A-Za-z0-9_-]/_/g;
+    return $value;
+};
 </%INIT>

-----------------------------------------------------------------------


More information about the Bps-public-commit mailing list