Bug 8735 - Expire holds waiting only on days the library is open

Signed-off-by: Leila <koha.aixmarseille@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8735 - Expire holds waiting only on days the library is open - Followup - Switch from C4::Calendar to Koha::Calendar

Test Plan:
 1) Set ExpireReservesMaxPickUpDelay
 2) Set ReservesMaxPickUpDelay to 1
 3) Place a hold, set it to waiting
 4) Using the MySQL console, modify the waiting date and set it to the
    day before yesterday.
 5) Set today as a holiday for the pickup branch in question.
 6) Run misc/cronjobs/holds/cancel_expired_holds.pl
 7) The hold should remain unchanged
 8) Remove today as a holiday
 9) Run misc/cronjobs/holds/cancel_expired_holds.pl again
10) The hold should now be canceled

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8735 [QA Followup] - Add Unit Tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8735 [QA Followup 2] - Remove extra period, add bug number to db update

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8735: DBRev 3.17.00.020

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12864: Add LOC SRU server to sample z3950servers.sql

Add LOC SRU server to sample servers installed.
This patch modifies four language files: de, en, es and nb.
For the other languages this may not be useful.

Test plan:
You could test this by using the webinstaller.
But you could also (backup) and delete your records in z3950servers, and
run the sample_z3950_servers.sql file from the command line.
Check if you see the new SRU server.

Tested using mysql. I truncated the table (to reset the IDs as well) and then ran the file. Works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
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>
Bug 12330: [QA Follow-up] Consistency between opac-search and staff client

In opac-search two regexes are added for the results of splitting the
pref AdvancedSearchTypes, allowing spaces before and after the names.
The same regexes should be added to catalogue/search.pl to have the
same behavior there.

Test plan:
Set AdvancedSearchTypes to "itemtypes  |  ccode |  loc " (no quotes).
Check OPAC and staff with and without this patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 12582 - Control of branch displayed in search results linked to HomeOrHoldingBranch

Some libraries would like the ability choose to display the home branch
on search results while having circulation rules based on the holding
branch. This is currently impossible because both the display of the
branch in search results, and the selection of the home or holding
branch for circulation rules are controlled by the same system
preference: HomeOrHoldingBranch. This preference is described as being
used only for circulation rules, and makes no mention of its use for
display control. The display control should be split off into a separate
preference.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Note the value of the new system preference StaffSearchResultsDisplayBranch
   matches the current value of HomeOrHoldingBranch
4) Set the preference to home branch
5) Perform a staff catalog search with results having items with differing home and
   holding branches.
6) Note the home branch displays
7) Set the preference to holding branch
8) Repeat step 5
9) Note the holding branch displays

Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, logic is now tied to a new system preference.
Passes tests and QA script.
Bug 12582: DBRev 3.17.00.021

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>