Bug 11292 - barcode scanner clicking 'save'

When cataloging a bib record if you scan an ISBN barcode in the barcode
scanner clicks the 'save' button before the cataloging is done. This did
not happen in 3.10, but is happening again in 3.12.

Test Plan:
1) Open the marc editor
2) Focus on a field, hit the enter key
3) Note the record tries to save
4) Focus on an indicator, hit the enter key
5) Note the record tries to save
6) Apply this patch
7) Repeat steps 2 and 4, note the record no longer
   tries to save upon carriage return

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Patch tested with a sandbox.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit a52a0a8811f6ad03c422c62280bc184a9e16996d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11292 [QA Followup] - Use noEnterSubmit instead of new keypress handler

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 6f4baf2c59ff00b64a0beb891605c2dd4a7452a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 12046: Authentication using CAS - bootstrap

At the OPAC, if the bootstrap theme is used, the modal
dialog does not allow to use the CAS authentication.

This patch proposes, in case CAS is enabled, to
redirect to the opac-user.pl page (like prog theme).
This is because the popup content should stay small
(thinking about mobile surf), and that CAS url is
actually only computed in opac-user (see C4/Auth.pm)
and it would not be performant to compute it in all
pages.

Test plan:
- set syspref opacthemes to bootstrap
- enable the casAuthentication syspref
- fill the casServerUrl syspref with something like:
  https://localhost:8443/cas
- go on the opac home page
- click on "Log in to your account" link (top right)
=> You go to cgi-bin/koha/opac-user.pl page where you
  see the cas link
- disable the casAuthentication syspref
- go on the opac home page
- click on "Log in to your account" link (top right)
=> You see a popup for login and password

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Normal login still works with/without CAS.
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4bc46dbbcb93ca43b2fd138cf65f51893978b3ad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 12438 - Bad encoding in acquisition basket

We noticed a bad encoding (diacritics replaced by <?>) in acquisition basket when updating a server to Debian Wheezy.
We found it comes from a query containing biblio.title twice.
Maybe the mysql newer version creates this side-effect.

Test plan :
- Create an order on a record containing a diacritic in title
- Look at the basket : cgi-bin/koha/acqui/basket.pl?basketno=x
=> Without the patch the record title is bad encoded (with <?>)
=> With this patch the record title is well encoded
- Check also basket CSV export

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Good catch!
Works as expected, passes tests and QA script.
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Duplicated biblio.title is a (minor) bug, and should be removed.

The side-effect of it solving an encoding problem might be seen
as problematic: it hides a real problem.
The efforts on 11944 actually solve this encoding problem (11944
merged into master actually fixes this), so I'm pushing it, for
a short term solution for stable, with the hope that we will soon
have 11944 pushed.
BTW, non-diacritic but non-ASCII characters are not broken either.

(cherry picked from commit 9fe36e0c705b958859babe565517554b722c66cd)
Bug 7308: Show ordered amount in aqbudgets.pl

Signed-off-by: Cédric Vita <cedric.vita@dracenie.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dc3a90c41160493e9dfbf3353d755825c7f403b8)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 7308: rework aqbudgets.pl table

admin/aqbudgets.pl should have the following columns:

Base-level allocated (or just Allocated)
Base-level ordered
Total sub-levels ordered
Base-level spent
Total sub-levels spent
Base-level available
Total sub-levels available

Base-level is always calculated for one level, without children.
Total sub-levels should include child funds.
Available is calculated as "allocated - (ordered + spent)".

Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Seems to work alright for me.
Passes QA script and tests, after I fixed 2 tabs in admin/aqbudgets.pl.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1e808f180540a7552a9c1467ee685ac037d8c042)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 7308: (follow-up) removing line breaks for better translatability

Because of the lines breaks in the table headings the strings
were separated in translation. Example:

Base-level allocated
 - Base-level
 - allocated

If you look at a smaller screen the table headings will still break
without the additional <br />.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 3c54feb1b3e15ddeca23adad1bec45e29dfeb1d5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 7308: (follow-up) change color style for fund child

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 773f28ac0d81ce9544fe8052da117e5b0c1da4c7)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 7308: (follow-up) tweak style of child fund amounts

This patch changes the styling of the amounts of child funds
in the funds table to use a more visible indication (i.e.,
italics rather than a font color of grey) and to use a
a new CSS class, "child_fund_amount", rather than a hard-coded
style.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c3a52a9b200f3e87033ecd8f42938eaa6ddab410)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11864: (code cleanup) re-indent parcel.tt and rename a variable

Signed-off-by: remy juliette <juliette.levast@iepg.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Fixed 2 additional tabs.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 906b7deffe88bf245d1b21c1e3b8df800034db2e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11864: Show parent order line in received orders table

Test plan:
1/ Go to the receipt page of a bookseller
2/ Choose an invoice for which you have already partially
   received some orders (or create an order an receive it
   partially)
3/ In the received orders table, under column Order line,
   you should now see the parent order line number in
   parenthesis

Signed-off-by: remy juliette <juliette.levast@iepg.fr>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 51c0e46033fffcbb07fb5456640e35fb41623707)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 12117 - Remove unused image myshadow.png from the staff client

myshadow.png was used by a jQuery plugin which has long been removed.
This patch removes it.

To test, search the Koha source for references to myshadow.png.
There should be none.

Followed test plan, patch removed file as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

