Bug 11310: update the XSLT for the Bootstrap theme

When the Bootstrap theme was started, the XSLT directory
was copied over from the prog theme.  However, it was not
kept up to date with respect to changes to prog's XSLT.

This patch rectifies the problem by copying over the
current state of prog/en/xslt to bootstrap/en/xslt.  As
a consequence, the following bugs or enhancements should
now be reflected in the Bootstrap theme:

* 6886
* 10905
* 10465
* 10564
* 10793
* 10218
* 6594
* 9820
* 10745
* 6553
* 10218
* 10284

To test:

[1] Apply the patch and ensure that OPACXSLTDetailsDisplay
    and OPACXSLTResultsDisplay are set to 'default' and that
    OPAC theme is set to 'bootstrap'.
[2] Ensure that OPAC results and bib details look OK.
[3] To be really thorough, run through the test plans for the
    other bugs referenced by this patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
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>
Bug 11748 - Remove unused jquery.uitablefilter.js plugin

This patch removes a jQuery plugin which was added for use with the old
tablesorter plugin. Since the tablesorter plugin has been removed and
replaced with DataTables this plugin can also be removed.

To test, apply the patch and search for instances of the plugin:

grep -r -l "jquery.uitablefilter.js" *

There should be no results.

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>
Bug 11628: add missing staffaccess permission to French userflags.sql file

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
This permission exists in other installer files (for all other languages).

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11764 - Move repeatedly redefined function toUC() into staff-global.js

toUC() is repeatedly declared on many administration templates. This
function, used to transform user input to uppercase, can be added to
staff-global.js to prevent repetition.

To test, confirm that transformation to uppercase is working on the
following Administration pages when text is entered in a form field and
focus is moved to the next field:

- Authority types -> New: Test the "Authority type" field.
- MARC bibliographic framework -> New framework: Test the "Framework
  code" field.
- Patron types and categories -> New category: Test the "Category code"
  field.
- Currencies and exchange rates -> New currency: Test the "Currency"
  field.
- Item types -> New item type: Test the "Item type" field.
- Z39.50 client targets -> New Z39.50 server: Test the "Z39.50 server"
  field.

The following pages do not call the toUC function despite the fact that
they included it:

auth_tag_structure.tt
printers.tt
roadtype.tt
stopwords.tt
systempreferences.tt

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
tools/letter.tt declares this js function and don't use it.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11765 - Remove unused function isDate from templates

Several administration templates declare but do not use the JavaScript
function isDate(). This patch removes the declarations.

To test, apply the patch and search for instances of "isDate" in Koha
templates, includes, and JavaScript files. There should be no results.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I'm not sure this function has ever been used.
This patch removes the toUC in tools/letter.tt too.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11772: Show warning on About page:System information if no active currency is defined

This patch displays a warning on the About page when no active currency
is defined.

Test plan:
1)
Make sure that no currency is defined as active
(Home › Administration › Currencies & Exchange rates › Currencies)
2)
Go to Home › About Koha > System information
Result: No warning issued.
3)
Apply patch and reload About page
Result: Warning issued.

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>
Bug 11772: (follow-up) make warning about no active currency a link to currency setup page

This patch standardizes the name of the currency and exchange rates
administration page (although I note that the breadcrumbs on that
page are inconsistent) and makes it a link.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11773: fix crash in sco-main.pl if no active currency is set

If no currency is defined as active and a patron with debts tries to
check out in welf checkout moduel, sco-main.pl crashes with:

Software error:
Can't use an undefined value as a HASH reference at /usr/share/kohaclone/opac/sco/sco-main.pl line 190.

This patch tests for active currency and simply does not display a
currency symbol if appropriate.

Test plan:

1) Make sure you have a patron with debts and no currency defined as
   active.  (Home › Administration › Currencies & Exchange rates
   › Currencies )
2) Go to Self checkout module and try to checkout an item to this patron
   Result: Crash with error message "Can't use an undefined value as a
   HASH..."
3) Apply patch
4) Reload and try to checkout again
   Expected result: Message "You owe the library..." without currency
   symbol
5) Define a currency as active and try to checkout again
   Expected result: Message "You owe..." with currency symbol

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>
Bug 11753 - Replace jQuery qTip plugin with Bootstrap tooltip on patron search form

The qTip plugin is out of date and incompatible with recent versions of
jQuery. This patch replaces use of qTip on the patron search form with a
Bootstrap tooltip implementation.

To test, apply the patch and view /cgi-bin/koha/members/members-home.pl

- Expand the patron search form by clicking the [+]
- Change 'search fields' from 'Standard' to 'Date of birth'
- A tooltip should appear giving details about the date format required
- Change the 'search fields' to something else. The tooltip should not
  appear.

Revision: Removed inclusion of qTip plugin from global header include.
The other instance of qTip usage occurs on a page which loads the plugin
separately.

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>
Bug 11618: ensure jQuery timepicker is picked up by the i18n toolchain

We handle internationalization of the jQuery datepicker by adding
language configuration strings to calendar.inc which can be processed by
the translation script. This patch adds a similar configuration file for
the timepicker.

This patch also upgrades the timepicker plugin to the latest version,
minified, and places it outside the prog template directory for global
use. The path in templates has been updated accordingly.

CSS has been added to more completely hide the controls for seconds,
milliseconds, and microseconds.

