Bug 19068 - OPAC purchase suggestion doesn't allow users to enter quantity of items
Summary: OPAC purchase suggestion doesn't allow users to enter quantity of items
Status: Pushed to Master
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jon Knight
QA Contact: Nick Clemens
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-09 16:11 UTC by Jon Knight
Modified: 2017-09-12 15:12 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
One line addition to opac-suggestions.tt to allow quantities to be entered (1.29 KB, patch)
2017-08-09 16:11 UTC, Jon Knight
Details | Diff | Splinter Review
Add quantity field to the opac suggestions form. (1.66 KB, patch)
2017-08-21 15:05 UTC, Jon Knight
Details | Diff | Splinter Review
Add quantity field to the opac suggestions form. (1.66 KB, patch)
2017-08-22 13:09 UTC, Jon Knight
Details | Diff | Splinter Review
Add quantity field to the opac suggestions form (with correct username and email) (1.70 KB, patch)
2017-08-22 13:16 UTC, Jon Knight
Details | Diff | Splinter Review
[SIGNED OFF] Add quantity field to the opac suggestions form (with correct username and email) (1.77 KB, patch)
2017-08-22 20:19 UTC, Katrin Fischer
Details | Diff | Splinter Review
Add quantity field to the opac suggestions form (with correct username and email) (1.82 KB, patch)
2017-09-01 15:19 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Knight 2017-08-09 16:11:49 UTC
Created attachment 65767 [details] [review]
One line addition to opac-suggestions.tt to allow quantities to be entered

Our librarians commented that the Koha purchase suggestions form doesn't allow the quantity of items to be suggested.  In an academic library, sometimes the academics will make suggestions for reading material and have an idea how popular it may be, even for modules/courses that aren't yet running so don't (officially) have any students allocated to them.

This enhancement just exposes the quantity field to the OPAC suggestions form to permit the end user to enter this if they wish.  The librarians can of course override this quantity when they process the suggestion.

Test Plan (assuming using kohadevbox VM):

1) apply patch and turn on purchase suggestions
2) Go to http://localhost:8080/cgi-bin/koha/opac-suggestions.pl?op=add and notice that there is now a quantity field available.
3) Make a purchasing suggestion using this form, including a quantity.
4) Log in as a member of library staff and go to Home › Acquisitions › Suggestions
5) Confirm that the previously entered suggestion is there, and that the correct quantity appears in the "Acquisition information" section.
6) Edit the purchasing suggestion, change the quantity, save it and check that the new quantity appears in the suggestion.

I've popped an ID attribute of "opac-suggestion-quantity" to the surrounding <li> so that CSS can easily make this optional field disappear (as suggested by cait on IRC).
Comment 1 Katrin Fischer 2017-08-17 10:37:43 UTC
Hi Jon, 

there is some information missing from your patch so that it doesn't apply cleanly with git commands. It's missing the "header" on top, that includes your authorship etc. 

How did you create the patch? 

You can create formatted patch files with "git format-patch" Or you could use git bz (https://wiki.koha-community.org/wiki/Git_bz_configuration). If you are using a kohadevbox this will already be preinstalled, but requires some settings in your configuration file to work right.

Please let us know if we can help!
Comment 2 Jon Knight 2017-08-17 14:52:17 UTC
I created the patch using "git diff".  I'll create a formatted patch next week (I'm not at the machine that has the kohadevbox VM on it at the moment).
Comment 3 Jon Knight 2017-08-21 15:05:40 UTC
Created attachment 66281 [details] [review]
Add quantity field to the opac suggestions form.
Comment 4 Jon Knight 2017-08-21 15:17:23 UTC
New version of the patch uploaded, hopefully this time in the correct format.
Comment 5 Katrin Fischer 2017-08-22 05:33:39 UTC
Hi Jon, patch def looks better! One more small but important thing. In the second line of the patch it reads:

From: Your Full Name <your_email>

That means you haven't set up your git completely yet. The name and address there will be visible in git and also will make your name show up in the release notes. I think you will just need to run those 2 commands with your correct information, before rerunning the format-patch command again:

 git config --global user.name "Your NAME"
 git config --global user.email "your@mail.com"
Comment 6 Jon Knight 2017-08-22 09:43:59 UTC
Ah thanks - those lines weren't in the git bz config set up on https://wiki.koha-community.org/wiki/Git_bz_configuration#Configure_git-bz that I followed to set up the kohadevbox git bz set up.
Comment 7 Jon Knight 2017-08-22 13:09:38 UTC
Created attachment 66339 [details] [review]
Add quantity field to the opac suggestions form.
Comment 8 Jon Knight 2017-08-22 13:16:07 UTC
Created attachment 66340 [details] [review]
Add quantity field to the opac suggestions form (with correct username and email)
Comment 9 Katrin Fischer 2017-08-22 13:18:40 UTC
I think the git bz instructions might have originally been written with developers switching to it in mind - I'll try to take a look.

New patch looks perfect, will try to test and thx for your patience so far!
Comment 10 Katrin Fischer 2017-08-22 20:19:19 UTC
Created attachment 66371 [details] [review]
[SIGNED OFF] Add quantity field to the opac suggestions form (with correct username and email)

https://bugs.koha-community.org/show_bug.cgi?id=19068

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Nick Clemens 2017-09-01 15:19:53 UTC
Created attachment 66755 [details] [review]
Add quantity field to the opac suggestions form (with correct username and email)

https://bugs.koha-community.org/show_bug.cgi?id=19068

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 12 Nick Clemens 2017-09-01 15:20:27 UTC
Looks good, includes id so easy to hide if unwanted
Comment 13 Jonathan Druart 2017-09-12 15:12:38 UTC
Pushed to master for 17.11, thanks to everybody involved!