From 4f308d8be0b811bffba0b9eace7ccb23c0e1d976 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Mon, 3 Feb 2020 21:03:51 +0000 Subject: [PATCH] Bug 24718: Get templates working with HourBasedHolds Sponsored-by: Waikato Institute of Technology Signed-off-by: David Nind --- .../prog/en/includes/waiting_holds.inc | 16 ++++++++++-- .../prog/en/modules/circ/pendingreserves.tt | 7 +++++- .../prog/en/modules/circ/view_holdsqueue.tt | 8 +++++- .../prog/en/modules/members/holdshistory.tt | 12 ++++++++- svc/holds | 29 +++++++++++++++++----- 5 files changed, 61 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc index c3a01dbedb..0988908878 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc @@ -19,8 +19,20 @@ [% FOREACH reserveloo IN reserveloop %] - [% reserveloo.waitingdate | $KohaDates %] - [% reserveloo.reservedate | $KohaDates %] + + [% IF Koha.Preference('HourBasedHolds') %] + [% reserveloo.waitingdate | $KohaDates with_hours = 1 %] + [% ELSE %] + [% reserveloo.waitingdate | $KohaDates %] + [% END %] + + + [% IF Koha.Preference('HourBasedHolds') %] + [% reserveloo.reservedate | $KohaDates with_hours = 1 %] + [% ELSE %] + [% reserveloo.reservedate | $KohaDates %] + [% END %] + [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %] [% INCLUDE 'biblio-title.inc' biblio=reserveloo.biblio %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt index 71527fc4c9..be983f26ee 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt @@ -145,7 +145,12 @@ [% END %] - [% reserveloo.reservedate | $KohaDates %] in [% Branches.GetName ( reserveloo.branch ) | html %] + + [% IF Koha.Preference('HourBasedHolds') %] + [% reserveloo.reservedate | $KohaDates with_hours = 1 %] + [% ELSE %] + [% reserveloo.reservedate | $KohaDates %] + [% END %] in [% Branches.GetName ( reserveloo.branch ) | html %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt index 2fe8d4e813..297a47f2ec 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt @@ -170,7 +170,13 @@ [% END %] [% Branches.GetName( itemsloo.pickbranch ) | html %] - [% itemsloo.reservedate | $KohaDates %] + + [% IF Koha.Preference('HourBasedHolds') %] + [% itemsloo.reservedate | $KohaDates with_hours = 1 %] + [% ELSE %] + [% itemsloo.reservedate | $KohaDates %] + [% END %] + [% itemsloo.notes | html %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt index c0d574a763..a821513240 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/holdshistory.tt @@ -61,10 +61,20 @@ [% hold.biblio.author | html %] [% hold.item.barcode | html %] [% Branches.GetName( hold.branchcode ) | html %] - [% hold.reservedate | $KohaDates %] + + [% IF Koha.Preference('HourBasedHolds') %] + [% hold.reservedate | $KohaDates with_hours = 1 %] + [% ELSE %] + [% hold.reservedate | $KohaDates with_hours %] + [% END %] + [% IF hold.expirationdate %] + [% IF Koha.Preference('HourBasedHolds') %] + [% hold.expirationdate | $KohaDates with_hours = 1 %] + [% ELSE %] [% hold.expirationdate | $KohaDates %] + [% END %] [% ELSE %] [% END %] diff --git a/svc/holds b/svc/holds index 37254b6407..ebe35f8fde 100755 --- a/svc/holds +++ b/svc/holds @@ -107,19 +107,36 @@ while ( my $h = $holds_rs->next() ) { waiting_here => $h->branch()->branchcode() eq $branch, priority => $h->priority(), itemtype_limit => $itemtype_limit, - reservedate_formatted => $h->reservedate() ? output_pref( - { dt => dt_from_string( $h->reservedate() ), dateonly => 1 } - ) - : q{}, + subtitle => GetRecordValue( + 'subtitle', + GetMarcBiblio({ biblionumber => $biblionumber }), + GetFrameworkCode($biblionumber) + ), suspend_until_formatted => $h->suspend_until() ? output_pref( { dt => dt_from_string( $h->suspend_until() ), dateonly => 1 } ) : q{}, - expirationdate_formatted => $h->expirationdate() ? output_pref( + }; + + if ( C4::Context->preference('HourBasedHolds') ){ + $hold->{reservedate_formatted} = $h->reservedate() ? output_pref( + { dt => dt_from_string( $h->reservedate() ) } + ) + : q{}, + $hold->{expirationdate_formatted} = $h->expirationdate() ? output_pref( + { dt => dt_from_string( $h->expirationdate() ) } + ) + : q{}, + } else { + $hold->{reservedate_formatted} = $h->reservedate() ? output_pref( + { dt => dt_from_string( $h->reservedate() ), dateonly => 1 } + ) + : q{}, + $hold->{expirationdate_formatted} = $h->expirationdate() ? output_pref( { dt => dt_from_string( $h->expirationdate() ), dateonly => 1 } ) : q{}, - }; + } $hold->{transfered} = 0; $hold->{not_transfered} = 0; -- 2.11.0