X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/711e6c99a7057aa79b306e9cbd789d88d4b022a2..51eca07c805710334a326a2eac6df7ba5bdc8aec:/SL/Controller/CsvImport/Clipboard/RequirementSpecPicture.pm diff --git a/SL/Controller/CsvImport/Clipboard/RequirementSpecPicture.pm b/SL/Controller/CsvImport/Clipboard/RequirementSpecPicture.pm deleted file mode 100644 index 7a3757f82..000000000 --- a/SL/Controller/CsvImport/Clipboard/RequirementSpecPicture.pm +++ /dev/null @@ -1,84 +0,0 @@ -package SL::Clipboard::RequirementSpecPicture; - -use strict; - -use parent qw(SL::Clipboard::Base); - -use SL::Common; -use SL::Locale::String; -use MIME::Base64; - -sub dump { - my ($self, $object) = @_; - - $self->reload_object($object); - - my $tree = $self->as_tree($object, exclude => sub { ref($_[0]) !~ m/::RequirementSpecPicture$/ }); - $tree->{$_} = encode_base64($tree->{$_}, '') for $self->_binary_column_names('SL::DB::RequirementSpecPicture'); - - return $tree; -} - -sub describe { - my ($self) = @_; - - return t8('Requirement spec picture "#1"', $self->content->{description} ? $self->content->{description} . ' (' . $self->content->{picture_file_name} . ')' : $self->content->{picture_file_name}); -} - -sub _fix_object { - my ($self, $object) = @_; - - $object->$_(undef) for qw(number); - $object->$_(decode_base64($object->$_)) for $self->_binary_column_names('SL::DB::RequirementSpecPicture'); - - return $object; -} - -1; -__END__ - -=pod - -=encoding utf8 - -=head1 NAME - -SL::Clipboard::RequirementSpecPicture - Clipboard specialization for -SL::DB::RequirementSpecPicture - -=head1 NOTES - -The underlying RDBO model contains binary columns, but binary data -cannot be dumped as YAML. Therefore the binary content is encoded in -Base64 in L and decoded back to binary form in L. - -=head1 FUNCTIONS - -=over 4 - -=item C - -Returns a human-readable description including the title and an -excerpt of its content. - -=item C - -This specialization reloads C<$object> from the database, and dumps -it. Binary columns are dumped encoded in Base64. - -=item C<_fix_object $object> - -Fixes C<$object> by clearing certain columns like the number. Also -decodes binary columns from Base64 back to binary. - -=back - -=head1 BUGS - -Nothing here yet. - -=head1 AUTHOR - -Moritz Bunkus Em.bunkus@linet-services.deE - -=cut