From b3e9e32b05d7d0072c4020ef8d99efe38f0a1a80 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 27 Aug 2018 13:04:49 +0300 Subject: [PATCH] Bug 12297: Fix waitingreserves code duplication waitingreserves.tt has two near-identical tables, holdst and holdso. These should be folded into a single TT BLOCK, which is then called with appropriate parameters to generate the two tables. Test plan: 1) apply patch 2) Go to the waitingreserves-page. It should look and behave identical to how it was before. Signed-off-by: Pasi Kallinen --- .../prog/en/modules/circ/waitingreserves.tt | 165 ++++++++------------- 1 file changed, 63 insertions(+), 102 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt index 8c442941da..04d044fa9e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt @@ -19,6 +19,61 @@ › Holds awaiting pickup +[% BLOCK show_hold_table %] + + + + + + + + + + + + + + + [% FOREACH reserveloo IN reserveloop %] + + + + + + + + + + + + + [% END %] + +
Waiting sinceDate hold placedTitlePatronHome branchCurrent locationCall numberCopy numberEnumerationAction
[% reserveloo.waitingdate | $KohaDates %][% reserveloo.reservedate | $KohaDates %][% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %] + [% reserveloo.title | html %] [% FOREACH subtitl IN reserveloo.subtitle %] [% subtitl.subfield | html %][% END %] + + [% UNLESS ( item_level_itypes ) %][% IF ( reserveloo.itemtype ) %]  ([% reserveloo.itemtype | html %])[% END %][% END %] +
Barcode: [% reserveloo.barcode | html %] +
[% reserveloo.patron.surname | html %], [% reserveloo.patron.firstname | html %] + [% IF ( reserveloo.patron.phone ) %]
[% reserveloo.patron.phone | html %][% END %] + [% IF ( reserveloo.patron.first_valid_email_address ) %]
+ [% reserveloo.patron.first_valid_email_address | html %][% END %] +
[% Branches.GetName( reserveloo.homebranch ) | html %][% Branches.GetName( reserveloo.holdingbranch ) | html %][% reserveloo.itemcallnumber | html %][% reserveloo.copynumber | html %][% reserveloo.enumchron | html %] +
+ + + + + + [% IF ( reserveloo.dotransfer ) %] + + [% ELSE %] + + [% END %] +
+
+[% END # show_hold_table %] + [% IF Koha.Preference('CircSidebar') %]
[% ELSE %]
[% END %]
@@ -68,64 +123,16 @@
- [% IF ( reserveloop ) %] - - - - - - - - - - - - - - [% FOREACH reserveloo IN reserveloop %] - - - - - - - - - - - - - [% END %] -
Waiting sinceDate hold placedTitlePatronHome branchCurrent locationCall numberCopy numberEnumerationAction
[% reserveloo.waitingdate | $KohaDates %][% reserveloo.reservedate | $KohaDates %][% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %] - [% reserveloo.title | html %] [% FOREACH subtitl IN reserveloo.subtitle %] [% subtitl.subfield | html %][% END %] - - [% UNLESS ( item_level_itypes ) %][% IF ( reserveloo.itemtype ) %]  ([% reserveloo.itemtype | html %])[% END %][% END %] -
Barcode: [% reserveloo.barcode | html %] -
[% reserveloo.patron.surname | html %], [% reserveloo.patron.firstname | html %] - [% IF ( reserveloo.patron.phone ) %]
[% reserveloo.patron.phone | html %][% END %] - [% IF ( reserveloo.patron.first_valid_email_address ) %]
- [% reserveloo.patron.first_valid_email_address | html %][% END %] -
[% Branches.GetName( reserveloo.homebranch ) | html %][% Branches.GetName( reserveloo.holdingbranch ) | html %][% reserveloo.itemcallnumber | html %][% reserveloo.copynumber | html %][% reserveloo.enumchron | html %] -
- - - - - - [% IF ( reserveloo.dotransfer ) %] - - [% ELSE %] - - [% END %] -
-
+ [% IF ( reserveloop ) %] + [% mailsubject = BLOCK %]Hold waiting: $1[% END %] + [% PROCESS show_hold_table table = { "id" => "holdst", "subject" => mailsubject, "tab" => "holdswaiting" } %] [% ELSE %]
No holds found.
[% END %]
- [% IF ( ReservesMaxPickUpDelay ) %]

Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay | html %] days.

[% END %] - [% IF ( overloop ) %] + [% IF ( ReservesMaxPickUpDelay ) %]

Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay | html %] days.

[% END %] + [% IF ( overloop ) %]
@@ -140,57 +147,11 @@ Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds sypref) [% END %] - - - - - - - - - - - - - - [% FOREACH overloo IN overloop %] - - - - - - - - - - - - - [% END %] -
Waiting sinceDate hold placedTitlePatronHome branchCurrent locationCall numberCopy numberEnumerationAction
[% overloo.waitingdate | $KohaDates %][% overloo.reservedate | $KohaDates %][% INCLUDE 'biblio-default-view.inc' biblionumber = overloo.biblionumber %][% overloo.title | html %] - [% FOREACH subtitl IN overloo.subtitle %] [% subtitl.subfield | html %][% END %] - - [% UNLESS ( item_level_itypes ) %][% IF ( overloo.itemtype ) %]  ([% overloo.itemtype | html %])[% END %][% END %] -
Barcode: [% overloo.barcode | html %] -
[% overloo.patron.surname | html %], [% overloo.patron.firstname | html %]
[% overloo.patron.phone | html %]
- [% IF ( overloo.patron.first_valid_email_address ) %] - [% overloo.patron.first_valid_email_address | html %][% END %] -
[% Branches.GetName( overloo.homebranch ) | html %][% Branches.GetName( overloo.holdingbranch ) | html %][% overloo.itemcallnumber | html %][% overloo.copynumber | html %][% overloo.enumchron | html %] - - - - - - [% IF ( overloo.dotransfer ) %] - - [% ELSE %] - - [% END %] - -
+ [% mailsubject = BLOCK %]Reservation: $1[% END %] + [% PROCESS show_hold_table reserveloop=overloop table = { "id" => "holdso", "subject" => mailsubject, "tab" => "holdsover" } %] [% ELSE %]
No holds found.
- [% END %] + [% END %]
[% END %] -- 2.11.0