From 39c0ad8bade197b47d069706a8fbbab69c186891 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 24 Apr 2014 12:41:29 -0400 Subject: [PATCH] Bug 9723 - Hourly loans don't show time due in OPAC Content-Type: text/plain; charset="utf-8" Due dates in the OPAC don't display the time items are due, and thus items which are on hourly loans don't display an accurate due date and time. This patch corrects this by adding the "with_hours => 1" parameter. To test, enable an hourly loan period for an itemtype in your collection. View the display of date due on the following pages: - Patron details (opac-user.pl) - Log into the OPAC as a user who has something checked out which circulates by the hour. - Bibliographic details (opac-detail.pl) - View the details for an item which is circulates by the hour and is checked out. - Course reserves details (opac-course-details.pl) - View the contents of a course reserve, one of which should be an item which circulates by the hour and is checked out. All due dates should show both date and time and be formatted correctly. Test in both prog and Bootstrap themes. This solution is less than ideal for libraries who do not use hourly loans, as the time information is useless and potentially confusing. It's problematic even for libraries who do use hourly loans, since probably not all loans are hourly. However, without doing a check of each item's circulation policy every time we display the due date I don't know how you can tell it's an hourly loan. Assume that items due at 23:59 are non-hourly? --- .../bootstrap/en/modules/opac-course-details.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 6 +++--- .../prog/en/modules/opac-course-details.tt | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 2 +- koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt index d5ff4bc..59484ae 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt @@ -68,7 +68,7 @@ [% cr.item.itemcallnumber %] [% cr.item.copynumber %] [% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %] - [% cr.issue.date_due | $KohaDates %] + [% cr.issue.date_due | $KohaDates with_hours => 1 %] [% cr.public_note %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 4abf17e..31c7d22 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1199,7 +1199,7 @@ [% IF ( itemdata_copynumber ) %][% ITEM_RESULT.copynumber %][% END %] [% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %] [% IF ( itemdata_itemnotes ) %][% ITEM_RESULT.itemnotes %][% END %] - [% ITEM_RESULT.datedue | $KohaDates %] + [% ITEM_RESULT.datedue | $KohaDates with_hours => 1 %] [% IF ( OPACShowBarcode ) %][% ITEM_RESULT.barcode %][% END %] [% IF holds_count.defined || show_priority %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 95c597c..340d661 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -172,14 +172,14 @@ Date due: - [% ISSUE.date_due | $KohaDates %] + [% ISSUE.date_due | $KohaDates with_hours => 1 %] [% ELSE %] Date due: - [% ISSUE.date_due | $KohaDates %] + [% ISSUE.date_due | $KohaDates with_hours => 1 %] [% END %] @@ -428,7 +428,7 @@ Date due: - [% OVERDUE.date_due | $KohaDates %] + [% OVERDUE.date_due | $KohaDates with_hours => 1 %] [% IF ( OpacRenewalAllowed ) %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-details.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-details.tt index 39cecbe..0a090ef 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-details.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-course-details.tt @@ -60,7 +60,7 @@ [% cr.item.itemcallnumber %] [% cr.item.copynumber %] [% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %] - [% cr.issue.date_due | $KohaDates %] + [% cr.issue.date_due | $KohaDates with_hours => 1 %] [% cr.public_note %] [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt index 7ffbbd0..47d2248 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -1581,7 +1581,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% IF ( itemdata_copynumber ) %][% ITEM_RESULT.copynumber %][% END %] [% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %] [% IF ( itemdata_itemnotes ) %][% ITEM_RESULT.itemnotes %][% END %] - [% ITEM_RESULT.datedue | $KohaDates %] + [% ITEM_RESULT.datedue | $KohaDates with_hours => 1 %] [% IF ( OPACShowBarcode ) %][% ITEM_RESULT.barcode %][% END %] [% IF holds_count.defined || show_priority %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt index e9fe2d2..6c34b9d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -184,9 +184,9 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended [% ISSUE.author %] [% IF ( ISSUE.overdue ) %] - [% ISSUE.date_due | $KohaDates %] + [% ISSUE.date_due | $KohaDates with_hours => 1 %] [% ELSE %] - [% ISSUE.date_due | $KohaDates %] + [% ISSUE.date_due | $KohaDates with_hours => 1 %] [% END %] [% UNLESS ( item_level_itypes ) %][% IF ( ISSUE.imageurl ) %][% ISSUE.description %][% END %] [% ISSUE.description %][% END %] [% IF ( show_barcode ) %][% ISSUE.barcode %][% END %] @@ -342,7 +342,7 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended [% UNLESS ( item_level_itypes ) %][% IF ( OVERDUE.imageurl ) %][% OVERDUE.description %][% END %] [% OVERDUE.description %][% END %] [% IF ( show_barcode ) %][% OVERDUE.barcode %][% END %] [% OVERDUE.itemcallnumber %] -[% OVERDUE.date_due | $KohaDates %] +[% OVERDUE.date_due | $KohaDates with_hours => 1 %] [% IF ( OpacRenewalAllowed ) %] [% IF ( OVERDUE.debarred ) %]Account frozen -- 1.7.9.5