1 package SL::Presenter::GL;
 
   5 use parent qw(Exporter);
 
   7 use Exporter qw(import);
 
   8 our @EXPORT = qw(gl_transaction);
 
  13   my ($self, $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=' . $self->escape($gl_transaction->id) . '">',
 
  21     $self->escape($gl_transaction->reference),
 
  22     $params{no_link} ? '' : '</a>',
 
  24   return $self->escaped_text($text);
 
  37 SL::Presenter::GL - Presenter module for GL transaction
 
  41   my $object = SL::DB::Manager::GLTransaction->get_first();
 
  42   my $html   = SL::Presenter->get->gl_transaction($object, display => 'inline');
 
  48 =item C<gl_transaction $object, %params>
 
  50 Returns a rendered version (actually an instance of
 
  51 L<SL::Presenter::EscapedText>) of a gl object C<$object>.
 
  53 C<%params> can include:
 
  59 Either C<inline> (the default) or C<table-cell>. At the moment both
 
  60 representations are identical and produce the trans_id number linked
 
  61 to the corresponding 'edit' action.
 
  65 If falsish (the default) then the trans_id number will be linked to the
 
  79 G. Richardson E<lt>information@kivitendo-premium.deE<gt>