(cherry picked from commit 5c573a7ad8d50788d3b5a78e58efb8c758a9ec0c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11639: fix untranslatable strings in 007 builder

This patch modifies marc21_field_007.tt to make
some missing strings translatable

To test:
1) Using your preferred language, xx-YY, updatepo files
cd misc/translator
perl translate update xx-YY
2) Check that missing strings are NOT present
egrep -i "exact bit depth|pad with zero|use up to 6" po/xx-YY-i-staff-t-prog-v-3006000.po
3) Apply the patch
4) repeat 1)
5) Repeat 2), check that missing strings are present

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Template change, works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d944728a917b5645ef3248e9689638f565388025)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11646: fix untranslatable confirm popup in field 006 and 008 builders

This patch MARC21 modifies value builders 006 and 008 to make
confirm popup translatable

To test:
1) Update po files for your preferred language, xx-YY
cd misc/translator; perl translate update xx-YY
2) Check that confirm string is NOT present
egrep -B3 "Show values for|material type\?" po/xx-YY*po
3) Apply the patch
4) Repeat 1)
5) Repeat 2), now the strings are present

Also check that english or translated popup is right

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a9f794a9c89465bdbf1b54ecd1c683c7825c8ae3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 10782 - Add a koha-mysqlcheck script

This patch adds the koha-mysqlcheck script, as a "frontend" for
the mysqlcheck command. It can be used to check the integrity of
database tables, as well as to repair them. See "man mysqlcheck"
for more information.

The script takes a Koha instance name as its only required
parameter. Any other parameters provided before the instance
name are passed directly to mysqlcheck, which means that all
the functionality of mysqlcheck is available through this script.

To test the script:
- Apply the patch, build your own packages and install them, or
- copy koha-mysqlcheck to a server already running off packages

- Run some variations of the command, with and without arguments,
  and check that the output makes sense. E.g.:
    sudo koha-mysqlcheck myinstance
    sudo koha-mysqlcheck -e myinstance # Extended checks
    sudo koha-mysqlcheck -e -v myinstance # Extended checks and verbose
- See "man mysqlcheck" for other relevant options

To test the man page:
- Run these commands and look at the formatted man page:
    $ xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \
      debian/docs/koha-mysqlcheck.xml
    $ man -l koha-mysqlcheck.8
- Make sure this test passes:
    $ prove -v xt/verify-debian-docbook.t

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 25c932967f9def41b689b07f4536f398b612944b)
Bug 12105 - Remove duplicated plugin jquery.dataTables.columnFilter.js

This patch removes a redundant copy of the DataTables plugin
jquery.dataTables.columnFilter.js and corrects two templates.

The path to the plugin has been modified in acqui/parcel.tt:

- Go to Acquisitions and search for a vendor.
- Open the detail page for that vendor.
- Click the "Receive shipments" button.
- Select an invoice to view.
- In the table of titles, confirm that the column header search forms
  work to filter column data.

In the template for the Staged MARC management page the plugin has been
removed as it is unused. A couple of markup corrects have been made.
Confirm that table sorting is unaffected by going to Administration ->
Staged MARC management, clicking a staged MARC file, and viewing the
table of items in that batch.

There should be no more remaining instances of this path in the
templates:

[% themelang %]/lib/jquery/plugins/jquery.dataTables.columnFilter.js

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

NOTE: I believe the sort order of the Order Line column is
      strange, but unrelated to this patch. The search area
      functions (filtering, paging, page size, etc.) worked
      fine.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 45ce7431d42cd470d7f7326d8935333014b1f62c)

Conflicts:
	koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
	koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt
Bug 12112: remove disused routine C4::Breeding::ImportBreeding()

This patch removes the ImportBreeding() routine, which lost its
last caller as of the patch for bug 10462.

To test:

[1] Verify that prove -v t/Breeding.t passes.
[2] Perform a Z39.50 search in the staff interface.
[3] Perform a cataloguing reservoir search in the staff
    interface; verifying that cached records from the search
    done in step 2 are retrieved.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 990bb17e14efb8a2c16236c89ef5869dcfc48ad4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Translation updates for Koha 3.14.11 release

Added new language Khmer.
Bug 12873 - Reserve can be cancelled by any logged in user

It is possible to cancel reservations through simply running opac-modreserve.pl with existing reserve_id number. This may provide remove even all reservations from system. The only limitation is that user have to be logged in. Simplest solution is to check whether reserve belongs to user or not.

Test plan:
1. Create reserves by 2 different users, and get their ID's
2. Before patch, hold may by cancelled by anyone who run site:
http://example.com/cgi-bin/koha/opac-modrequest.pl?reserve_id=XXX
3. After patch hold may by cancelled only by user whose reserve is.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 60875757c761a9ad59734e968cf34a831c65e9a6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 12876 - Reserve in waiting/transfer status may be cancelled by user

User may cancel his own reservation at waiting or in transit status
through calling opac-modrequest.pl. Cancel button is disabled in
interface but possibility to cancel should be checked also in
opac-moderequest.pl, before calling CancelReserve().
Similar situation is with opac-modrequest-suspend.pl

This patch provides new soubroutine to chceck if user can cancel given
reserve. It's possible only when he's owner of hold and hold isn't in
transfer or waiting status.

Additionaly there are new test for this function in Reserves.t

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests, QA script and new tests.
Works as described, tested with:
.../cgi-bin/koha/opac-modrequest.pl?reserve_id=XXX

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>

Conflicts:
	t/db_dependent/Reserves.t

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c0ab862f4a902ce261b9b8870c169f6fe27711e1)

Conflicts:
	opac/opac-modrequest-suspend.pl