Bug 10284: Add missing spaces between label and content in XSLT view (780/785)

To test:
- Check OPAC and intranet XSLT view for a record that contains
  780 and 785 fields.
- Verify there is no space between the label and the content of the
  field.
- Apply patch.
- Verify the display both in intranet and OPAC is a little nicer now.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9424: Move JavaScript out of header include

This patch removes JavaScript "onlick" attributes from header.inc and
moves the functionality to staff-global.js. This is in keeping with the
idea of progressive enhancement.

To test, be sure to clear your browser cache after applying the patch.

- Test the help link.
- Test the logout link with the intranetbookbag preference on and off.
- Open a patron's account and click "search to hold." Log out, and log
  in again. Koha should not remember the patron you chose before
  logging out (as seen from a search results page).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7368: Correct three typos in history.txt

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10193 - Copies should be holdings as label for items on MARC view

In the OPAC MARC view, the table of holdings is labeled 'copies.' In
order to be consistent with the normal view this should be labeled
'holdings.' This patch makes this correction.

To test, apply the patch and view the MARC detail page for any record
with items. The table of holdings data at the bottom of the page should
be labeled 'Holdings.'

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9286 - Add script to add a bib to the zebra queue from the command line

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: No test plan, but works.
Tested adding auth, biblios or both, then rebuilding -z
No errors.

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

Test Plan

1/ run misc/mod_zebraqueue.pl -a 1
2/ In your koha db
SELECT * FROM zebraqueue WHERE done = 0;
Check that a row for authority record id 1 has been inserted
3/ run misc/mod_zebraqueue.pl -b 1
4/ In your koha db
SELECT * FROM zebraqueue WHERE done = 0;
Check that a row for biblio record id 1 has been inserted
5/ run misc/mod_zebraqueue.pl
Make sure the help is sensible
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10184 - Circulation History reverses sort order

Issue data is passed to the readingrec template ordered
most recent due date first. Datatables unless specified
otherwise do a presort on the data they will display
the default results in an order the reverse of what was
intended. Disabling the presort preserves the initial sort
order until the user selects a different sort

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10218 - In OPAC XSLT search results, add class to 'online access'

In some cases in OPAC search results and the detail page there is a
class specific to each line of data being output (publisher, date,
subjects, etc). In other cases there is no additional class. This patch
makes modifications to a few different OPAC files in an attempt to make
them consistent with each other.

To test, apply the patch and view:

- an OPAC detail page with OPACXSLTDetailsDisplay off
- the OPAC search results page with OPACXSLTDetailsDisplay off
- the OPAC search results page with OPACXSLTDetailsDisplay on

Labels should have classes relevant to their data. To test the specific
case requested by this bug, view details/results for a record which
includes online resources (856u in MARC21).

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

html changes only, passes all tests

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10262 - fine calculation at checkin not respecting CircControl

The fines.pl script uses the system preference CircControl to decide
what branches circ rules to use for fine generation.

Recently, code was added to the returns system to recalculate the fine
at checkin time ( to support hourly loans ). The problem is that this
code does not respect CircControl.

Test Plan:
1) Set circ control to "the library you are logged in at"
2) Set different fines rules for two different librarys
3) Check an item out at library A, backdate the due date so it's overdue
   and will have fines.
4) Check the item in at library B
5) Observe that the fines should be generated based on library A's rules,
   but the fines will be based on library B's rules instead!
5) Apply the patch
6) Repeat steps 3 and 4.
7) Observe now that the fines should reflect the fines rules for Library A

Note: it seems counter-intuitive for the fines system to behave this way
based on the preference being set to "the library you are logged in at"
but it does make sense. The rules used are from "the library you are
logged in at" when the item is first checked out.

If the fines system really did use the rules for the library the item was
returned to, it would be easy to exploit the library system. Some Koha
using systems have branches that charge fines, and others that don't, so
a patron could just return any overdue items to a non-charging branch
to avoid ever paying fines!

Furthermore, it would mean that the fines.pl script would be using one
set of rules to charge fines, and the returns system could possibly be
using another. Since fines.pl has been around far longer, it makes sense
to assume the fines.pl behavior is canonical.

Signed-off-by: Mickey Coalwell <mcoalwell@nekls.org>
Signed-off-by: George Williams <georgew@latahlibrary.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Merged with reservations; see comment on bug report for details.
bug 10292: improve fallback logic for picking XSLT

This patch fixes a bug whereby XSLT files from the
prog theme would be used (for English OPACs and staff
interfaces) even if the user had created and enabled a
custom theme that provided override XSLT files.

This patch provides a clearer implementation of the fallback
logic and adds test cases.

To reproduce the bug:

[1] Set OPACXSLTDetailsDisplay to 'default' and English as the OPAC
    language.
