[Rt-commit] rt branch, 4.6/priority-as-string, repushed
Michel Rodriguez
michel at bestpractical.com
Tue Dec 31 11:52:37 EST 2019
The branch 4.6/priority-as-string was deleted and repushed:
was c15f80d23918ff1434bea4b166301f07ae27fa7a
now b420bf72ebbc4ed778f207bcf7f39f2749975c68
1: 147508b3a2 ! 1: e698a7d302 Cores PriorityAsString
@@ -358,7 +358,7 @@
+}
+
+sub _PriorityAsString {
-+ my $self = shift;
++ my $self = shift;
+ my $priority = shift;
+ return undef unless defined $priority && length $priority;
+
@@ -367,19 +367,21 @@
+ $map = shift;
+ } else {
+ my $queue_name = $self->QueueObj->Name;
-+ $map = RT->Config->PriorityMap( $queue_name );
-+ }
-+
-+ return $priority if ! $map;
-+
-+ my @orderedLabels = sort { $map->{$b} <=> $map->{$a} } keys %$map;
++ $map = RT->Config->PriorityMap($queue_name);
++ }
++
++ return $priority if !$map;
++
++ my @orderedLabels = sort { $map->{$b} <=> $map->{$a} } keys %$map;
+
+ # priority could be '(no value)' (or a localized version)
+ $priority = 0 if $priority !~ m{^\d+$};
++
+ # return the label for the first priority <= $priority
+ foreach my $label ( @orderedLabels ) {
-+ return $label if $priority >= $map->{ $label };
-+ };
++ return $label if $priority >= $map->{$label};
++ }
++
+ # if we get here the priority is lower than the lowest in the map
+ # return the label associated with the lowest priority
+ return $orderedLabels[-1];
2: c15f80d239 = 2: b420bf72eb Test PriorityAsString.
More information about the rt-commit
mailing list