[Koha-bugs] [Bug 26139] 'Place hold' button isn't hidden in all detail views if there are no items available for loan

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Aug 25 11:11:04 CEST 2020


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

Joonas Kylmälä <joonas.kylmala at helsinki.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #108966|0                           |1
        is obsolete|                            |

--- Comment #15 from Joonas Kylmälä <joonas.kylmala at helsinki.fi> ---
Created attachment 109057
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=109057&action=edit
Bug 26139: Centralize code for "Place hold" button (detail)

There is a "norequest" boolean passed to the include cat-toolbar.inc, to
display or not the "Pace hold" button.
This flag was not calculated in some place (ISBDdetail and moredetail
for instance)

Here we centralize the code to make it more robust and less regression
prone.

Note that the same problem appears at the OPAC (opac-MARCdetail is
always display the button). That will have to be fixed separately

Test plan:
Create biblio A with 0 item, B and C with 1 item and D with 2 items
item for B is not for loan, C is for loan and D has 1 of each
Go to the bibliographic detail page of each record and confirm that the
"Place hold" button appears appropriately.
Test the different tabs of the catalogue module

QA note: This patch is only centralizing the existing code, but it is
still too naive. To manage the visibility of this button we certainly
want to copy what is done in C4::Search::searchResults:
  # can place a hold on a item if
  # not lost nor withdrawn
  # not damaged unless AllowHoldsOnDamagedItems is true
  # item is either for loan or on order (notforloan < 0)
  $can_place_holds = 1
    if (
         !$item->{itemlost}
      && !$item->{withdrawn}
      && ( !$item->{damaged} ||
C4::Context->preference('AllowHoldsOnDamagedItems') )
      && ( !$item->{notforloan} || $item->{notforloan} < 0 )
    );

Signed-off-by: Didier Gautheron <didier.gautheron at biblibre.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala at helsinki.fi>

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


More information about the Koha-bugs mailing list