kivitendo/SL/Presenter/Reclamation.pm @ 983b4461
1b0a6037 | Tamino Steinert | package SL::Presenter::Reclamation;
|
||
use strict;
|
||||
use SL::Presenter::EscapedText qw(escape is_escaped);
|
||||
60cba3e3 | Tamino Steinert | use SL::Presenter::Tag qw(link_tag);
|
||
1b0a6037 | Tamino Steinert | |||
use Exporter qw(import);
|
||||
60cba3e3 | Tamino Steinert | our @EXPORT_OK = qw(show sales_reclamation purchase_reclamation);
|
||
1b0a6037 | Tamino Steinert | |||
use Carp;
|
||||
60cba3e3 | Tamino Steinert | sub show {goto &reclamation};
|
||
1b0a6037 | Tamino Steinert | |||
60cba3e3 | Tamino Steinert | sub sales_reclamation {goto &reclamation}
|
||
sub purchase_reclamation {goto &reclamation}
|
||||
1b0a6037 | Tamino Steinert | |||
60cba3e3 | Tamino Steinert | sub reclamation {
|
||
1b0a6037 | Tamino Steinert | my ($reclamation, %params) = @_;
|
||
$params{display} ||= 'inline';
|
||||
my $text = escape($reclamation->record_number);
|
||||
unless ($params{no_link}) {
|
||||
60cba3e3 | Tamino Steinert | my $href = 'controller.pl?action=Reclamation/edit&id=' . escape($reclamation->id);
|
||
$text = link_tag($href, $text, %params);
|
||||
1b0a6037 | Tamino Steinert | }
|
||
is_escaped($text);
|
||||
}
|
||||
1;
|
||||
__END__
|
||||
=pod
|
||||
=encoding utf8
|
||||
=head1 NAME
|
||||
SL::Presenter::Reclamation - Presenter module for Rose::DB objects for sales
|
||||
reclamations and purchase reclamations
|
||||
=head1 SYNOPSIS
|
||||
# Sales reclamations:
|
||||
my $object = SL::DB::Manager::Reclamation->get_first(
|
||||
where => [ SL::DB::Manager::Reclamation->type_filter('sales_reclamation') ]
|
||||
);
|
||||
60cba3e3 | Tamino Steinert | my $html = SL::Presenter::Reclamation::sales_reclamation($object);
|
||
1b0a6037 | Tamino Steinert | |||
# Purchase reclamations:
|
||||
my $object = SL::DB::Manager::Reclamation->get_first(
|
||||
where => [ SL::DB::Manager::Reclamation->type_filter('purchase_reclamation') ]
|
||||
);
|
||||
60cba3e3 | Tamino Steinert | my $html = SL::Presenter::Reclamation::purchase_reclamation($object);
|
||
# or for all types:
|
||||
my $html = SL::Presenter::Reclamation::reclamation(
|
||||
1b0a6037 | Tamino Steinert | $object, display => 'inline'
|
||
);
|
||||
60cba3e3 | Tamino Steinert | my $html = $object->presenter->show();
|
||
1b0a6037 | Tamino Steinert | |||
=head1 FUNCTIONS
|
||||
=over 4
|
||||
60cba3e3 | Tamino Steinert | =item C<show $object %params>
|
||
1b0a6037 | Tamino Steinert | |||
60cba3e3 | Tamino Steinert | Alias for C<reclamation $object %params>.
|
||
1b0a6037 | Tamino Steinert | |||
60cba3e3 | Tamino Steinert | =item C<sales_reclamation $object, %params>
|
||
1b0a6037 | Tamino Steinert | |||
60cba3e3 | Tamino Steinert | Alias for C<reclamation $object %params>.
|
||
1b0a6037 | Tamino Steinert | |||
60cba3e3 | Tamino Steinert | =item C<purchase_reclamation $object, %params>
|
||
1b0a6037 | Tamino Steinert | |||
60cba3e3 | Tamino Steinert | Alias for C<reclamation $object %params>.
|
||
1b0a6037 | Tamino Steinert | |||
60cba3e3 | Tamino Steinert | =item C<reclamation $object %params>
|
||
1b0a6037 | Tamino Steinert | |||
Returns a rendered version (actually an instance of
|
||||
60cba3e3 | Tamino Steinert | L<SL::Presenter::EscapedText>) of the sales reclamation object C<$object>.
|
||
1b0a6037 | Tamino Steinert | |||
C<%params> can include:
|
||||
=over 2
|
||||
=item * no_link
|
||||
If falsish (the default) then the reclamation number will be linked to the
|
||||
60cba3e3 | Tamino Steinert | "edit reclamation" dialog.
|
||
1b0a6037 | Tamino Steinert | |||
=back
|
||||
60cba3e3 | Tamino Steinert | When C<$params{no_link}> is falsish, other C<%params> get passed to
|
||
L<SL::Presenter::Tag/link_tag> .
|
||||
1b0a6037 | Tamino Steinert | =back
|
||
=head1 BUGS
|
||||
Nothing here yet.
|
||||
=head1 AUTHOR
|
||||
Tamino Steinert E<lt>tamino.steinert@tamino.stE<gt>
|
||||
=cut
|