Bug 17821 - due date in intranet search results should use TT date plugin
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 28 Dec 2016 14:08:42 +0000 (15:08 +0100)
committerJulian Maurice <julian.maurice@biblibre.com>
Wed, 10 May 2017 08:21:46 +0000 (10:21 +0200)
Intranet search results displays due date from item onloan.
This should use the TT date plugin.

Test plan :
- set syspref dateformat not on yyyy-mm-dd, for example dd/mm/yyyy
- checkout an item
- at intranet, perform a search where you see the item
=> You must see : "date due : dd/mm/yyyy"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Mason James <mtj@kohaaloha.com>
(cherry picked from commit a6315f2f4423a9b90203db72f74f69bfaa31815e)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

C4/Search.pm
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt

index 2519186..eb2b926 100644 (file)
@@ -2107,7 +2107,7 @@ sub searchResults {
             {
                 $onloan_count++;
                 my $key = $prefix . $item->{onloan} . $item->{barcode};
-                $onloan_items->{$key}->{due_date} = output_pref( { str => $item->{onloan}, dateonly => 1 } );
+                $onloan_items->{$key}->{due_date} = $item->{onloan};
                 $onloan_items->{$key}->{count}++ if $item->{$hbranch};
                 $onloan_items->{$key}->{branchname}     = $item->{branchname};
                 $onloan_items->{$key}->{location}       = $shelflocations->{ $item->{location} };
index af92b49..798d0f6 100644 (file)
@@ -1,4 +1,5 @@
 [% USE Koha %]
+[% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Catalog &rsaquo; [% IF ( searchdesc ) %]Results of search [% IF ( query_desc ) %]for '[% query_desc | html %]'[% END %][% IF ( limit_desc ) %]&nbsp;with limit(s):&nbsp;'[% limit_desc | html %]'[% END %][% ELSE %]You did not specify any search criteria[% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
@@ -629,7 +630,7 @@ var holdForPatron = function () {
                                         [% IF ( onloan_items_loo.branchname ) %][% onloan_items_loo.branchname %][% END %]
                                         [% IF ( onloan_items_loo.location ) %][% onloan_items_loo.location %][% END %]
                                         [% IF ( onloan_items_loo.itemcallnumber ) %][<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&amp;q=%22[% onloan_items_loo.itemcallnumber |uri %]%22">[% onloan_items_loo.itemcallnumber %]</a>][% END %]
-                                        ([% onloan_items_loo.count %][% IF ( onloan_items_loo.longoverdue ) %], [% onloan_items_loo.longoverdue %] long overdue[% END %]) date due: [% onloan_items_loo.due_date %]
+                                        ([% onloan_items_loo.count %][% IF ( onloan_items_loo.longoverdue ) %], [% onloan_items_loo.longoverdue %] long overdue[% END %]) date due: [% onloan_items_loo.due_date | $KohaDates %]
                                         [% IF item_level_itypes && onloan_items_loo.description %]
                                         <br/>[% onloan_items_loo.description %]
                                         [% END %]