Projekt

Allgemein

Profil

Herunterladen (1,83 KB) Statistiken
| Zweig: | Markierung: | Revision:
ad4bebf4 Felix Eichler
package SL::Presenter::Dunning;

use strict;

use SL::Presenter::EscapedText qw(escape is_escaped);
91e4e0fc Bernd Bleßmann
use SL::Presenter::Tag qw(link_tag);
ad4bebf4 Felix Eichler
use Exporter qw(import);
60cba3e3 Tamino Steinert
our @EXPORT_OK = qw(show dunning);
ad4bebf4 Felix Eichler
use Carp;

60cba3e3 Tamino Steinert
sub show {goto &dunning};

ad4bebf4 Felix Eichler
sub dunning {
863cc59d Bernd Bleßmann
my ($dunning, %params) = @_;
ad4bebf4 Felix Eichler
$params{display} ||= 'inline';

croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;

38bb9635 Bernd Bleßmann
my $text = escape($dunning->dunning_config->dunning_description);
91e4e0fc Bernd Bleßmann
if (! delete $params{no_link}) {
60cba3e3 Tamino Steinert
my @flags = ();
b23ee626 Bernd Bleßmann
push @flags, 'showold=1';
push @flags, 'l_mails=1' if $::instance_conf->get_email_journal;
push @flags, 'l_webdav=1' if $::instance_conf->get_webdav;
push @flags, 'l_documents=1' if $::instance_conf->get_doc_storage;

my $href = 'dn.pl?action=show_dunning&dunning_id=' . $dunning->dunning_id;
$href .= '&' . join '&', @flags if @flags;
$text = link_tag($href, $text, %params);
91e4e0fc Bernd Bleßmann
}
ad4bebf4 Felix Eichler
is_escaped($text);
}

1;
60cba3e3 Tamino Steinert
__END__

=pod

=encoding utf8

=head1 NAME

SL::Presenter::Dunning - Presenter module for SL::DB::Dunning objects

=head1 SYNOPSIS

my $object = SL::DB::Manager::Dunning->get_first();
my $html = SL::Presenter::Dunning::dunning($object);
# or
my $html = $object->presenter->show();

=head1 FUNCTIONS

=over 4

=item C<show $object>

Alias for C<dunning $object %params>.

=item C<dunning $object %params>

Returns a rendered version (actually an instance of
L<SL::Presenter::EscapedText>) of the dunning object
C<$object>.

Remaining C<%params> are passed to the function
C<SL::Presenter::Tag::link_tag>. It can include:

=over 2

=item * no_link

If falsish (the default) then the dunning will be linked to the "show" dialog.

=back

=back

=head1 BUGS

Nothing here yet.

=head1 AUTHOR

Tamino Steinert E<lt>tamino.steinert@tamino.stE<gt>

=cut