From f690b491b20d1d7eda0a180d15b7b70df4ecde3e 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 e445ace165..337ff7b961 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 1510f81ed9..6cef08a45e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt @@ -143,7 +143,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 63bc6263de..1ccf396452 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 @@ -169,7 +169,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 9510750cbe..eb3d33b1ef 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 af1b033063..45351d157f 100755 --- a/svc/holds +++ b/svc/holds @@ -108,19 +108,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