[Koha-bugs] [Bug 19690] Smart rules: Term "If any unavailable" is confusing and just means No

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Nov 28 15:34:48 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=19690

--- Comment #3 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
Please have a look at the code in IsAvailableForItemLevelRequest:

    } elsif ( $on_shelf_holds == 2 ) {
        my @items = ...
        my $any_available = 0;
        foreach my $i (@items) {
...
            $any_available = 1
              unless $i->itemlost
...
        }
        return $any_available ? 0 : 1;
    }

The variable name could put you on the wrong track, but 2 == all_unavailable.
What does the above say? If you choose for all_unavailable and there is at
lease one item available ("On shelf"), you cannot place the hold. If all are
unavailable, you can place the item level hold.

Finally, we have the remaining case (on_shelf_holds == 0 /"If any
unavailable"):

    return $item->{onloan} || GetReserveStatus($item->{itemnumber}) eq
"Waiting"

The item level hold is only allowed now if the current item is on loan or
waiting. (Using the term "any" here is making no sense to me..)

===
What makes it more complicated, is the use of the sub OnShelfHoldsAllowed in
Koha (opac-detail, opac-shelves). In opac-detail-sidebar.inc the following test
is used before displaying a place hold link:
[% IF ( AllowOnShelfHolds OR ItemsIssued ) %]
opac-shelves does more or less the same by first testing allow_onshelf_holds
and testing if issued in the else branch.
Note that in these tests the values 1 and 2 are just interpreted as one case
(shelf holds are allowed).

===
Conclusion: The name is confusing/misleading. This is partially hidden by the
obscure use of onshelfholds in other places. We cannot solve this by a rename
only. So I am leaving it as-is.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list