Revision 18407da4
Von Sven Schöling vor etwa 12 Jahren hinzugefügt
bin/mozilla/common.pl | ||
---|---|---|
169 | 169 |
map { $form->{$_} = $options{$_} if ($options{$_}) } qw(no_services no_assemblies assemblies click_button); |
170 | 170 |
|
171 | 171 |
my $parts = Common->retrieve_parts(\%myconfig, $form, $order_by, $order_dir); |
172 |
my $onload; |
|
173 | 172 |
|
174 | 173 |
if (0 == scalar(@{$parts})) { |
175 | 174 |
$form->show_generic_information($locale->text("No part was found matching the search parameters.")); |
176 | 175 |
} elsif (1 == scalar(@{$parts})) { |
177 |
$onload = "part_selected('1')";
|
|
176 |
$::request->{layout}->add_javascripts_inline("part_selected('1')");
|
|
178 | 177 |
} |
179 | 178 |
|
180 | 179 |
map { $parts->[$_]->{selected} = $_ ? 0 : 1; } (0..$#{$parts}); |
... | ... | |
199 | 198 |
$form->{title} = $locale->text("Select a part"); |
200 | 199 |
$form->header(); |
201 | 200 |
print $form->parse_html_template("generic/part_selection", { "HEADER" => \@header, |
202 |
"PARTS" => $parts, |
|
203 |
"onload" => $onload }); |
|
201 |
"PARTS" => $parts, }); |
|
204 | 202 |
|
205 | 203 |
$main::lxdebug->leave_sub(); |
206 | 204 |
} |
... | ... | |
222 | 220 |
my $delivery = Common->retrieve_delivery_customer(\%myconfig, $form, $order_by, $order_dir); |
223 | 221 |
map({ $delivery->[$_]->{"selected"} = $_ ? 0 : 1; } (0..$#{$delivery})); |
224 | 222 |
|
225 |
my $onload; |
|
226 | 223 |
if (0 == scalar(@{$delivery})) { |
227 | 224 |
$form->show_generic_information($locale->text("No Customer was found matching the search parameters.")); |
228 | 225 |
} elsif (1 == scalar(@{$delivery})) { |
229 |
$onload = "customer_selected('1')";
|
|
226 |
$::request->{layout}->add_javascripts_inline("customer_selected('1')");
|
|
230 | 227 |
} |
231 | 228 |
|
232 | 229 |
my $callback = "$form->{script}?action=delivery_customer_selection&"; |
... | ... | |
249 | 246 |
$form->{"title"} = $locale->text("Select a Customer"); |
250 | 247 |
$form->header(); |
251 | 248 |
print $form->parse_html_template("generic/select_delivery_customer", { "HEADER" => \@header, |
252 |
"DELIVERY" => $delivery, |
|
253 |
"onload" => $onload }); |
|
249 |
"DELIVERY" => $delivery, }); |
|
254 | 250 |
|
255 | 251 |
$main::lxdebug->leave_sub(); |
256 | 252 |
} |
... | ... | |
272 | 268 |
my $vendor = Common->retrieve_vendor(\%myconfig, $form, $order_by, $order_dir); |
273 | 269 |
map({ $vendor->[$_]->{"selected"} = $_ ? 0 : 1; } (0..$#{$vendor})); |
274 | 270 |
|
275 |
my $onload; |
|
276 | 271 |
if (0 == scalar(@{$vendor})) { |
277 | 272 |
$form->show_generic_information($locale->text("No Vendor was found matching the search parameters.")); |
278 | 273 |
} elsif (1 == scalar(@{$vendor})) { |
279 |
$onload = "vendor_selected('1')";
|
|
274 |
$::request->{layout}->add_javascripts_inline("vendor_selected('1')");
|
|
280 | 275 |
} |
281 | 276 |
|
282 | 277 |
my $callback = "$form->{script}?action=vendor_selection&"; |
... | ... | |
299 | 294 |
$form->{"title"} = $locale->text("Select a Customer"); |
300 | 295 |
$form->header(); |
301 | 296 |
print $form->parse_html_template("generic/select_vendor", { "HEADER" => \@header, |
302 |
"VENDOR" => $vendor, |
|
303 |
"onload" => $onload }); |
|
297 |
"VENDOR" => $vendor, }); |
|
304 | 298 |
|
305 | 299 |
$main::lxdebug->leave_sub(); |
306 | 300 |
} |
... | ... | |
317 | 311 |
|
318 | 312 |
my ($variable_string, $formel) = split /###/,$form->{formel}; |
319 | 313 |
my @variable; |
320 |
my $onload; # note! this sub is mostly called over a javascript invocation, and it's unlikey that onload is set. |
|
321 | 314 |
|
322 | 315 |
foreach my $item (split m/;/, $variable_string) { |
323 | 316 |
next unless $item =~ m/^ \s* (\w+) \s* = \s* (\w+) \s* (\w+) \s* $/x; |
... | ... | |
343 | 336 |
$form->{title} = $locale->text("Please enter values"); |
344 | 337 |
$form->header(); |
345 | 338 |
print $form->parse_html_template("generic/calculate_qty", { "HEADER" => \@header, |
346 |
"VARIABLES" => \@variable, |
|
347 |
"onload" => $onload }); |
|
339 |
"VARIABLES" => \@variable, }); |
|
348 | 340 |
|
349 | 341 |
$main::lxdebug->leave_sub(); |
350 | 342 |
} |
... | ... | |
549 | 541 |
my $covs = Common->retrieve_customers_or_vendors(\%myconfig, $form, $order_by, $order_dir, $form->{"is_vendor"}, $form->{"allow_both"}); |
550 | 542 |
map({ $covs->[$_]->{"selected"} = $_ ? 0 : 1; } (0..$#{$covs})); |
551 | 543 |
|
552 |
my $onload; |
|
553 | 544 |
if (0 == scalar(@{$covs})) { |
554 | 545 |
$form->show_generic_information(sprintf($locale->text("No %s was found matching the search parameters."), $type)); |
555 | 546 |
} elsif (1 == scalar(@{$covs})) { |
556 |
$onload = "cov_selected('1')";
|
|
547 |
$::request->{layout}->add_javascripts_inline("cov_selected('1')");
|
|
557 | 548 |
} |
558 | 549 |
|
559 | 550 |
my $callback = "$form->{script}?action=cov_selection_internal&"; |
... | ... | |
585 | 576 |
$form->{"title"} = $form->{is_vendor} ? $locale->text("Select a vendor") : $locale->text("Select a customer"); |
586 | 577 |
$form->header(); |
587 | 578 |
print($form->parse_html_template("generic/cov_selection", { "HEADER" => \@header, |
588 |
"COVS" => $covs, |
|
589 |
"onload" => $onload })); |
|
579 |
"COVS" => $covs, })); |
|
590 | 580 |
|
591 | 581 |
$main::lxdebug->leave_sub(); |
592 | 582 |
} |
Auch abrufbar als: Unified diff
onload in dn.pl und common.pl