Bug 15505

Summary: Mark Hold Items 'On hold' instead of 'Available'
Product: Koha Reporter: Nicole C. Engard <nengard>
Component: Hold requestsAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: normal    
Priority: P5 - low CC: cbrannon, chris.kirby, george, gmcharlt, imelda.bennis, jdemuth, jonathan.druart, jose-mario.monteiro-santos, kelly, lisettepalouse+koha, lucas, margaret, martin.renvoize, nick, rkuiper, sally.healey, veron, wizzyrea
Version: Main   
Hardware: All   
OS: All   
URL: http://devs.bywatersolutions.com/projects/mark-hold-items-on-hold-instead-of-available/
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Corrects the display of status for items on hold in the OPAC.
Version(s) released in:
19.05 18.11.05
Circulation function:
Bug Depends on:    
Bug Blocks: 22899    
Attachments: Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'
Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'
Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'
Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'
Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'
Bug 15505: Mark Hold Items 'On hold' instead of 'Available'
Bug 15505: Mark Hold Items 'On hold' instead of 'Available'

Description Nicole C. Engard 2016-01-06 16:53:46 UTC
Work to be done:

* Modify C4::XSLT::buildKohaItemsNamespace to check for proposed holds for each item

* Modify XSLT if needed

* Modify item-status.inc to do the same check




Seeking Co-sponsors: http://devs.bywatersolutions.com/projects/mark-hold-items-on-hold-instead-of-available/
Comment 1 Christopher Brannon 2016-08-26 17:19:53 UTC
It's good to see this project funded.  Is any work currently being done on this?
Comment 2 Nick Clemens (kidclamp) 2016-12-27 17:11:51 UTC
Created attachment 58459 [details] [review]
Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'

This patch adds a 'pending hold' column to C4::Items:GetItemsInfo to
allow for displaying status of an item when it has been selected for a
hold by the holdsqueue.

To test:
01 - Place a hold on an item
02 - Build the holdsqueue (kohadevbox example below)
    sudo koha-shell kohadev
    perl misc/cronjobs/holds/build_holds_queue.pl
