Revision 07a1d9c6
Von Tamino Steinert vor 4 Monaten hinzugefügt
SL/Controller/Part.pm | ||
---|---|---|
133 | 133 |
my ($self) = @_; |
134 | 134 |
|
135 | 135 |
$self->save_with_render_error() or return; |
136 |
flash_later('info', t8('The item has been saved.')); |
|
137 | 136 |
$self->js_reset_part_after_save(); |
137 |
$self->js->flash('info', t8('The item has been saved.')); |
|
138 | 138 |
|
139 | 139 |
my $formname = $::form->{print_options}->{formname}; |
140 | 140 |
my $language = $::form->{print_options}->{language}; |
... | ... | |
183 | 183 |
file_name => $result{file_name}, |
184 | 184 |
); |
185 | 185 |
|
186 |
flash_later('info', t8('The document has been sent to the printer \'#1\'.', $printer->printer_description));
|
|
186 |
$self->js->flash('info', t8('The document has been sent to the printer \'#1\'.', $printer->printer_description));
|
|
187 | 187 |
unlink $result{file_name} if $result{file_name}; |
188 | 188 |
} else { |
189 | 189 |
die t8('Media \'#1\' is not supported yet/anymore.', $media); |
... | ... | |
192 | 192 |
1; |
193 | 193 |
} or do { |
194 | 194 |
unlink $result{file_name} if $result{file_name}; |
195 |
flash_later('error', t8("Creating the PDF failed!")); |
|
196 |
flash_later('error', $@); |
|
195 |
$self->js |
|
196 |
->flash('error', t8("Creating the PDF failed!")) |
|
197 |
->flash('error', $@); |
|
197 | 198 |
}; |
198 | 199 |
|
199 |
my $redirect_url = $self->url_for( |
|
200 |
'action' => 'edit', |
|
201 |
'part.id' => $self->part->id, |
|
202 |
); |
|
203 |
$self->js->redirect_to($redirect_url)->render; |
|
200 |
$self->js->render(); |
|
204 | 201 |
} |
205 | 202 |
|
206 | 203 |
sub action_save_and_purchase_order { |
... | ... | |
1239 | 1236 |
return [t8('The document has been changed by another user. Please reopen it in another window and copy the changes to the new window')]; |
1240 | 1237 |
} |
1241 | 1238 |
|
1242 |
if ( $is_new |
|
1243 |
&& $::form->{part}{partnumber} |
|
1244 |
&& SL::DB::Manager::Part->find_by(partnumber => $::form->{part}{partnumber}) |
|
1245 |
) { |
|
1246 |
return $self->js->error(t8('The partnumber is already being used'))->render; |
|
1247 |
} |
|
1248 |
|
|
1249 | 1239 |
$self->parse_form; |
1250 | 1240 |
|
1251 | 1241 |
@errors = $self->part->validate; |
... | ... | |
1870 | 1860 |
call => [ 'kivi.Part.show_print_options' ], |
1871 | 1861 |
disabled => !$may_edit ? t8('You do not have the permissions to access this function.') : undef, |
1872 | 1862 |
checks => [ 'kivi.validate_form' ], |
1863 |
only_if => !$::form->{inline_create}, |
|
1873 | 1864 |
], |
1874 | 1865 |
action => [ |
1875 | 1866 |
$self->part->is_assembly ? t8('Assembly items') : t8('Assortment items'), |
Auch abrufbar als: Unified diff
S:C:Part: Flash-Logik von Artikeldruck überarbeitet