Bug 9723: display time due for hourly loans in the public catalog

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 (and using) a new "as_due_date"
option to the KohaDates plugin made possible by Bug 11148.

Thanks to Galen for providing the changes to KohaDates.pm.

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.

Due dates for hourly items should show both date and time and be
formatted correctly. Due dates for non-hourly loans should show only the
date. Test in both prog and Bootstrap themes.

Signed-off-by: Aleisha <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Owen Leonard 2014-04-24 12:41:29 -04:00 committed by Galen Charlton
parent fb8d47beda
commit 6f0215da9e
7 changed files with 13 additions and 11 deletions

View File

@ -30,7 +30,9 @@ sub filter {
return "" unless $text;
$config->{with_hours} //= 0;
my $dt = dt_from_string( $text, 'iso' );
return output_pref({ dt => $dt, dateonly => !$config->{with_hours} });
return $config->{as_due_date} ?
output_pref({ dt => $dt, as_due_date => 1 }) :
output_pref({ dt => $dt, dateonly => !$config->{with_hours} });
}
1;

View File

@ -68,7 +68,7 @@
<td>[% cr.item.itemcallnumber %]</td>
<td>[% cr.item.copynumber %]</td>
<td>[% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %]</td>
<td>[% cr.issue.date_due | $KohaDates %]</td>
<td>[% cr.issue.date_due | $KohaDates as_due_date => 1 %]</td>
<td>[% cr.public_note %]</td>
</tr>
[% END %]

View File

@ -1209,7 +1209,7 @@
[% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber %]</td>[% END %]
<td class="status">[% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
[% IF ( itemdata_itemnotes ) %]<td class="notes" property="description">[% ITEM_RESULT.itemnotes %]</td>[% END %]
<td class="date_due"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates %]</span></td>
<td class="date_due"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates as_due_date => 1 %]</span></td>
[% IF ( OPACShowBarcode ) %]<td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode %]</td>[% END %]
[% IF holds_count.defined || show_priority %]
<td class="holds_count">

View File

@ -190,14 +190,14 @@
<td class="date_due overdue">
<span title="[% ISSUE.date_due %]">
<span class="tdlabel">Date due:</span>
[% ISSUE.date_due | $KohaDates %]
[% ISSUE.date_due | $KohaDates as_due_date => 1 %]
</span>
</td>
[% ELSE %]
<td class="date_due">
<span title="[% ISSUE.date_due %]">
<span class="tdlabel">Date due:</span>
[% ISSUE.date_due | $KohaDates %]
[% ISSUE.date_due | $KohaDates as_due_date => 1 %]
</span>
</td>
[% END %]
@ -446,7 +446,7 @@
<td>
<span title="[% OVERDUE.date_due %]">
<span class="tdlabel">Date due:</span>
[% OVERDUE.date_due | $KohaDates %]
[% OVERDUE.date_due | $KohaDates as_due_date => 1 %]
</span>
</td>
[% IF ( OpacRenewalAllowed ) %]

View File

@ -60,7 +60,7 @@
<td>[% cr.item.itemcallnumber %]</td>
<td>[% cr.item.copynumber %]</td>
<td>[% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %]</td>
<td>[% cr.issue.date_due | $KohaDates %]</td>
<td>[% cr.issue.date_due | $KohaDates as_due_date => 1 %]</td>
<td>[% cr.public_note %]</td>
</tr>
[% END %]

View File

@ -1570,7 +1570,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
[% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber %]</td>[% END %]
<td class="status">[% INCLUDE 'item-status-schema-org.inc' item = ITEM_RESULT %][% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
[% IF ( itemdata_itemnotes ) %]<td class="notes" property="description">[% ITEM_RESULT.itemnotes %]</td>[% END %]
<td class="date_due"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates %]</span></td>
<td class="date_due"><span title="[% ITEM_RESULT.datedue %]">[% ITEM_RESULT.datedue | $KohaDates as_due_date => 1 %]</span></td>
[% IF ( OPACShowBarcode ) %]<td class="barcode" property="serialNumber">[% ITEM_RESULT.barcode %]</td>[% END %]
[% IF holds_count.defined || show_priority %]
<td class="holds_count">

View File

@ -210,9 +210,9 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended
[% ISSUE.author %]
</span></td>
[% IF ( ISSUE.overdue ) %]
<td class="date_due overdue"><span title="[% ISSUE.date_due %]">[% ISSUE.date_due | $KohaDates %]</span></td>
<td class="date_due overdue"><span title="[% ISSUE.date_due %]">[% ISSUE.date_due | $KohaDates as_due_date => 1 %]</span></td>
[% ELSE %]
<td class="date_due"><span title="[% ISSUE.date_due %]">[% ISSUE.date_due | $KohaDates %]</span></td>
<td class="date_due"><span title="[% ISSUE.date_due %]">[% ISSUE.date_due | $KohaDates as_due_date => 1 %]</span></td>
[% END %]
[% UNLESS ( item_level_itypes ) %]<td class="itype">[% IF ( ISSUE.imageurl ) %]<img src="[% ISSUE.imageurl %]" title="[% ISSUE.description %]" alt="[% ISSUE.description %]" />[% END %] [% ISSUE.description %]</td>[% END %]
[% IF ( show_barcode ) %]<td class="barcode">[% ISSUE.barcode %]</td>[% END %]
@ -368,7 +368,7 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended
[% UNLESS ( item_level_itypes ) %]<td>[% IF ( OVERDUE.imageurl ) %]<img src="[% OVERDUE.imageurl %]" title="[% OVERDUE.description %]" alt="[% OVERDUE.description %]" />[% END %] [% OVERDUE.description %]</td>[% END %]
[% IF ( show_barcode ) %]<td>[% OVERDUE.barcode %]</td>[% END %]
<td>[% OVERDUE.itemcallnumber %]</td>
<td><span title="[% OVERDUE.date_due %]">[% OVERDUE.date_due | $KohaDates %]</span></td>
<td><span title="[% OVERDUE.date_due %]">[% OVERDUE.date_due | $KohaDates as_due_date => 1 %]</span></td>
[% IF ( OpacRenewalAllowed ) %]
<td>
[% IF ( OVERDUE.debarred ) %]Account frozen