[koha-commits] main Koha release repository branch master updated. v16.11.00-327-ge429db4
Git repo owner
gitmaster at git.koha-community.org
Fri Jan 20 15:24:32 CET 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "main Koha release repository".
The branch, master has been updated
via e429db4746f4ea53abe4e271afd6adb43b54c5d8 (commit)
via a118dd2ba09c62f4d30475636f4900232ef80132 (commit)
via 3acee793105f66ff0acc5b8879e3cbceb0fb2b54 (commit)
via ba5cd2455327c8eddc4c5e9c90642398b210a680 (commit)
via 158442eb9e3658e22c54a3315caa57673e6940ab (commit)
via 7a620054684e4ab0dfdbb5bd285a9c70928a7e14 (commit)
via 42f0bdf9f1a3f14ca454fee93507d795f6da74c0 (commit)
via 4efe9e82cd75b48e3fc98646259d1744963402c2 (commit)
via 44c4b3fca6eff57dd88989309970fe9cebfb8b6e (commit)
via 44d4dc70404e596648415f3db60ff7975e986281 (commit)
from 57568b9a0bf38706e41580e5a9e48777793c00ac (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e429db4746f4ea53abe4e271afd6adb43b54c5d8
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Tue Jan 10 17:11:08 2017 +0100
Bug 17501: [Follow-up] QA Requests
This patch makes the following changes, as requested by QA:
[1] UploadedFile->delete always calls SUPER::delete.
The return value normally comes from SUPER::delete; if removing the
file failed, we return false. Two warns are kept.
Since delete does no longer return the filename, a few changes were
needed in tools/upload.pl.
[2] Method getCategories is moved to UploadedFiles. Script tools/upload.pl
now only contains one call. Added a use C4::Koha.
[3] Calls UploadedFiles->delete as class method. As a result I removed
method delete_errors for now; may be reconsidered on a new report.
[4] Adjusted three ->search calls for id and public to ->find calls.
[5] If you pass no id to upload.pl when deleting, you don't get an alert.
All by all, we got rid of 15 lines !
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
commit a118dd2ba09c62f4d30475636f4900232ef80132
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Thu Nov 24 14:13:22 2016 +0100
Bug 17501: Additional polishing (POD, unit tests)
This patch adds some documentation lines.
And mainly rearrangs the tests in Upload.t. The 'basic CRUD testing' is
not needed separately any more. A new test catches the "file missing"
warn.
Test plan:
[1] Run perldoc on UploadedFile[s].pm
[2] Run t/db_dependent/Upload.t
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
commit 3acee793105f66ff0acc5b8879e3cbceb0fb2b54
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Thu Nov 24 10:02:19 2016 +0100
Bug 17501: Rename Upload to Uploader
Why? Koha::Uploader now only contains the actual CGI upload. The new name
better reflects its handler status.
Pragmatically, the difference between Uploaded and Uploader makes it
easier to specifically search for them in the codebase.
Test plan:
[1] Run t/db_dependent/Upload.t.
[2] Add an upload via the interface.
[3] Check the code:
git grep "Koha::Upload;"
git grep "Koha::Upload\->"
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
commit ba5cd2455327c8eddc4c5e9c90642398b210a680
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Thu Nov 24 09:27:23 2016 +0100
Bug 17501: Move getCategories and httpheaders from Upload.pm
Class method getCategories has no strict binding to Upload.pm. While
Upload.pm is now restricted to the actual uploading process with CGI
hook, this routine fits better in the UploadedFile package.
Class method httpheaders can be moved as well for the same reason. Note
that it actually is an instance method. The parameter $name is dropped.
Test plan:
[1] Run t/db_dependent/Upload.t.
[2] Check the categories in the combo box of tools/upload.
[3] Check a download via tools/upload and opac-retrieve-file.
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
commit 158442eb9e3658e22c54a3315caa57673e6940ab
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Tue Nov 22 16:57:21 2016 +0100
Bug 17501: Remove Koha::Upload::get from Koha::Upload
The get routine actually returns records from uploaded_files. It should be
possible to replace its calls by direct calls of Koha::UploadedFiles.
This patch is the crux of this patch set. It deals with all scripts that
use Koha::Upload.
In the process we do:
[1] Add a file_handle method to Koha::UploadedFile. This was previously
arranged via the fh parameter of get.
[2] Add a full_path method to UploadedFile. Previously returned in the
path hash key of get. (Name is replaced by filename.)
[3] Add a search_term method too (implementing get({ term => .. }).
This logic came from _lookup.
[4] Add a keep_file parameter to delete method. Only used in test now.
Test plan:
[1] Run t/db_dependent/Upload.t
[2] Go to Tools/Upload. Add an upload, download and delete.
[3] Add another public upload , search for it.
Use the hashvalue to download via opac with URL:
cgi-bin/koha/opac-retrieve-file.pl?id=[hashvalue]
[4] Go to Tools/Stage MARC for import. Import a marc file.
[5] Go to Tools/Upload local cover image. Import an image file.
Enable OPACLocalCoverImages to see result.
[6] Test uploading a offline circulation file:
Enable AllowOfflineCirculation, and create a koc file (plain text):
Line1: Version=1.0\tA=1\tB=2
Line2: 2016-11-23 16:00:00 345\treturn\t[barcode]
Note: Replace tabs and barcode. The number of tabs is essential!
Checkout the item with your barcode.
Go to Circulation/Offline circulation file upload.
Upload and click Apply directly.
Checkout again. Repeat Offline circulation file upload.
Now click Add to offline circulation queue.
[7] Connect the upload plugin to field 856$u.
Enable HTML5MediaEnabled.
Upload a webm file via the plugin. Click Choose to save the URL,
and put 'video/webm' into 856$q. Save the biblio record.
Check if you see the media tab with player on staff detail.
(See also: Bug 17673 about empty OPACBaseURL.)
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
commit 7a620054684e4ab0dfdbb5bd285a9c70928a7e14
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Mon Nov 21 14:53:27 2016 +0100
Bug 17501: Move Koha::Upload::delete to Koha::UploadedFile[s]
Since delete is not part of the upload process, we will move it now
to Koha::UploadedFile[s].
Deleting the file will be done in UploadedFile.
The (multiple) delete method in UploadedFiles refers to the single delete.
Test plan:
[1] Run t/db_dependent/Upload.t
The warning ("but file was missing") in the last subtest is fine;
the file did not exist. Will be addressed in a follow-up.
[2] Search for uploads on Tools/Upload. Clone this tab (repeat search on
a new tab in your browser).
[3] Delete an existing upload on the first tab.
[4] Try to delete it again on the second tab. Error message?
[5] Bonus points:
Add an upload. Mark the file immutable with chattr +i. Try to delete
the file. You should see a "Could not be deleted"-message.
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
commit 42f0bdf9f1a3f14ca454fee93507d795f6da74c0
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Mon Nov 21 14:12:17 2016 +0100
Bug 17501: Use Koha::Object in Koha::Upload::_delete
Note: This is the last occurrence where we use DBI to perform a CRUD
operation. In this case a delete from uploaded_files.
We now call Koha::UploadedFile[s]->delete to only delete the record
from the table. A next step will be moving the additional functionality
of removing the file(s) too.
Test plan:
[1] Run t/db_dependent/Upload.t
[2] Delete an upload from tools/upload.pl
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
commit 4efe9e82cd75b48e3fc98646259d1744963402c2
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Mon Nov 21 08:48:02 2016 +0100
Bug 17501: Use Koha::Object in Koha::Upload::_lookup
The _lookup routine performs a few select statements on uploaded_files.
In this patch the SQL statements are replaced with Koha::Object calls.
One call of _lookup is replaced directly by Koha::UploadedFiles.
Note: _lookup can be removed in a later stage.
Test plan:
[1] Run t/db_dependent/Upload.t
[2] Upload a file in some upload category
[3] Try to upload the same file into the same category. Error?
[4] Try to upload the same file in another category. Should work.
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
commit 44c4b3fca6eff57dd88989309970fe9cebfb8b6e
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Sun Nov 20 16:10:33 2016 +0100
Bug 17501: Use Koha::Object in Koha::Upload::_register
The _register routine basically inserts a new record in uploaded_files.
It should use Koha::UploadedFile now.
Test plan:
[1] Run t/db_dependent/Upload.t
[2] Upload a file via Tools/Upload.
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
commit 44d4dc70404e596648415f3db60ff7975e986281
Author: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Date: Sat Nov 19 17:24:11 2016 +0100
Bug 17501: Introduce Koha::Object[s] classes for UploadedFile(s)
In the next set of patches we will start using these new classes in
Koha::Upload, and scripts using it.
This is just the starting point of that migration.
Test plan:
[1] Run t/db_dependent/Upload.t
Signed-off-by: Marcel de Rooy <m.de.rooy at rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen at theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle at bywatersolutions.com>
-----------------------------------------------------------------------
Summary of changes:
C4/HTML5Media.pm | 12 +-
Koha/UploadedFile.pm | 176 +++++++++++++++
Koha/UploadedFiles.pm | 140 ++++++++++++
Koha/{Upload.pm => Uploader.pm} | 220 ++++---------------
.../intranet-tmpl/prog/en/modules/tools/upload.tt | 4 +-
offline_circ/enqueue_koc.pl | 9 +-
offline_circ/process_koc.pl | 11 +-
opac/opac-retrieve-file.pl | 14 +-
t/db_dependent/Upload.t | 223 ++++++++++++--------
tools/stage-marc-import.pl | 8 +-
tools/upload-cover-image.pl | 11 +-
tools/upload-file.pl | 8 +-
tools/upload.pl | 49 +++--
13 files changed, 561 insertions(+), 324 deletions(-)
create mode 100644 Koha/UploadedFile.pm
create mode 100644 Koha/UploadedFiles.pm
rename Koha/{Upload.pm => Uploader.pm} (57%)
hooks/post-receive
--
main Koha release repository
More information about the koha-commits
mailing list