1 package SL::Presenter::GL;
5 use SL::Presenter::EscapedText qw(escape is_escaped);
7 use Exporter qw(import);
8 our @EXPORT_OK = qw(gl_transaction);
13 my ($gl_transaction, %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="gl.pl?action=edit&id=' . escape($gl_transaction->id) . '">',
21 escape($gl_transaction->reference),
22 $params{no_link} ? '' : '</a>',
38 SL::Presenter::GL - Presenter module for GL transaction
42 my $object = SL::DB::Manager::GLTransaction->get_first();
43 my $html = SL::Presenter::GL::gl_transaction($object, display => 'inline');
49 =item C<gl_transaction $object, %params>
51 Returns a rendered version (actually an instance of
52 L<SL::Presenter::EscapedText>) of a gl object C<$object>.
54 C<%params> can include:
60 Either C<inline> (the default) or C<table-cell>. At the moment both
61 representations are identical and produce the trans_id number linked
62 to the corresponding 'edit' action.
66 If falsish (the default) then the trans_id number will be linked to the
80 G. Richardson E<lt>information@kivitendo-premium.deE<gt>