Bugzilla – Attachment 104727 Details for
Bug 19532
Recalls for Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19532: Other objects used in recalls feature
Bug-19532-Other-objects-used-in-recalls-feature.patch (text/plain), 37.17 KB, created by
Aleisha Amohia
on 2020-05-12 05:52:12 UTC
(
hide
)
Description:
Bug 19532: Other objects used in recalls feature
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2020-05-12 05:52:12 UTC
Size:
37.17 KB
patch
obsolete
>From a99103abbebd86d066bfa3371be042aede3c3363 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 22 Apr 2020 20:06:54 +0000 >Subject: [PATCH] Bug 19532: Other objects used in recalls feature > >* biblio->recalls >* biblio->can_be_recalled >* item->recall >* item->can_be_recalled >* item->can_set_waiting_recall >* patron->recalls >* tests >--- > C4/Circulation.pm | 101 ++++++++++++++++++++++- > C4/Search.pm | 9 ++ > C4/XSLT.pm | 4 +- > Koha/Biblio.pm | 102 +++++++++++++++++++++++ > Koha/Item.pm | 181 +++++++++++++++++++++++++++++++++++++++++ > Koha/Patron.pm | 24 ++++++ > Koha/Template/Plugin/Biblio.pm | 9 ++ > t/db_dependent/Koha/Biblio.t | 118 ++++++++++++++++++++++++++- > t/db_dependent/Koha/Item.t | 147 ++++++++++++++++++++++++++++++++- > 9 files changed, 690 insertions(+), 5 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 8db887db2e7..ea6d9357e3d 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -299,6 +299,14 @@ The item was reserved. The value is a reference-to-hash whose keys are fields fr > > The item was eligible to be transferred. Barring problems communicating with the database, the transfer should indeed have succeeded. The value should be ignored. > >+=item C<RecallPlacedAtHoldingBranch> >+ >+A recall for this item was found, and the transfer has already been completed as the item's branch matches the recall's pickup branch. >+ >+=item C<RecallFound> >+ >+A recall for this item was found, and the item needs to be transferred to the recall's pickup branch. >+ > =back > > =back >@@ -360,6 +368,19 @@ sub transferbook { > $dotransfer = 1; > } > >+ # find recall >+ my $recall = Koha::Recalls->find({ itemnumber => $itemnumber, status => 'T' }); >+ if ( defined $recall ) { >+ # do a transfer if the recall branch is different to the item holding branch >+ if ( $recall->branchcode eq $fbr ) { >+ $dotransfer = 0; >+ $messages->{'RecallPlacedAtHoldingBranch'} = 1; >+ } else { >+ $dotransfer = 1; >+ $messages->{'RecallFound'} = $recall; >+ } >+ } >+ > #actually do the transfer.... > if ($dotransfer) { > ModItemTransfer( $itemnumber, $fbr, $tbr, $trigger ); >@@ -669,6 +690,10 @@ sticky due date is invalid or due date in the past > > if the borrower borrows to much things > >+=head3 RECALLED >+ >+recalled by someone else >+ > =cut > > sub CanBookBeIssued { >@@ -1020,7 +1045,35 @@ sub CanBookBeIssued { > } > } > >- unless ( $ignore_reserves ) { >+ my $recall; >+ # CHECK IF ITEM HAS BEEN RECALLED BY ANOTHER PATRON >+ # Only bother doing this if UseRecalls is enabled and the item is recallable >+ # Don't look at recalls that are in transit >+ if ( C4::Context->preference('UseRecalls') and $item_object->can_be_waiting_recall({ patron => $patron }) ) { >+ my @recalls = $biblio->recalls; >+ >+ foreach my $r ( @recalls ) { >+ if ( $r->item_level_recall and >+ $r->itemnumber == $item_object->itemnumber and >+ $r->borrowernumber != $patron->borrowernumber and >+ !$r->in_transit ) { >+ # this specific item has been recalled by a different patron >+ $needsconfirmation{RECALLED} = $r; >+ $recall = $r; >+ last; >+ } >+ elsif ( !$r->item_level_recall and >+ $r->borrowernumber != $patron->borrowernumber and >+ !$r->in_transit ) { >+ # a different patron has placed a biblio-level recall and this item is eligible to fill it >+ $needsconfirmation{RECALLED} = $r; >+ $recall = $r; >+ last; >+ } >+ } >+ } >+ >+ unless ( $ignore_reserves and defined $recall ) { > # See if the item is on reserve. > my ( $restype, $res ) = C4::Reserves::CheckReserves( $item_object->itemnumber ); > if ($restype) { >@@ -1290,6 +1343,10 @@ AddIssue does the following things : > * RESERVE PLACED ? > - fill reserve if reserve to this patron > - cancel reserve or not, otherwise >+ * RECALL PLACED ? >+ - fill recall if recall to this patron >+ - cancel recall or not >+ - revert recall's waiting status or not > * TRANSFERT PENDING ? > - complete the transfert > * ISSUE THE BOOK >@@ -1304,6 +1361,8 @@ sub AddIssue { > my $onsite_checkout = $params && $params->{onsite_checkout} ? 1 : 0; > my $switch_onsite_checkout = $params && $params->{switch_onsite_checkout}; > my $auto_renew = $params && $params->{auto_renew}; >+ my $cancel_recall = $params && $params->{cancel_recall}; >+ my $recall_id = $params && $params->{recall_id}; > my $dbh = C4::Context->dbh; > my $barcodecheck = CheckValidBarcode($barcode); > >@@ -1375,6 +1434,8 @@ sub AddIssue { > AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} ); > } > >+ Koha::Recalls->move_recall({ action => $cancel_recall, recall_id => $recall_id, itemnumber => $item_object->itemnumber, borrowernumber => $borrower->{borrowernumber} }); >+ > C4::Reserves::MoveReserve( $item_object->itemnumber, $borrower->{'borrowernumber'}, $cancelreserve ); > > # Starting process for transfer job (checking transfert and validate it if we have one) >@@ -1836,6 +1897,16 @@ Value 1 if return is successful. > > If AutomaticItemReturn is disabled, return branch is given as value of NeedsTransfer. > >+=item C<RecallFound> >+ >+This item can fill a recall. The recall object is returned. If the recall pickup branch differs from >+the branch this item is being returned at, C<RecallNeedsTransfer> is also returned which contains this >+branchcode. >+ >+=item C<TransferredRecall> >+ >+This item has been transferred to this branch to fill a recall. The recall object is returned. >+ > =back > > C<$iteminformation> is a reference-to-hash, giving information about the >@@ -2076,6 +2147,16 @@ sub AddReturn { > } > } > >+ # find recalls... >+ # check if this item is recallable first, which includes checking if UseRecalls syspref is enabled >+ my $recall = $item->check_recalls if $item->can_be_waiting_recall; >+ if ( defined $recall ) { >+ $messages->{RecallFound} = $recall; >+ if ( $recall->branchcode ne $branch ) { >+ $messages->{RecallNeedsTransfer} = $branch; >+ } >+ } >+ > # find reserves..... > # launch the Checkreserves routine to find any holds > my ($resfound, $resrec); >@@ -2143,8 +2224,13 @@ sub AddReturn { > $request->status('RET') if $request; > } > >+ my $transfer_recall = Koha::Recalls->find({ itemnumber => $item->itemnumber, status => 'T' }); # all recalls that have triggered a transfer will have an allocated itemnumber >+ if ( $transfer_recall && $transfer_recall->branchcode eq $branch ) { >+ $messages->{TransferredRecall} = $transfer_recall; >+ } >+ > # Transfer to returnbranch if Automatic transfer set or append message NeedsTransfer >- if (!$is_in_rotating_collection && ($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $returnbranch) and not $messages->{'WrongTransfer'}){ >+ if (!$is_in_rotating_collection && ($doreturn or $messages->{'NotIssued'}) and !$resfound and ($branch ne $returnbranch) and not $messages->{'WrongTransfer'} and not $messages->{TransferredRecall} and $recall->branchcode ne $branch){ > my $BranchTransferLimitsType = C4::Context->preference("BranchTransferLimitsType") eq 'itemtype' ? 'effective_itemtype' : 'ccode'; > if (C4::Context->preference("AutomaticItemReturn" ) or > (C4::Context->preference("UseBranchTransferLimits") and >@@ -2835,6 +2921,17 @@ sub CanBookBeRenewed { > } > } > >+ my $recall = $item->check_recalls if $item->can_be_waiting_recall; >+ if ( defined $recall ) { >+ if ( $recall->item_level_recall ) { >+ # item-level recall. check if this item is the recalled item, otherwise renewal will be allowed >+ return ( 0, 'recalled' ) if ( $recall->itemnumber == $item->itemnumber ); >+ } else { >+ # biblio-level recall, so only disallow renewal if the biblio-level recall has been fulfilled by a different item >+ return ( 0, 'recalled' ) unless ( $recall->waiting ); >+ } >+ } >+ > my ( $resfound, $resrec, undef ) = C4::Reserves::CheckReserves($itemnumber); > > # This item can fill one or more unfilled reserve, can those unfilled reserves >diff --git a/C4/Search.pm b/C4/Search.pm >index a10e50f2b68..44a64959cbc 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1893,6 +1893,7 @@ sub searchResults { > my $can_place_holds = 0; > my $item_onhold_count = 0; > my $notforloan_count = 0; >+ my $item_recalled_count = 0; > my $items_count = scalar(@fields); > my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults'); > my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1; >@@ -1987,6 +1988,9 @@ sub searchResults { > # is item on the reserve shelf? > my $reservestatus = ''; > >+ # is item a waiting recall? >+ my $recallstatus = ''; >+ > unless ($item->{withdrawn} > || $item->{itemlost} > || $item->{damaged} >@@ -2008,6 +2012,7 @@ sub searchResults { > # > ($transfertwhen, $transfertfrom, $transfertto) = C4::Circulation::GetTransfers($item->{itemnumber}); > $reservestatus = C4::Reserves::GetReserveStatus( $item->{itemnumber} ); >+ $recallstatus = 'Waiting' if Koha::Recalls->search({ itemnumber => $item->{itemnumber}, status => 'W' })->count; > } > > # item is withdrawn, lost, damaged, not for loan, reserved or in transit >@@ -2016,6 +2021,7 @@ sub searchResults { > || $item->{damaged} > || $item->{notforloan} > || $reservestatus eq 'Waiting' >+ || $recallstatus eq 'Waiting' > || ($transfertwhen && $transfertwhen ne '')) > { > $withdrawn_count++ if $item->{withdrawn}; >@@ -2023,6 +2029,7 @@ sub searchResults { > $itemdamaged_count++ if $item->{damaged}; > $item_in_transit_count++ if $transfertwhen && $transfertwhen ne ''; > $item_onhold_count++ if $reservestatus eq 'Waiting'; >+ $item_recalled_count++ if $recallstatus eq 'Waiting'; > $item->{status} = ($item->{withdrawn}//q{}) . "-" . ($item->{itemlost}//q{}) . "-" . ($item->{damaged}//q{}) . "-" . ($item->{notforloan}//q{}); > > # can place a hold on a item if >@@ -2044,6 +2051,7 @@ sub searchResults { > $other_items->{$key}->{$_} = $item->{$_}; > } > $other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0; >+ $other_items->{$key}->{recalled} = ($recallstatus) ? 1 : 0; > $other_items->{$key}->{onhold} = ($reservestatus) ? 1 : 0; > $other_items->{$key}->{notforloan} = GetAuthorisedValueDesc('','',$item->{notforloan},'','',$notforloan_authorised_value) if $notforloan_authorised_value and $item->{notforloan}; > $other_items->{$key}->{count}++ if $item->{$hbranch}; >@@ -2112,6 +2120,7 @@ sub searchResults { > $oldbiblio->{damagedcount} = $itemdamaged_count; > $oldbiblio->{intransitcount} = $item_in_transit_count; > $oldbiblio->{onholdcount} = $item_onhold_count; >+ $oldbiblio->{recalledcount} = $item_recalled_count; > $oldbiblio->{orderedcount} = $ordered_count; > $oldbiblio->{notforloancount} = $notforloan_count; > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 1b3941c7fbe..eb350cd2d75 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -321,10 +321,12 @@ sub buildKohaItemsNamespace { > my $status; > my $substatus = ''; > >+ my $recalls = Koha::Recalls->search({ itemnumber => $item->itemnumber, status => 'W' }); >+ > if ($item->has_pending_hold) { > $status = 'Pending hold'; > } >- elsif ( $item->holds->waiting->count ) { >+ elsif ( $item->holds->waiting->count || $recalls->count ) { > $status = 'Waiting'; > } > elsif ($item->get_transfer) { >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 4fe30113e3b..10568a9b779 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -815,6 +815,108 @@ sub to_api_mapping { > }; > } > >+=head3 recalls >+ >+ my @recalls = $biblio->recalls; >+ >+Return all active recalls attached to this biblio, sorted by oldest first >+ >+=cut >+ >+sub recalls { >+ my ( $self ) = @_; >+ my @recalls_rs = Koha::Recalls->search({ biblionumber => $self->biblionumber, old => undef }, { order_by => { -asc => 'recalldate' } }); >+ return @recalls_rs; >+} >+ >+=head3 can_be_recalled >+ >+ my @items_for_recall = $biblio->can_be_recalled({ patron => $patron_object }); >+ >+Does biblio-level checks and returns the items attached to this biblio that are available for recall >+ >+=cut >+ >+sub can_be_recalled { >+ my ( $self, $params ) = @_; >+ >+ return 0 if !( C4::Context->preference('UseRecalls') ); >+ >+ my $patron = $params->{patron}; >+ >+ my $branchcode = C4::Context->userenv->{'branch'}; >+ if ( C4::Context->preference('CircControl') eq 'PatronLibrary' and $patron ) { >+ $branchcode = $patron->branchcode; >+ } >+ >+ # items are unavailable for recall if they are lost, withdrawn or notforloan >+ my @items = Koha::Items->search({ biblionumber => $self->biblionumber, itemlost => 0, withdrawn => 0, notforloan => 0 }); >+ >+ # if there are no available items at all, no recall can be placed >+ return 0 if ( scalar @items == 0 ); >+ >+ my @itemtypes; >+ my @itemnumbers; >+ foreach my $item ( @items ) { >+ push( @itemtypes, $item->effective_itemtype ); >+ push( @itemnumbers, $item->itemnumber ); >+ } >+ >+ # Check the circulation rule for each relevant itemtype for this biblio >+ my ( @recalls_allowed, @recalls_per_record, @on_shelf_recalls ); >+ foreach my $itemtype ( @itemtypes ) { >+ my $rule = Koha::CirculationRules->get_effective_rules({ >+ branchcode => $branchcode, >+ categorycode => $patron ? $patron->categorycode : undef, >+ itemtype => $itemtype, >+ rules => [ >+ 'recalls_allowed', >+ 'recalls_per_record', >+ 'on_shelf_recalls', >+ ], >+ }); >+ push( @recalls_allowed, $rule->{recalls_allowed} ) if $rule; >+ push( @recalls_per_record, $rule->{recalls_per_record} ) if $rule; >+ push( @on_shelf_recalls, $rule->{on_shelf_recalls} ) if $rule; >+ } >+ my $recalls_allowed = (sort {$b <=> $a} @recalls_allowed)[0]; # take highest >+ my $recalls_per_record = (sort {$b <=> $a} @recalls_per_record)[0]; # take highest >+ my %on_shelf_recalls_count = (); >+ foreach my $count ( @on_shelf_recalls ) { >+ $on_shelf_recalls_count{$count}++; >+ } >+ my $on_shelf_recalls = (sort {$on_shelf_recalls_count{$b} <=> $on_shelf_recalls_count{$a}} @on_shelf_recalls)[0]; # take most common >+ >+ # check recalls allowed has been set and is not zero >+ return 0 if ( !defined($recalls_allowed) || $recalls_allowed == 0 ); >+ >+ if ( $patron ) { >+ # check borrower has not reached open recalls allowed limit >+ return 0 if ( $patron->recalls->count >= $recalls_allowed ); >+ >+ # check borrower has not reached open recalls allowed per record limit >+ return 0 if ( $patron->recalls({ biblionumber => $self->biblionumber })->count >= $recalls_per_record ); >+ >+ # check if any of the items under this biblio are already checked out by this borrower >+ return 0 if ( Koha::Checkouts->search({ itemnumber => [ @itemnumbers ], borrowernumber => $patron->borrowernumber })->count > 0 ); >+ } >+ >+ # check item availability >+ my $checked_out_count = 0; >+ foreach (@items) { >+ if ( Koha::Checkouts->search({ itemnumber => $_->itemnumber })->count > 0 ){ $checked_out_count++; } >+ } >+ >+ # can't recall if on shelf recalls only allowed when all unavailable, but items are still available for checkout >+ return 0 if ( $on_shelf_recalls eq 'all' && $checked_out_count < scalar @items ); >+ >+ # can't recall if no items have been checked out >+ return 0 if ( $checked_out_count == 0 ); >+ >+ # can recall >+ return @items; >+} >+ > =head2 Internal methods > > =head3 type >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 57fe8f1b20d..da921bd8002 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -852,6 +852,187 @@ sub _after_item_action_hooks { > } > } > >+=head3 recall >+ >+ my $recall = $item->recall; >+ >+Return the relevant recall for this item >+ >+=cut >+ >+sub recall { >+ my ( $self ) = @_; >+ my @recalls = Koha::Recalls->search({ biblionumber => $self->biblionumber, old => undef }, { order_by => { -asc => 'recalldate' } }); >+ foreach my $recall (@recalls) { >+ if ( $recall->item_level_recall and $recall->itemnumber == $self->itemnumber ){ >+ return $recall; >+ } >+ } >+ # no item-level recall to return, so return earliest biblio-level >+ # FIXME: eventually this will be based on priority >+ return $recalls[0]; >+} >+ >+=head3 can_be_recalled >+ >+ if ( $item->can_be_recalled({ patron => $patron_object }) ) # do recall >+ >+Does item-level checks and returns if items can be recalled by this borrower >+ >+=cut >+ >+sub can_be_recalled { >+ my ( $self, $params ) = @_; >+ >+ return 0 if !( C4::Context->preference('UseRecalls') ); >+ >+ # check if this item is not for loan, withdrawn or lost >+ return 0 if ( $self->notforloan != 0 ); >+ return 0 if ( $self->itemlost != 0 ); >+ return 0 if ( $self->withdrawn != 0 ); >+ >+ # check if this item is not checked out - if not checked out, can't be recalled >+ return 0 if ( !defined( $self->checkout ) ); >+ >+ my $patron = $params->{patron}; >+ >+ my $branchcode = C4::Context->userenv->{'branch'}; >+ if ( $patron ) { >+ $branchcode = C4::Circulation::_GetCircControlBranch( $self->unblessed, $patron->unblessed ); >+ } >+ >+ # Check the circulation rule for each relevant itemtype for this item >+ my $rule = Koha::CirculationRules->get_effective_rules({ >+ branchcode => $branchcode, >+ categorycode => $patron ? $patron->categorycode : undef, >+ itemtype => $self->effective_itemtype, >+ rules => [ >+ 'recalls_allowed', >+ 'recalls_per_record', >+ 'on_shelf_recalls', >+ ], >+ }); >+ >+ # check recalls allowed has been set and is not zero >+ return 0 if ( !defined($rule->{recalls_allowed}) || $rule->{recalls_allowed} == 0 ); >+ >+ if ( $patron ) { >+ # check borrower has not reached open recalls allowed limit >+ return 0 if ( $patron->recalls->count >= $rule->{recalls_allowed} ); >+ >+ # check borrower has not reach open recalls allowed per record limit >+ return 0 if ( $patron->recalls({ biblionumber => $self->biblionumber })->count >= $rule->{recalls_per_record} ); >+ >+ # check if this patron has already recalled this item >+ return 0 if ( Koha::Recalls->search({ itemnumber => $self->itemnumber, borrowernumber => $patron->borrowernumber, old => undef })->count > 0 ); >+ >+ # check if this patron has already checked out this item >+ return 0 if ( Koha::Checkouts->search({ itemnumber => $self->itemnumber, borrowernumber => $patron->borrowernumber })->count > 0 ); >+ >+ # check if this patron has already reserved this item >+ return 0 if ( Koha::Holds->search({ itemnumber => $self->itemnumber, borrowernumber => $patron->borrowernumber })->count > 0 ); >+ } >+ >+ # check item availability >+ # items are unavailable for recall if they are lost, withdrawn or notforloan >+ my @items = Koha::Items->search({ biblionumber => $self->biblionumber, itemlost => 0, withdrawn => 0, notforloan => 0 }); >+ >+ # if there are no available items at all, no recall can be placed >+ return 0 if ( scalar @items == 0 ); >+ >+ my $checked_out_count = 0; >+ foreach (@items) { >+ if ( Koha::Checkouts->search({ itemnumber => $_->itemnumber })->count > 0 ){ $checked_out_count++; } >+ } >+ >+ # can't recall if on shelf recalls only allowed when all unavailable, but items are still available for checkout >+ return 0 if ( $rule->{on_shelf_recalls} eq 'all' && $checked_out_count < scalar @items ); >+ >+ # can't recall if no items have been checked out >+ return 0 if ( $checked_out_count == 0 ); >+ >+ # can recall >+ return 1; >+} >+ >+=head3 can_be_waiting_recall >+ >+ if ( $item->can_be_waiting_recall ) { # allocate item as waiting for recall >+ >+Checks item type and branch of circ rules to return whether this item can be used to fill a recall. >+At this point the item has already been recalled. We are now at the checkin and set waiting stage. >+ >+=cut >+ >+sub can_be_waiting_recall { >+ my ( $self ) = @_; >+ >+ return 0 if !( C4::Context->preference('UseRecalls') ); >+ >+ # check if this item is not for loan, withdrawn or lost >+ return 0 if ( $self->notforloan != 0 ); >+ return 0 if ( $self->itemlost != 0 ); >+ return 0 if ( $self->withdrawn != 0 ); >+ >+ my $branchcode = $self->holdingbranch; >+ if ( C4::Context->preference('CircControl') eq 'PickupLibrary' and C4::Context->userenv and C4::Context->userenv->{'branch'} ) { >+ $branchcode = C4::Context->userenv->{'branch'}; >+ } else { >+ $branchcode = ( C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ) ? $self->homebranch : $self->holdingbranch; >+ } >+ >+ # Check the circulation rule for each relevant itemtype for this item >+ my $rule = Koha::CirculationRules->get_effective_rules({ >+ branchcode => $branchcode, >+ categorycode => undef, >+ itemtype => $self->effective_itemtype, >+ rules => [ >+ 'recalls_allowed', >+ ], >+ }); >+ >+ # check recalls allowed has been set and is not zero >+ return 0 if ( !defined($rule->{recalls_allowed}) || $rule->{recalls_allowed} == 0 ); >+ >+ # can recall >+ return 1; >+} >+ >+=head3 check_recalls >+ >+ my $recall = $item->check_recalls; >+ >+Get the most relevant recall for this item. >+ >+=cut >+ >+sub check_recalls { >+ my ( $self ) = @_; >+ >+ my @recalls = Koha::Recalls->search({ itemnumber => $self->itemnumber, status => [ 'R','O','W' ] }, { order_by => { -asc => 'recalldate' } }); >+ if ( scalar @recalls == 0 ) { >+ # no item-level recalls or recalls waiting for this specific item >+ # look for biblio-level recalls >+ @recalls = Koha::Recalls->search({ biblionumber => $self->biblionumber, itemnumber => [ $self->itemnumber, undef ], status => [ 'R','O','W' ] }, { order_by => { -asc => 'recalldate' } }); >+ } >+ >+ my $recall; >+ # iterate through relevant recalls to find the best one. >+ # if we come across a waiting recall, use this one. >+ # if we have iterated through all recalls and not found a waiting recall, use the first recall in the array, which should be the oldest recall. >+ foreach my $r ( @recalls ) { >+ if ( $r->waiting ) { >+ $recall = $r; >+ last; >+ } >+ } >+ unless ( defined $recall ) { >+ $recall = $recalls[0]; >+ } >+ >+ return $recall; >+} >+ > =head3 _type > > =cut >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 5436ccc4485..6e2db596545 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -1712,6 +1712,30 @@ sub to_api_mapping { > }; > } > >+=head3 recalls >+ >+ my $recalls = $patron->recalls; >+ >+ my $recalls = $patron->recalls({ biblionumber => $biblionumber }); >+ >+Return the patron's active recalls - total, or on a specific biblio >+ >+=cut >+ >+sub recalls { >+ my ( $self, $params ) = @_; >+ >+ my $biblionumber = $params->{biblionumber}; >+ >+ my $recalls_rs = Koha::Recalls->search({ borrowernumber => $self->borrowernumber, old => undef }); >+ >+ if ( $biblionumber ) { >+ $recalls_rs = Koha::Recalls->search({ borrowernumber => $self->borrowernumber, old => undef, biblionumber => $biblionumber }); >+ } >+ >+ return $recalls_rs; >+} >+ > =head2 Internal methods > > =head3 _type >diff --git a/Koha/Template/Plugin/Biblio.pm b/Koha/Template/Plugin/Biblio.pm >index e9d7a730098..a4e6aab3417 100644 >--- a/Koha/Template/Plugin/Biblio.pm >+++ b/Koha/Template/Plugin/Biblio.pm >@@ -27,6 +27,7 @@ use Koha::Biblios; > use Koha::Patrons; > use Koha::ArticleRequests; > use Koha::ArticleRequest::Status; >+use Koha::Recalls; > > sub HoldsCount { > my ( $self, $biblionumber ) = @_; >@@ -63,4 +64,12 @@ sub CanArticleRequest { > return $biblio ? $biblio->can_article_request( $borrower ) : 0; > } > >+sub RecallsCount { >+ my ( $self, $biblionumber ) = @_; >+ >+ my $recalls = Koha::Recalls->search({ biblionumber => $biblionumber, old => undef }); >+ >+ return $recalls->count; >+} >+ > 1; >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 790b623aade..070367e9892 100644 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 12; >+use Test::More tests => 13; > > use C4::Biblio; > use Koha::Database; >@@ -569,3 +569,119 @@ subtest 'subscriptions() tests' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'Recalls tests' => sub { >+ >+ plan tests => 12; >+ >+ $schema->storage->txn_begin; >+ my $item1 = $builder->build_sample_item; >+ my $biblio = $item1->biblio; >+ my $branchcode = $item1->holdingbranch; >+ my $patron1 = $builder->build_object({ class => 'Koha::Patrons', value => { branchcode => $branchcode } }); >+ my $patron2 = $builder->build_object({ class => 'Koha::Patrons', value => { branchcode => $branchcode } }); >+ my $patron3 = $builder->build_object({ class => 'Koha::Patrons', value => { branchcode => $branchcode } }); >+ my $item2 = $builder->build_object({ class => 'Koha::Items', value => { holdingbranch => $branchcode, homebranch => $branchcode, biblionumber => $biblio->biblionumber, itype => $item1->effective_itemtype } }); >+ t::lib::Mocks::mock_userenv({ patron => $patron1 }); >+ >+ my $recall1 = Koha::Recall->new({ >+ borrowernumber => $patron1->borrowernumber, >+ recalldate => Koha::DateUtils::dt_from_string, >+ biblionumber => $biblio->biblionumber, >+ branchcode => $branchcode, >+ status => 'R', >+ itemnumber => $item1->itemnumber, >+ expirationdate => undef, >+ item_level_recall => 1 >+ })->store; >+ my $recall2 = Koha::Recall->new({ >+ borrowernumber => $patron2->borrowernumber, >+ recalldate => Koha::DateUtils::dt_from_string, >+ biblionumber => $biblio->biblionumber, >+ branchcode => $branchcode, >+ status => 'R', >+ itemnumber => undef, >+ expirationdate => undef, >+ item_level_recall => 0 >+ })->store; >+ my $recall3 = Koha::Recall->new({ >+ borrowernumber => $patron3->borrowernumber, >+ recalldate => Koha::DateUtils::dt_from_string, >+ biblionumber => $biblio->biblionumber, >+ branchcode => $branchcode, >+ status => 'R', >+ itemnumber => $item1->itemnumber, >+ expirationdate => undef, >+ item_level_recall => 1 >+ })->store; >+ >+ my $recalls_count = scalar $biblio->recalls; >+ is( $recalls_count, 3, 'Correctly get number of active recalls for biblio' ); >+ >+ $recall1->set_cancelled; >+ $recall2->set_expired({ interface => 'COMMANDLINE' }); >+ >+ $recalls_count = scalar $biblio->recalls; >+ is( $recalls_count, 1, 'Correctly get number of active recalls for biblio' ); >+ >+ t::lib::Mocks::mock_preference('UseRecalls', 0); >+ is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" ); >+ >+ t::lib::Mocks::mock_preference("UseRecalls", 1); >+ $item1->update({ notforloan => 1 }); >+ is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with no available items" ); >+ >+ $item1->update({ notforloan => 0 }); >+ Koha::CirculationRules->set_rules({ >+ branchcode => $branchcode, >+ categorycode => $patron1->categorycode, >+ itemtype => $item1->effective_itemtype, >+ rules => { >+ recalls_allowed => 0, >+ recalls_per_record => 1, >+ on_shelf_recalls => 'all', >+ }, >+ }); >+ is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if recalls_allowed = 0" ); >+ >+ Koha::CirculationRules->set_rules({ >+ branchcode => $branchcode, >+ categorycode => $patron1->categorycode, >+ itemtype => $item1->effective_itemtype, >+ rules => { >+ recalls_allowed => 1, >+ recalls_per_record => 1, >+ on_shelf_recalls => 'all', >+ }, >+ }); >+ is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if patron has more existing recall(s) than recalls_allowed" ); >+ is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if patron has more existing recall(s) than recalls_per_record" ); >+ >+ $recall1->set_cancelled; >+ C4::Circulation::AddIssue( $patron1->unblessed, $item2->barcode ); >+ is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if patron has already checked out an item attached to this biblio" ); >+ >+ is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if on_shelf_recalls = all and items are still available" ); >+ >+ Koha::CirculationRules->set_rules({ >+ branchcode => $branchcode, >+ categorycode => $patron1->categorycode, >+ itemtype => $item1->effective_itemtype, >+ rules => { >+ recalls_allowed => 1, >+ recalls_per_record => 1, >+ on_shelf_recalls => 'any', >+ }, >+ }); >+ C4::Circulation::AddReturn( $item2->barcode, $branchcode ); >+ is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if no items are checked out" ); >+ >+ $recall2->set_cancelled; >+ C4::Circulation::AddIssue( $patron2->unblessed, $item2->barcode ); >+ is( $biblio->can_be_recalled({ patron => $patron1 }), 2, "Can recall two items" ); >+ >+ $item1->update({ withdrawn => 1 }); >+ is( $biblio->can_be_recalled({ patron => $patron1 }), 1, "Can recall one item" ); >+ >+ $schema->storage->txn_rollback; >+}; >diff --git a/t/db_dependent/Koha/Item.t b/t/db_dependent/Koha/Item.t >index 581c96d776e..f2f27fa28c3 100644 >--- a/t/db_dependent/Koha/Item.t >+++ b/t/db_dependent/Koha/Item.t >@@ -19,7 +19,7 @@ > > use Modern::Perl; > >-use Test::More tests => 6; >+use Test::More tests => 7; > > use C4::Biblio; > use C4::Circulation; >@@ -501,3 +501,148 @@ subtest 'renewal_branchcode' => sub { > is( $item->renewal_branchcode({branch=>'MANATEE'}), $item->homebranch, "If interface opac and OpacRenewalBranch set to itemhomebranch, we get homebranch of item even if branch passed"); > > }; >+ >+subtest 'Recalls tests' => sub { >+ >+ plan tests => 17; >+ >+ $schema->storage->txn_begin; >+ >+ my $item1 = $builder->build_sample_item; >+ my $biblio = $item1->biblio; >+ my $branchcode = $item1->holdingbranch; >+ my $patron1 = $builder->build_object({ class => 'Koha::Patrons', value => { branchcode => $branchcode } }); >+ my $patron2 = $builder->build_object({ class => 'Koha::Patrons', value => { branchcode => $branchcode } }); >+ my $patron3 = $builder->build_object({ class => 'Koha::Patrons', value => { branchcode => $branchcode } }); >+ my $item2 = $builder->build_object({ class => 'Koha::Items', value => { holdingbranch => $branchcode, homebranch => $branchcode, biblionumber => $biblio->biblionumber, itype => $item1->effective_itemtype } }); >+ t::lib::Mocks::mock_userenv({ patron => $patron1 }); >+ >+ my $recall1 = Koha::Recall->new({ >+ borrowernumber => $patron1->borrowernumber, >+ recalldate => Koha::DateUtils::dt_from_string, >+ biblionumber => $biblio->biblionumber, >+ branchcode => $branchcode, >+ status => 'R', >+ itemnumber => $item1->itemnumber, >+ expirationdate => undef, >+ item_level_recall => 1 >+ })->store; >+ my $recall2 = Koha::Recall->new({ >+ borrowernumber => $patron2->borrowernumber, >+ recalldate => Koha::DateUtils::dt_from_string, >+ biblionumber => $biblio->biblionumber, >+ branchcode => $branchcode, >+ status => 'R', >+ itemnumber => $item1->itemnumber, >+ expirationdate => undef, >+ item_level_recall =>1 >+ })->store; >+ >+ is( $item1->recall->borrowernumber, $patron1->borrowernumber, 'Correctly returns most relevant recall' ); >+ >+ $recall2->set_cancelled; >+ >+ t::lib::Mocks::mock_preference('UseRecalls', 0); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall with UseRecalls disabled" ); >+ >+ t::lib::Mocks::mock_preference("UseRecalls", 1); >+ >+ $item1->update({ notforloan => 1 }); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall that is not for loan" ); >+ $item1->update({ notforloan => 0, itemlost => 1 }); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall that is marked lost" ); >+ $item1->update({ itemlost => 0, withdrawn => 1 }); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall that is withdrawn" ); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall item if not checked out" ); >+ >+ $item1->update({ withdrawn => 0 }); >+ C4::Circulation::AddIssue( $patron2->unblessed, $item1->barcode ); >+ >+ Koha::CirculationRules->set_rules({ >+ branchcode => $branchcode, >+ categorycode => $patron1->categorycode, >+ itemtype => $item1->effective_itemtype, >+ rules => { >+ recalls_allowed => 0, >+ recalls_per_record => 1, >+ on_shelf_recalls => 'all', >+ }, >+ }); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if recalls_allowed = 0" ); >+ >+ Koha::CirculationRules->set_rules({ >+ branchcode => $branchcode, >+ categorycode => $patron1->categorycode, >+ itemtype => $item1->effective_itemtype, >+ rules => { >+ recalls_allowed => 1, >+ recalls_per_record => 1, >+ on_shelf_recalls => 'all', >+ }, >+ }); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if patron has more existing recall(s) than recalls_allowed" ); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if patron has more existing recall(s) than recalls_per_record" ); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if patron has already recalled this item" ); >+ >+ my $reserve_id = C4::Reserves::AddReserve({ branchcode => $branchcode, borrowernumber => $patron1->borrowernumber, biblionumber => $item1->biblionumber, itemnumber => $item1->itemnumber }); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall item if patron has already reserved it" ); >+ C4::Reserves::ModReserve({ rank => 'del', reserve_id => $reserve_id, branchcode => $branchcode, itemnumber => $item1->itemnumber, borrowernumber => $patron1->borrowernumber, biblionumber => $item1->biblionumber }); >+ >+ $recall1->set_cancelled; >+ is( $item1->can_be_recalled({ patron => $patron2 }), 0, "Can't recall if patron has already checked out an item attached to this biblio" ); >+ >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if on_shelf_recalls = all and items are still available" ); >+ >+ Koha::CirculationRules->set_rules({ >+ branchcode => $branchcode, >+ categorycode => $patron1->categorycode, >+ itemtype => $item1->effective_itemtype, >+ rules => { >+ recalls_allowed => 1, >+ recalls_per_record => 1, >+ on_shelf_recalls => 'any', >+ }, >+ }); >+ C4::Circulation::AddReturn( $item1->barcode, $branchcode ); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if no items are checked out" ); >+ >+ C4::Circulation::AddIssue( $patron2->unblessed, $item1->barcode ); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 1, "Can recall item" ); >+ >+ $recall1 = Koha::Recall->new({ >+ borrowernumber => $patron1->borrowernumber, >+ recalldate => Koha::DateUtils::dt_from_string, >+ biblionumber => $biblio->biblionumber, >+ branchcode => $branchcode, >+ status => 'R', >+ itemnumber => undef, >+ expirationdate => undef, >+ item_level_recall => 0 >+ })->store; >+ >+ # Patron2 has Item1 checked out. Patron1 has placed a biblio-level recall on Biblio1, so check if Item1 can fulfill Patron1's recall. >+ >+ Koha::CirculationRules->set_rules({ >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => $item1->effective_itemtype, >+ rules => { >+ recalls_allowed => 0, >+ recalls_per_record => 1, >+ on_shelf_recalls => 'any', >+ }, >+ }); >+ is( $item1->can_be_waiting_recall, 0, "Recalls not allowed for this itemtype" ); >+ >+ Koha::CirculationRules->set_rules({ >+ branchcode => undef, >+ categorycode => undef, >+ itemtype => $item1->effective_itemtype, >+ rules => { >+ recalls_allowed => 1, >+ recalls_per_record => 1, >+ on_shelf_recalls => 'any', >+ }, >+ }); >+ is( $item1->can_be_waiting_recall, 1, "Recalls are allowed for this itemtype" ); >+}; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19532
:
68569
|
68570
|
68571
|
68572
|
68642
|
68643
|
68644
|
68645
|
68653
|
69100
|
69102
|
69147
|
69148
|
69149
|
69170
|
69172
|
69221
|
69222
|
69223
|
69322
|
69353
|
69354
|
69405
|
69409
|
69410
|
69411
|
69841
|
69872
|
69873
|
69874
|
69875
|
69876
|
69877
|
69878
|
69879
|
69880
|
69881
|
69882
|
69883
|
69884
|
69885
|
69886
|
69887
|
69888
|
69889
|
69890
|
69986
|
70093
|
71409
|
71574
|
71575
|
71576
|
71577
|
71578
|
71579
|
71580
|
71581
|
71582
|
71583
|
71584
|
71585
|
71586
|
71587
|
71588
|
71589
|
71590
|
71591
|
71592
|
72244
|
72311
|
72312
|
72313
|
72314
|
72315
|
72316
|
72317
|
72318
|
72319
|
72320
|
72321
|
72322
|
72323
|
72324
|
72325
|
72326
|
72327
|
72328
|
72329
|
72330
|
72331
|
72332
|
72333
|
72334
|
72335
|
72336
|
72337
|
72338
|
72527
|
76817
|
76818
|
76819
|
76820
|
76821
|
76822
|
76823
|
76824
|
76825
|
76826
|
76827
|
76828
|
76829
|
76830
|
76831
|
76832
|
76833
|
76834
|
76835
|
76836
|
76837
|
76838
|
76839
|
76840
|
76841
|
76842
|
76843
|
76844
|
76845
|
76846
|
76847
|
77177
|
77178
|
77179
|
78755
|
78757
|
78759
|
78761
|
78763
|
78765
|
78766
|
78768
|
78770
|
78772
|
78773
|
78774
|
78775
|
78776
|
78777
|
78778
|
78780
|
78782
|
78785
|
78787
|
78789
|
78790
|
78792
|
78794
|
78797
|
78800
|
78801
|
78802
|
78803
|
78804
|
78805
|
78806
|
78807
|
78808
|
80763
|
80764
|
80765
|
80766
|
80767
|
80768
|
80769
|
80770
|
80771
|
80772
|
80773
|
80774
|
80775
|
80776
|
80777
|
80778
|
80779
|
80780
|
80781
|
80782
|
80783
|
80784
|
80785
|
80786
|
80787
|
80788
|
80789
|
80793
|
80878
|
81204
|
81205
|
81206
|
81207
|
81208
|
81209
|
81210
|
81211
|
81212
|
81213
|
81214
|
81215
|
81216
|
81217
|
81218
|
81219
|
81220
|
81221
|
81222
|
81223
|
81224
|
81225
|
81226
|
81227
|
81228
|
81229
|
81230
|
81231
|
81232
|
81233
|
81234
|
81235
|
81236
|
81237
|
81238
|
81239
|
81240
|
81241
|
81242
|
81243
|
81244
|
81245
|
81246
|
81247
|
81547
|
81548
|
81549
|
81550
|
81551
|
81552
|
81553
|
81554
|
81555
|
81556
|
81557
|
81558
|
81559
|
81560
|
81561
|
81562
|
81563
|
81564
|
81565
|
81566
|
81567
|
81568
|
81569
|
81583
|
81584
|
81585
|
81586
|
81587
|
81588
|
81595
|
81618
|
81652
|
81653
|
81654
|
81655
|
81656
|
81657
|
81658
|
81659
|
81660
|
81661
|
81662
|
81663
|
81664
|
81665
|
81666
|
81667
|
81668
|
81669
|
81670
|
81671
|
81672
|
81673
|
81674
|
81675
|
81676
|
81677
|
81678
|
81679
|
81680
|
81681
|
81682
|
81683
|
103887
|
103888
|
103890
|
103899
|
103900
|
103901
|
103999
|
104000
|
104001
|
104002
|
104005
|
104006
|
104007
|
104066
|
104067
|
104068
|
104069
|
104070
|
104071
|
104246
|
104247
|
104248
|
104249
|
104250
|
104322
|
104323
|
104324
|
104325
|
104326
|
104327
|
104328
|
104329
|
104330
|
104331
|
104332
|
104333
|
104334
|
104335
|
104336
|
104391
|
104392
|
104393
|
104394
|
104395
|
104396
|
104397
|
104398
|
104474
|
104475
|
104476
|
104477
|
104478
|
104479
|
104480
|
104481
|
104545
|
104546
|
104547
|
104548
|
104549
|
104550
|
104551
|
104552
|
104646
|
104647
|
104648
|
104649
|
104650
|
104651
|
104652
|
104653
|
104722
|
104723
|
104724
|
104725
|
104726
|
104727
|
104728
|
104729
|
104806
|
104807
|
104808
|
104809
|
104810
|
104811
|
104812
|
104813
|
104814
|
104815
|
104816
|
104817
|
104818
|
104819
|
104820
|
104821
|
104863
|
104864
|
104865
|
104866
|
104867
|
104868
|
104869
|
104870
|
104902
|
104903
|
104904
|
104905
|
104906
|
104907
|
104908
|
104909
|
104910
|
104913
|
104914
|
104915
|
104916
|
104917
|
104918
|
104919
|
104920
|
104988
|
104989
|
104990
|
104991
|
104992
|
106268
|
106269
|
106371
|
106372
|
106373
|
106374
|
106375
|
106376
|
106377
|
106378
|
106810
|
106811
|
106812
|
106813
|
106814
|
106815
|
106816
|
106817
|
106857
|
107198
|
107199
|
107200
|
107201
|
107202
|
107203
|
107204
|
107205
|
107807
|
107808
|
107809
|
107810
|
107811
|
107812
|
107813
|
107814
|
107918
|
107919
|
107920
|
107921
|
107922
|
107923
|
107924
|
107925
|
108222
|
108223
|
108224
|
108225
|
108226
|
108227
|
108228
|
108229
|
108980
|
108981
|
108982
|
109306
|
109307
|
109308
|
109309
|
109310
|
109311
|
109312
|
109313
|
109314
|
109315
|
109316
|
109317
|
109318
|
109463
|
109464
|
109465
|
109466
|
109467
|
109468
|
109469
|
109775
|
109776
|
109777
|
109778
|
109779
|
109780
|
109781
|
109782
|
109783
|
109784
|
109785
|
111199
|
111200
|
111201
|
111202
|
111203
|
111204
|
111205
|
111206
|
112316
|
112317
|
112321
|
112322
|
112323
|
112324
|
112325
|
112326
|
112346
|
112472
|
112491
|
112540
|
112612
|
112613
|
112614
|
112615
|
112616
|
112617
|
112618
|
112619
|
112620
|
112621
|
112622
|
113195
|
113196
|
113197
|
113198
|
113199
|
113200
|
113201
|
113202
|
113203
|
113204
|
113205
|
113286
|
113287
|
113288
|
113289
|
113290
|
113291
|
113292
|
113293
|
113294
|
113295
|
113296
|
113297
|
113298
|
113335
|
113351
|
113352
|
113353
|
113354
|
113355
|
113356
|
113357
|
113358
|
113359
|
113361
|
113362
|
113363
|
113364
|
113365
|
113430
|
113431
|
113432
|
113433
|
113434
|
113435
|
113436
|
113437
|
113438
|
113439
|
113440
|
113441
|
113442
|
113443
|
113444
|
113445
|
116121
|
116122
|
116123
|
116124
|
116125
|
116126
|
116127
|
116128
|
116129
|
116130
|
116131
|
116132
|
116133
|
116134
|
118267
|
118268
|
118269
|
118270
|
118271
|
118272
|
118273
|
118274
|
118275
|
118276
|
118277
|
118278
|
118279
|
118280
|
122993
|
122994
|
122995
|
122996
|
122997
|
122998
|
122999
|
123000
|
123001
|
123002
|
123003
|
123004
|
123005
|
126244
|
126245
|
126246
|
126247
|
126248
|
126249
|
126250
|
126251
|
126252
|
126253
|
126254
|
126255
|
126256
|
126257
|
126453
|
126454
|
126455
|
126456
|
126457
|
126458
|
126459
|
126460
|
126469
|
126470
|
126565
|
126566
|
126568
|
126569
|
126570
|
126571
|
126572
|
126573
|
126574
|
126575
|
126576
|
126577
|
126578
|
126579
|
126580
|
129305
|
129306
|
129307
|
129308
|
129309
|
129310
|
129311
|
129312
|
129313
|
129314
|
129315
|
129316
|
129317
|
129318
|
129319
|
130641
|
130642
|
130643
|
130644
|
130645
|
130646
|
130647
|
130648
|
130649
|
130650
|
130651
|
130652
|
130653
|
130654
|
130655
|
130656
|
131108
|
131156
|
131157
|
131158
|
131159
|
131160
|
131193
|
131213
|
131257
|
131260
|
131261
|
131262
|
131263
|
131264
|
131265
|
131266
|
131267
|
131268
|
131269
|
131270
|
131271
|
131272
|
131273
|
131274
|
131275
|
131276
|
131277
|
131278
|
131279
|
131280
|
131281
|
131282
|
131330
|
131629
|
131630
|
131631
|
131664
|
131665
|
131666
|
131701
|
132332