Revision 8925999b
Von Moritz Bunkus vor mehr als 8 Jahren hinzugefügt
SL/Presenter/CustomerVendor.pm | ||
---|---|---|
5 | 5 |
use parent qw(Exporter); |
6 | 6 |
|
7 | 7 |
use Exporter qw(import); |
8 |
our @EXPORT = qw(customer vendor customer_vendor_picker); |
|
8 |
our @EXPORT = qw(customer_vendor customer vendor customer_vendor_picker);
|
|
9 | 9 |
|
10 | 10 |
use Carp; |
11 | 11 |
|
12 |
sub customer_vendor { |
|
13 |
my ($self, $customer_vendor, %params) = @_; |
|
14 |
return _customer_vendor($self, $customer_vendor, ref($customer_vendor) eq 'SL::DB::Customer' ? 'customer' : 'vendor', %params); |
|
15 |
} |
|
16 |
|
|
12 | 17 |
sub customer { |
13 | 18 |
my ($self, $customer, %params) = @_; |
14 | 19 |
return _customer_vendor($self, $customer, 'customer', %params); |
... | ... | |
136 | 141 |
|
137 | 142 |
=back |
138 | 143 |
|
144 |
=item C<customer_vendor $object, %params> |
|
145 |
|
|
146 |
Returns a rendered version (actually an instance of |
|
147 |
L<SL::Presenter::EscapedText>) of the customer or vendor object |
|
148 |
C<$object> by calling either L</customer> or L</vendor> depending on |
|
149 |
C<$object>'s type. See the respective functions for available |
|
150 |
parameters. |
|
151 |
|
|
139 | 152 |
=back |
140 | 153 |
|
141 | 154 |
=head1 BUGS |
Auch abrufbar als: Unified diff
CustomerVendor-Presenter: neue Funktion customer_vendor()
Damit der Aufrufer nicht im Vorfeld entscheiden muss, ob $object ein
Kunde oder ein Lieferant ist.