Bug 28762: Replace is_notforloan with not_for_loan
This patch replaces the use of is_notforloan with not_for_loan and removes the older is_notforloan method and tests Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
0d5c224cc3
commit
4e6d9d13bf
|
|
@ -970,7 +970,7 @@ sub _availability {
|
|||
my $location = $library ? $library->branchname : '';
|
||||
my $itemcallnumber = $item->itemcallnumber;
|
||||
|
||||
if ( $item->is_notforloan ) {
|
||||
if ( $item->effective_notforloan ) {
|
||||
return ( $biblionumber, __('not available'), __('Not for loan'), $location, $itemcallnumber );
|
||||
} elsif ( $item->onloan ) {
|
||||
return ( $biblionumber, __('not available'), __('Checked out'), $location, $itemcallnumber );
|
||||
|
|
|
|||
14
Koha/Item.pm
14
Koha/Item.pm
|
|
@ -2398,20 +2398,6 @@ sub check_recalls {
|
|||
return $recall;
|
||||
}
|
||||
|
||||
=head3 is_notforloan
|
||||
|
||||
my $is_notforloan = $item->is_notforloan;
|
||||
|
||||
Determine whether or not this item is "notforloan" based on
|
||||
the item's notforloan status or its item type
|
||||
|
||||
=cut
|
||||
|
||||
sub is_notforloan {
|
||||
my ( $self ) = @_;
|
||||
return $self->not_for_loan;
|
||||
}
|
||||
|
||||
=head3 is_denied_renewal
|
||||
|
||||
my $is_denied_renewal = $item->is_denied_renewal;
|
||||
|
|
|
|||
|
|
@ -2242,25 +2242,6 @@ subtest 'Recalls tests' => sub {
|
|||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
||||
subtest 'Notforloan tests' => sub {
|
||||
|
||||
plan tests => 3;
|
||||
|
||||
$schema->storage->txn_begin;
|
||||
|
||||
my $item1 = $builder->build_sample_item;
|
||||
$item1->update({ notforloan => 0 });
|
||||
$item1->itemtype->notforloan(0);
|
||||
ok( !$item1->is_notforloan, 'Notforloan is correctly false by item status and item type');
|
||||
$item1->update({ notforloan => 1 });
|
||||
ok( $item1->is_notforloan, 'Notforloan is correctly true by item status');
|
||||
$item1->update({ notforloan => 0 });
|
||||
$item1->itemtype->update({ notforloan => 1 });
|
||||
ok( $item1->is_notforloan, 'Notforloan is correctly true by item type');
|
||||
|
||||
$schema->storage->txn_rollback;
|
||||
};
|
||||
|
||||
subtest 'item_group() tests' => sub {
|
||||
|
||||
plan tests => 4;
|
||||
|
|
|
|||
Loading…
Reference in New Issue