Bug 31272 - Show library name not code when placing item level holds in OPAC
Summary: Show library name not code when placing item level holds in OPAC
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Katrin Fischer
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 30992
Blocks:
  Show dependency treegraph
 
Reported: 2022-07-30 20:35 UTC by Katrin Fischer
Modified: 2023-06-08 22:26 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00,22.05.06,21.11.12
Circulation function:


Attachments
Bug 31272: Use TT plugins for pickup library and due date in opac-reserve.pl (4.75 KB, patch)
2022-07-30 21:40 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 31272: Use TT plugins for pickup library and due date in opac-reserve.pl (4.82 KB, patch)
2022-08-05 11:01 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2022-07-30 20:35:24 UTC
When placing an item level hold in the OPAC and there are other pending holds, the branchcode will show instead of the branchname:

On hold for patron expected at FFL since 07/30/2022 .
Comment 1 Katrin Fischer 2022-07-30 21:40:03 UTC
Created attachment 138399 [details] [review]
Bug 31272: Use TT plugins for pickup library and due date in opac-reserve.pl

Before this patch the date formatting for the due date was done
in the .pl instead of the template and the branchcode would show
instead of the library's name in the list of items when placing
an item level hold in the OPAC.

To test:
* Find or create a record with mulitple items
* Check out one of the items
* Place a record level hold
* Return an item to set to waiting
* Place an item level hold
* Go to the OPAC and start placing an item level hold
* Verify the messages in the item table show the branchcode
* Apply patch
* Only visible change should be the library name replacing the branchcode
Comment 2 Martin Renvoize (ashimema) 2022-08-05 11:01:44 UTC
Created attachment 138680 [details] [review]
Bug 31272: Use TT plugins for pickup library and due date in opac-reserve.pl

Before this patch the date formatting for the due date was done
in the .pl instead of the template and the branchcode would show
instead of the library's name in the list of items when placing
an item level hold in the OPAC.

To test:
* Find or create a record with mulitple items
* Check out one of the items
* Place a record level hold
* Return an item to set to waiting
* Place an item level hold
* Go to the OPAC and start placing an item level hold
* Verify the messages in the item table show the branchcode
* Apply patch
* Only visible change should be the library name replacing the branchcode

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize (ashimema) 2022-08-05 11:02:35 UTC
Nice one Katrin, this is a great little improvement.

Going straight for QA on this, it's clear and simple and achieves exactly what's on the tin.

Passing QA
Comment 4 Tomás Cohen Arazi (tcohen) 2022-08-05 15:05:54 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 5 Lucas Gass (lukeg) 2022-09-29 17:05:28 UTC
Backported to 22.05.x for 22.05.06
Comment 6 Victor Grousset/tuxayo 2022-10-13 16:20:29 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document it seems, marking resolved.
Comment 7 Arthur Suzuki 2022-10-22 22:09:22 UTC
Thanks!

Pushed to 21.11 for 21.11.12
Comment 8 Nick Clemens (kidclamp) 2022-11-23 12:13:32 UTC
(In reply to Arthur Suzuki from comment #7)
> Thanks!
> 
> Pushed to 21.11 for 21.11.12

This depends on 30992 which was not backported to 21.11
This means that:
reservedate is being formatted in opac-reserve.pl:
    $itemLoopIter->{reservedate}     = output_pref({ dt => dt_from_string($first_hold->reservedate), dateonly => 1 }); # FIXME Should be formatted in the template

And is also being formatted in the template:
<span>On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.reservedate | $KohaDates %]</span>

And DateUtils dies on an unexpected date (as it has already been formatted)

Please revert