@@ -, +, @@ the patron's opac checkout summary 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. --- C4/Reserves.pm | 1 + circ/circulation.pl | 33 +++++++++++++++++++--- circ/returns.pl | 1 + koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 12 ++++++-- .../prog/en/modules/circ/circulation.tt | 30 +++++++++++--------- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 4 ++- opac/opac-user.pl | 1 + svc/checkouts | 3 +- 9 files changed, 64 insertions(+), 23 deletions(-) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -358,6 +358,7 @@ sub GetReservesFromItemnumber { $r->get_column('branchcode'), $r->reserve_id(), $r->waitingdate(), + $r->get_column('expirationdate'), ); } --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -458,11 +458,36 @@ if ($borrowernumber) { if ($borrowernumber) { my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); $template->param( - holds_count => $holds->count(), - WaitingHolds => scalar $holds->waiting(), + holds_count => Koha::Database->new()->schema() + ->resultset('Reserve') + ->count( { borrowernumber => $borrowernumber } ), ); - - $template->param( adultborrower => 1 ) if ( $borrower->{category_type} eq 'A' || $borrower->{category_type} eq 'I' ); + 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} = format_date( $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' ); } #title --- a/circ/returns.pl +++ a/circ/returns.pl @@ -581,6 +581,7 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { $ri{itemtitle} = $biblio->{'title'}; $ri{itemauthor} = $biblio->{'author'}; $ri{itemcallnumber} = $biblio->{'itemcallnumber'}; + $ri{enumchron} = $item->{'enumchron'}; $ri{itemtype} = $biblio->{'itemtype'}; $ri{itemnote} = $biblio->{'itemnotes'}; $ri{ccode} = $biblio->{'ccode'}; --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ a/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 ); @@ -489,7 +493,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 ); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -797,28 +797,30 @@ No patron matched [% message %] - [% IF ( WaitingHolds ) %] + [% IF ( WaitingReserveLoop ) %]

Holds waiting:

- [% FOREACH w IN WaitingHolds %] + [% FOREACH WaitingReserveLoo IN WaitingReserveLoop %] [% END %]
- [% END %] + [% END %] [% IF ( notes ) %]
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -580,7 +580,7 @@ $(document).ready(function () { [% END %] - [% riloo.itemtitle |html %] + [% riloo.itemtitle |html %][% IF ( riloo.enumchron ) %]
[% riloo.enumchron %][% END %] [% riloo.itemauthor %] [% riloo.barcode %] [% riloo.homebranch %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ a/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 @@ [% WAITIN.itemtype %] - [% WAITIN.waiting_title %] [% FOREACH subtitl IN WAITIN.subtitle %] [% subtitl.subfield %][% END %] + [% WAITIN.waiting_title %] [% IF ( WAITIN.enumchron ) %][% WAITIN.enumchron %] [% END %][% FOREACH subtitl IN WAITIN.subtitle %] [% subtitl.subfield %][% END %] [% WAITIN.author %] @@ -540,6 +541,7 @@ [% RESERVE.reserves_title %] + [% IF ( WAITIN.enumchron ) %] [% WAITIN.enumchron %][% END %] [% FOREACH subtitl IN RESERVE.subtitle %] [% subtitl.subfield %] [% END %] --- a/opac/opac-user.pl +++ a/opac/opac-user.pl @@ -312,6 +312,7 @@ my $wcount = 0; foreach my $res (@reserves) { if ( $res->{'itemnumber'} ) { my $item = GetItem( $res->{'itemnumber'}); + $res->{enumchron} = $item->{enumchron}; $res->{'holdingbranch'} = $branches->{ $item->{'holdingbranch'} }->{'branchname'}; $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'}; --- a/svc/checkouts +++ a/svc/checkouts @@ -93,7 +93,7 @@ my $sql = ' itemlost, damaged, location, - + items.enumchron, DATEDIFF( issuedate, CURRENT_DATE() ) AS not_issued_today FROM issues LEFT JOIN items USING ( itemnumber ) @@ -168,6 +168,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, --