[Rt-commit] rt branch, 4.0/extract-quote-header-method, created. rt-4.0.8-301-ge6cfc69
Ruslan Zakirov
ruz at bestpractical.com
Mon Dec 31 12:32:30 EST 2012
The branch, 4.0/extract-quote-header-method has been created
at e6cfc69c40da44fa367e1e7dad0deeae909819ac (commit)
- Log -----------------------------------------------------------------
commit e6cfc69c40da44fa367e1e7dad0deeae909819ac
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Tue Dec 25 16:22:22 2012 +0400
extract Transaction->QuoteHeader method
Code that is adding "On <date> <person> wrote:" in front of
quoted context is burried in other method, so it's hard to
change style of the quoting. Extract it into a new method.
diff --git a/lib/RT/Transaction.pm b/lib/RT/Transaction.pm
index fa0d590..47ae072 100644
--- a/lib/RT/Transaction.pm
+++ b/lib/RT/Transaction.pm
@@ -381,13 +381,24 @@ sub Content {
}
$content =~ s/^/> /gm;
- $content = $self->loc("On [_1], [_2] wrote:", $self->CreatedAsString, $self->CreatorObj->Name)
- . "\n$content\n\n";
+ $content = $self->QuoteHeader . "\n$content\n\n";
}
return ($content);
}
+=head2 QuoteHeader
+
+Returns text prepended to content when transaction is quoted
+(see C<Quote> argument in L</Content>). By default returns
+localized "On <date> <user name> wrote:\n".
+
+=cut
+
+sub QuoteHeader {
+ my $self = shift;
+ return $self->loc("On [_1], [_2] wrote:", $self->CreatedAsString, $self->CreatorObj->Name);
+}
=head2 Addresses
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list