From 033e0c8c1d54acc54c7259a617e4ccd250034dbc Mon Sep 17 00:00:00 2001 From: charles Date: Wed, 30 Mar 2016 12:27:00 -0400 Subject: [PATCH] Bug 14668 - Show serial enumeration in the checkin page and the patron's opac checkout summary The enumchron is now displayed alongside the author name in the "Title" section of the item summary. TEST PLAN ========= 1) INTRANET 1) Edit an item and add something in the "h" subfield, ie: "volume #42" 2) Check out the item to a patron 3) In the patron page, both at the bottom of the page or in the "Check out" tab, you should see the enumchron concatenated with the title 2) OPAC 1) Search for the same patron you used earlier 2) In the "your summary" tab, you should see the enumchron in the Title 3) INTRANET 1) Check in the item you just borrowed 2) At check in, the enumchron should also appear in the Title. Signed-off-by: Liz Rea Appears in the places listed, looks ok to me. --- C4/Reserves.pm | 1 + circ/circulation.pl | 25 ++++++++++++ circ/returns.pl | 1 + koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 12 +++++- .../prog/en/modules/circ/circulation.tt | 46 +++++++++++----------- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 3 +- svc/checkouts | 3 +- 8 files changed, 66 insertions(+), 27 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index fbeca06..1731c92 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -368,6 +368,7 @@ sub GetReservesFromItemnumber { $r->get_column('branchcode'), $r->reserve_id(), $r->waitingdate(), + $r->get_column('expirationdate'), ); } diff --git a/circ/circulation.pl b/circ/circulation.pl index 2bda49b..84adc61 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -467,6 +467,31 @@ if ($borrowernumber) { WaitingHolds => $waiting_holds, ); + my @borrowerreserv = GetReservesFromBorrowernumber($borrowernumber); + + my @WaitingReserveLoop; + foreach my $num_res (@borrowerreserv) { + if ( $num_res->{'found'} && $num_res->{'found'} eq 'W' ) { + my $getiteminfo = GetBiblioFromItemNumber( $num_res->{'itemnumber'} ); + my $itemholdinfo = GetReservesFromItemnumber( $num_res->{'itemnumber'} ); + my $itemtypeinfo = getitemtypeinfo( (C4::Context->preference('item-level_itypes')) ? $getiteminfo->{'itype'} : $getiteminfo->{'itemtype'} ); + my %getWaitingReserveInfo; + $getWaitingReserveInfo{title} = $getiteminfo->{'title'}; + $getWaitingReserveInfo{biblionumber} = $getiteminfo->{'biblionumber'}; + $getWaitingReserveInfo{author} = $getiteminfo->{'author'}; + $getWaitingReserveInfo{itemcallnumber} = $getiteminfo->{'itemcallnumber'}; + $getWaitingReserveInfo{enumchron} = $getiteminfo->{'enumchron'}; + $getWaitingReserveInfo{reservedate} = $num_res->{'reservedate'}; + $getWaitingReserveInfo{waitingat} = GetBranchName( $num_res->{'branchcode'} ); + $getWaitingReserveInfo{itemtype} = $itemtypeinfo->{'description'}; + $getWaitingReserveInfo{expirationdate} = $itemholdinfo->{'expirationdate'}; + $getWaitingReserveInfo{waitinghere} = 1 + if $num_res->{'branchcode'} eq $branch; + push( @WaitingReserveLoop, \%getWaitingReserveInfo ); + } + } + $template->param( WaitingReserveLoop => \@WaitingReserveLoop ); + $template->param( adultborrower => 1 ) if ( $borrower->{category_type} eq 'A' || $borrower->{category_type} eq 'I' ); } diff --git a/circ/returns.pl b/circ/returns.pl index 2f09b80..27212e9 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -594,6 +594,7 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { $ri{itemtitle} = $biblio->{'title'}; $ri{itemauthor} = $biblio->{'author'}; $ri{itemcallnumber} = $biblio->{'itemcallnumber'}; + $ri{enumchron} = $item->{'enumchron'}; $ri{dateaccessioned} = $item->{dateaccessioned}; $ri{itemtype} = $biblio->{'itemtype'}; $ri{itemnote} = $biblio->{'itemnotes'}; diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js index 5137b7d..15b36ac 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -227,7 +227,11 @@ $(document).ready(function() { title += " " + value.subfield; }); - title += ""; + if ( oObj.enumchron ) { + title += "" + " " + oObj.enumchron + ""; + } else { + title += ""; + } if ( oObj.author ) { title += " " + BY.replace( "_AUTHOR_", " " + oObj.author ); @@ -499,7 +503,11 @@ $(document).ready(function() { title += " " + value.subfield; }); - title += ""; + if ( oObj.enumchron ) { + title += "" + " " + oObj.enumchron + ""; + } else { + title += ""; + } if ( oObj.author ) { title += " " + BY.replace( "_AUTHOR_", " " + oObj.author ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 0efe49b..965ab3e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -800,28 +800,30 @@ No patron matched [% message %] - [% IF WaitingHolds.count %] -
-

