Bug 10656: add regression test

This patch adds regression tests to verify the sort
order when fetching authorised values in either staff
or OPAC mode.

This patch also wraps the Koha.t tests in a transaction, and
better handles skipping tests if Test::Deep is not installed.

To test:

[1] Verify that prove -v t/db_dependent/Koha.t passes

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests pass with all patches applied.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f8484348d12bac3b1e5f3d2e4fef9d3034d58969)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10656: improve sorting of shelving location and collections on OPAC advanced search form

Collection codes and shelving locations are displayed in the OPAC and
staff client via GetAuthorisedValues which currently sorts results by
"lib, lib_opac." Consequently if lib (the description for the staff
client) doesn't match lib_opac (the description for the OPAC) sorting
will appear to be nonsensical in the OPAC. GetAuthorisedValues can be
passed an $opac parameter, so this should be used to switch how reuslts
are sorted. This patch implements such a switch.

To test, modify your collection code or shelving location authorized
values so that lib and lib_opac do not match. Set your
AdvancedSearchTypes system preference to display the modified authorized
values and view the advanced search page in the OPAC and staff client.
Sorting should be correct in each case according to the correct value
(lib in the staff client, lib_opac in the OPAC).

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Tested in staff and opac and it works perfectly!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dd13998837ebd28b3b97e28da470ec341251b9b2)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10656: (follow-up) handle OPAC sorting of authvals where lib_opac is NULL

The OPAC description for an authorized value is not required to be
populated.  In particular, if it is NULL, the staff description is
displayed instead.

This patch makes sure that the sort order (in OPAC mode) uses either
the staff description or the OPAC description as needed for each
value.

To test:

[1] Make sure that AdvancedSearchTypes includes "ccode"
[1] Arrange your CCODE values so the sort order for staff labels
    is different from the sort order for OPAC descriptions.  Also,
    ensure that one of the OPAC descriptions is NULL.  For example,

    authorised_value | lib     | lib_opac
    --------------------------------------
    ZZZ              | A_STAFF | Z_PUBLIC
    DDD              | D_STAFF | NULL
    AAA              | Z_STAFF | A_PUBLIC

[2] Prior to the patch, any CCODE values where the OPAC description
    is NULL will sort first in the OPAC advanced search page, even
    if the displayed label shouldn't come first.
[3] Apply the patch.
[4] Verify that the collection list on the OPAC advanced search page
    is now correct.
[5] Verify that the sort order on the staff advanced search page
    has not changed.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely, tested in staff and OPAC.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0c67e94c8b8dbe1912fd5ba4b503cf53789b75a5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10727: Replace carriage return with <br /> when printing hold notices

This patch replaces carriage return with <br /> in the content of
hold notices for printing. This is necessary to convert html file
into well formatted pdf file.

Test plan :
  - check in an item reserved by a borrower
    that has not activated email notification
  - verify in message_queue table that you've got a
    new HOLD_PRINT notice with status 'pending'
  - run gather_print_notices.pl <directory>

Without the patch, the script generates a html file without <br /> tags.
If you run printoverdues.sh <directory>, the text in the resulting PDF
file is all on one line

With the patch, the script generates a html file with <br/> tags and
the PDF file created by printoverdues.sh is well formatted.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 30b32d99381a8296e41e6843c440cd9e3594eb8a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10915: fix About->timeline breakage on incompletely upgraded Koha

This patch supplies a default value for the koha-conf.xml
setting docdir to handle the case where the user neglects
to set it upon upgrade.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Fixes dev and standard installs without docdic tag in koha-conf.xml.
Doesn't break when docdir present either. Warning still present
on packages install that didn't add the docdir definition in koha-conf.xml

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3ae471a352fa2b00782c29c5c40f39db04fe510a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10915: (QA followup) warn if cannot read history.txt

This patch makes about.pl test if success opening history.txt, and
shows a convenient warning to the end user. No more warnings in the logs
(about.pl: readline() on closed filehandle $file at /usr/share/koha/intranet/cgi-bin/about.pl line 166)
and better problem solving information for the end user.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 45b85a700fcb4c9db07ec0bd13ecd8463696c4c2)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Update release notes for 3.12.5 release
Translation updates for 3.12.05

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 64332b6b9be9ab71b22433533d529573a2f5297f)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Increment version for 3.12.5 release