Revision cec7cc39
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Presenter/Part.pm | ||
---|---|---|
12 | 12 |
our @EXPORT_OK = qw( |
13 | 13 |
part_picker part select_classification classification_abbreviation |
14 | 14 |
type_abbreviation separate_abbreviation typeclass_abbreviation |
15 |
vendor_price_dropdown |
|
15 | 16 |
); |
16 | 17 |
our %EXPORT_TAGS = (ALL => \@EXPORT_OK); |
17 | 18 |
|
... | ... | |
133 | 134 |
select_tag( $name, $collection, %attributes ); |
134 | 135 |
} |
135 | 136 |
|
137 |
sub vendor_price_dropdown { |
|
138 |
my ($name, $part, %attributes) = @_; |
|
139 |
|
|
140 |
$attributes{value_key} = 'id'; |
|
141 |
$attributes{title_key} = 'text'; |
|
142 |
|
|
143 |
my @vendor_price_list = map {{ |
|
144 |
id => $_->vendor->id, |
|
145 |
text => $_->vendor->vendornumber . "--" .$_->vendor->name |
|
146 |
. " (" |
|
147 |
. $::form->format_amount(\%::myconfig, $_->lastcost, 2) |
|
148 |
. ")", |
|
149 |
}} |
|
150 |
@{$part->makemodels}; |
|
151 |
|
|
152 |
select_tag( $name, \@vendor_price_list, %attributes ); |
|
153 |
} |
|
154 |
|
|
136 | 155 |
1; |
137 | 156 |
|
138 | 157 |
__END__ |
... | ... | |
219 | 238 |
|
220 | 239 |
=over 2 |
221 | 240 |
|
241 |
=item C<vendor_price_dropdown $name, $part, %params> |
|
242 |
|
|
243 |
Returns an HTML select tag with all available vendors with the best price |
|
244 |
for the given part. The value of the select tag is the vendor id. |
|
245 |
|
|
246 |
C<%params> can include: |
|
247 |
|
|
248 |
=over 4 |
|
249 |
|
|
250 |
=item * default |
|
251 |
|
|
252 |
The id of the selected vendor. |
|
253 |
|
|
254 |
=back |
|
255 |
|
|
256 |
=back |
|
257 |
|
|
258 |
=over 2 |
|
259 |
|
|
222 | 260 |
=item C<part_picker $name, $value, %params> |
223 | 261 |
|
224 | 262 |
All-in-one picker widget for parts. The name will be both id and name |
Auch abrufbar als: Unified diff
Presenter: Part: Leferantenauswahl mit Preisen