Bug 10311 - Holds queue ignores item-level holds where only one items exists

If a record has only one item, and that item has one item-level hold on
it, that hold will not show in the holds queue.

Test Plan:
1) Create 1 record with 1 item at BranchA
2) Create an item-level hold for that item, for pickup at BranchA by a
   patron of BranchA
3) Run build_holds_queue.pl
4) View the holds queue for BranchA
5) Note the hold is not in there
6) Apply this patch
7) Re-run build_holds_queue.pl
8) View the holds queue again
9) Not that the hold is now there

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>
(cherry picked from commit acd4b21c91f4b06a6e19cafb4b9a6dd2817ad8e9)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit c500fbb9e2fe292adbd4c33f8a6071bd7aa5b0fd)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked fromc500fbb9e2fe292adbd4c33f8a6071bd7aa5b0fd)
bug 6281: add test case for sorting LC call numbers correctly

My thanks to Michael Flanagan of UCAR for providing some of
these examples.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 87ab820a20e1ef935d4d29c6fed313e9723fcb64)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit cee5651e11e48c240136e764b628545a1ba6d05e)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from cee5651e11e48c240136e764b628545a1ba6d05e)
bug 6281: introduce LC::CallNumber::LC for sorting LC call numbers

This replaces the previous hand-coded normalizer.  Because
LC::CallNumber::LC appears to reject strings that aren't valid
LC call numbers, significant changes to the test cases were
made as well -- however, the one that really counts is the
last one which verifies the sorting.

To recalculate the call number sort key for each item, it is necessary
to run misc/maintenance/touch_all_items.pl

To test, create item records with the following call numbers, setting
the classification sort to 'lcc':

QC100 .U57 NO. 555 1986
QC145 .A57 V.12 1980
QC145.45 .H4 D65 1998
QC995 .E29 1997

Next, make a report of them in the inventory tool.  The items should be sorted
in the above order.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit bc87274c66a50712dccb15656001d97f2a36fba5)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit d7862378f006603fb742bd5fe896ea8a0222a5bd)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit d7862378f006603fb742bd5fe896ea8a0222a5bd)
bug 6281: add Library::CallNumber::LC as a required Perl dependency

This module is currently packaged by Debian for Wheezy and by
Ubuntu for Precise and Quantal.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f1c45784dc5dfa431ef68e5d38a14b6fb93c904d)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit e4faf296c98f70f44ee67d2354a7cf5c682b27c8)

Solved minor Conflicts:
C4/Installer/PerlDependencies.pm

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit e4faf296c98f70f44ee67d2354a7cf5c682b27c8)
bug 9370: test case for splitting LC call number

QH541.15.C6 C25 2012 should be split as follows:

QH
541.15
.C6
C25
2012

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ecf6721060607b621c58f234ab5a5f43e30b1d98)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 8ceab821b5ded6fb14ac747dfc1e2c67a3cbbad8)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 8ceab821b5ded6fb14ac747dfc1e2c67a3cbbad8)
bug 9370: add invalid call number to LC splitting test cases

'123 ABC FOO BAR' is intentionally *not* a valid LC call number,
but in order to preserve legacy behavior, it should be split on
whitespace.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a5e9e15663289489e0baafff73d7bed20434b8ec)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit d743b2084cddb5197393bfa5ffeaf6f1e0334784)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit d743b2084cddb5197393bfa5ffeaf6f1e0334784)
bug 9370: improve splitting of LC call numbers for labels

Use the Perl module Library::CallNumber::LC to parse and split
LC call numbers when generating spine labels.

For example, QH541.15.C6 C25 2012 should be split as follows:

QH
541.15
.C6
C25
2012

To test, create an item with call number QH541.15.C6 C25 2012
and classification source LC, then create a spine label for that
item using a layout of type 'biblio' that has the split call numbers
option enabled.  The call number should be split as indicated above.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit edb8bddff074769a95744b6a7fa59eff61e0cfc1)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 10f5822daabf34ede50b2b35b5e02324482af9ac)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 10f5822daabf34ede50b2b35b5e02324482af9ac)
Bug 10297 - categorycode and branchcode should be required when adding patrons

