Bug 11104: Wraps series label in a span for CSS selectability.

Note: patch is only for the prog theme.

Patch submitted as part of Librarian to Developer in 90 Minutes
at LIANZA 2013.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 396bbc758756637782cd463a8586f2ac15757f4e)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 6e0985f7d85f3bc41cf78e76ff2db2a3b3245915)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11101: add CSS selector to item types facet label in OPAC

Note: prog-only patch.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Adds a CSS class to the Item types facet in OPAC.
Works as described.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit b8a3933ca38ea36df73bd903835e9ed1db02bed7)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 945496b32fe3be9862a2705fb07993f9710c1b60)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 2310: display tooltips explaining why patron menu items are disabled

With some staff client menus options are displayed as disabled when the
logged in user doesn't have permission to perform that function. This
patch adds Bootstrap tooltips to patron menu items with text explaining
why they are disabled.

To test, log in as a user who lacks permission to modify patrons or set
permissions. Open a patron record in circulation or patrons. Hovering
over renew, delete, and set permissions links (in the patron toolbar
"More" menu) should trigger a tooltip with a brief explanation.

Test the "Update child to adult patron" link by viewing an adult patron.

A separate patch will address catalog menu items.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
New tooltip texts are translatable, patch passes all tests
and QA script.
Tested according to test plan in Chromium and Firefox.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 01c101a6b9b60b685abca58fddfccb1087b4dbce)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 8b037651780d86f6fc0576abe1a665a379a8a443)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as expected, simple addition.
Bug 9728: XISBN unit test update

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit b0941f9058fa96818fceaf2515742ab0f4bebbe1)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Grabbed just the XISBN unit test updates.
Bug 11439: UT: fix XISBN.t test failure

A unit test fails in t/db_dependent/XISBN.t, the get_xisbn routine, if
ThingISBN is enabled, returns the 3rd biblionumber, not the second one.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 81133cf2c2238aaff3b3594b95211c689d2dae61)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11439: UT: Improve XISBN.t

The tests should be executed into a transaction and the SimpleSearch
routine correctly mocked.

Test plan:
Verify that prove t/db_dependent/XISBN.t returns green.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0d71139fff68523beee3f14ea26e0d670eb7c409)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Cleaned stuff not for 3.12.x and added the rollback call at the end.
Bug 10688: Don't prefix index inappropriately

If you select an index in the search dropdown and then enter in a QP
query starting with the field, Koha will prepend the index you do not
want to use at the beginning of the search, resulting in a search that
probably does not match what you were hoping for.

To test:
1) Select an index in the search dropdown in the OPAC. Author is fine.
2) Enter a search term using manually entered indexes. For example:
    ti:cat in the hat
3) Note that the search fails.
4) Apply patch.
5) Repeat steps 1 and 2.
6) Note that the search succeeds.
7) Sign off.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 03f342aa67034a56876b9b45545c607b961587b7)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 1e3602de9f0fe495e5e1931b04b6f2f06d04fb66)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as advertised.
Bug 8683: ensure clear button clears all item fields on order form

The clear js function parses input text, but input filled to a plugin
does not contain the type attribute.

Test plan:
- fill the barcode field to the barcode plugin
- go on the new order page
- verify the barcode plugin works as before
- verify the clear link clears the barcode field and all others fields.

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

Works as expected, passes all tests and QA script.
Template change only.
Barcode and date acquired are now also cleared with the
'clear' link.

But: it only works when you enter a barcode manually currently,
because the AutoBarcode functionality is broken on master (bug 11273).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f3b28a5d8ad381bbe5b3edce994e0d45ee96f920)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 842724659c9ac3b6dd1fbf312d8a07ac00fa43c5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10808: make authority search form retain drop-down selections

When cataloging a field defined with a thesaurus, an authority search
popup is displayed with a search from. Once operators, values and sort
selected in this form the search can be performed. The bug is that the
values entered are kept but not the selected operators and sort.

The same bug was existing in authorities module, solved by Bug 8692.

This patch corrects the bug.

Also uses in 'sort by' options the same text as search in authorities
module : Heading A-Z (default), Heading Z-A, None.

Also removes duplicated code in auth_finder.pl :
    value_mainstr => $query->param('value_mainstr') || "", ...

Test plan :
- Create a new biblio with a framework containing a field linked to a
  thesaurus. For example : 600
- Click on small icon of main entry. For example : 600$a
=> You get a search form with all operators to "contains" and sort by
   "Heading A-Z"