Holds waiting:

- [% FOREACH w IN WaitingHolds %] -
    -
  • - [% w.biblio.title | html %] - ([% ItemTypes.GetDescription( w.item.effective_itemtype ) %]), - [% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %] - [% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber %]] [% END %] - Hold placed on [% w.reservedate | $KohaDates %]. - -
    - [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode() ) %][% ELSE %][% END %] - [% SET waiting_expires_on = w.waiting_expires_on %] - Waiting at [% w.branch.branchname | html %] [% IF waiting_expires_on %] until [% waiting_expires_on | $KohaDates %] [% END %] - -
  • -
- [% END %] -
- [% END %] + [% IF ( WaitingReserveLoop ) %] +
+

Holds waiting:

+ [% FOREACH WaitingReserveLoo IN WaitingReserveLoop %] +
    +
  • + [% WaitingReserveLoo.title | html %] + ([% WaitingReserveLoo.itemtype %]) + [% IF ( WaitingReserveLoo.enumchron ) %] [% WaitingReserveLoo.enumchron %][% END %], + [% IF ( WaitingReserveLoo.author ) %]
    by [% WaitingReserveLoo.author | html %][% END %] + [% IF ( WaitingReserveLoo.itemcallnumber ) %][[% WaitingReserveLoo.itemcallnumber %]] [% END %] + Hold placed on [% WaitingReserveLoo.reservedate %]. + +
    + [% IF ( WaitingReserveLoo.waitingat ) %] + [% IF ( WaitingReserveLoo.waitinghere ) %][% ELSE %][% END %] + Waiting at [% WaitingReserveLoo.waitingat | html %] [% IF WaitingReserveLoo.expiratedate %] until [% WaitingReserveLoo.expirationdate | $KohaDates %] [% END %] + + [% END %] +
  • +
+ [% END %] +
+ [% END %] [% IF ( notes ) %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 2c650d9..df229ff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -614,7 +614,7 @@ $(document).ready(function () { [% END %] - [% riloo.itemtitle |html %] + [% riloo.itemtitle |html %][% IF ( riloo.enumchron ) %]
[% riloo.enumchron %][% END %] [% riloo.itemauthor %] [% riloo.barcode %] [% Branches.GetName( riloo.homebranch ) %] 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 d45222e..5147701 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -193,6 +193,7 @@ [% ISSUE.title |html %] [% FOREACH subtitl IN ISSUE.subtitle %] [% subtitl.subfield %][% END %] + [% IF ( ISSUE.enumchron ) %] [% ISSUE.enumchron %][% END %] [% ISSUE.author %] [% IF ( ISSUE.overdue ) %] @@ -353,7 +354,7 @@ - [% i.item.biblio.title %] + [% i.item.biblio.title %][% IF ( i.item.enumchron ) %] [% i.item.enumchron %][% END %] diff --git a/svc/checkouts b/svc/checkouts index 93a1c95..3a3673f 100755 --- a/svc/checkouts +++ b/svc/checkouts @@ -97,7 +97,7 @@ my $sql = ' itemlost, damaged, location, - + items.enumchron, DATEDIFF( issuedate, CURRENT_DATE() ) AS not_issued_today FROM issues LEFT JOIN items USING ( itemnumber ) @@ -173,6 +173,7 @@ while ( my $c = $sth->fetchrow_hashref() ) { date_due_overdue => $c->{date_due_overdue} ? JSON::true : JSON::false, timestamp => $c->{timestamp}, onsite_checkout => $c->{onsite_checkout}, + enumchron => $c->{'enumchron'}, renewals_count => $renewals_count, renewals_allowed => $renewals_allowed, renewals_remaining => $renewals_remaining, -- 1.9.1