Revision a03e4841
Von Bernd Bleßmann vor etwa 2 Jahren hinzugefügt
SL/DB/ValidityToken.pm | ||
---|---|---|
|
||
__PACKAGE__->meta->initialize;
|
||
|
||
use constant SCOPE_SALES_INVOICE_POST => 'SalesInvoice::Post';
|
||
use constant SCOPE_SALES_INVOICE_POST => 'SalesInvoice::Post';
|
||
use constant SCOPE_DELIVERY_ORDER_SAVE => 'DeliveryOrder::Save';
|
||
|
||
sub create {
|
||
my ($class, %params) = @_;
|
bin/mozilla/do.pl | ||
---|---|---|
$form->{show_details} = $::myconfig{show_form_details};
|
||
$form->{callback} = build_std_url('action=add', 'type', 'vc') unless ($form->{callback});
|
||
|
||
if (!$form->{form_validity_token}) {
|
||
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_DELIVERY_ORDER_SAVE())->token;
|
||
}
|
||
|
||
order_links(is_new => 1);
|
||
prepare_order();
|
||
display_form();
|
||
... | ... | |
|
||
$form->mtime_ischanged('delivery_orders');
|
||
|
||
my $validity_token;
|
||
if (!$form->{id}) {
|
||
$validity_token = SL::DB::Manager::ValidityToken->fetch_valid_token(
|
||
scope => SL::DB::ValidityToken::SCOPE_DELIVERY_ORDER_SAVE(),
|
||
token => $form->{form_validity_token},
|
||
);
|
||
|
||
$form->error($::locale->text('The form is not valid anymore.')) if !$validity_token;
|
||
}
|
||
|
||
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
|
||
|
||
$form->isblank("transdate", $locale->text('Delivery Order Date missing!'));
|
||
... | ... | |
}
|
||
}
|
||
DO->save();
|
||
|
||
$validity_token->delete if $validity_token;
|
||
delete $form->{form_validity_token};
|
||
|
||
# saving the history
|
||
if(!exists $form->{addition}) {
|
||
$form->{snumbers} = qq|donumber_| . $form->{donumber};
|
bin/mozilla/oe.pl | ||
---|---|---|
$form->{type} = 'purchase_delivery_order';
|
||
}
|
||
|
||
$form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_DELIVERY_ORDER_SAVE())->token;
|
||
|
||
$form->get_employee();
|
||
|
||
require "bin/mozilla/do.pl";
|
templates/design40_webpages/do/form_header.html | ||
---|---|---|
<input type="hidden" name="lastmtime" id="lastmtime" value="[% HTML.escape(lastmtime) %]">
|
||
<input type="hidden" name="tax_point" id="tax_point" value="[% HTML.escape(tax_point) %]">
|
||
|
||
|
||
[% IF !id %]
|
||
[% L.hidden_tag('form_validity_token', form_validity_token) %]
|
||
[% END %]
|
||
|
||
<table class="tbl-horizontal col">
|
||
<caption>[% 'Customer & Order Information' | $T8 %]</caption>
|
templates/webpages/do/form_header.html | ||
---|---|---|
<input type="hidden" name="lastmtime" id="lastmtime" value="[% HTML.escape(lastmtime) %]">
|
||
<input type="hidden" name="tax_point" id="tax_point" value="[% HTML.escape(tax_point) %]">
|
||
|
||
[% IF !id %]
|
||
[% L.hidden_tag('form_validity_token', form_validity_token) %]
|
||
[% END %]
|
||
|
||
<p>
|
||
<table width="100%">
|
||
<tr valign="top">
|
Auch abrufbar als: Unified diff
Gültigkeitstoken Lieferscheine (alter Controller)