Bug 8130

Summary: attach PDF files to a patron record
Product: Koha Reporter: Melia Meggs <melia>
Component: PatronsAssignee: Kyle M Hall <kyle.m.hall>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: gbengaadara, gmcharlt, jonathan.druart, katrin.fischer, koha.sekjal, kyle, m.r.davis, paul.poulain, stephane.delaye, wizzyrea
Version: 3.10   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=3050
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 6274, 10443    
Attachments: Bug 8130 - attach PDF files to a patron record
Bug 8130 - attach PDF files to a patron record
Bug 8130 - attach PDF files to a patron record
Bug 8130 - attach PDF files to a patron record
bug 8130: remove merge marker
Bug 8130 - Fix incorrect permission, allow deletion of files of logged in user has 'borrowers' permission
Bug 8130 - attach PDF files to a patron record
Bug 8130 - attach PDF files to a patron record
Bug 8130 - attach PDF files to a patron record
[PASSED QA] Bug 8130 - attach PDF files to a patron record
Bug 8130 [FOLLOW-UP] attach PDF files to a patron record
[PASSED-QA][SIGNED OFF]Bug 8130 [FOLLOW-UP] attach PDF files to a patron record
Bug 8310: Followup errors must be a hashref
Bug 8310: Followup - Empty file upload error never displays.
[SIGNED-OFF} Bug 8310: Followup: errors must be a hashref
Bug 8310: Followup - Empty file upload error never displays.
Bug 8130: [SIGNED-OFF] Followup - Empty file upload error never displays.
[SIGNED-OFF] Bug 8130: Followup: errors must be a hashref

Description Melia Meggs 2012-05-18 23:08:18 UTC
We would like a feature that allows librarians to attach unlimited arbitrary files to a patron record.

Specifically, we want to store a PDF document with a patron record. They would be like the patron images, but for a document. We would like a link on the patron record that when clicked would open the PDF.
Comment 1 Kyle M Hall 2012-05-21 20:44:51 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall 2012-05-21 20:53:24 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2012-05-31 13:42:14 UTC Comment hidden (obsolete)
Comment 4 Olugbenga Adara 2012-06-10 11:43:46 UTC
Trying to sign off on this patch using Biblibre's sandbox. Got the message below

<h1>Something went wrong !</h1>Applying: Bug 8130 - attach PDF files to a patron record<br/>
Using index info to reconstruct a base tree...<br/>
Falling back to patching base and 3-way merge...<br/>
Auto-merging installer/data/mysql/sysprefs.sql<br/>
CONFLICT (content): Merge conflict in installer/data/mysql/sysprefs.sql<br/>
Auto-merging installer/data/mysql/updatedatabase.pl<br/>
CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl<br/>
Failed to merge in the changes.<br/>
Patch failed at 0001 Bug 8130 - attach PDF files to a patron record<br/>
Comment 5 Kyle M Hall 2012-06-11 08:20:41 UTC Comment hidden (obsolete)
Comment 6 Michael Davis 2012-06-11 10:41:21 UTC Comment hidden (obsolete)
Comment 7 Michael Davis 2012-06-11 10:43:41 UTC
Works fine, except there does not seem to be any delete function. Either add delete function or change remit to not include a delete function and add a new bug for delete capability.
Comment 8 Kyle M Hall 2012-06-11 10:59:23 UTC Comment hidden (obsolete)
Comment 9 Kyle M Hall 2012-06-11 11:00:28 UTC Comment hidden (obsolete)
Comment 10 Kyle M Hall 2012-06-11 11:01:09 UTC
Squashed all patches together for ease of use.
Comment 11 Michael Davis 2012-06-11 11:30:20 UTC Comment hidden (obsolete)
Comment 12 Ian Walls 2012-06-15 17:58:03 UTC
Patch does not apply; probably a merge conflict in updatedatabase
Comment 13 Liz Rea 2012-06-15 19:37:33 UTC Comment hidden (obsolete)
Comment 14 Ian Walls 2012-06-21 19:32:21 UTC
Further rebasing has been required...

