97 |
97 |
->render();
|
98 |
98 |
}
|
99 |
99 |
|
100 |
|
sub action_ajax_update_file{
|
101 |
|
my ($self, %params) = @_;
|
102 |
|
|
103 |
|
my $attributes = $::form->{ $::form->{form_prefix} } || die "Missing attributes";
|
104 |
|
|
105 |
|
if (!$attributes->{file_content}) {
|
106 |
|
delete $attributes->{file_content};
|
107 |
|
} else {
|
108 |
|
$attributes->{filename} = ((($::form->{ATTACHMENTS} || {})->{ $::form->{form_prefix} } || {})->{file_content} || {})->{filename};
|
109 |
|
}
|
110 |
|
|
111 |
|
my @errors;
|
112 |
|
my @type_error = SL::Controller::FileUploader->validate_filetype($attributes->{filename},$::form->{aft});
|
113 |
|
push @errors,@type_error if @type_error;
|
114 |
|
$self->file->assign_attributes(%{ $attributes });
|
115 |
|
my @file_errors = $self->file->validate if $attributes->{file_content};;
|
116 |
|
push @errors,@file_errors if @file_errors;
|
117 |
|
|
118 |
|
return $self->js->error(@errors)->render($self) if @errors;
|
119 |
|
|
120 |
|
$self->file->file_update_type_and_dimensions if $attributes->{file_content};
|
121 |
|
$self->file->save;
|
122 |
|
|
123 |
|
$self->js
|
124 |
|
->dialog->close('#jqueryui_popup_dialog')
|
125 |
|
->run('kivi.ShopPart.show_images',$self->file->trans_id)
|
126 |
|
->render();
|
127 |
|
}
|
|
100 |
#sub action_ajax_update_file{
|
|
101 |
# my ($self, %params) = @_;
|
|
102 |
|
|
103 |
# my $attributes = $::form->{ $::form->{form_prefix} } || die "Missing attributes";
|
|
104 |
|
|
105 |
# if (!$attributes->{file_content}) {
|
|
106 |
# delete $attributes->{file_content};
|
|
107 |
# } else {
|
|
108 |
# $attributes->{filename} = ((($::form->{ATTACHMENTS} || {})->{ $::form->{form_prefix} } || {})->{file_content} || {})->{filename};
|
|
109 |
# }
|
|
110 |
|
|
111 |
# my @errors;
|
|
112 |
# my @type_error = SL::Controller::FileUploader->validate_filetype($attributes->{filename},$::form->{aft});
|
|
113 |
# push @errors,@type_error if @type_error;
|
|
114 |
# $self->file->assign_attributes(%{ $attributes });
|
|
115 |
# my @file_errors = $self->file->validate if $attributes->{file_content};;
|
|
116 |
# push @errors,@file_errors if @file_errors;
|
|
117 |
|
|
118 |
# return $self->js->error(@errors)->render($self) if @errors;
|
|
119 |
|
|
120 |
# $self->file->file_update_type_and_dimensions if $attributes->{file_content};
|
|
121 |
# $self->file->save;
|
|
122 |
|
|
123 |
# $self->js
|
|
124 |
# ->dialog->close('#jqueryui_popup_dialog')
|
|
125 |
# ->run('kivi.ShopPart.show_images',$self->file->trans_id)
|
|
126 |
# ->render();
|
|
127 |
#}
|
128 |
128 |
|
129 |
129 |
sub action_ajax_delete_file {
|
130 |
130 |
my ( $self ) = @_;
|
Shopmodul: Funktion auskommentiert wird nicht mehr benötigt, Tabelle in ALL eingetragen wg. Testfehler