Bugzilla – Attachment 41880 Details for
Bug 14321
Merge UploadedFile and UploadedFiles into Koha::Upload
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14321: Just some documentation lines added or fixed
Bug-14321-Just-some-documentation-lines-added-or-f.patch (text/plain), 2.97 KB, created by
Marcel de Rooy
on 2015-08-25 07:03:17 UTC
(
hide
)
Description:
Bug 14321: Just some documentation lines added or fixed
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-08-25 07:03:17 UTC
Size:
2.97 KB
patch
obsolete
>From 9a76e63867b2f4a8b66fca6920f9d50f0ddc2fea Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 19 Aug 2015 15:01:04 +0200 >Subject: [PATCH] Bug 14321: Just some documentation lines added or fixed >Content-Type: text/plain; charset=utf-8 > >Test plan: >Actually, you cannot really test this. But you could run the unit test >again. >--- > Koha/Upload.pm | 47 +++++++++++++++++++++++++++++++---------------- > 1 file changed, 31 insertions(+), 16 deletions(-) > >diff --git a/Koha/Upload.pm b/Koha/Upload.pm >index 1468a4f..0014509 100644 >--- a/Koha/Upload.pm >+++ b/Koha/Upload.pm >@@ -1,5 +1,7 @@ > package Koha::Upload; > >+# Copyright 2007 LibLime, Galen Charlton >+# Copyright 2011-2012 BibLibre > # Copyright 2015 Rijksmuseum > # > # This file is part of Koha. >@@ -25,23 +27,34 @@ Koha::Upload - Facilitate file upload > > use Koha::Upload; > >-=head1 DESCRIPTION >- >- This class >+ # add an upload (see tools/upload-file.pl) >+ my $upload = Koha::Upload->new( public => 1, category => 'A' ); >+ my $cgi = $upload->cgi; >+ # Do something with $upload->count, $upload->result or $upload->err > >-=head1 METHODS >- >-=head2 new >+ # get some upload records >+ my @uploads = Koha::Upload->new->get( term => $term ); >+ $template->param( uploads => \@uploads ); > >- Create object (via Class::Accessor). >+ # download >+ my $rec = Koha::Upload->new->get({ id => $id, filehandle => 1 }); >+ my $fh = $rec->{fh}; >+ my @hdr = Koha::Upload->httpheaders( $rec->{name} ); >+ print Encode::encode_utf8( $input->header( @hdr ) ); >+ while( <$fh> ) { print $_; } >+ $fh->close; > >-=head1 PROPERTIES >+ # delete an upload >+ my ( $fn ) = Koha::Upload->new->delete({ id => $id }); > >-=head2 ??? >+=head1 DESCRIPTION > >- ??? >+ This module is a refactored version of C4::UploadedFile but adds on top >+ of that the new functions from report 6874 (Upload plugin in editor). >+ That report added module UploadedFiles.pm. This module contains the >+ functionality of both. > >-=head1 ADDITIONAL COMMENTS >+=head1 METHODS > > =cut > >@@ -78,7 +91,7 @@ sub new { > > =head2 cgi > >- Returns new object based on Class::Accessor. >+ Returns CGI object. The CGI hook is used to store the uploaded files. > > =cut > >@@ -109,7 +122,7 @@ sub count { > > =head2 result > >- Returns new object based on Class::Accessor. >+ Returns a string of id's for each successful upload separated by commas. > > =cut > >@@ -140,8 +153,9 @@ sub err { > > =head2 get > >- Returns array >- optional parameter: filehandle => 1 (name, path only by default) >+ Returns arrayref of uploaded records (hash) or one uploaded record. >+ You can pass id => $id or hashvalue => $hash or term => $term. >+ Optional parameter filehandle => 1 returns you a filehandle too. > > =cut > >@@ -400,7 +414,8 @@ sub _compute { > > =head1 AUTHOR > >- Marcel de Rooy, Rijksmuseum Amsterdam, The Netherlands >+ Koha Development Team >+ Larger parts from Galen Charlton, Julian Maurice and Marcel de Rooy > > =cut > >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14321
:
41498
|
41499
|
41500
|
41501
|
41555
|
41556
|
41557
|
41558
|
41559
|
41560
|
41561
|
41562
|
41665
|
41666
|
41667
|
41668
|
41669
|
41677
|
41873
|
41874
|
41875
|
41876
|
41877
|
41878
|
41879
|
41880
|
41881
|
42411
|
42412
|
42413
|
42414
|
42558
|
42559
|
42560
|
42561
|
42584
|
42587
|
42588
|
42589
|
42590
|
42591
|
42660
|
42661
|
42662
|
42663
|
42664
|
42665
|
42666
|
42707
|
42726
|
42727
|
42728
|
42729
|
42730
|
42731
|
42732
|
42889
|
42890