[Rt-commit] rt branch, 4.6/priority-as-string, repushed
Craig Kaiser
craig at bestpractical.com
Tue Aug 14 08:16:09 EDT 2018
The branch 4.6/priority-as-string was deleted and repushed:
was b2f029ac4c1cd33289f752882316c453214fc284
now 056cf567fa2781a6c65f4f945e4817fdbdc799c2
1: b2f029ac4 ! 1: 056cf567f Core RT::Extension::PriorityAsString
@@ -28,14 +28,14 @@
+integer in the database, but RT supports mapping strings to numerical
+values. For example, the default mapping is:
+
-+ Set(%PriorityAsString, (Low => 0, Medium => 50, High => 100));
++ Set(%PriorityAsString, Low => 0, Medium => 50, High => 100);
+
+Redefine C<%PriorityAsString> in C<RT_SiteConfig.pm> to set site
+priority strings.
+
+=cut
+
-+Set(%DefaultPriorityAsString, (Low => 0, Medium => 50, High => 100));
++Set(%DefaultPriorityAsString, Low => 0, Medium => 50, High => 100);
+
+=item C<%PriorityAsStringOrder>
+
@@ -72,6 +72,10 @@
+
+=cut
+
++Set(%PriorityAsStringQueues,
++ General => { Low => 0, Medium => 50, High => 100 },
++);
++
=back
=head1 Assets
@@ -91,7 +95,7 @@
+
+ my $numerical_priority = $self->Get('NumericalPriority');
+ my %default_config = $self->Get('DefaultPriorityAsString');
-+ my %user_config = $self->Get('PriorityAsString');
++ my %user_config = $self->Get('PriorityAsString') || ();
+ my %config = $self->Get('PriorityAsStringQueues');
+
+ if ($numerical_priority) {
@@ -103,7 +107,7 @@
+ my $queues = RT::Queues->new(RT->SystemUser);
+ $queues->Limit(
+ FIELD => 'Name',
-+ OPERATOR => '!=',
++ OPERATOR => 'IS NOT',
+ VALUE => '___Approvals',
+ );
+ my @queue_configs = keys %config;
@@ -217,7 +221,6 @@
+ my $escaped = $m->interp->apply_escapes($string, 'h');
+ my $loc_escaped = $m->interp->apply_escapes(loc($string), 'h');
+ return \( qq{<span class="ticket-info-$class-}. lc($escaped) .qq{">$loc_escaped</span>} );
-+
+};
+
+foreach my $field (qw(Priority InitialPriority FinalPriority)) {
@@ -285,9 +288,8 @@
+my $priority_is_string = undef;
+my @order;
+my $default_label = '';
-+my %map = undef;
-+
-+use Data::Dumper;
++my %map = ();
++
+if ($PriorityStringMap) {
+ %map = %{$PriorityStringMap};
+} elsif ($QueueObj) {
More information about the rt-commit
mailing list