1 package SL::Presenter::Letter;
5 use parent qw(Exporter);
7 use Exporter qw(import);
8 our @EXPORT = qw(letter);
13 my ($self, $letter, %params) = @_;
15 $params{display} ||= 'inline';
17 croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;
20 $params{no_link} ? '' : '<a href="controller.pl?action=Letter/edit&letter.id=' . $self->escape($letter->id) . '">',
21 $self->escape($letter->letternumber),
22 $params{no_link} ? '' : '</a>',
25 return $self->escaped_text($text);
38 SL::Presenter::Letter - Presenter module for letter objects
42 my $letter = SL::DB::Manager::Letter->get_first(where => [ … ]);
43 my $html = SL::Presenter->get->letter($letter, display => 'inline');
49 =item C<letter $object, %params>
51 Returns a rendered version (actually an instance of
52 L<SL::Presenter::EscapedText>) of the letter object C<$object>
55 C<%params> can include:
61 Either C<inline> (the default) or C<table-cell>. At the moment both
62 representations are identical and produce the invoice number linked
63 to the corresponding 'edit' action.
67 If falsish (the default) then the invoice number will be linked to the
68 "edit invoice" dialog from the general ledger menu.
80 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>