X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/048f2af4cc81425f9148dac716c4c1ecf23ab020..26c66e2caae4a9af6464223cbde41a74203f59ec:/SL/Presenter/GL.pm
diff --git a/SL/Presenter/GL.pm b/SL/Presenter/GL.pm
new file mode 100644
index 000000000..5a9c15b02
--- /dev/null
+++ b/SL/Presenter/GL.pm
@@ -0,0 +1,79 @@
+package SL::Presenter::GL;
+
+use strict;
+
+use parent qw(Exporter);
+
+use Exporter qw(import);
+our @EXPORT = qw(gl_transaction);
+
+use Carp;
+
+sub gl_transaction {
+ my ($self, $gl_transaction, %params) = @_;
+
+ $params{display} ||= 'inline';
+
+ croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;
+
+ my $text = join '', (
+ $params{no_link} ? '' : '',
+ $self->escape($gl_transaction->id),
+ $params{no_link} ? '' : '',
+ );
+ return $self->escaped_text($text);
+}
+
+1;
+
+__END__
+
+=pod
+
+=encoding utf8
+
+=head1 NAME
+
+SL::Presenter::GL - Presenter module for GL transaction
+
+=head1 SYNOPSIS
+
+ my $object = SL::DB::Manager::GLTransaction->get_first();
+ my $html = SL::Presenter->get->gl_transaction($object, display => 'inline');
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item C
+
+Returns a rendered version (actually an instance of
+L) of a gl object C<$object>.
+
+C<%params> can include:
+
+=over 2
+
+=item * display
+
+Either C (the default) or C. At the moment both
+representations are identical and produce the trans_id number linked
+to the corresponding 'edit' action.
+
+=item * no_link
+
+If falsish (the default) then the trans_id number will be linked to the
+"edit gl" dialog.
+
+
+=back
+
+=head1 BUGS
+
+Nothing here yet.
+
+=head1 AUTHOR
+
+G. Richardson Einformation@kivitendo-premium.deE
+
+=cut