1 package SL::Presenter::Reclamation;
5 use SL::Presenter::EscapedText qw(escape is_escaped);
6 use SL::Presenter::Tag qw(link_tag);
8 use Exporter qw(import);
9 our @EXPORT_OK = qw(show sales_reclamation purchase_reclamation);
13 sub show {goto &reclamation};
15 sub sales_reclamation {goto &reclamation}
16 sub purchase_reclamation {goto &reclamation}
19 my ($reclamation, %params) = @_;
21 $params{display} ||= 'inline';
23 my $text = escape($reclamation->record_number);
24 unless ($params{no_link}) {
25 my $href = 'controller.pl?action=Reclamation/edit&id=' . escape($reclamation->id);
26 $text = link_tag($href, $text, %params);
42 SL::Presenter::Reclamation - Presenter module for Rose::DB objects for sales
43 reclamations and purchase reclamations
48 my $object = SL::DB::Manager::Reclamation->get_first(
49 where => [ SL::DB::Manager::Reclamation->type_filter('sales_reclamation') ]
51 my $html = SL::Presenter::Reclamation::sales_reclamation($object);
53 # Purchase reclamations:
54 my $object = SL::DB::Manager::Reclamation->get_first(
55 where => [ SL::DB::Manager::Reclamation->type_filter('purchase_reclamation') ]
57 my $html = SL::Presenter::Reclamation::purchase_reclamation($object);
60 my $html = SL::Presenter::Reclamation::reclamation(
61 $object, display => 'inline'
63 my $html = $object->presenter->show();
69 =item C<show $object %params>
71 Alias for C<reclamation $object %params>.
73 =item C<sales_reclamation $object, %params>
75 Alias for C<reclamation $object %params>.
77 =item C<purchase_reclamation $object, %params>
79 Alias for C<reclamation $object %params>.
81 =item C<reclamation $object %params>
83 Returns a rendered version (actually an instance of
84 L<SL::Presenter::EscapedText>) of the sales reclamation object C<$object>.
86 C<%params> can include:
92 If falsish (the default) then the reclamation number will be linked to the
93 "edit reclamation" dialog.
97 When C<$params{no_link}> is falsish, other C<%params> get passed to
98 L<SL::Presenter::Tag/link_tag> .
108 Tamino Steinert E<lt>tamino.steinert@tamino.stE<gt>