categorycode and branchcode should show as required under all
circumstances, not just when they are included in the
BorrowerMandatoryField system preference. This patch adds the correct
classes and hints to those fields.

To test, view the patron entry form for a new or existing patron.
Category and Library should show that they are required.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 81bfae93649a2f1a93f4722d052fc529c6495d71)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Logical addition
(cherry picked from commit 545504e6041809b2ec5d435f9a8660428ec60e52)

Solved Conflicts:
	koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 545504e6041809b2ec5d435f9a8660428ec60e52)
Bug 10443 - Table borrower_files does not exists in kohastructure.sql file

As a consequence, the borrower_files table would not exist
in Koha databases that were installed starting at 3.10.0
or later.

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>
(cherry picked from commit 2e86612a15c228357223beaf996f4b3350334b2e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit e9bd7d6064ec31ab1b6307db04e0cc6656038d46)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit e9bd7d6064ec31ab1b6307db04e0cc6656038d46)
Bug 10443: (follow-up) make sure borrower_files has FK constraint

This follows the example of the DBrev that introduced
this table.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 43b17feed6ce64bdff6b31918e40170f6681e397)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit cb4c29a97cc01a0184b1c39a6ab0e09506817ace)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit cb4c29a97cc01a0184b1c39a6ab0e09506817ace)
Bug 10443: DBRev 3.10.07.001 - make sure borrower_files exists

This schema update ensures that the borrower_files table
will exist for libraries who first installed Koha at 3.10.x.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Bug 10458: Remove obsolete Z3950 module and test

Are not used. Contain several FIXMEs.
Removing them makes life easier.

Test plan:
Actually, you cannot test this.
But for confidence: do a Z3950 search in cataloguing and acquisition.

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>
(cherry picked from commit 63ba05183e627bbe7278b9064d22e93d39b65461)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 1dbd1d938aabb72021cd8157e111d3f7555fff9d)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 1dbd1d938aabb72021cd8157e111d3f7555fff9d)
Bug 10458: t/Z3950.t should be removed too

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit cab50698f57c88670241d88028afebd3eb5b5dd8)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit d5f9a3ec5c6f86c9678e6df39bbd2ac69fc77c95)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit d5f9a3ec5c6f86c9678e6df39bbd2ac69fc77c95)
Bug 10425 - Help page missing for Local Use preferences

When viewing Local Use system preferences tab, the help button will lead to an error page.
This is because Local Use tab uses not the same script has other tabs : systempreferences.pl.

This patch adds help/systemprefences.tt

Test plan :
- Go to Local Use preferences : /cgi-bin/koha/admin/systempreferences.pl
- Click on Help link (at right top)
- See you get the same page as other preferences tab help

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 0e0a1a61a62473de7ae92bde9d0f3617c34ba325)
(cherry picked from commit ff9638d8151258eec1ee1bb67196845eb1dabd18)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit ff9638d8151258eec1ee1bb67196845eb1dabd18)
Bug 10425: tweaks to text of help for local use system preference

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c02b57bd5cacc3fbe981f5d8331c7cfe8aa178a7)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 1133c328b31cf9e8138de85ef266a6557757bab4)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 1133c328b31cf9e8138de85ef266a6557757bab4)
Bug 10466: fix glitch in OPAC display of titles saved to list

When displaying (in the OPAC) the set of records saved to a list,
an apparently random number (typically 33 or 34) is sometimes
displayed at the end of the publication description.  In particular,
this can occur when XSLT is *not* being used to display search results;
this patch corrects the problem.

Now for the technical details:

This patch checks to see if "size" is undefined. If it is, we add a
blank (i.e. "") value to it in place of undef.

If we do not do this, calling "itemloo.size" will return the size
of the "itemloo" hash, rather than the value for the "size" key.

This is because "size" is a virtual method in Template Toolkit. It's
uncertain why the value is retrieved for the "size" key when there is
a defined value and why TT doesn't use the method instead, and that
it uses "size" as a method only if there is either no "size" key or
if the value tied to the "size" key is null/undef. This might be a
feature or it might be a bug in TT...

In the meantime, we will check to see if it's undefined. If it is,
we'll give it a value.

This bug has been identified in the opac-search.pl, search.pl and
addbooks.pl pages before. To address it, we're currently checking
if there is a "size" key, and if not...we're adding one with a blank
value.

