Bug 6875 de-nesting C4::Items
authorPaul Poulain <paul.poulain@biblibre.com>
Fri, 16 Sep 2011 18:20:37 +0000 (20:20 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Mon, 20 Feb 2012 15:35:20 +0000 (16:35 +0100)
commitdf5405c56e0f89dee44ed1cf1a3a761cf31efe3c
tree6601d0ad6c103239886dc0cca3189814b7815d13
parent49b167e8486e19a20f055e1ce9cde30f82cfc55e
Bug 6875 de-nesting C4::Items

C4::Branch is used only in CheckItemPresave, moving from a use to a require in the sub
C4::Reserve:
    This package is loaded just for C4::Reserves::CheckReserves called in C4::Items::GetItemsInfo
    The GetItemsInfo stores the result of CheckReserves in a hash entry, count_reserve, that is used only in opac_detail to display the status of a hold. We could remove the reserve_count hash entry and inline C4::Reserves::CheckReserves directly from opac-detail.pl page
    in opac-detail.pl, instead of
    if( $itm->{'count_reserves'} eq "Waiting"){ $itm->{'waiting'} = 1; }
    write :
    if ( C4::Reserves::CheckReserves(<<parameters>>) eq "Waiting"){ $itm->{'waiting'} = 1; }
C4::Acquisition is used only in MoveItemFromBiblio, a sub that is rarely called. Moving from a use to a require in the sub
C4::Charset is used only in _parse_unlinked_item_subfields_from_xml. Moving from a use to require in the sub

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Checked opac-detail and cataloging. Code looks good.
C4/Items.pm
opac/opac-detail.pl