Translation updates for 3.14.06 release

New languages:
    Kinyarwanda from Rwanda - rw-RW
    Swahili from Kenya - sw-KY

Renames:
    Thai from th-THA to th-TH
Bug 12134: Add unit tests to reflect the change in IsDebarred

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 9f1f7da8ac205b2d642aa7986a9ac26b1a8614e1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 12134: (follow-up) add more unit tests to reflect the change in IsDebarred

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c2d0a49defbc739469be61c33061d6819feb7b69)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 12134: (follow-up) fix one of the IsDebarred() tests

- pass valid ISO date to the debar-date-in-future test
- correctly verify that patron is restricted

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2f5e9df121508fe32e5109621224d1ebbc8c388c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 12134: ensure that patrons are not restricted even when the last restriction has expired

Test Plan:
1) Add a manual restriction to a patron and wait until the
   expiration date of the restriction has passed.  This can be
   simulated by modifying borrowers.debarred for a borrower and
   setting the date in the past.
2) Try to check out an item to that patron
3) Note you cannot
4) Apply this patch
5) Repeat step 2
6) Note you can now check out items the patron

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 35a94f6423ee851668047075dbc153dc3aa13606)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11655: koha-translate --list no longer shows 'en'

'en' is not a translation and it doesn't make any sense to return it as
part of the installed translations or the available ones.

It becomes relevant to remove it as users upgrading their installed
translations end up grepping the output to remove 'en' like in:

for lang in $(koha-translate --list | grep -v -x -e 'en') ; do
  koha-translate --update $lang
done

instead of simply issuing the koha-translate --list command.

To test:
- Run
  ./koha-translate --list
  ./koha-translate --list --available
=> It shouldn't return 'en' in the result list.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6aa021896827e846e58f88a8c5387df122688c53)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11246: remove reference to fields 780 and 785 in UNIMARC XSLT files for Bootstrap OPAC

Another fix, 10465, removed fields 780 and 785 from a unimarc xslt file.
This cleanup is needed for bootstrap too

To test : in a UNIMARC Koha, with Bootstrap theme OPAC
1. Be sure that OPACXSLTDetailsDisplay , OPACXSLTResultsDisplay sysprefs
   are set to "default"
2. Apply the patch
3. Search some records in OPAC : the list view and the detail view
   should be exacty the same as before you apply the patch.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Changes are consistent with changes done earlier on the prog theme.
Checked that the detail pages and results still display correctly
for UNIMARC.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 684143a529cb556236f46d1d2a8ef05908c0b2f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11572: ensure that running Z39.50 search from staff search results detects ISBN

In Koha 3.8, if a standard catalog search was performed and the user
clicked the Z39.50 search button, the search string would automatically
be placed in the isbn field for the Z39.50 search form.
Changes to the code have since broken this functionality.

Test Plan:
1) From mainpage.pl, use "Search the catalog" to search for the string
   "9781570672835"
2) Click the Z39.50 Search button
3) Note the string is placed in the title field
4) Apply this patch
5) Repeat steps 1-2
6) Note the string is placed in the isbn field

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested old and new ISBN with and without hyphens.
Also tested some other keyword searches.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Note that the behavior will be a bit odd if you do a 'replace via
Z39.50' from a bib record whose title happens to be an ISBN, but
this scenario seems unlikely enough to ignore.

(cherry picked from commit 7f6f3b924e5bc9343bb475a1add714923a025913)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11619: remove duplicate key in QueryParser config

Corrects a double entry for language in yaml file.
Language should have been language-original.

Test plan:
Check that you have language-original in your zebra install.
Specifically, this index should cover MARC21 041$h.
Enable QueryParser and search for a record with this index.
Note that this patch does not enable searching on this
index without QueryParser. This is true for many more indexes
in record.abs that are not included in the getIndexes routine.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described - make sure you are testing with a current
indexing configuration.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3424f0d84a1622c502aeb376450cad5b74f0cea1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11619: (follow-up) fix QueryParser.t

The previous patch did not account for the change
in the number of indexes, and thus caused one
of the tests to fail.

To test:

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

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 547ebaece0bcd24857cecd6c95d8a5c1c41ce222)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Update release notes for 3.14.6 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Merge remote-tracking branch 'translator/3.14.06-release' into 3.14.x

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Increment version for 3.14.6 release

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11290: fix display of patron home page for certain translations

To test
1) In a fresh Koha, generate translation into XX
2) Select XX for the staff interface (i.e. enable it, and choose it)
3) Go to the Patrons page
4) Everything looks fine
5) In the admin page, create a patron category with any non-ASCII
   character.
