Revision ee51b82f
Von Tamino Steinert vor etwa 2 Jahren hinzugefügt
SL/Presenter/Invoice.pm | ||
---|---|---|
3 | 3 |
use strict; |
4 | 4 |
|
5 | 5 |
use SL::Presenter::EscapedText qw(escape is_escaped); |
6 |
use SL::Presenter::Tag qw(link_tag); |
|
6 | 7 |
|
7 | 8 |
use Exporter qw(import); |
8 | 9 |
our @EXPORT_OK = qw(invoice sales_invoice ar_transaction purchase_invoice ap_transaction); |
... | ... | |
58 | 59 |
|
59 | 60 |
croak "Unknown display type '$params{display}'" unless $params{display} =~ m/^(?:inline|table-cell)$/; |
60 | 61 |
|
61 |
my $text = join '', ( |
|
62 |
$params{no_link} ? '' : '<a href="' . $controller . '.pl?action=edit&type=invoice&id=' . escape($invoice->id) . '">', |
|
63 |
escape($invoice->invnumber), |
|
64 |
$params{no_link} ? '' : '</a>', |
|
65 |
); |
|
62 |
my $text = escape($invoice->invnumber); |
|
63 |
if (! delete $params{no_link}) { |
|
64 |
my $href = $controller . '.pl?action=edit&type=invoice' |
|
65 |
. '&id=' . escape($invoice->id); |
|
66 |
$text = link_tag($href, $text, %params); |
|
67 |
} |
|
66 | 68 |
|
67 | 69 |
is_escaped($text); |
68 | 70 |
} |
... | ... | |
111 | 113 |
L<SL::Presenter::EscapedText>) of an ar/ap/is/ir object C<$object> . Determines |
112 | 114 |
which type (sales or purchase, invoice or not) the object is. |
113 | 115 |
|
114 |
C<%params> can include: |
|
116 |
Remaining C<%params> are passed to the function |
|
117 |
C<SL::Presenter::Tag::link_tag>. It can include: |
|
115 | 118 |
|
116 | 119 |
=over 2 |
117 | 120 |
|
118 | 121 |
=item * display |
119 | 122 |
|
120 |
Either C<inline> (the default) or C<table-cell>. At the moment both |
|
121 |
representations are identical and produce the invoice number linked |
|
122 |
to the corresponding 'edit' action. |
|
123 |
Either C<inline> (the default) or C<table-cell>. Is passed to the function |
|
124 |
C<SL::Presenter::Tag::link_tag>. |
|
123 | 125 |
|
124 | 126 |
=item * no_link |
125 | 127 |
|
... | ... | |
134 | 136 |
L<SL::Presenter::EscapedText>) of the sales invoice object C<$object> |
135 | 137 |
. |
136 | 138 |
|
137 |
C<%params> can include: |
|
139 |
Remaining C<%params> are passed to the function |
|
140 |
C<SL::Presenter::Tag::link_tag>. It can include: |
|
138 | 141 |
|
139 | 142 |
=over 2 |
140 | 143 |
|
141 | 144 |
=item * display |
142 | 145 |
|
143 |
Either C<inline> (the default) or C<table-cell>. At the moment both |
|
144 |
representations are identical and produce the invoice number linked |
|
145 |
to the corresponding 'edit' action. |
|
146 |
Either C<inline> (the default) or C<table-cell>. Is passed to the function |
|
147 |
C<SL::Presenter::Tag::link_tag>. |
|
146 | 148 |
|
147 | 149 |
=item * no_link |
148 | 150 |
|
... | ... | |
157 | 159 |
L<SL::Presenter::EscapedText>) of the AR transaction object C<$object> |
158 | 160 |
. |
159 | 161 |
|
160 |
C<%params> can include: |
|
162 |
Remaining C<%params> are passed to the function |
|
163 |
C<SL::Presenter::Tag::link_tag>. It can include: |
|
161 | 164 |
|
162 | 165 |
=over 2 |
163 | 166 |
|
164 | 167 |
=item * display |
165 | 168 |
|
166 |
Either C<inline> (the default) or C<table-cell>. At the moment both |
|
167 |
representations are identical and produce the invoice number linked |
|
168 |
to the corresponding 'edit' action. |
|
169 |
Either C<inline> (the default) or C<table-cell>. Is passed to the function |
|
170 |
C<SL::Presenter::Tag::link_tag>. |
|
169 | 171 |
|
170 | 172 |
=item * no_link |
171 | 173 |
|
... | ... | |
180 | 182 |
L<SL::Presenter::EscapedText>) of the purchase invoice object |
181 | 183 |
C<$object>. |
182 | 184 |
|
183 |
C<%params> can include: |
|
185 |
Remaining C<%params> are passed to the function |
|
186 |
C<SL::Presenter::Tag::link_tag>. It can include: |
|
184 | 187 |
|
185 | 188 |
=over 2 |
186 | 189 |
|
187 | 190 |
=item * display |
188 | 191 |
|
189 |
Either C<inline> (the default) or C<table-cell>. At the moment both |
|
190 |
representations are identical and produce the invoice number name |
|
191 |
linked to the corresponding 'edit' action. |
|
192 |
Either C<inline> (the default) or C<table-cell>. Is passed to the function |
|
193 |
C<SL::Presenter::Tag::link_tag>. |
|
192 | 194 |
|
193 | 195 |
=item * no_link |
194 | 196 |
|
... | ... | |
203 | 205 |
L<SL::Presenter::EscapedText>) of the AP transaction object C<$object> |
204 | 206 |
. |
205 | 207 |
|
206 |
C<%params> can include: |
|
208 |
Remaining C<%params> are passed to the function |
|
209 |
C<SL::Presenter::Tag::link_tag>. It can include: |
|
207 | 210 |
|
208 | 211 |
=over 2 |
209 | 212 |
|
210 | 213 |
=item * display |
211 | 214 |
|
212 |
Either C<inline> (the default) or C<table-cell>. At the moment both |
|
213 |
representations are identical and produce the invoice number linked |
|
214 |
to the corresponding 'edit' action. |
|
215 |
Either C<inline> (the default) or C<table-cell>. Is passed to the function |
|
216 |
C<SL::Presenter::Tag::link_tag>. |
|
215 | 217 |
|
216 | 218 |
=item * no_link |
217 | 219 |
|
Auch abrufbar als: Unified diff
Presenter: nutze link_tag anstelle von html im perl-code
(cherry picked aus Kundenprojekt)