03 - Search for the item on the OPAC
04 - Note item shows as 'Available' in results and details
05 - Apply Patch
06 - Search for the item on the OPAC
07 - Note that item now shows as 'Pending hold'
Comment 3 Nick Clemens (kidclamp) 2016-12-28 15:49:14 UTC
Link to dev site updated:
http://devs.bywatersolutions.com/2016/11/30/Mark-Hold-Items-On-hold-instead-of-Available/
Comment 4 Chris Kirby 2016-12-31 20:55:42 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2017-01-01 22:57:59 UTC
I am not sure if this is a change libraries want in general - libraries are handling holds on shelf items differently, like some say if a patron gets to it first, they should have it (I think that's a pref).
Comment 6 Owen Leonard 2017-01-03 16:18:35 UTC
(In reply to Katrin Fischer from comment #5)
> like some say if a patron gets to
> it first, they should have it

Yes, that's how it works at my library.

> (I think that's a pref)

AllowItemsOnHoldCheckout? Would it make sense if this change were tied to that preference?
Comment 7 George Williams (NEKLS) 2018-06-01 15:35:59 UTC
Working in a large consortium, I definitely want something like this.

If a patron looks at the OPAC and sees a title with 30 items spread around at different locations and 20 are already checked out and there are 15 unfilled requests on the remaining 10 items the existing message can be confusing if you're not at a branch where a copy is actually available to be grabbed off of the shelf.

Maybe the issue could be resolved by allowing for the wording of the wording of the "Pending hold" message to be customized to suit the needs of the library.  If the message that displays when there is a pending hold on an item could be tied to an authorised value, then each library could customize the description of the item's availability in the staff client and the OPAC to suit the needs of their library.  If, for example, I want an item that is hold_fill_targets to display a message that the item has a hold on it then I can change the authorised value to read "Pending hold" but if I want it to display the same availability as any other item on the shelf, I could change the authorised value to read "Available."

George
Comment 8 Christopher Brannon 2018-06-01 20:21:02 UTC
(In reply to George Williams (NEKLS) from comment #7)
> Working in a large consortium, I definitely want something like this.
> 
> If a patron looks at the OPAC and sees a title with 30 items spread around
> at different locations and 20 are already checked out and there are 15
> unfilled requests on the remaining 10 items the existing message can be
> confusing if you're not at a branch where a copy is actually available to be
> grabbed off of the shelf.
> 
> Maybe the issue could be resolved by allowing for the wording of the wording
> of the "Pending hold" message to be customized to suit the needs of the
> library.  If the message that displays when there is a pending hold on an
> item could be tied to an authorised value, then each library could customize
> the description of the item's availability in the staff client and the OPAC
> to suit the needs of their library.  If, for example, I want an item that is
> hold_fill_targets to display a message that the item has a hold on it then I
> can change the authorised value to read "Pending hold" but if I want it to
> display the same availability as any other item on the shelf, I could change
> the authorised value to read "Available."
> 
> George

I agree with George.  This feature is needed, yet, we need to do it in a way that won't jeopardize how some libraries already use it.  If it can be setup in a way we can tailor it, that would be great.

Christopher
Comment 9 Katrin Fischer 2019-01-02 22:26:16 UTC
Please, no descriptions in authorised values or prefs - these are not translatable and break things for multi-language installations.

Better to keep configuration to behaviour if possible.

In a consortia setting with multiple branches: When is an item on hold?
- If it's on the pickup shelf
- if it has an item level hold on it

... but what about record level holds where items are available at multiple branches?

If there are 2 holds to be pulled and there are 5 items to potentially fill the hold - how should this be displayed?
Comment 10 Nick Clemens (kidclamp) 2019-01-04 17:44:43 UTC
Created attachment 83643 [details] [review]
Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'

This patch adds a 'pending hold' column to C4::Items:GetItemsInfo to
allow for displaying status of an item when it has been selected for a
hold by the holdsqueue and AllowItemsOnHoldCheckout is set to 'Don't
allow'

To test:
00 - Set AllowItemsOnHoldCheckout to 'Allow'
01 - Place a hold on an item
02 - Build the holdsqueue (kohadevbox example below)
      sudo koha-shell kohadev
      perl misc/cronjobs/holds/build_holds_queue.pl
03 - Search for the item on the OPAC
04 - Note item shows as 'Available' in results and details
05 - Toggle AllowItemsOnHOldCheckout to 'Don't allow'
06 - Repeat search, note there is no change
06 - Apply Patch
07 - Search for the item on the OPAC
08 - Note that item now shows as 'Pending hold'
09 - Toggle AllowItemsOnHoldCheckout to Allow
10 - Note item shows as available
11 - prove -v t/db_dependent/Items.t
Comment 11 Nick Clemens (kidclamp) 2019-01-04 17:46:52 UTC
I updated the patches to respect AllowItemsOnHoldCheckout and updated the pref description.

This patch only affects sites using the holds queue and will only affect items that have been currently selected to be pulled for a hold
Comment 12 José-Mario Monteiro-Santos 2019-02-15 20:17:22 UTC
Patch doesn't apply

Applying: Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'
.git/rebase-apply/patch:51: trailing whitespace.
            } 
warning: 1 line adds whitespace errors.
Using index info to reconstruct a base tree...
M	C4/Items.pm
M	koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
M	koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc
M	koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl
M	t/db_dependent/Items.t
.git/rebase-apply/patch:51: trailing whitespace.
            } 
warning: 1 line adds whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging t/db_dependent/Items.t
CONFLICT (content): Merge conflict in t/db_dependent/Items.t
Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl
Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
Auto-merging C4/Items.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'
Comment 13 Nick Clemens (kidclamp) 2019-02-20 13:15:08 UTC
Created attachment 85349 [details] [review]
Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'

This patch adds a 'pending hold' column to C4::Items:GetItemsInfo to
allow for displaying status of an item when it has been selected for a
hold by the holdsqueue and AllowItemsOnHoldCheckout is set to 'Don't
allow'

To test:
00 - Set AllowItemsOnHoldCheckout to 'Allow'
01 - Place a hold on an item
02 - Build the holdsqueue (kohadevbox example below)
      sudo koha-shell kohadev
      perl misc/cronjobs/holds/build_holds_queue.pl
03 - Search for the item on the OPAC
04 - Note item shows as 'Available' in results and details
05 - Toggle AllowItemsOnHOldCheckout to 'Don't allow'
06 - Repeat search, note there is no change
06 - Apply Patch
07 - Search for the item on the OPAC
08 - Note that item now shows as 'Pending hold'
09 - Toggle AllowItemsOnHoldCheckout to Allow
10 - Note item shows as available
11 - prove -v t/db_dependent/Items.t
Comment 14 Liz Rea 2019-03-13 17:58:14 UTC
Hi Nick,

This one seems to cause searches in the OPAC to fail with 

Undefined subroutine &C4::Search::XSLTParse4Display called at /home/vagrant/kohaclone/C4/Search.pm line 2255.
 at /home/vagrant/kohaclone/C4/Search.pm line 2254

Please have a look!

Cheers,
Liz
Comment 15 Nick Clemens (kidclamp) 2019-03-20 15:54:43 UTC
Created attachment 86817 [details] [review]
Bug 15505 - Mark Hold Items 'On hold' instead of 'Available'

This patch adds a 'pending hold' column to C4::Items:GetItemsInfo to
allow for displaying status of an item when it has been selected for a
hold by the holdsqueue and AllowItemsOnHoldCheckout is set to 'Don't
allow'

To test:
00 - Set AllowItemsOnHoldCheckout to 'Allow'
01 - Place a hold on an item
02 - Build the holdsqueue (kohadevbox example below)
      sudo koha-shell kohadev
      perl misc/cronjobs/holds/build_holds_queue.pl
03 - Search for the item on the OPAC
04 - Note item shows as 'Available' in results and details
05 - Toggle AllowItemsOnHOldCheckout to 'Don't allow'
06 - Repeat search, note there is no change
06 - Apply Patch
07 - Search for the item on the OPAC
08 - Note that item now shows as 'Pending hold'
09 - Toggle AllowItemsOnHoldCheckout to Allow
10 - Note item shows as available
11 - prove -v t/db_dependent/Items.t
Comment 16 Liz Rea 2019-03-20 16:18:10 UTC
Created attachment 86821 [details] [review]
Bug 15505: Mark Hold Items 'On hold' instead of 'Available'

This patch adds a 'pending hold' column to C4::Items:GetItemsInfo to
allow for displaying status of an item when it has been selected for a
hold by the holdsqueue and AllowItemsOnHoldCheckout is set to 'Don't
allow'

To test:
00 - Set AllowItemsOnHoldCheckout to 'Allow'
01 - Place a hold on an item
02 - Build the holdsqueue (kohadevbox example below)
      sudo koha-shell kohadev
      perl misc/cronjobs/holds/build_holds_queue.pl
03 - Search for the item on the OPAC
04 - Note item shows as 'Available' in results and details
05 - Toggle AllowItemsOnHOldCheckout to 'Don't allow'
06 - Repeat search, note there is no change
06 - Apply Patch
07 - Search for the item on the OPAC
08 - Note that item now shows as 'Pending hold'
09 - Toggle AllowItemsOnHoldCheckout to Allow
10 - Note item shows as available
11 - prove -v t/db_dependent/Items.t

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 17 Martin Renvoize (ashimema) 2019-04-17 09:55:08 UTC
Created attachment 88158 [details] [review]
Bug 15505: Mark Hold Items 'On hold' instead of 'Available'

This patch adds a 'pending hold' column to C4::Items:GetItemsInfo to
allow for displaying status of an item when it has been selected for a
hold by the holdsqueue and AllowItemsOnHoldCheckout is set to 'Don't
allow'

To test:
00 - Set AllowItemsOnHoldCheckout to 'Allow'
01 - Place a hold on an item
02 - Build the holdsqueue (kohadevbox example below)
      sudo koha-shell kohadev
      perl misc/cronjobs/holds/build_holds_queue.pl
03 - Search for the item on the OPAC
04 - Note item shows as 'Available' in results and details
05 - Toggle AllowItemsOnHOldCheckout to 'Don't allow'
06 - Repeat search, note there is no change
06 - Apply Patch
07 - Search for the item on the OPAC
08 - Note that item now shows as 'Pending hold'
09 - Toggle AllowItemsOnHoldCheckout to Allow
10 - Note item shows as available
11 - prove -v t/db_dependent/Items.t

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 18 Martin Renvoize (ashimema) 2019-04-17 09:56:09 UTC
I would love to have seen a test added for the C4::XSLT.pm change.. but as there appears to be no tests at all for this module yet and it's within C4 I don't want to hold this one up..

Passing QA
Comment 19 Nick Clemens (kidclamp) 2019-04-19 14:53:25 UTC
Awesome work all!

Pushed to master for 19.05
Comment 20 Martin Renvoize (ashimema) 2019-04-26 14:32:25 UTC
Pushed to 18.11.x for 18.11.05
Comment 21 Lucas Gass (lukeg) 2019-05-30 15:47:52 UTC
no backport for 18.05.x