[2] Create a new OPAC theme, including copying the XSLT files.
[3] Set opactheme to the new theme.
[4] Make a change to koha-tmpl/opac-tmpl/NEWTHEME/en/xslt/MARC21slim2OPACDetail.xsl
[5] View a bib record in the OPAC. The change made in the previous step
    is not reflected.

To test after applying the patch:

[6] Reload the bib record in the OPAC. The change made in step 4 should
    now be reflected.
[7] (To be thorough) Go through the test plan for bug 8947
    and verify that there is no regression.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10359: transform masthead dropdown after user JS for CCSR

Since libraries may want to customize the options in the masthead search
dropdown, which is done via dropdown, it would be better if the select
box were transformed *after* user javascript was run.

To test:
1) Switch to the CCSR OPAC theme.
2) Add some Javascript to your OpacUserJS that will modify the masthead
   search dropdown, such as:
   $("select[name='idx']").append("<option value='Host-item,wrdl'>Journal title</option>");
3) Note that when you view the OPAC, the results in the dropdown are unchanged.
4) Apply patch.
5) Note that your new option now shows up.
6) Sign off.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9763 - Add callnumber column to "print summary" for moremember.pl

Test plan:
1) Apply patch
2) Check out some items to a borrower
3) Choose "Print summary" from the "Print" pulldown
4) Observe the new callnumber column after "Author" and before "Item type"
5) Note that the totals in the footer are still aligned correctly

Signed-off-by: Eli Anthony <library.assist@taylorcountygov.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10367 - update the rules and control file for wheezy

This updates the control file to use tinymce rather than tinymce2, as
tinymce2 is deprecated and no longer in Debian.

Also a general dependencies update. Note that this is suitable for
master only.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9773 - Replace YUI AJAX calls in cataloging plugins with jQuery

Several cataloging plugins make some simple AJAX GET calls via the YUI
AJAX feature. This code can be easily converted to jQuery.

To test, link each plugin to the relelvant field by editing your MARC
stucture. Confirm that functionality is unchanged.

For callnumber.pl and callnumber-KU.pl, test by linking to 952o.
callnumber.pl is triggered on blur of (when you focus on and click away
from) the 952o entry field. callnumber-KU.pl is triggered by clicking
the "..." link.

stocknumberam123.pl should be linked to 952i. If your data doesn't
already have information stored for inventory number, modify at least
one record to add one. The plugin is triggered on blur of the 952i
field. It should increment the highest value inventory number stored in
your system.

unimarc_field_010.pl is UNIMARC-specific, so I'm guessing about its
functionality. I tested it by linking the plugin to MARC21 field 020a.
The plugin is triggered on blur of the affected field (020a in my test).
You can confirm that the plugin returns valid data by using a tool like
Firebug to view the XHR response. Or if you're not using UNIMARC you can
hack the plugin to update a different field instead (line 57,
/^tag_210_subfield_c/ ). I tried "245_subfield_c" instead of
"210c_subfield_c." Nonsensical, but useful for testing.

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Tried the 3 MARC21 plugins. Did not try the Unimarc one, but it's exactly the same code change.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
bug 9505 refactor loops in invoices.pl

- Remove an unnecessary loop where output just
  recreated input.
- Remove unnecessary temp variables that obscure code purpose.
- Call the variable containing invoices, invoices
  rather than anonymous and ambiguous results
  reflect namechange in template.
- Lists are passed to template as array refs;
  declare them as scalars as that is how we use them.
- No need to introduce the whole namespace of some C4
  modules for 1 routine.

Test plan:

Note that this patch should not change any visible behavior.

[1] Open the invoice search page.
[2] Verify that the list of suppliers in the drop-down
    on the search form is complete.
[3] Verify that the list of libraries in the drop-down
    on the saerch form is complete.
[4] Perform a search.  Verify that the list of invoices
    is correct.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8845 - Add ability search patrons by date of birth

Adds the ability to search by dates of birth in iso format.

Signed-off-by: Marc Veron <veron@veron.ch>

Searched with following formats: YYYYMMDD , YYYY-MM-DD , YYYY.MM.DD
All searches are OK

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8845: Followup Allow to give a date using the syspref format

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8845 - Add ability search patrons by date of birth - Add tooltip

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Works with all date formats

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8845: FIX dateonly is the 4th parameter, not 3rd!

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10381: POD lines of GetBasketsInfosByBookseller

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Cedric Vita <cedric.vita@dracenie.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10381: Followup adding some text around Apply/cancel filter.

The texts Apply/cancel filter did not need translation and were used to get
this change into 3.12.
For 3.12.X or 3.14 we can add some words to clarify its meaning.
With thanks to Owen for some rewording.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Pierre Angot <tredok.pierre@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>