Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 60cba3e3

Von Tamino Steinert vor 12 Monaten hinzugefügt

  • ID 60cba3e3891894ba4238971f1d5f7a2c99137dc0
  • Vorgänger 5353aec5
  • Nachfolger 148785d9

S:Presenter:Record: Alias Funktion "show" in verwendeten Objekten

Verknüpfte Belege nutzt folgende Objekte:
DeliveryOrder, Dunning, EmailJournal, GL, Invoice, Letter, Order,
Reclamation, RequirementSpec, ShopOrder

Unterschiede anzeigen:

SL/Presenter/DeliveryOrder.pm
8 8
use SL::Presenter::Tag         qw(link_tag);
9 9

  
10 10
use Exporter qw(import);
11
our @EXPORT_OK = qw(sales_delivery_order purchase_delivery_order delivery_order_status_line);
11
our @EXPORT_OK = qw(
12
  show delivery_order delivery_order_status_line
13
  sales_delivery_order purchase_delivery_order
14
  rma_delivery_order supplier_delivery_order
15
);
12 16

  
13 17
use Carp;
14 18

  
15
sub sales_delivery_order {
16
  my ($delivery_order, %params) = @_;
19
sub show {goto &delivery_order};
17 20

  
18
  return _do_record($delivery_order, 'sales_delivery_order', %params);
19
}
21
sub sales_delivery_order {goto &delivery_order}
20 22

  
21
sub rma_delivery_order {
22
  my ($delivery_order, %params) = @_;
23

  
24
  return _do_new_record($delivery_order, 'rma_delivery_order', %params);
25
}
23
sub rma_delivery_order {goto &delivery_order};
26 24

  
27
sub purchase_delivery_order {
28
  my ($delivery_order, %params) = @_;
25
sub purchase_delivery_order {goto &delivery_order};
29 26

  
30
  return _do_record($delivery_order, 'purchase_delivery_order', %params);
31
}
27
sub supplier_delivery_order {goto &delivery_order};
32 28

  
33
sub supplier_delivery_order {
29
sub delivery_order {
34 30
  my ($delivery_order, %params) = @_;
35 31

  
36
  return _do_new_record($delivery_order, 'supplier_delivery_order', %params);
37
}
38

  
39
sub _do_new_record {
40
  my ($delivery_order, $type, %params) = @_;
41

  
42
  $params{display} ||= 'inline';
43

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

  
46
  my $text = join '', (
47
    $params{no_link} ? '' : '<a href="controller.pl?action=DeliveryOrder/edit&amp;type=' . $type . '&amp;id=' . escape($delivery_order->id) . '">',
48
    escape($delivery_order->donumber),
49
    $params{no_link} ? '' : '</a>',
50
  );
51
  is_escaped($text);
52
}
53

  
54
sub _do_record {
55
  my ($delivery_order, $type, %params) = @_;
56

  
57 32
  $params{display} ||= 'inline';
58 33

  
59 34
  croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/;
......
121 96
  my $object = SL::DB::Manager::DeliveryOrder->get_first(where => [ record_type  => PURCHASE_DELIVERY_ORDER_TYPE ]);
122 97
  my $html   = SL::Presenter::DeliveryOrder::purchase_delivery_order($object, display => 'inline');
123 98

  
99
  #...
100

  
101
  # or for all types:
102
  my $html   = SL::Presenter::DeliveryOrder::delivery_order($object);
103
  my $html   = $object->presenter->show();
104

  
124 105
=head1 FUNCTIONS
125 106

  
126 107
=over 4
127 108

  
128
=item C<sales_delivery_order $object, %params>
109
=item C<show $object %params>
129 110

  
130
Returns a rendered version (actually an instance of
131
L<SL::Presenter::EscapedText>) of the sales delivery order object
132
C<$object>.
111
Alias for C<delivery_order $object %params>.
133 112

  
134
Remaining C<%params> are passed to the function
135
C<SL::Presenter::Tag::link_tag>. It can include:
113
=item C<sales_delivery_order $object, %params>
136 114

  
137
=over 2
115
Alias for C<delivery_order $object %params>.
138 116

  
139
=item * display
117
=item C<purchase_delivery_order $object, %params>
140 118

  
141
Either C<inline> (the default) or C<table-cell>. Is passed to the function
142
C<SL::Presenter::Tag::link_tag>.
119
Alias for C<delivery_order $object %params>.
143 120

  
144
=item * no_link
121
=item C<rma_delivery_order $object, %params>
145 122

  
146
If falsish (the default) then the delivery order number will be linked
147
to the "edit delivery order" dialog from the sales menu.
123
Alias for C<delivery_order $object %params>.
148 124

  
149
=back
125
=item C<supplier_delivery_order $object, %params>
150 126

  
151
=item C<purchase_delivery_order $object, %params>
127
Alias for C<delivery_order $object %params>.
128

  
129
=item C<delivery_order $object, %params>
152 130

  
153 131
Returns a rendered version (actually an instance of
154
L<SL::Presenter::EscapedText>) of the purchase delivery order object
132
L<SL::Presenter::EscapedText>) of the sales delivery order object
155 133
C<$object>.
156 134

  
157 135
Remaining C<%params> are passed to the function
158
C<SL::Presenter::Tag::link_tag>. It can include:
136
L<SL::Presenter::Tag/link_tag>. It can include:
159 137

  
160 138
=over 2
161 139

  
......
167 145
=item * no_link
168 146

  
169 147
If falsish (the default) then the delivery order number will be linked
170
to the "edit delivery order" dialog from the purchase menu.
148
to the "edit delivery order" dialog from the sales menu.
171 149

  
172 150
=back
173 151

  
SL/Presenter/Dunning.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(dunning);
9
our @EXPORT_OK = qw(show dunning);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &dunning};
14

  
13 15
sub dunning {
14 16
  my ($dunning, %params) = @_;
15 17

  
......
19 21

  
20 22
  my $text = escape($dunning->dunning_config->dunning_description);
21 23
  if (! delete $params{no_link}) {
22
    my @flags;
24
    my @flags = ();
23 25
    push @flags, 'showold=1';
24 26
    push @flags, 'l_mails=1'      if $::instance_conf->get_email_journal;
25 27
    push @flags, 'l_webdav=1'     if $::instance_conf->get_webdav;
......
34 36
}
35 37

  
36 38
1;
39

  
40
__END__
41

  
42
=pod
43

  
44
=encoding utf8
45

  
46
=head1 NAME
47

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

  
50
=head1 SYNOPSIS
51

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

  
57
=head1 FUNCTIONS
58

  
59
=over 4
60

  
61
=item C<show $object>
62

  
63
Alias for C<dunning $object %params>.
64

  
65
=item C<dunning $object %params>
66

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

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

  
74
=over 2
75

  
76
=item * no_link
77

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

  
80
=back
81

  
82
=back
83

  
84
=head1 BUGS
85

  
86
Nothing here yet.
87

  
88
=head1 AUTHOR
89

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

  
92
=cut
SL/Presenter/EmailJournal.pm
9 9
use SL::DB::EmailJournalAttachment;
10 10

  
11 11
use Exporter qw(import);
12
our @EXPORT_OK = qw(email_journal entry_status attachment_preview);
12
our @EXPORT_OK = qw(show email_journal entry_status attachment_preview);
13 13

  
14 14
use Carp;
15 15

  
16
sub show {goto &email_journal};
17

  
16 18
sub email_journal {
17 19
  my ($email_journal_entry, %params) = @_;
18 20

  
......
91 93

  
92 94
  my $journal_entry = SL::DB::Manager::EmailJournal->get_first();
93 95
  my $html   = SL::Presenter::EmailJournal::email_journal($journal_entry, display => 'inline');
96
  # or
97
  my $html   = $journal_entry->presenter->show();
94 98

  
95 99
  # pp $html
96 100
  # <a href="controller.pl?action=EmailJournal/show&amp;id=1">IDEV Daten fuer webdav/idev/2017-KW-26.csv erzeugt</a>
......
99 103

  
100 104
=over 4
101 105

  
106
=item C<show $object %params>
107

  
108
Alias for C<email_journal $object %params>.
109

  
102 110
=item C<email_journal $object, %params>
103 111

  
104 112
Returns a rendered version (actually an instance of
SL/Presenter/GL.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(gl_transaction);
9
our @EXPORT_OK = qw(show gl_transaction);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &gl_transaction};
14

  
13 15
sub gl_transaction {
14 16
  my ($gl_transaction, %params) = @_;
15 17

  
......
42 44

  
43 45
  my $object = SL::DB::Manager::GLTransaction->get_first();
44 46
  my $html   = SL::Presenter::GL::gl_transaction($object, display => 'inline');
47
  # or
48
  my $html   = $object->presenter->show();
45 49

  
46 50
=head1 FUNCTIONS
47 51

  
48 52
=over 4
49 53

  
54
=item C<show $object %params>
55

  
56
Alias for C<gl_transaction $object %params>.
57

  
50 58
=item C<gl_transaction $object, %params>
51 59

  
52 60
Returns a rendered version (actually an instance of
SL/Presenter/Invoice.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(invoice sales_invoice ar_transaction purchase_invoice ap_transaction);
9
our @EXPORT_OK = qw(show invoice sales_invoice ar_transaction purchase_invoice ap_transaction);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &invoice};
14

  
13 15
sub invoice {
14 16
  my ($invoice, %params) = @_;
15 17

  
......
102 104

  
103 105
  # use with any of the above ar/ap/is/ir types:
104 106
  my $html   = SL::Presenter::Invoice::invoice($object, display => 'inline');
107
  my $html   = $object->presenter->show();
105 108

  
106 109
=head1 FUNCTIONS
107 110

  
108 111
=over 4
109 112

  
113
=item C<show $object>
114

  
115
Alias for C<invoice $object %params>.
116

  
110 117
=item C<invoice $object, %params>
111 118

  
112 119
Returns a rendered version (actually an instance of
SL/Presenter/Letter.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(letter);
9
our @EXPORT_OK = qw(show letter);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &letter};
14

  
13 15
sub letter {
14 16
  my ($letter, %params) = @_;
15 17

  
......
43 45

  
44 46
  my $letter = SL::DB::Manager::Letter->get_first(where => [ … ]);
45 47
  my $html   = SL::Presenter::Letter::letter($letter, display => 'inline');
48
  # or
49
  my $html   = $letter->presenter->show();
46 50

  
47 51
=head1 FUNCTIONS
48 52

  
49 53
=over 4
50 54

  
55
=item C<show $object>
56

  
57
Alias for C<letter $object %params>.
58

  
51 59
=item C<letter $object, %params>
52 60

  
53 61
Returns a rendered version (actually an instance of
SL/Presenter/Order.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(sales_quotation sales_order request_quotation purchase_order purchase_order_confirmation);
9
our @EXPORT_OK = qw(show order sales_quotation sales_order_intake sales_order request_quotation purchase_quotation_intake purchase_order purchase_order_confirmation);
10 10

  
11 11
use Carp;
12 12

  
13
sub sales_quotation {
14
  my ($order, %params) = @_;
15

  
16
  return _oe_record($order, 'sales_quotation', %params);
17
}
18

  
19
sub sales_order_intake {
20
  my ($order, %params) = @_;
21

  
22
  return _oe_record($order, 'sales_order_intake', %params);
23
}
24

  
25
sub sales_order {
26
  my ($order, %params) = @_;
13
sub show {goto &order}
27 14

  
28
  return _oe_record($order, 'sales_order', %params);
29
}
15
sub sales_quotation {goto &order}
30 16

  
31
sub request_quotation {
32
  my ($order, %params) = @_;
17
sub sales_order_intake {goto &order}
33 18

  
34
  return _oe_record($order, 'request_quotation', %params);
35
}
19
sub sales_order {goto &order}
36 20

  
37
sub purchase_quotation_intake {
38
  my ($order, %params) = @_;
21
sub request_quotation {goto &order}
39 22

  
40
  return _oe_record($order, 'purchase_quotation_intake', %params);
41
}
23
sub purchase_quotation_intake {goto &order}
42 24

  
43
sub purchase_order {
44
  my ($order, %params) = @_;
25
sub purchase_order {goto &order}
45 26

  
46
  return _oe_record($order, 'purchase_order', %params);
47
}
27
sub purchase_order_confirmation {goto &order}
48 28

  
49
sub purchase_order_confirmation {
29
sub order {
50 30
  my ($order, %params) = @_;
51

  
52
  return _oe_record($order, 'purchase_order_confirmation', %params);
53
}
54

  
55
sub _oe_record {
56
  my ($order, $type, %params) = @_;
31
  my $type = $order->record_type;
57 32

  
58 33
  $params{display} ||= 'inline';
59 34

  
......
107 82
  my $object = SL::DB::Manager::Order->get_first(where => [ SL::DB::Manager::Order->type_filter('purchase_order') ]);
108 83
  my $html   = SL::Presenter::Order::purchase_order($object, display => 'inline');
109 84

  
85
  # or for all types:
86
  my $html   = SL::Presenter::Order::order($object);
87
  my $html   = $object->presenter->show();
88

  
110 89
=head1 FUNCTIONS
111 90

  
112 91
=over 4
113 92

  
114
=item C<sales_quotation $object, %params>
93
=item C<show $object %params>
115 94

  
116
Returns a rendered version (actually an instance of
117
L<SL::Presenter::EscapedText>) of the sales quotation object
118
C<$object>.
95
Alias for C<order $object %params>.
119 96

  
120
Remaining C<%params> are passed to the function
121
C<SL::Presenter::Tag::link_tag>. It can include:
97
=item C<sales_quotation $object %params>
122 98

  
123
=over 2
99
Alias for C<order $object %params>.
124 100

  
125
=item * display
101
=item C<sales_order_intake $object %params>
126 102

  
127
Either C<inline> (the default) or C<table-cell>. Is passed to the function
128
C<SL::Presenter::Tag::link_tag>.
103
Alias for C<order $object %params>.
129 104

  
130
=item * no_link
105
=item C<sales_order $object %params>
131 106

  
132
If falsish (the default) then the order number will be linked to the
133
"edit quotation" dialog from the sales menu.
107
Alias for C<order $object %params>.
134 108

  
135
=back
109
=item C<request_quotation $object %params>
136 110

  
137
=item C<sales_order $object, %params>
111
Alias for C<order $object %params>.
138 112

  
139
Returns a rendered version (actually an instance of
140
L<SL::Presenter::EscapedText>) of the sales order object C<$object>.
113
=item C<purchase_quotation_intake $object %params>
141 114

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

  
145
=over 2
146

  
147
=item * display
148

  
149
Either C<inline> (the default) or C<table-cell>. Is passed to the function
150
C<SL::Presenter::Tag::link_tag>.
115
Alias for C<order $object %params>.
151 116

  
152
=item * no_link
153

  
154
If falsish (the default) then the  order number will be linked
155
to the "edit order" dialog from the sales menu.
156

  
157
=back
158

  
159
=item C<request_quotation $object, %params>
117
=item C<purchase_order $object %params>
160 118

  
161
Returns a rendered version (actually an instance of
162
L<SL::Presenter::EscapedText>) of the request for quotation object
163
C<$object>.
164

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

  
168
=over 2
169

  
170
=item * display
171

  
172
Either C<inline> (the default) or C<table-cell>. Is passed to the function
173
C<SL::Presenter::Tag::link_tag>.
174

  
175
=item * no_link
176

  
177
If falsish (the default) then the order number will be linked to the
178
"edit request for quotation" dialog from the purchase menu.
179

  
180
=back
119
Alias for C<order $object %params>.
181 120

  
182
=item C<purchase_order $object, %params>
121
=item C<order $object %params>
183 122

  
184 123
Returns a rendered version (actually an instance of
185 124
L<SL::Presenter::EscapedText>) of the purchase order object
......
198 137
=item * no_link
199 138

  
200 139
If falsish (the default) then the  order number will be linked
201
to the "edit order" dialog from the purchase menu.
140
to the "edit order" dialog.
202 141

  
203 142
=back
204 143

  
SL/Presenter/Reclamation.pm
3 3
use strict;
4 4

  
5 5
use SL::Presenter::EscapedText qw(escape is_escaped);
6
use SL::Presenter::Tag qw(html_tag);
6
use SL::Presenter::Tag qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(sales_reclamation purchase_reclamation);
9
our @EXPORT_OK = qw(show sales_reclamation purchase_reclamation);
10 10

  
11 11
use Carp;
12 12

  
13
sub sales_reclamation {
14
  my ($reclamation, %params) = @_;
13
sub show {goto &reclamation};
15 14

  
16
  return _reclamation_record($reclamation, 'sales_reclamation', %params);
17
}
15
sub sales_reclamation {goto &reclamation}
16
sub purchase_reclamation {goto &reclamation}
18 17

  
19
sub purchase_reclamation {
18
sub reclamation {
20 19
  my ($reclamation, %params) = @_;
21 20

  
22
  return _reclamation_record($reclamation, 'purchase_reclamation', %params);
23
}
24

  
25
sub _reclamation_record {
26
  my ($reclamation, $type, %params) = @_;
27

  
28 21
  $params{display} ||= 'inline';
29 22

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

  
32 23
  my $text = escape($reclamation->record_number);
33 24
  unless ($params{no_link}) {
34
    my $id = $reclamation->id;
35
    $text =  html_tag('a', $text, href => escape("controller.pl?action=Reclamation/edit&type=${type}&id=${id}"));
25
    my $href = 'controller.pl?action=Reclamation/edit&id=' . escape($reclamation->id);
26
    $text =  link_tag($href, $text, %params);
36 27
  }
37 28

  
38 29
  is_escaped($text);
......
57 48
  my $object = SL::DB::Manager::Reclamation->get_first(
58 49
    where => [ SL::DB::Manager::Reclamation->type_filter('sales_reclamation') ]
59 50
  );
60
  my $html   = SL::Presenter::Reclamation::sales_reclamation(
61
    $object, display => 'inline'
62
  );
51
  my $html   = SL::Presenter::Reclamation::sales_reclamation($object);
63 52

  
64 53
  # Purchase reclamations:
65 54
  my $object = SL::DB::Manager::Reclamation->get_first(
66 55
    where => [ SL::DB::Manager::Reclamation->type_filter('purchase_reclamation') ]
67 56
  );
68
  my $html   = SL::Presenter::Reclamation::purchase_reclamation(
57
  my $html   = SL::Presenter::Reclamation::purchase_reclamation($object);
58

  
59
  # or for all types:
60
  my $html   = SL::Presenter::Reclamation::reclamation(
69 61
    $object, display => 'inline'
70 62
  );
63
  my $html   = $object->presenter->show();
71 64

  
72 65
=head1 FUNCTIONS
73 66

  
74 67
=over 4
75 68

  
76
=item C<sales_reclamation $object, %params>
69
=item C<show $object %params>
77 70

  
78
Returns a rendered version (actually an instance of
79
L<SL::Presenter::EscapedText>) of the sales reclamation object C<$object>.
80

  
81
C<%params> can include:
71
Alias for C<reclamation $object %params>.
82 72

  
83
=over 2
84

  
85
=item * display
73
=item C<sales_reclamation $object, %params>
86 74

  
87
Either C<inline> (the default) or C<table-cell>. At the moment both
88
representations are identical and produce the objects's
89
reclamation number linked to the corresponding 'edit' action.
75
Alias for C<reclamation $object %params>.
90 76

  
91
=item * no_link
77
=item C<purchase_reclamation $object, %params>
92 78

  
93
If falsish (the default) then the  reclamation number will be linked to the
94
"edit reclamation" dialog from the sales menu.
79
Alias for C<reclamation $object %params>.
95 80

  
96
=back
97

  
98
=item C<purchase_reclamation $object, %params>
81
=item C<reclamation $object %params>
99 82

  
100 83
Returns a rendered version (actually an instance of
101
L<SL::Presenter::EscapedText>) of the purchase reclamation object C<$object>.
84
L<SL::Presenter::EscapedText>) of the sales reclamation object C<$object>.
102 85

  
103 86
C<%params> can include:
104 87

  
105 88
=over 2
106 89

  
107
=item * display
108

  
109
Either C<inline> (the default) or C<table-cell>. At the moment both
110
representations are identical and produce the objects's reclamation number
111
linked to the corresponding 'edit' action.
112

  
113 90
=item * no_link
114 91

  
115 92
If falsish (the default) then the  reclamation number will be linked to the
116
"edit reclamation" dialog from the purchase menu.
93
"edit reclamation" dialog.
117 94

  
118 95
=back
119 96

  
97
When C<$params{no_link}> is falsish, other C<%params> get passed to
98
L<SL::Presenter::Tag/link_tag> .
99

  
120 100
=back
121 101

  
122 102
=head1 BUGS
SL/Presenter/RequirementSpec.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(requirement_spec);
9
our @EXPORT_OK = qw(show requirement_spec);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &requirement_spec};
14

  
13 15
sub requirement_spec {
14 16
  my ($requirement_spec, %params) = @_;
15 17

  
......
28 30
}
29 31

  
30 32
1;
33

  
34
__END__
35

  
36
=pod
37

  
38
=encoding utf8
39

  
40
=head1 NAME
41

  
42
SL::Presenter::RequirementSpec - Presenter module for SL::DB::RequirementSpec objects
43

  
44
=head1 SYNOPSIS
45

  
46
  my $object = SL::DB::Manager::RequirementSpec->get_first();
47
  my $html   = SL::Presenter::RequirementSpec::requirement_spec($object);
48
  # or
49
  my $html   = $object->presenter->show();
50

  
51
=head1 FUNCTIONS
52

  
53
=over 4
54

  
55
=item C<show $object>
56

  
57
Alias for C<requirement_spec $object %params>.
58

  
59
=item C<requirement_spec $object %params>
60

  
61
Returns a rendered version (actually an instance of
62
L<SL::Presenter::EscapedText>) of the bank transaction object
63
C<$object>. C<%params> gets passed to L<SL::Presenter::Tag/link_tag>.
64

  
65
=back
66

  
67
=head1 BUGS
68

  
69
Nothing here yet.
70

  
71
=head1 AUTHOR
72

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

  
75
=cut
SL/Presenter/ShopOrder.pm
6 6
use SL::Presenter::Tag         qw(link_tag);
7 7

  
8 8
use Exporter qw(import);
9
our @EXPORT_OK = qw(shop_order);
9
our @EXPORT_OK = qw(show shop_order);
10 10

  
11 11
use Carp;
12 12

  
13
sub show {goto &shop_order};
14

  
13 15
sub shop_order {
14
  my ($shop_order, $type, %params) = @_;
16
  my ($shop_order, %params) = @_;
15 17

  
16 18
  $params{display} ||= 'inline';
17 19

  
......
26 28

  
27 29
  is_escaped($text);
28 30
}
31

  
29 32
1;
33

  
34
__END__
35

  
36
=pod
37

  
38
=encoding utf8
39

  
40
=head1 NAME
41

  
42
SL::Presenter::ShopOrder - Presenter module for SL::DB::ShopOrder objects
43

  
44
=head1 SYNOPSIS
45

  
46
  my $object = SL::DB::Manager::ShopOrder->get_first();
47
  my $html   = SL::Presenter::ShopOrder::shop_order($object);
48
  # or
49
  my $html   = $object->presenter->show();
50

  
51
=head1 FUNCTIONS
52

  
53
=over 4
54

  
55
=item C<show $object>
56

  
57
Alias for C<shop_order $object %params>.
58

  
59
=item C<shop_order $object %params>
60

  
61
Returns a rendered version (actually an instance of
62
L<SL::Presenter::EscapedText>) of the shop order object
63
C<$object>.
64

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

  
68
=over 2
69

  
70
=item * no_link
71

  
72
If falsish (the default) then the shop order will be linked to the "show" dialog.
73

  
74
=back
75

  
76
C<%params> gets passed to L<SL::Presenter::Tag/link_tag>.
77

  
78
=back
79

  
80
=head1 BUGS
81

  
82
Nothing here yet.
83

  
84
=head1 AUTHOR
85

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

  
88
=cut

Auch abrufbar als: Unified diff