This all looks very good, except I'm not terribly thrilled about the hardcoded MAX_FILE_SIZE value in the upload.  It seems to me that that value should be controllable by the sysadmin, rather than locked in at 2000000.

I think a followup fix would be appropriate here, rather than a complete resubmission.   Rebased version is Passed QA.
Comment 15 Ian Walls 2012-06-21 19:32:29 UTC Comment hidden (obsolete)
Comment 16 Paul Poulain 2012-06-26 15:59:39 UTC
Hi Melia,

Could you explain the use case for this feature ? I can't see why it's something we would need in an ILS.
Comment 17 Katrin Fischer 2012-06-26 16:22:47 UTC
Hi Paul,
the use case that comes to my mind are signed registration forms or other forms that need a signature from the patron.
Comment 18 Melia Meggs 2012-06-26 16:33:52 UTC
Yes, that's exactly it, Katrin.
Comment 19 Paul Poulain 2012-06-28 12:01:01 UTC
Patch pushed, but I think it would be usefull to have the list of attached files available on the moremembers.pl page (and maybe also on the check-out page)
The use case that has been given make interesting for a librarian to see quickly if there are files attached to ask for missing ones.

Exemple: I'm supposed to give a proof of address every year. On the check-out page, when my card is entered, Koha display "Patron Paul Poulain, currently 0 issues, 1 file attached (10/01/2010) => I haven't updated my proof of address

(that's just an example)

However : the moremember.pl page is really crapy now and would not deserve a large update. But that's another topic !
Comment 20 Paul Poulain 2012-07-02 12:51:54 UTC
In bug 7955, http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7955#c21, Nicole spotted that the "notices" tab appear twice.

This was due to the fact that this patch add the "notices" tab without removing it. Probably a rebase mistake. Will push a patch removing the duplicate tab now
Comment 21 Owen Leonard 2012-07-10 18:09:02 UTC Comment hidden (obsolete)
Comment 22 Owen Leonard 2012-07-10 18:14:56 UTC
In testing my patch I found that I couldn't trigger any error messages to appear. The error box appears without text if I submit the form without selecting a file. The error box does not appear at all if I submit a 0-byte file (which I assume is what errors.empty_upload is about?)
Comment 23 Kyle M Hall 2012-07-19 11:31:26 UTC
Created attachment 11001 [details] [review]
[PASSED-QA][SIGNED OFF]Bug 8130 [FOLLOW-UP] attach PDF files to a patron record

Markup corrections:

- Hide table of files if no files are attached
- Move error messages out of table (invalid)
- Add <tr> tags to table (invalid)
- Apply standard form structure to upload form
- Add proper labels and ids to upload form
- Correct unescaped ampersands

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 24 Jonathan Druart 2012-07-19 11:51:32 UTC
Comment on attachment 11001 [details] [review]
[PASSED-QA][SIGNED OFF]Bug 8130 [FOLLOW-UP] attach PDF files to a patron record

Passed QA for this patch.
Comment 25 Jonathan Druart 2012-07-19 11:57:33 UTC Comment hidden (obsolete)
Comment 26 Kyle M Hall 2012-07-19 12:42:06 UTC Comment hidden (obsolete)
Comment 27 Kyle M Hall 2012-07-19 12:43:42 UTC Comment hidden (obsolete)
Comment 28 Kyle M Hall 2012-07-19 12:44:58 UTC Comment hidden (obsolete)
Comment 29 Jonathan Druart 2012-07-19 13:13:22 UTC
Created attachment 11009 [details] [review]
Bug 8130: [SIGNED-OFF] Followup - Empty file upload error never displays.

http://bugs.koha-community.org/show_bug.cgi?id=8130
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 30 Jonathan Druart 2012-07-19 13:16:15 UTC
Created attachment 11010 [details] [review]
[SIGNED-OFF] Bug 8130: Followup: errors must be a hashref

correct the bug number (8130 not 8310...)
Comment 31 Jonathan Druart 2012-07-19 13:18:07 UTC
Qa seems easy for the 2 last patches
Comment 32 Paul Poulain 2012-07-23 16:06:56 UTC
follow-ups pushed