Bug 10664: fix error in overdue_notices.pl if there is no active currency

If there is no active currency, when running overdue_notices.pl
you get a sofware error "Can't use an undefined value as a HASH
reference" on GetCurrency() function call.

With this patch, if there is no active currency, fines are formated
by default 0.00 and notices are correctly generated.

Test plan :
- have at least one borrower with overdue that should trigger a notice
- verify that there is no active currency (Adminitration > Currency &
  Exchange rates)
- run misc/cronjobs/overdue_notices.pl -v -n (to get the notice directly
  on output)

=> without the patch you get the software error
=> with the patch, notices are correctly generated

If an active currency is defined, the script overdue_notices.pl runs
the same with or without patch

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 a9a3bb7b3d7e8e862cf0f772246667258a20b786)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10664 [QA Followup] - fix error in overdue_notices.pl if there is no active currency

Fixes the following koha-qa.pl error:
 FAIL   misc/cronjobs/overdue_notices.pl
    OK     pod
    OK     forbidden patterns
    OK     valid
    FAIL   critic
               # Variables::ProhibitConditionalDeclarations:

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e476378323eb8dd31e67e4741d271d88de61b59e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10745: remove more ambiguity for translators for XSLT subfieldSelect parameters

As in Bug 6278, this patch replace ">at<" with ">a_t<"
so not to mislead translators. Found more cases that
initial description.

To test:

1) Check that problem exists and only on xslt files,
using your preferred language

egrep -B10 "^msgid \"at\"" misc/translator/po/xx-YY-i-staff-t*

2) Apply the patch

3) Update translation file
(cd misc/translator; perl translate update xx-YY)

4) Verify the problem is gone, repeat 1

5) If you like verify new entries in PO file

egrep -B15 "^msgid \"a_t\"" misc/translator/po/xx-YY-i-staff-t*

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested this with field 780 and running a Dutch translation.

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5b9cd85dd0dbd7e3470c783e0e024ad32df2f8b5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Translation updates for 3.12.04

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Update release notes for 3.12.4 release
Merge remote-tracking branch 'github-pichu/3.12.04-translate' into 3.12.x_release
Increment version for 3.12.4 release
Bug 10543: fix false warnings from checks of mandatory item fields

Under certain circumstances, when editing an item, you get a popup
warning
  "1 mandatory fields empty (highlighted)".

Even though all mandatory fields are filled in.

This occurs when there is a field with a huge content (more than 100
characters) that gets displayed in a textarea instead of input.

This patch corrects the Javascript form check by using siblings().

Also adds a more precise filter to find mandatory inputs because
looking in full page may bring unwanted results.

Test plan :
- In a framework, make sure you have in item field :
  An optional subfield (without authorised value),
  then a mandatory subfield, then an optional subfield
  next to mandatory subfield
  For example : $i (optional), $r (mandatory) and $s (optional)
- Open a biblio record and create a new item
- Enter more than 100 characters in $i, fill $r and $s
- Click "Add item"
- Edit this item
=> You get a textarea for $i
- Empty $s and Save
=> Without patch, you get a warning and form is not saved and you see that $s is yellow while it should be $r
=> With patch, form is saved
- Re-edit this item
- Empty $r and save
=> You get a warning and form is not saved

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Notes on last patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 651ea298ea90742a2c56bbb693a4fbbb0064d5b2)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Couldn't reproduce using $i as in the test plan, but $o triggered the problem, which this patch series fix.
Bug 10543 - Unify item mandatory subfields check

Use of CheckMandatorySubfields from cataloging.js
everywhere an item cataloging form is checked for
mandatory fields.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0d4724e81b94b290a5b58970a8f59ebe8340f165)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Couldn't reproduce using $i as in the test plan, but $o triggered the problem, which this patch series fix.
Bug 10543 - add mandatory subfield check to addorderiso2709.pl

When adding orders from staged file, you can create one order per
record using item form in the bottom of addorderiso2709.pl.  The
form was missing checks of mandatory item fields; this patch
adds those checks.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>

All 3 patches pass tests and QA script.

Some additional notes on the test plan from the first patch:
It took me a while to figure out a combination of subfields
that would trigger the bug. I am not sure about the condition
that transforms the input field into a textbox as it does
not seem to happen for every field.

What worked in the end was (MARC21):
- $g cost, normal purchase price = mandatory
- $h serial enumeration/chronolgy = optional, filled with
  text over 100 characters

Checked for:
- Adding items in cataloguing
  Was able to reproduce the problem, mandatory check works
  as expected.
- Adding items from staged file in acq
  Was not able to trigger the problem, because we don't edit
  the item here, but mandatory check works as expected.
- Addings items for serial subscriptions
  Was not able to trigger the problem, because we don't edit
  the items here, but mandatory check works better as before
  as missing mandatory fields are now highlighted and weren't
  before.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2c7e1390b45e497676ea4f414520708577cf761a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Couldn't reproduce using $i as in the test plan, but $o triggered the problem, which this patch series fix.