Browse Source

Bug 9788: QA followup

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>
3.16.x
Jonathan Druart 11 years ago
committed by Galen Charlton
parent
commit
38edd714c5
  1. 2
      C4/Reserves.pm
  2. 2
      catalogue/detail.pl
  3. 3
      koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
  4. 2
      koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
  5. 3
      koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt
  6. 2
      opac/opac-reserve.pl
  7. 2
      reserve/request.pl

2
C4/Reserves.pm

@ -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
";

2
catalogue/detail.pl

@ -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;
}

3
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

@ -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 %])

2
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt

@ -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 %]

3
koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt

@ -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' %]
@ -529,7 +530,7 @@
<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>

2
opac/opac-reserve.pl

@ -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};

2
reserve/request.pl

@ -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

Loading…
Cancel
Save