[Bps-public-commit] RT-Extension-PriorityAsString branch, master, updated. 0.05-1-gcba4711

Alex Vandiver alexmv at bestpractical.com
Wed Jun 25 17:33:23 EDT 2014


The branch, master has been updated
       via  cba4711b3dd405a508ed462960c8ff993674ba9b (commit)
      from  95582dc6bec2f038eb162bcb1bc4d0dff66a05d9 (commit)

Summary of changes:
 html/Elements/SelectPriorityAsString | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit cba4711b3dd405a508ed462960c8ff993674ba9b
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Jun 25 17:23:29 2014 -0400

    Only use PriorityAsStringOrder if it is defined
    
    This updates the code to match the documentation update in c3e0b5f5

diff --git a/html/Elements/SelectPriorityAsString b/html/Elements/SelectPriorityAsString
index 281ecc2..91ba289 100644
--- a/html/Elements/SelectPriorityAsString
+++ b/html/Elements/SelectPriorityAsString
@@ -22,8 +22,12 @@ $Mapping => undef
 <%INIT>
 
 my %map   = $Mapping ? %{ $Mapping } : RT->Config->Get('PriorityAsString');
-my @order = $Mapping ? sort { $map{$a} <=> $map{$b} } keys %map
-  : grep {exists $map{$_}} RT->Config->Get('PriorityAsStringOrder');
+my @order;
+if (not $Mapping and RT->Config->Get('PriorityAsStringOrder')) {
+    @order = grep {exists $map{$_}} RT->Config->Get('PriorityAsStringOrder');
+} else {
+    @order = sort { $map{$a} <=> $map{$b} } keys %map;
+}
 
 my $default_label = '';
 if ( defined $Default && length $Default ) {

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


More information about the Bps-public-commit mailing list