6) Go back to the Patrons page, everything is broken
7) Apply patch
8) regenerate translation
9) Go back to the Patrons page, everything looks fine
10) Switch to english it still looks fine

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Tried with ru-RU and fixes the problem.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Problem is also visible on untranslated templates changing
one of the sample category descriptions to include diacritics.

[RM note: I wasn't able to reproduce this on an unstranslated
 template -- I tried using Arabic, Cyrllic, and Spanish characters]

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3e1b781adc253722209e46385fb3248ae8d668f9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11369 - Updating the jquery.cookie.js-plugin

The current jquery.cookie-plugin crashes when trying to fetch
all cookies using $.cookie();
Downloaded the newest plugin version and minified it.
Now works as intended.

Encountered an issue with the plugin now returning null when
no cookies are found, and applied a fix in browser.js.

-------------
- Test plan -
-------------
Plugin is used in browser.js and batchMod.js so testing both

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 35bec75d66637bd3c4cff499ed7fb534b8d09f35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11369: fix issue that can cause staff client searches to stop working

This patch fixes an issue where too many search cursor cookies overflow
the HTTP-header size after making multiple searches in the staff client.

To replicate this issue, make multiple searches in catalogue/search.pl.
50+ Should be enough to cause the HTTP-request header to overgrow.
One can verify this issue by observing the searchCookie growth in
browser's stored cookies.

-------------
- TEST PLAN -
-------------

Keep making searches.
One should never have more than 10 searchCookies. Browser might display
only 9, because for some reason the newest js-generated cookie is not
included in Firefox's cookies listing.

------------
- DRAWBACK -
------------

Removing these cookies disables the search cursor for traversing search
results (next/previous) for the removed cookie. This maybe be problematic
in some cases,
(for ex when multiple search tabs need to be open and they need to be
 traversed)
One easy solution is to grow the amount of stored searchCookies from 10 to
20, but 10 is chosen so there will be plenty of room for other cookies as
well.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0cada7a323db7f9871b67a07e3343642543b64e0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11369: (follow-up) Correct usage of me.searchid in browser.js

In browser.js, at creation of browser, the searchid is transmited to
JS object into me.searchid.
To be consistant, me.searchid should always be use, never searchid alone.
In browseRecords function, setting searchid as parameter is useless
because it is defined in me.searchid.

Test with test plan of Bug 10404

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 98edbf00cc10c908820eb1126a176ed12a04300d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11369: (follow-up) generate searchid in browser.js

The search browser feature uses nearly only the browser.js file.
That is why I propose to move the searchid generation from search.pl
to browser.js.
We then use Date.getTime() to use current timestamp as searchid,
prefixed by 'scs_' like before.

Test by using test plan of main patch :
Too many search cursor cookies overflow HTTP-header size, when
making multiple searches in the staff client

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.
Tested the browse functionality in staff by using the different
options (back to results, next, previous, etc) and the batch
modifications for items. An old cookie can cause a Javascript error,
but after restarting the browser/deleting cookies it all works
correctly.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c4f17650132c9b74aa56c40a3a2bec2bdbc4477e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11563: restore preventing the enter key from submitting several forms

Several forms that take patron or item barcodes as input stopped
preventing the enter key (which is often sent by barcode scanners)
from submitting the form.

The code binding the CSS class noEnterSubmit to the handler preventing
submission when hitting the enter key was no longer triggered.  This is
because this class is added using JavaScript in $(document).ready() and
the keypress event listerning is also set using $(document).ready().

This patch corrects by using JQuery live() with will set event handlers
for HTML generated with JavaScript.

Also sets noEnterSubmit to use the checkEnter(e) function, as that has
broader browser compatibility.  Also corrects a small bug, for IE,
window.event must be used, not event alone.

Test plan :
- Flush browser cache (Crtl+F5) to update js files
- Go to patron creation : members/memberentrygen.tt
- Type a text in all mandatory inputs
- Type some caracters in a non mandatory input
- Press Enter key
=> Without patch : the form is submitted
=> With patch : the form is not submitted
- Try to set several lines in a textarea
=> It works (checks that in this case enter key is allowed)
- Test other pages usign noEnterSubmit class :
cataloguing/additem.tt
course_reserves/course.tt
members/mancredit.tt
members/maninvoice.tt
patron_lists/list.tt

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, tested in Firefox and Chromium.
Passes tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e5ab2203745d7c70e1c4d2f54cea967710a88b96)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11563: (follow-up) change .live() to .on()

The jquery event handler .live() has been deprecated. It is recommended
that .on() be used instead.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1226f901cef989915ee68e7ac7d1b1acf9fba91c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>