- Enter a value in each text box and perform search
=> You get a search form with values in text boxes and all operators
   to "contains"
- Select "starts with" in all operator comboboxes and perform search
=> You get a search form with all operators to "starts with"
- Select "is exactly" in all operator comboboxes and perform search
=> You get a search form with all operators to "is exactly"
- Select "Heading Z-A" in sort by and perform search
=> You get a search form with "Heading Z-A" in sort by
- Select "None" in sort by and perform search
=> You get a search form with "None" in sort by

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Comment: With both patches applied no koha-qa errors

Test
1) Original behavior is whatever selection you do before patch,
search form returns to default options
2) After patch, selection remains

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass, further comments on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 857547c992ea2b548712583d09602eda3787556c)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 9959fca67510356ab9d7acd128c453d6008a2b73)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10808: (follow-up) reformat auth_finder.pl

Perltidy and some format changes.

Most important : call to get_template_and_user must be at begining
of script because it checks authentification.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Testing notes:
- Tested various searches, selections now remain after
  submitting the search form.
Regression testing:
- Clearing the authority from the record still works.
- Creating a new authority from the plugin page
  still works.
- Autocomplete of entries still works.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ca29e0658c469abff1e54e8630fb989757d02f71)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit b91635d802e6648c7708df72ba323c3f4b39efcc)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10605: fix encoding issue in basket email (OPAC)

There is an encoding issue on the received mail.
Here, we have to keep the encode_qp in order not to break links (= is a
special char for email https://en.wikipedia.org/wiki/MIME#Encoded-Word).

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 4290fa60ef0fd93f1c0b51485f3b3ec74f316043)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit adb91828bd95a006a0db89756dd51f3728de5034)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10605: fix encoding issue on basket email (INTRANET)

Same fix for the staff interface.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Both patches tested with English and German, diacritics
now appear correctly if UTF-8 is selected as encoding.
Passes all tests and QA script.

Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 62fcbea10a0e7b3fbca74531ec5051704ab63f7c)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 6d16356a1a5bf08c83b7e00dbbfa84ae3bf3d02b)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11535: sanitize input from patron self-registration form

This patch adds the use of C4::Scrubber to the processing of input
from the patron self-registration form, thereby closing off one
avenue for Javascript injection.

To test:

[1] Use the OPAC self-registration form to enter a new patron,
    and set its address to something like:

    <span style="color: red;">BAD</span>

[2] In the staff interface, bring up the new patron record.  The
    address will show up in red, indicating a successful HTML
    injection.
[3] Apply the patch and use self-registration to enter a new
    patron with a similar case of unwanted HTML coding.
[4] Bring up the second patron in the staff interface.  This time,
    the undesirable HTML tag should not be present.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Liz Rea <liz@catalyst.net.nz>
Tags are not present on testing.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Confirmed bug and that the patch fixes it.
Passes all tests and QA script.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11174: fix OPAC search links built from authority 5xx fields

In the templates opac-authoritiessearchresultlist of prog and
bootstrap the incorrect parameter 'valuec' is changed to 'value'

To test:

1) Insert an authority record with a 5xx field  (on MARC21 or UNIMARC)
2) Index the record
3) Search for the record in using OPAC authorities search.
4) Click one of the "see also" links built from the 5xx field, the link
   doesn't work
5) Apply the patch
6) Close the browser
7) Open the opac and select the english interface
8) Redo the search
9) Now the link works
10) To use the patch in others languages you need to regenerate the
    templates.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with bootstrap.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Following commit remove the use to valuec:
 commit 31f41e2c1db9d8dca82e0249050acb8f906c8164
    Bug 8206: Specify index in OPAC authority search

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 09fcd6980301bae3daad68f8cc27a2d5e7d488e4)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 27596b0c6a808fda6a08abb4cd46a98025e3a38f)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Removed the Bootstrap bits.
Bug 9224: Make acqui/finishreceive.pl Plack-compatible

Under Plack/mod_perl wrapping, sub update_item() will become a closure,
so after the 1st run it will retain its own private instances of the
following variables: $booksellerid, $datereceived, $unitprice, $rrp,
$biblionumber.

I.e., in case update_item() gets invoked 2nd+ time (inside
the same process, but for different-subsequent receives) it may
incorrectly flag the (old, wrong) biblionumber for Zebra reindexing,
and erronously modify the current item[s] with the previously
used (wrong) values.

