[Rt-commit] rt branch, 4.6/priority-as-string, repushed
Craig Kaiser
craig at bestpractical.com
Tue Aug 14 11:00:14 EDT 2018
The branch 4.6/priority-as-string was deleted and repushed:
was 87984768e07489ec601c4db6eac8c164486c98f8
now 7a71343fa3c91f1c2585d9a3910de97b32f67f97
1: 87984768e ! 1: 7a71343fa Core RT::Extension::PriorityAsString
@@ -185,7 +185,7 @@
+
+ my $method = $field .'AsString';
+
-+ my %queues = RT->Config->Get('PriorityAsStringQueues');
++ my %queues = RT->Config->Get('PriorityAsStringQueues') || ();
+ if (not keys %queues) {
+ $COLUMN_MAP->{ $field }{'value'} = sub {
+ return $printer->( $class, $_[0]->$method() );
@@ -247,19 +247,19 @@
+if ($PriorityStringMap) {
+ %map = %{$PriorityStringMap};
+} elsif ($QueueObj and ! RT->Config->Get('NumericalPriority')) {
-+ my %config = RT->Config->Get('PriorityAsStringQueues');
++ my %config = RT->Config->Get('PriorityAsStringQueues') || ();
+ %map = $config{$QueueObj->Name} ? %{$config{$QueueObj->Name}} : RT->Config->Get('PriorityAsString');
+}
+
+if (%map) {
+ if (RT->Config->Get('PriorityAsStringOrder')) {
-+ @order = grep {exists $map{$_}} RT->Config->Get('PriorityAsStringOrder');
++ @order = grep {exists $map{$_}} RT->Config->Get('PriorityAsStringOrder');
+ } else {
-+ @order = sort { $map{$a} <=> $map{$b} } keys %map;
++ @order = sort { $map{$a} <=> $map{$b} } keys %map;
+ }
+
+ if ( defined $Default && length $Default ) {
-+ $default_label = RT::Ticket->_PriorityAsString( $Default, \%map ) || '';
++ $default_label = RT::Ticket->_PriorityAsString( $Default, \%map ) || '';
+ }
+}
+
@@ -273,14 +273,14 @@
},
);
-+my %priority_strings = RT->Config->Get('PriorityAsStringQueues');
++my %priority_strings = RT->Config->Get('PriorityAsStringQueues') || ();
+if ( !RT->Config->Get('NumericalPriority') ) {
+ my ($priority_dropdown) = grep {$_->{Name} eq "Priority"} @lines;
+ my %priority_map = ( '-' => '' );
+ for my $queue (keys %queues) {
-+ for my $priority (keys %{$priority_strings{$queue}}) {
-+ $priority_map{ keys %queues > 1 ? "$queue: $priority" : "$priority" } = $priority_strings{$queue}{$priority};
-+ }
++ for my $priority (keys %{$priority_strings{$queue}}) {
++ $priority_map{ keys %queues > 1 ? "$queue: $priority" : "$priority" } = $priority_strings{$queue}{$priority};
++ }
+ }
+ $priority_dropdown->{Value}{Arguments}{PriorityStringMap} = \%priority_map;
+}
@@ -331,7 +331,7 @@
args => {
Name => $field,
Default => $defaults{$field} || $TicketObj->$field,
-+ QueueObj => $QueueObj,
++ QueueObj => $QueueObj,
}
}
} ('Priority', 'Final Priority')
More information about the rt-commit
mailing list