Bug 11269: fix incorrect use of MARC::Field->subfield()

MARC::Record 2.0.6+ enables the warnings pragma, and as a
consequence, started logging cases where a routine in
C4::Search was calling MARC::Field->subfield() with an undef
subfield label.  This patch removes the log noise.

To test:
- Run prove -v t/db_dependent/Search.t
- There will be warnings about
  "Use of uninitialized value $code_wanted in string" in MARC::Field.
- Apply the patch.
- Those warnings are gone.

Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Tests now pass

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2f6f6d2b0c4d4e8a4ed5ab17fbbf66393f8a2c69)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 8070: improve MARC preview display for RTL languages

The Right Answer, according to the cataloger I spoke to,
is to make it LTR when doing "raw" MARC display.

To test:

1) Install this patch, then run misc/translator/translate install ar-Arab
2) search for a bib in the staff client.
3) Switch to Arabic, and click the link to the left of "MARC Preview"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

At first glace I was unsure about hard-coding this style in the
template. Further testing indicated that this is required as the
showmarc template doesn't inherit any of the CSS from the containing
page.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 432f5ad400c6679186b27a00b61a3ad72ddda313)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10016: force zero browser-side caching of SCO pages

This patch makes the web-based self-check module pages
specify that no browser (or proxy caching) occur at all.
This prevents a security issue where letting the SCO session time out,
then hitting the back button allowed one to view the previous
patron's session.

This patch adds an optional fifth parameter to output_with_http_headers(),
and output_html_with_http_headers(), a hashref for miscellaneous
options.  One key is defined at the moment: force_no_caching, which if
if present and set to a true value, sets HTTP headers to specify no
browser caching of the page at all.

To test:

[1] Start a web-based self-check session and optionally perform
    some transactions.
[2] Allow the session to time out (it may be helpful to set
    SelfCheckTimeout to a low value such as 10 seconds).
[3] Hit the back button.  You should not see the previous patron's
    self-check session.
[4] Verify that prove -v t/Output.t passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Ed Veal <ed.veal@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7b165794cd1875b79177f85db59be42a9708554a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
bug 10016: munge history in SCO to discourage resubmitting user login

This patch uses history.replaceState (introduced in HTML5) to manipulate
the browser history to encourage returning to the SCO patron barcode
form if the back button is used.

Note that a side effect of this patch is that if the user uses
the help link, they will be prompted to enter their barcode
again.  It may be better to put the help inline with the rest
of the SCO forms.

To test:

[1] Start a web-based self-check session.
[2] Enter a patron barcode.
[3] Allow the self-check session to time out.
[4] Use the back button.  You should get the patron barcode
    entry form; you should not be prompted to resubmit form input.
[5] Enter a patron barcode, perform some transactions, then
    use the finish button.
[6] Next, use the back button.  You should get the patron barcode
    entry form.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Ed Veal <ed.veal@bywatersolutions.com>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 58d469ed4d6891cddf6a5ef35d21caa553dfb8ae)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Deleted the sco-main.tt file for the bootstrap theme from the patch.
Bug 11054: Specify UTF-8 encoding when creating a child record

When the only non-ascii characters in a new child record
are latin + diacritic in the range covered by Latin-1 they
are not being added to a new child record correctly encoded.
Explicitly setting the record's encodiing ensures that
they are interpreted correctly.

see "Unicode Bug" in perldoc perlunicode for background on
why these characters are special

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Works well. No koha-qa errors.

Same test as before
1) with a record with diacritics in author/title,
2) press new child record, on new record 773adt
with mangled accents
3) Apply patch
4) Repeat 2, now good results

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Tested with a record containing umlauts in the title,
$t was empty before and umlauts in $a mangled.
After applying the patch fields are correctly filled and
diacritics display correctly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 8861c8dda545bddb3a4d28abce77c53c173e00d0)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10720: fix issue that prevented use of HTML tags in overdue notices

Substitution term in overdue notices shouldn't be removed if they don't match.
It prevents use of HTML in notices to use with CSS.

Test plan :
- define an overdue notice containing some valid substitution terms + some valid html tags (<strong> or <div class="my class" to use with a css
- find a borrower with overdues that trigger this notice
- run overdue_notices.pl -html <directory>

Without patch, your html tags are missing in your html file
With the patch, they are present and can be used with a css to generate a formatted pdf file.

If you add some invalid substitution term, with the patch, they are still in the final letter, but the warn in the log helps you to correct your notice template.

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 394be84dcd65a4569d0467bc12b99dbd6341fc43)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>