Bugzilla – Attachment 104071 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), 21.62 KB, created by
Aleisha Amohia
on 2020-05-01 05:44:32 UTC
(
hide
)
Description:
Bug 19532: Other objects used in recalls feature
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2020-05-01 05:44:32 UTC
Size:
21.62 KB
patch
obsolete
>From e7aaad416d26b4de989c7704a1d3d4ab7baa04f9 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 >--- > Koha/Biblio.pm | 102 ++++++++++++++++++++++++++++++ > Koha/Item.pm | 145 +++++++++++++++++++++++++++++++++++++++++++ > Koha/Patron.pm | 21 +++++++ > t/db_dependent/Koha/Biblio.t | 118 ++++++++++++++++++++++++++++++++++- > t/db_dependent/Koha/Item.t | 108 +++++++++++++++++++++++++++++++- > 5 files changed, 492 insertions(+), 2 deletions(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 4fe30113e3b..1b6dd217351 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 >+ >+=cut >+ >+sub recalls { >+ my ( $self ) = @_; >+ $self->{_recalls} ||= Koha::Recalls->search({ biblionumber => $self->biblionumber, old => undef }); >+ return $self->{_recalls}; >+} >+ >+=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 9e1bca4ef5f..843c8a23710 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -842,6 +842,151 @@ 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->first; >+} >+ >+=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_set_waiting_recall >+ >+ if ( $item->can_set_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_set_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 _type > > =cut >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 5436ccc4485..5abd55485e2 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -1712,6 +1712,27 @@ 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}; >+ >+ if ( $biblionumber ) { >+ return Koha::Recalls->search({ borrowernumber => $self->borrowernumber, old => undef, biblionumber => $biblionumber }); >+ } >+ return Koha::Recalls->search({ borrowernumber => $self->borrowernumber, old => undef }); >+} >+ > =head2 Internal methods > > =head3 _type >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 790b623aade..b0a82b2a5cc 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 = $biblio->recalls->count; >+ is( $recalls_count, 3, 'Correctly get number of active recalls for biblio' ); >+ >+ $recall1->set_cancelled; >+ $recall2->set_expired({ location => 'COMMANDLINE' }); >+ >+ $recalls_count = $biblio->recalls->count; >+ 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 55709643b78..48799ecc956 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; >@@ -493,3 +493,109 @@ 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 => 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 => $item1->itemnumber, >+ expirationdate => undef, >+ item_level_recall => 0 >+ })->store; >+ >+ is( $item1->recall->borrowernumber, $patron1->borrowernumber, 'Correctly returns oldest 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" ); >+ >+ $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( $item2->barcode, $branchcode ); >+ is( $biblio->can_be_recalled({ patron => $patron1 }), 0, "Can't recall if no items are checked out" ); >+ >+ $recall2->set_cancelled; >+ >+ $item1->update({ withdrawn => 1 }); >+ is( $item1->can_be_recalled({ patron => $patron1 }), 1, "Can recall one item" ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >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