25 |
25 |
use SL::DB::RecordLink;
|
26 |
26 |
use SL::DB::Shipto;
|
27 |
27 |
use SL::DB::Translation;
|
|
28 |
use SL::DB::ValidityToken;
|
28 |
29 |
|
29 |
30 |
use SL::Helper::CreatePDF qw(:all);
|
30 |
31 |
use SL::Helper::PrintOptions;
|
... | ... | |
96 |
97 |
|
97 |
98 |
$self->pre_render();
|
98 |
99 |
|
|
100 |
if (!$::form->{form_validity_token}) {
|
|
101 |
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_RECLAMATION_SAVE())->token;
|
|
102 |
}
|
|
103 |
|
99 |
104 |
$self->render(
|
100 |
105 |
'reclamation/form',
|
101 |
106 |
title => $self->get_title_for('add'),
|
... | ... | |
119 |
124 |
|
120 |
125 |
$self->reinit_after_new_reclamation();
|
121 |
126 |
|
|
127 |
if (!$::form->{form_validity_token}) {
|
|
128 |
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_RECLAMATION_SAVE())->token;
|
|
129 |
}
|
|
130 |
|
122 |
131 |
$self->render(
|
123 |
132 |
'reclamation/form',
|
124 |
133 |
title => $self->get_title_for('add'),
|
... | ... | |
142 |
151 |
|
143 |
152 |
$self->reinit_after_new_reclamation();
|
144 |
153 |
|
|
154 |
if (!$::form->{form_validity_token}) {
|
|
155 |
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_RECLAMATION_SAVE())->token;
|
|
156 |
}
|
|
157 |
|
145 |
158 |
$self->render(
|
146 |
159 |
'reclamation/form',
|
147 |
160 |
title => $self->get_title_for('add'),
|
... | ... | |
165 |
178 |
|
166 |
179 |
$self->reinit_after_new_reclamation();
|
167 |
180 |
|
|
181 |
if (!$::form->{form_validity_token}) {
|
|
182 |
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_RECLAMATION_SAVE())->token;
|
|
183 |
}
|
|
184 |
|
168 |
185 |
$self->render(
|
169 |
186 |
'reclamation/form',
|
170 |
187 |
title => $self->get_title_for('add'),
|
... | ... | |
189 |
206 |
|
190 |
207 |
$self->reinit_after_new_reclamation();
|
191 |
208 |
|
|
209 |
if (!$::form->{form_validity_token}) {
|
|
210 |
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_RECLAMATION_SAVE())->token;
|
|
211 |
}
|
|
212 |
|
192 |
213 |
$self->render(
|
193 |
214 |
'reclamation/form',
|
194 |
215 |
title => $self->get_title_for('add'),
|
... | ... | |
314 |
335 |
)
|
315 |
336 |
);
|
316 |
337 |
|
|
338 |
if (!$::form->{form_validity_token}) {
|
|
339 |
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_RECLAMATION_SAVE())->token;
|
|
340 |
}
|
|
341 |
|
317 |
342 |
# save
|
318 |
343 |
$self->action_save();
|
319 |
344 |
}
|
... | ... | |
1721 |
1746 |
sub save {
|
1722 |
1747 |
my ($self) = @_;
|
1723 |
1748 |
|
|
1749 |
my $validity_token;
|
|
1750 |
if (!$self->reclamation->id) {
|
|
1751 |
$validity_token = SL::DB::Manager::ValidityToken->fetch_valid_token(
|
|
1752 |
scope => SL::DB::ValidityToken::SCOPE_RECLAMATION_SAVE(),
|
|
1753 |
token => $::form->{form_validity_token},
|
|
1754 |
);
|
|
1755 |
|
|
1756 |
die t8('The form is not valid anymore.') if !$validity_token;
|
|
1757 |
}
|
|
1758 |
|
1724 |
1759 |
my $errors = [];
|
1725 |
1760 |
my $db = $self->reclamation->db;
|
1726 |
1761 |
|
... | ... | |
1739 |
1774 |
|
1740 |
1775 |
$self->save_history('SAVED');
|
1741 |
1776 |
|
|
1777 |
$validity_token->delete if $validity_token;
|
|
1778 |
delete $::form->{form_validity_token};
|
|
1779 |
|
1742 |
1780 |
1;
|
1743 |
1781 |
}) || push(@{$errors}, $db->error);
|
1744 |
1782 |
|
... | ... | |
1784 |
1822 |
|
1785 |
1823 |
$self->reinit_after_new_reclamation();
|
1786 |
1824 |
|
|
1825 |
if (!$::form->{form_validity_token}) {
|
|
1826 |
$::form->{form_validity_token} = SL::DB::ValidityToken->create(scope => SL::DB::ValidityToken::SCOPE_RECLAMATION_SAVE())->token;
|
|
1827 |
}
|
|
1828 |
|
1787 |
1829 |
$self->render(
|
1788 |
1830 |
'reclamation/form',
|
1789 |
1831 |
title => $self->get_title_for('add'),
|
Gültigkeitstoken Reklamationscontroller