Bug 11749 - Remove unused jQuery plugin jquery.hoverIntent.minified.js from the staff client

The jQuery plugin jquery.hoverIntent.minified.js is used only in the
OPAC, not the staff client. This patch removes it from the staff client.

To test, apply the patch and search for instances of "hoverIntent." Only
references in OPAC templates should be returned.

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 11766 - Use validation plugin when creating new authority type

The new authority type entry form uses custom form validation
JavaScript. This patch removes it in favor of using HTML5 validation
attributes and Koha's built-in validation plugin.

To test, go to Administration -> Authority types and click "New
authority type." Try submitting the form without entering any data. You
should see a warning about required fields. Upon entering text in those
fields the warning should disappear.

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 11767 - Use validation plugin when creating new authority framework tag

The page for adding a new tag to an authority framework includes some
custom form validation JavaScript which can be removed in favor of HTML5
validation attributes and Koha's built-in validation plugin. This patch
does so.

The patch also moves some tag markup out of the script and into the
template where it belongs.

To test, apply the patch and go to Administration -> Authority types ->
MARC structure -> New tag. Try submitting the form without entering a
tag number. This should trigger a validation warning.

Submission of the form with valid data should work correctly. Editing an
existing tag should also work correctly.

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 11740 - Use new DataTables include in quotes upload template

Bug 10649 introduced a new include file for adding DataTables-related
JavaScript assets. This patch adds use of this include file to the
quotes upload page.

To test you need a CSV file of quotes to upload ( "source","text" ).
Go to Tools -> Quote editor and click the "Import quotes" button. Upload
the CSV file and confirm that the table which previews the import
results loads correctly. Sorting is not enabled, but pagination and
searching should work.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
No regression found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11784 - fix displaying patron images in self checkout

I suppose this bug was introduced with Bug 10636 (patronimage should
have borrowernumber as PK, not cardnumber)

To test:
- Have a Patron with image. Configure everything to show image in SCO.
- Go to SCO and log in patron
- Image does not show up (broken link)
- Apply patch
- Test with prog, ccsr and bootstrap themes
- Image should display

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11779: fix unexpected change in logged-in library when changing overdue notice triggers

Steps to reproduce:
1) Log into staff intranet
2) Set logged in branch
3) Browse to tools/overdue notice triggers
4) Select a branch from the pulldown that is not your logged in branch
5) use the "Check out" bar at the top of the page to search for a patron
to check out to
6) Once you have landed here, click the "check out" tab link again, or
   the Edit button ( any action really )
7) Note your logged in branch has now changed to the once selected
   when editing the notice/status triggers

This is due to the way the patron search passes the branchcode to be
used via the form. This form assumes the branchcode variable is
always the currently logged in branch, which may not and is not
always the case.

Test Plan:
1) Apply this patch
2) Repeat the steps to reproduce above
3) Note your logged in branch does not change

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Funny bug :) This patch fixes the described issue and should not
introduce regression.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11779: (follow-up) improve GetLoggedInBranchcode() and add test cases

This patch adjusts the new GetLoggedInBranchcode() template function so
that it returns the empty string rather than undef if there is no
active user environment.  That way, there won't be lots of undefined
value warnings if/when this function gets used in the OPAC.

This patch also adds test cases.

To test:

[1] Verify that there are no regressions in the main test
    plan for this bug.
[2] Verify that prove -v t/db_dependent/Koha_template_plugin_Branches.t
    passes.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11783: ensure CD field in SIP patron information response is populated

If a patron has a record-level hold that is unavailable, any patron
information request will send back an empty CD field when this field
should have an item barcode in it [RM note: this actually isn't
universally true -- the SIP2 standard is silent as to what is supposed
to go in the CD field. Some SIP2 devices do indeed want an item
barcode, but others are known to just want a display of the title
and author of the request in question.  Providing an option is the
topic of a new enhancement request, however.]

This is due to a minor error in ILS::Patron::_get_outstanding_holds
where GetItemnumbersForBiblio is assumed to return an array but in
reality returns an arrayref.

Test Plan:
1) Create a record level hold for a patron and record
2) Using SIP2, make a patron information request
3) Note the empty CD fields
4) Apply this patch, restart SIP server
5) Repeat step 2
6) Note the CD field now has a barcode

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
I did not test this patch but the following code shows me it is correct:
  use C4::Items;
  use Data::Dumper;
  my $biblionumber = 5035;
  my $itemnumber = (GetItemnumbersForBiblio($biblionumber))[0];
  say Dumper $itemnumber;
  $itemnumber = (GetItemnumbersForBiblio($biblionumber))->[0];
  say Dumper $itemnumber;

displays:

$VAR1 = [
          '23168',
          '23169',
          '23170',
          '23171',
          '23172'
        ];

$VAR1 = '23168';

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11777: ensure "created by" is displayed by the order receiving page

This fixes a regression introduced by the patches for bug 10723.

To Test:
1) Create budget and fund under budget administration.
2) Create Vendor in acquisitons module.
3) Create basket under vendor.
4) Create order and choose budget while creating order.
5) Click on Receive shipment button.
6) Click on receive link on the right hand side you
   will be able to see a staff user name in the "created by"
   field.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11777: add regression test

This patch adds a regression test for ensuring that the
authorisedby field is returned by SearchOrders().

To test:

[1] Upon applying the main patch, verify that
    prove -v t/db_dependent/Acquisition.t passes.

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