Bug 9788: QA followup
authorJonathan Druart <jonathan.druart@biblibre.com>
Mon, 4 Nov 2013 10:55:57 +0000 (11:55 +0100)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 17 Jan 2014 05:10:42 +0000 (05:10 +0000)
1/ CURRENT_DATE() is a MySQLism and should be replaced with CAST(now() AS
DATE).
2/ The date formatting should be done in the template (using the TT
plugin).

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

C4/Reserves.pm
catalogue/detail.pl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt
opac/opac-reserve.pl
reserve/request.pl

index ea46f2a..f066404 100644 (file)
@@ -372,7 +372,7 @@ sub GetReservesFromItemnumber {
     my $query = "
     SELECT reservedate,borrowernumber,branchcode,reserve_id,waitingdate
     FROM   reserves
-    WHERE  itemnumber=? AND ( reservedate <= CURRENT_DATE() OR
+    WHERE  itemnumber=? AND ( reservedate <= CAST(now() AS date) OR
            waitingdate IS NOT NULL )
     ORDER BY priority
     ";
index 25893be..a3df03b 100755 (executable)
@@ -249,7 +249,7 @@ foreach my $item (@items) {
         $item->{ExpectedAtLibrary}      = $branches->{$expectedAt}{branchname};
         $item->{Reservedcardnumber}             = $ItemBorrowerReserveInfo->{'cardnumber'};
         # Check waiting status
-        $item->{waitingdate} = format_date($wait) if $wait;
+        $item->{waitingdate} = $wait;
     }
 
 
index 0a44dbf..1a81ef7 100644 (file)
@@ -1,5 +1,6 @@
 [% USE KohaDates %]
 [% USE AuthorisedValues %]
+[% USE KohaDates %]
 
 [% ShowCourseReserves = 0 %]
 [% IF UseCourseReserves %]
@@ -634,7 +635,7 @@ function verify_images() {
                             [% END %]
                             [% item.ExpectedAtLibrary %]
                             [% IF ( item.waitingdate ) %]
-                                since [% item.waitingdate %]
+                                since [% item.waitingdate | $KohaDates %]
                             [% ELSE %]
                                 [% IF ( item.reservedate ) %]
                                     (placed [% item.reservedate %])
index beeb5d7..79ec493 100644 (file)
@@ -456,7 +456,7 @@ function checkMultiHold() {
                     [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
                     [% IF ( itemloo.canreservefromotherbranches ) %]for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedForBorrowernumber %]">[% itemloo.ReservedForFirstname %] [% itemloo.ReservedForSurname %]</a>[% END %] [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemloo.ExpectedAtLibrary %]
                     since
-                    [% IF ( itemloo.waitingdate ) %][% itemloo.waitingdate %][% ELSE %][% IF ( itemloo.reservedate ) %][% itemloo.reservedate %][% END %][% END %]. <a class="info" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber %]&amp;CancelBorrowerNumber=[% itemloo.ReservedForBorrowernumber %]&amp;CancelItemnumber=[% itemloo.itemnumber %]"  onclick="if (window.confirm('Are you sure you want to delete this hold?')) {return true;} else {return false;}">Cancel hold</a>
+                    [% IF ( itemloo.waitingdate ) %][% itemloo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemloo.reservedate ) %][% itemloo.reservedate %][% END %][% END %]. <a class="info" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber %]&amp;CancelBorrowerNumber=[% itemloo.ReservedForBorrowernumber %]&amp;CancelItemnumber=[% itemloo.itemnumber %]"  onclick="if (window.confirm('Are you sure you want to delete this hold?')) {return true;} else {return false;}">Cancel hold</a>
 
                     [% END %]
             [% ELSE %]
index 671e1f9..b2e20c4 100644 (file)
@@ -1,4 +1,5 @@
 [% USE Koha %]
+[% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo;  Placing a hold
 [% INCLUDE 'doc-head-close.inc' %]
 [% INCLUDE 'calendar.inc' %]
                                   <span class="waiting">[% IF ( itemLoo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %] for patron
                                     [% IF ( itemLoo.waitingdate ) %]at[% ELSE %]expected at[% END %] [% itemLoo.ExpectedAtLibrary %]
                                     since
-                                    [% IF ( itemLoo.waitingdate ) %][% itemLoo.waitingdate %][% ELSE %][% IF ( itemLoo.reservedate ) %][% itemLoo.reservedate %][% END %][% END %].
+                                    [% IF ( itemLoo.waitingdate ) %][% itemLoo.waitingdate | $KohaDates %][% ELSE %][% IF ( itemLoo.reservedate ) %][% itemLoo.reservedate %][% END %][% END %].
                                   </span>
                                 [% ELSE %]
                                   <span class="notonhold">Not on hold</span>
index 3b1ca2b..df55c19 100755 (executable)
@@ -447,7 +447,7 @@ foreach my $biblioNum (@biblionumbers) {
             $itemLoopIter->{ReservedForFirstname}      = $ItemBorrowerReserveInfo->{'firstname'};
             $itemLoopIter->{ExpectedAtLibrary}         = $expectedAt;
             #waiting status
-            $itemLoopIter->{waitingdate} = format_date($wait) if $wait;
+            $itemLoopIter->{waitingdate} = $wait;
         }
 
         $itemLoopIter->{notforloan} = $itemInfo->{notforloan};
index 8701586..e915dbf 100755 (executable)
@@ -338,7 +338,7 @@ foreach my $biblionumber (@biblionumbers) {
                 $item->{ReservedForSurname}     = $ItemBorrowerReserveInfo->{'surname'};
                 $item->{ReservedForFirstname}     = $ItemBorrowerReserveInfo->{'firstname'};
                 $item->{ExpectedAtLibrary}     = $branches->{$expectedAt}{branchname};
-                $item->{waitingdate} = format_date($wait) if $wait;
+                $item->{waitingdate} = $wait;
             }
 
             # Management of the notforloan document