To test, apply the patch and clear your cache so that the browser
loads the new version of the jQuery plugin. Confirm that date and time
selection still function correctly on the circulation page, the patron
detail page, and the offline circulation page (circ/offline.pl).

Test at least one datepicker instance which does not use the
timepicker.

Run translate update on a po file and confirm that the timepicker
strings are now present.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Works as expected, no regression found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11743 - Remove unused DataTables plugin from OPAC theme directories

The Bootstrap and CCSR theme directories contain older copies of the
DataTables plugin which is no longer in use. This patch removes them
both.

To test, apply the patch and confirm that DataTables still work on the
following pages in both the Bootstrap and CCSR OPAC themes:

- The Cart. Add items to the Cart, open it and confirm that the table is
  sorted correctly.

- The detail page: View the detail page for a title (opac-detail.pl)
  with multiple items and confirm that the table of items is sorted
  correctly.

- A subscription's "full history" page: Navigate to the detail page of a
  subscription in your catalog which has received multiple issues. From
  the subscriptions tab click the "More details" link, then the "Full
  history" link. Confirm that the table of issues is sorted correctly.

- Search history: Enable the EnableOpacSearchHistory system
  preference. Perform a few searches so that your current session
  will record them. View the search history page and confirm that the
  tables of current and past searches are sorted correctly.

- Suggestions (enable 'suggestion' system pref if necessary)
- Tags (enable TagsEnabled if necessary)
- Most popular (enable OpacTopissue if necessary)

- User summary (opac-user.pl): Checkouts, overdues, and holds tables
  should all sort correctly.
- Self checkout: Enable WebBasedSelfCheck if necessary. Check out as a
  patron who has multiple existing checkouts. Confirm that the table is
  sorted correctly.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Existing uses of datatables.min.js don't point to the theme directory.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10789: Remove unnecessary calls to $sth->finish in C4::Acquisitions

C4::Acquisitions contained a number of unnecessary calls to
$sth->finish. Removed these and the associated variables introduced to
cache query results between fetch and the return

Where finish was the end of the routine I have added an
explicit return to document that no data is returned.

A number of places made query calls and fetched a single
row. Such a case could require an explicit finish.
These assume that they are looking up with a unique key.
To remove assumptions and isolate the code from future changes
I've switched these to fetching all and returning the
first row. I have commented these cases.

For fuller explanation see perldoc DBI

What I tested:
Edit existing basket, chnged name
Modify order line, change vendor price
Create new basket and add order
Delet this order
Delte this basket
New Basket, new order, user added, user removed
Add contract to vendor, change details, delete contract
Search order biblio
Create basket group, add basket to group, remove basket from group
Delete basket group
Receive order

Everything behaved as I expected

Signed-off-by: Marc Veron <veron@veron.ch>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10789: Follow-up: Fix typo "infermation"

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10789: Follow-up: restored second SQL parameter in GetLastOrderReceivedFromSubscriptionid

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11730: ensure that C4::Charset loads C4::Context

C4::Charset::SetMarcUnicodeFlag() fetches system preference
values, so since it invokes routines in C4::Context, it should
load the module.

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>
Bug 11709: revisions to Bootstrap OPAC lists interface

This patch makes some revisions to the lists template:

- Removed the old prog theme breadcrumbs from the List edit screen.
- Added New/Edit/Delete controls to the list view in cases where the
  list is empty.
- Corrected some breadcrumb logic.

To test, apply the patch and edit an existing list. You should see a
heading "Editing [list name]".

If necessary create a list with zero items on it. View the list. You
should see New/Edit/Delete links above the message about the list being
empty.

Patch behaves as expected.
Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11756: improve default sorting on hold ratios report

The DataTables plugin doesn't by default take multiple columns into
account when sorting. The hold ratios report presents a situation where
it makes sense to sort by default based on two columns: hold count and
title, since there are likely to be many titles with the same hold
count.

This patch adds sorting by default on holds (descending) and title
(ascending). It also modifies the configuration of the title sort to
exclude articles when sorting.

To test, view the hold ratios report. If necessary use the filter form
to reduce the minimum hold ratio and generate more results. Confirm that
the correct columns can be sorted.

Note that by default one can manually trigger sorting on two columns by
shift-clicking the second column header.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11649 - Always use words "copy number" - intranet

In most cases, the value of items.copynumber is displayed using the
words "Copy number". But in some cases, it is just "Copy".
It would be better to always use "Copy number" because in translation
the word "Copy" means the action of coping.

This patch manages templates of intranet.

To test, display an item containing a value in items.copynumber.

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>
Bug 11649 - Always use words "copy number" - opac bootstrap

In most cases, the value of items.copynumber is displayed using the
ords "Copy number". But in some cases, it is just "Copy".
It would be better to always use "Copy number" because in translation
the word "Copy" means the action of coping.

This patch manages templates of opac bootstrap theme.

To test, display an item containing a value in items.copynumber.

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>
Bug 11649 - Always use words "copy number" - opac prog

In most cases, the value of items.copynumber is displayed using the
words "Copy number". But in some cases, it is just "Copy".
It would be better to always use "Copy number" because in translation
the word "Copy" means the action of coping.

This patch manages templates of opac prog theme.

To test, display an item containing a value in items.copynumber.

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>