Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0c0e2ee2

Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt

  • ID 0c0e2ee2fe0e7893532a1346bbc979eea0dfa03d
  • Vorgänger 822fc676
  • Nachfolger 5427e094

Gültigkeitstoken: Dialogbuchung

Unterschiede anzeigen:

SL/DB/ValidityToken.pm
use constant SCOPE_DELIVERY_ORDER_SAVE => 'DeliveryOrder::Save';
use constant SCOPE_ORDER_SAVE => 'Order::Save';
use constant SCOPE_RECLAMATION_SAVE => 'Reclamation::Save';
use constant SCOPE_GL_TRANSACTION_POST => 'GLTransaction::Post';
sub create {
my ($class, %params) = @_;
bin/mozilla/gl.pl
use SL::DB::ReconciliationLink;
use SL::DB::BankTransactionAccTrans;
use SL::DB::Tax;
use SL::DB::ValidityToken;
use SL::FU;
use SL::GL;
use SL::Helper::Flash qw(flash flash_later);
......
flash('info', $::locale->text("The record template '#1' has been loaded.", $template->template_name));
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_GL_TRANSACTION_POST())->token;
update(
keep_rows_without_amount => 1,
dont_add_new_row => 1,
......
$form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details};
if (!$form->{form_validity_token}) {
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_GL_TRANSACTION_POST())->token;
}
&display_form(1);
$main::lxdebug->leave_sub();
......
sub show_draft {
$::form->{transdate} = DateTime->today_local->to_kivitendo if !$::form->{transdate};
$::form->{gldate} = $::form->{transdate} if !$::form->{gldate};
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_GL_TRANSACTION_POST())->token;
update();
}
......
my $form = $main::form;
my $locale = $main::locale;
my $validity_token;
if (!$form->{id}) {
$validity_token = SL::DB::Manager::ValidityToken->fetch_valid_token(
scope => SL::DB::ValidityToken::SCOPE_GL_TRANSACTION_POST(),
token => $form->{form_validity_token},
);
$form->error($::locale->text('The form is not valid anymore.')) if !$validity_token;
}
if ($::myconfig{mandatory_departments} && !$form->{department_id}) {
$form->error($locale->text('You have to specify a department.'));
}
......
$form->{storno} = 0;
post_transaction();
# If we get here, the transaction is posted.
$validity_token->delete if $validity_token;
delete $form->{form_validity_token};
if ($::instance_conf->get_webdav) {
SL::Webdav->new(type => 'general_ledger',
number => $form->{id},
templates/design40_webpages/gl/form_header.html
[% L.hidden_tag(name, $name) %]
[% END %]
[% IF !id %]
[% L.hidden_tag('form_validity_token', form_validity_token) %]
[% END %]
<input type=hidden name=title value="[% hide_title | html %]">
<input type="hidden" name="follow_up_trans_id_1" value="[% id | html %]">
templates/webpages/gl/form_header.html
[% L.hidden_tag(name, $name) %]
[%- END %]
[% IF !id %]
[% L.hidden_tag('form_validity_token', form_validity_token) %]
[% END %]
<input type=hidden name=title value="[% hide_title | html %]">
<input type="hidden" name="follow_up_trans_id_1" value="[% id | html %]">

Auch abrufbar als: Unified diff