[Rt-commit] rt branch, history-filter, updated. rt-3.8.8-94-ge259684
Shawn Moore
sartak at bestpractical.com
Tue Jun 15 17:26:51 EDT 2010
The branch, history-filter has been updated
via e2596840f590fd1c13f197e1255839932974a9ad (commit)
from 72367f65472f6bc41b1464b7eb5e26969e5516d5 (commit)
Summary of changes:
lib/RT/Transaction_Overlay.pm | 46 +++++++++++++++++++++++++---------------
1 files changed, 29 insertions(+), 17 deletions(-)
- Log -----------------------------------------------------------------
commit e2596840f590fd1c13f197e1255839932974a9ad
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Tue Jun 15 17:27:43 2010 -0400
Put (fallback) into TypeMetadata too so extensions can override it
diff --git a/lib/RT/Transaction_Overlay.pm b/lib/RT/Transaction_Overlay.pm
index 24bc6ce..f89b15e 100755
--- a/lib/RT/Transaction_Overlay.pm
+++ b/lib/RT/Transaction_Overlay.pm
@@ -396,6 +396,24 @@ use HTML::TreeBuilder;
}
},
},
+ '(fallback)' => {
+ BriefDescription => sub {
+ my $self = shift;
+ my %args = @_;
+
+ return $self->loc(
+ "Default: [_1]/[_2] changed from [_3] to [_4]",
+ $args{type},
+ $self->Field,
+ (
+ $self->OldValue
+ ? "'" . $self->OldValue . "'"
+ : $self->loc("(no value)")
+ ),
+ "'" . $self->NewValue . "'"
+ );
+ },
+ },
);
# }}}
@@ -935,26 +953,20 @@ sub BriefDescription {
return $self->loc("No transaction type specified");
}
- if ( my $code = $self->TypeMetadata(Type => $type, Field => 'BriefDescription') ) {
- my %args = (
- obj_type => $self->FriendlyObjectType,
- );
+ for my $lookup_type ($type, '(fallback)') {
+ if ( my $code = $self->TypeMetadata(Type => $lookup_type, Field => 'BriefDescription') ) {
+ my %args = (
+ type => $type,
+ obj_type => $self->FriendlyObjectType,
+ );
- my $description = $code->($self, %args);
- return $description if defined $description;
+ my $description = $code->($self, %args);
+ return $description if defined $description;
+ }
}
- return $self->loc(
- "Default: [_1]/[_2] changed from [_3] to [_4]",
- $type,
- $self->Field,
- (
- $self->OldValue
- ? "'" . $self->OldValue . "'"
- : $self->loc("(no value)")
- ),
- "'" . $self->NewValue . "'"
- );
+ # this should never happen!
+ return $self->loc("No transaction formatter found");
}
# }}}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list