Bug 12330: OpacHiddenItems not affecting Advanced Search
authorMark Tompsett <mtompset@hotmail.com>
Thu, 29 May 2014 22:31:03 +0000 (18:31 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Fri, 5 Sep 2014 15:05:58 +0000 (12:05 -0300)
commitf5320c4bf873c8fe328d0fdc819fa11f05f346ef
tree6729afefd0b05833e500064bf4b06fff257f04c7
parent33db04fab8ca46168f541bc0d80eb6beced5ef82
Bug 12330: OpacHiddenItems not affecting Advanced Search

This patch affects only the area displayed on Advanced Search
by setting the AdvancedSearchTypes OPAC system preference
accordingly. Prior to this patch, no filtering based on
OpacHiddenItems was done. This patch determines if itemtypes,
collections, or shelving locations are hidden and prevents
them from being shown.

TEST PLAN
---------
 1) Back up your DB (always handy)
 2) Set the Searching system preference AdvancedSearchTypes to:
    'itemtypes|ccode|loc' (without the single quotes).
 3) Set the OPAC system preference OpacHiddenItems to include the
    lines:
     itype: [{list of itemtype codes separated by commas}]
     location: [{list of comma delimited shelving location codes}]
     ccode: [{list of comma delimited collection codes}]
    Make sure to exclude one value for each, so there will be at
    least one known thing on each tab.
 4) Open the OPAC.
 5) Click on 'Advanced Search'
    -- three tabs appear: Itemtypes, Collection, Shelving location
    -- Everything is visible
 6) Set the Searching system preference AdvancedSearchTypes to:
    'itemtypes | ccode |     loc' (without the single quotes).
 7) Refresh the OPAC.
    -- There will be three tabs, but ugliness ensues.
 8) Apply the patch
 9) Refresh the OPAC.
    -- You will see: Itemtypes, Collection, Shelving location
    -- Only excluded values from OpacHiddenItems will be seen.
10) Run koha qa test tools

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
All tests pass

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Small rewording in comment only.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
opac/opac-search.pl