This simple patch should make acqui/finishreceive.pl Plack-compatible.

Test plan:
Test patched acqui/finishreceive.pl script (create and receive some
orders w/ items, etc.). Ensure items are gettting added and/or modified
correctly during receiving process.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised, no regressions found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 6dcc34c1b44f72a8602c4ee95540836e6cd1e7bd)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 2a38ac7259bbe88d1d531bfd9d93d9edee64a4c4)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11255: allow "relevance ascending" as a sort option

This patch fixes a problem where if a staff member sets the
*defaultSortField/*defaultSortOrder system preferences to relevance
ascending while QueryParser is enabled, default keyword search
would break -- the query parser config did not declare relevance asc
as a possible "modifier".

Note that setting the sort order to relevance ascending does not
actually make catalog search return results with the least relevant
records showing up first; Zebra does not support such a mode.  In other
words, relevance ascending acts exactly the same as relevance descending.

Test plan:

0/ Create some biblio with "history" in the title and
   ensure that the QueryParser system preference is enabled.
1/ Define prefs defaultSortField = relevance and defaultSortOrder = asc
2/ Search "history" on the staff interface
3/ Note that no result is returned.
4/ Apply the patch
5/ Verify the queryparser config file in use takes the modification into
account (see the queryparser_config value in your $KOHA_CONF file).
6/ Relaunch the search and verify results are returned

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 54937c5eb34c511e00de8d0831141516422885c7)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 96599cc238393ff3f70445c512ff8ffc87bc13ce)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as described. Had to copy the queryparser.yaml file to my koha-dev/etc/searchengine dir.
Bug 11166: make library filter in funds administration page more precise

In funds administration, admin/aqbudgets.pl, there is a combobox for
filtering by library code.

The bug is that the filter uses a pattern match  instead of equals :
  next unless $budget->{budget_branchcode} =~ m/$filter_budgetbranch/;

In this case, if there is a library with code '1' and one with code '12',
filtering by library '1' will also show funds of library '12'.

Test plan :
- Create a library with code '1' and one with code '12'
- Create funds in both libraries
- Go to admin/aqbudgets.pl
- Filter by branch '12'
=> You see only funds of this library
- Filter by branch '1'
=> You see only funds of this library

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 484d1490925d736f99a430a6933c96e42ea4e768)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 64c79561bbabf6476fb72c27435789f4dd19180a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 11410: ensure cataloging search finds results for searches with ampersands

When QueryParser is off, the cataloging search is passing the incorrect
variable to SimpleSearch.  I'm sure this is causing other issues, but
the one I have identified is that any searches with an "&" in them
return no results.  This patch corrects the bug.

Test Plan:
1) Catalog a new record titled "Cats & Dogs"
2) Rebuild your zebra index so this record is indexed
3) Browse to cataloguing/addbooks.pl
4) Search for "Cats & Dogs"
5) Notice you get no results
6) Apply this patch
7) Repeat the search
8) Notice your result now shows up!

Signed-off-by: Heather Braum <hbraum@nekls.org>
Signed-off-by: Suzanne Fayle <sfayle@roseman.edu>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
This works as described, passes all tests and QA script.
Note: Because $query = $builtquery when the QueryParser is used,
this problem is only visible when UseQueryParser is set to "Don't try".

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 2a4e193c242372f488892591a72752dfd4ffb138)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit 0c500f463001db06c8c1f72f8b81c8edde6487d7)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Bug 10735: prevent koha-dump from aborting if backupdir undefined

Older versions of Koha didn't have <backupdir>...</backupdir> defined in
koha-conf.xml. The koha-dump script is aware of this, and checks to see
if it's there. However, if it's not, xmlstarlet returns a non-0 error
code which causes the script to abort due to running under set -e.

Test plan:
 * Remove backupdir from koha-conf.xml
 * Run koha-dump, notice that it doesn't do backups
 * Apply patch
 * Run koha-dump again, notice that it does do backups

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
The fallback method works as described. It might be made more robust
like checking for dir existence (thinking of older instances upgrades).
But it certainly belongs to another bug report.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
As Tomas said, it would be better to alert the user if the backupdir tag
does not exist (or contains a nonexistent directory) in the config file.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 266f2a3a9f3d67fed0e0b35d267419a901345b92)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
(cherry picked from commit de1344c2759631e1a8d505151630f160ebdab768)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Update release notes for 3.12.9 release

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>