Revision b9882bee
Von Moritz Bunkus vor etwa 17 Jahren hinzugefügt
bin/mozilla/am.pl | ||
---|---|---|
339 | 339 |
}; |
340 | 340 |
|
341 | 341 |
# Ausgabe des Templates |
342 |
print($form->parse_html_template('am/edit_accounts', $parameters_ref)); |
|
342 |
print($form->parse_html_template2('am/edit_accounts', $parameters_ref));
|
|
343 | 343 |
|
344 | 344 |
|
345 | 345 |
$lxdebug->leave_sub(); |
... | ... | |
398 | 398 |
sub list_account { |
399 | 399 |
$lxdebug->enter_sub(); |
400 | 400 |
|
401 |
CA->all_accounts(\%myconfig, \%$form); |
|
402 |
|
|
403 |
$form->{title} = $locale->text('Chart of Accounts'); |
|
404 |
|
|
405 |
# construct callback |
|
406 |
$callback = |
|
407 |
"$form->{script}?action=list_account&login=$form->{login}&password=$form->{password}"; |
|
408 |
|
|
401 |
$form->{callback} = build_std_url('action=list_account'); |
|
402 |
my $link_edit_account = build_std_url('action=edit_account', 'callback'); |
|
409 | 403 |
|
410 |
|
|
411 |
# escape callback |
|
412 |
$callback = $form->escape($callback); |
|
404 |
CA->all_accounts(\%myconfig, \%$form); |
|
413 | 405 |
|
414 | 406 |
foreach $ca (@{ $form->{CA} }) { |
415 | 407 |
|
... | ... | |
423 | 415 |
$ca->{debit} = $form->format_amount(\%myconfig, -1 * $ca->{amount}, 2); |
424 | 416 |
} |
425 | 417 |
$ca->{heading} = ( $ca->{charttype} eq 'H' ) ? 1:''; |
426 |
$ca->{link_edit_account} = |
|
427 |
qq|$form->{script}?action=edit_account&id=$ca->{id}| |
|
428 |
.qq|&login=$form->{login}| |
|
429 |
.qq|&password=$form->{password}&callback=$callback|; |
|
418 |
$ca->{link_edit_account} = $link_edit_account . '&id=' . E($ca->{id}); |
|
430 | 419 |
} |
431 | 420 |
|
432 | 421 |
# Ajax |
433 |
my $list_account_details_url = |
|
434 |
"$form->{script}?login=$form->{login}" |
|
435 |
."&password=$form->{password}&action=list_account_details&"; |
|
436 |
|
|
437 |
|
|
438 |
my $pjx = new CGI::Ajax('list_account_details' => $list_account_details_url); |
|
422 |
my $pjx = new CGI::Ajax('list_account_details' => build_std_url('action=list_account_details')); |
|
439 | 423 |
|
440 | 424 |
# Eneable AJAX debuging |
441 | 425 |
#$pjx->DEBUG(1); |
... | ... | |
444 | 428 |
push(@ { $form->{AJAX} }, $pjx); |
445 | 429 |
|
446 | 430 |
$form->{stylesheets} = "list_accounts.css"; |
431 |
$form->{title} = $locale->text('Chart of Accounts'); |
|
447 | 432 |
|
448 | 433 |
$form->header; |
449 | 434 |
|
... | ... | |
461 | 446 |
|
462 | 447 |
|
463 | 448 |
sub list_account_details { |
464 |
# Ajax Funktion aus list_account_details
|
|
449 |
# Ajax Funktion aus list_account_details |
|
465 | 450 |
$lxdebug->enter_sub(); |
466 | 451 |
|
467 | 452 |
my $chart_id = $form->{args}; |
468 |
|
|
469 |
CA->all_accounts(\%myconfig, \%$form, $chart_id); |
|
470 |
|
|
471 |
$form->{title} = $locale->text('Chart of Accounts'); |
|
472 |
|
|
473 |
# construct callback |
|
474 |
$callback = |
|
475 |
"$form->{script}?action=list_account&login=$form->{login}&password=$form->{password}"; |
|
476 | 453 |
|
477 |
$form->header; |
|
478 |
|
|
479 |
# escape callback |
|
480 |
$callback = $form->escape($callback); |
|
454 |
CA->all_accounts(\%myconfig, \%$form, $chart_id); |
|
481 | 455 |
|
482 | 456 |
foreach $ca (@{ $form->{CA} }) { |
483 | 457 |
|
... | ... | |
494 | 468 |
} |
495 | 469 |
|
496 | 470 |
my @links = split( q{:}, $ca->{link}); |
497 |
|
|
471 |
|
|
498 | 472 |
$ca->{link} = q{}; |
499 |
|
|
473 |
|
|
500 | 474 |
foreach my $link (@links){ |
501 |
$link = ( $link eq 'AR') ? $locale->text('Account Link AR') |
|
475 |
$link = ( $link eq 'AR') ? $locale->text('Account Link AR')
|
|
502 | 476 |
: ( $link eq 'AP') ? $locale->text('Account Link AP') |
503 | 477 |
: ( $link eq 'IC') ? $locale->text('Account Link IC') |
504 | 478 |
: ( $link eq 'AR_amount' ) ? $locale->text('Account Link AR_amount') |
... | ... | |
515 | 489 |
: ( $link eq 'IC_taxservice' ) ? $locale->text('Account Link IC_taxservice') |
516 | 490 |
# : ( $link eq 'CT_tax' ) ? $locale->text('Account Link CT_tax') |
517 | 491 |
: $locale->text('Unknown Link') . ': ' . $link; |
518 |
|
|
519 | 492 |
$ca->{link} .= ($link ne '') ? "[$link] ":''; |
520 | 493 |
} |
521 |
|
|
522 |
$ca->{startdate} =~ s/,/<br>/og; |
|
523 |
$ca->{tk_ustva} =~ s/,/<br>/og; |
|
524 |
$ca->{taxkey} =~ s/,/<br>/og; |
|
525 |
$ca->{taxaccount} =~ s/,/<br>/og; |
|
526 |
$ca->{taxdescription} =~ s/,/<br>/og; |
|
527 |
$ca->{datevautomatik} = ($ca->{datevautomatik}) ? $locale->text('On'):$locale->text('Off'); |
|
528 | 494 |
|
529 | 495 |
$ca->{category} = ($ca->{category} eq 'A') ? $locale->text('Account Category A') |
530 | 496 |
: ($ca->{category} eq 'E') ? $locale->text('Account Category E') |
... | ... | |
534 | 500 |
: ($ca->{category} eq 'C') ? $locale->text('Account Category C') |
535 | 501 |
: ($ca->{category} eq 'G') ? $locale->text('Account Category G') |
536 | 502 |
: $locale->text('Unknown Category') . ': ' . $ca->{category}; |
537 |
|
|
538 |
$ca->{link_edit_account} = |
|
539 |
qq|$form->{script}?action=edit_account&id=$ca->{id}| |
|
540 |
.qq|&login=$form->{login}| |
|
541 |
.qq|&password=$form->{password}&callback=$callback|; |
|
542 | 503 |
} |
543 | 504 |
|
505 |
$form->{title} = $locale->text('Chart of Accounts'); |
|
506 |
$form->header(); |
|
544 | 507 |
|
508 |
print $form->parse_html_template2('am/list_account_details'); |
|
545 | 509 |
|
546 |
|
|
547 |
my $parameters_ref = { |
|
548 |
|
|
549 |
|
|
550 |
# hidden_variables => $_hidden_variables_ref, |
|
551 |
}; |
|
552 |
|
|
553 |
# Ausgabe des Templates |
|
554 |
#my $q = CGI->new(); |
|
555 |
my $result = $form->parse_html_template('am/list_account_details', $parameters_ref); |
|
556 |
|
|
557 |
print $result; |
|
558 |
# print "chart_id:$chart_id, form->chartid:$form->{chart_id}, rest=$rest"; |
|
559 |
|
|
560 | 510 |
$lxdebug->leave_sub(); |
561 | 511 |
|
562 | 512 |
} |
... | ... | |
2609 | 2559 |
|
2610 | 2560 |
$form->{"title"} = sprintf($locale->text("Add and edit %s"), $form->{"unit_type"} eq "dimension" ? $locale->text("dimension units") : $locale->text("service units")); |
2611 | 2561 |
$form->header(); |
2612 |
print($form->parse_html_template("am/edit_units", |
|
2613 |
{ "UNITS" => \@unit_list,
|
|
2614 |
"NEW_BASE_UNIT_DDBOX" => $ddbox, |
|
2615 |
"LANGUAGES" => \@languages,
|
|
2616 |
"updownlink" => $updownlink }));
|
|
2562 |
print($form->parse_html_template2("am/edit_units",
|
|
2563 |
{ "UNITS" => \@unit_list,
|
|
2564 |
"NEW_BASE_UNIT_DDBOX" => $ddbox,
|
|
2565 |
"LANGUAGES" => \@languages,
|
|
2566 |
"updownlink" => $updownlink }));
|
|
2617 | 2567 |
|
2618 | 2568 |
$lxdebug->leave_sub(); |
2619 | 2569 |
} |
Auch abrufbar als: Unified diff
Umstellung der Vorlagen in templates/webpages/am von HTML::Template auf Template.