This patch takes up that same idea, although I think it might be better
to rename the variable before passing it to TT in case the behaviour
of TT changes in the future in regards to how it handles virtual
methods.

N.B. Obviously, this only affects users not using XSLTs.

--

Test Plan:

Before applying the patch:

0) Make sure you have opac search result XSLT turned off

1) Find bib records that do not have a 300$c (Dimensions) value.
2) Find bib records that do have a 300$c (Dimensions) value.

(N.B. These values should be stored in the `size` column of biblioitems).

3) Add items from both sets of records to a List
4) Note that records without a 300$c will display a number at the end
of the "Publication" description/string. It should be something like
33 or 34 in most cases.
5) Note that records with a 300$c don't display this number. They just
show the value from 300$c.

Apply the patch.

6) Clear your cache, refresh the page, etc.
7) Note that the number (e.g. 33 or 34) has disappeared from the end
of the "Publication" description/string.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Added a small comment at the end of this one line.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit ceada35e008e6a60b62f384ec386e80b03fe0130)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit a7d116e2fe39a17dd076e1dc805239622b410418)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit a7d116e2fe39a17dd076e1dc805239622b410418)
Bug 766: remove CGI::scrolling_list from request.pl

Let the template take care of generating the display.
Lets at least part of request.pl be more succinct.

To test, place a hold and search for the patron using a partial name.
You should get a dropdown select list of patrons and be able to select
the patron to hold for from there.

The functionality should remain unimpaired after this patch is applied.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 7668e19c9593da570cffb5cd4640fe175d739328)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit b88f16a4e99d533753e3d707239e94da019ce303)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit b88f16a4e99d533753e3d707239e94da019ce303)
Bug 10464: Patron search on placing a hold now supports autocomplete

The patron search box for placing a hold request on a bib in the
staff interface now supports autocomplete if the CircAutocompl
system preference is enabled.

This patch grabs the autocomplete handling javascript stuff from patron-search-box.inc
and puts an adjusted version on reserve/request.tt.  It sets form and input
IDs to match those configured in the autocomplete call, adjusted where needed to
avoid name collisions with the patron-search-box.inc that is present everywhere.

This patch also doubles the width of the patron search input field.

To test:
- On a biblio record, go to the Holds tab, mine looks like
  /cgi-bin/koha/reserve/request.pl?biblionumber=2
- A search box is shown for patron searching.
- Search for a patron: it works as usual.
- Make sure CircAutocompl is "Don't try"
- Apply the patch
- Click the Holds tab again, and do the same search: functionality should remain intact.
- Change CircAutocompl to "Try"
- Click the Holds tab again
- Autocomplete should show you the possible options, and once you choose one result,
  it should work as usual.

Sponsored-by: Universidad Nacional de Córdoba
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Adding a nice new autocomplete feature.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit dc94a9bef79dc6d186fe93d82dac10cab0468d24)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit ab3163564e91921222c153897f786551fe59647e)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit ab3163564e91921222c153897f786551fe59647e)
Bug 10439: fix bug preventing the library for a notice from being changed

2 javascript functions should be apply only in a specific case, not for all
views.

Test plan:

- Switch on the IndependentBranches pref and log
  in as a superlibrarian.
- Try to change the library for a notice. Before the patch,
  no change is applied.
- Try to create a new notice, changing the library from
  default in the process.  Before the patch, the notice
  is not created.

The bug can also be reproduced when IndependentBranches is
off, in which case the staff user need not be a superlibrarian.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 77a5e3e365a50b02c9f224d731e05de90fc667c9)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Test plan works as advertised.
(cherry picked from commit a2e89edf43b2946da0986a5c83b04a60dea04061)

Solved Conflicts:
	koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit a2e89edf43b2946da0986a5c83b04a60dea04061)
Bug 10396: remove unnecessary date-picker widgets from Catalog statistics form

In particular, removed it from the call number and publication year
input fields.

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d7bfba8a106fbb00331e16dbc0943226bad24668)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as expected, simple patch
(cherry picked from commit d525d414538709ddf8feb4da6db3dee6c9ae9ff0)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit d525d414538709ddf8feb4da6db3dee6c9ae9ff0)