Bug 9142 - Remove the use of subtests

Debian stable's version of Test::More is older than the one I used on my
12.04 dev box, and doesn't support subtests, which I used to avoid side
effects between different test scenarios.

This patch removes that subtest definition.

Signed-off-by: Robin Sheat <robin@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
All tests passing in 3.10.x

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
All tests passing in 3.8.x
Bug 9098 Replace tabulations by spaces in opac-user.pl

There was a bunch of tabulations from line 157 and followings

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
The following command show us there is no change:
  git show HEAD --ignore-all-space
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 6680 - simple tidy-up of cart download format descriptions

Explains what uses RIS, and replaces iso2709 with 'MARC'.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Simple change, all tests pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Follow up to Bug 6680: tiny up download lists formats

Explains what uses RIS, and replaces iso2709 with 'MARC'.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Simply change, all tests pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 8614 [3.8.x] Icon for scores on OPAC detail page broken

At some point some famfamfam icons were moved out of the
theme director into the lib directory in opac-tmpl. When
this was done the path to the directory was changed accordingly
in most cases. However, not all famfamfam icons were moved,
and some image paths were not corrected.

This patch completes the move of the famfamfam icon set
to opac-tmpl/lib and corrects the path to the icons on
the OPAC XSL detail page and the OPAC holds page.

To test, view those pages and confirm that the images work.
View records with a variety of material types.

Edit: Rebased on origin/3.8.x
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 9106 - Filtering list of uncertain price list by owner empties order information

The form which filters the list of orders with uncertain prices
includes a parameter which tells the script to modify the orders,
resulting in order information being lost. This patch removes
the unnecessary form field.

To test you must have orders with uncertain prices, preferably from
more than one user. Go to the uncertain prices page. Before applying
this patch, submitting the "orders from" form would cause the page
to refresh with no results. This is because the script cleared the
orders of price, quantity, etc. information.

After applying this patch the uncertain prices list should refresh
and show the correct results, either your orders ("me") or all
("Everyone").

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 9137 - Focus when editing/adding new itemtypes/authorised values

This patch adds the "focus" class to the relevant inputs so
that the global staff client JS will move the focus to those fields.
Logic in the authorised_values template puts the focus on the
correct field whether you're adding a new category, a new value,
or performing an edit.

To test, try the following operations:
 - add an itemtype
 - edit an itemtype
 - add an authorised value category
 - add an authorised value value
 - edit an authorised value value

In all cases the focus should automatically be in the first
form field.

Signed-off-by: Melia Meggs <melia@test.bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass and works nicely.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Works well in 3.10.x
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Works well in 3.8.x
Bug 5801 - C4::Circulation::_GetCircControlBranch wrongly used in opac-reserve.pl

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and perlcritic pass.

Tests done:
holds policy vs. circulation rules seemed to make the difference for me,
I am not totally sure why that is, but see no reason to fail this patch as
results are ok.

System preferences
- CircControlBranch = the library the item is from
- ReservesControlBranch = patron's home library

Circulation rules
- Library A - Holds policy: Books can not be put on hold.
- Library B - Holds policy: Books can be put on hold. (no special setting needed)

Catalog data
- A record with an item for library B, itemtype Books.

Test without patch:

1) Patron A (home library A) places a hold in OPAC on an item from library B.

Should be: hold is NOT allowed.
Before patch: hold IS allowed.
After patch: hold is NOT allowed.
OK

2) ReserveControlbranch = item's home library
Patron A (home library A) places a hold in OPAC on an item from library B.

Should be: hold is allowed.
Before patch: hold is allowed.
After patch: hold is allowed.
OK

3) ReservesControlBranch = patron's home library
Circulation rules: Remove hold policy for library B.
Library A: no holds allowed for books using 'Holds allowed (count)' = 0
Library B: 5 holds allowed for books using 'Holds allowed (count)' = 5
Patron A (home library A) places a hold in OPAC on an item from library B.

Should be: hold is NOT allowed
Before patch: hold is NOT allowed
After patch:  hold is NOT allowed
OK

4) ReserveControlbranch = item's home library

Should be: hold is allowed
Before patch: hold is allowed
After patch:  hold is allowed
OK
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8981 - Remove Nonpublic General Note from OPAC authorities display

Currently, the MARC21 667 Nonpublic General Note field is appearing on the opac-authoritiesdetail.pl page.

Since it is a nonpublic note, it makes sense to remove it from this view.

This patch adds in an extra condition that checks authority records for MARC21 667 fields before displaying them in this opac screen.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>

Does what it says, with no side effects

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8981 follow-up: case

While QAing your patch, I saw you were writting "MarcFlavour", it should have been "marcflavour"

Will work with the UC, but let's be consistent.

This patch fixes another MarcFlavour just a few lines before I spotted by chance

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9149: Add missing GetAuthorizedHeading

On 3.8.x, it was possible for multiple automatically generated
authorities to be linked to a single heading. This patch deletes
previous links from headings prior to linking them to
automatically-generated headings. This patch also corrects a
potential problem wherein multiple authorities might be generated if
a record is edited repeatedly in quick succession. The latter problem
exists on Master and 3.6.x as well, and the code that corrects the
multiple linkages is equally applicable if seemingly unnecessary.

This patch adds a missing routine to C4::AuthoritiesMarc that should
have been in the 3.8.x version of the patch for bug 8823.

To test:
1) Turn on BiblioAddsAuthorities and AutoCreateAuthorities.
2) Create a new record or edit an existing one, and add an
   authority-controlled heading (for example, MARC21 1xx or 6xx or
   UNIMARC 6xx or 7xx) which does not currently exist in your authority
   file.
3) If you don't get a software error, it worked.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
For 2) you can also download a record over Z39.50.
Passes all tests.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8946: corrections in inc files for UNIMARC coded fields advanced search

In subtypes_unimarc.inc files for opac and staff interface, this patch
- fix 1 wrong code (Frequency-code:i = Other should be z)
- fix the label "Feschrift Ind." to "Literary genre"
- add some values for Material-type index (s, t), Literature-Code (i), ctype (v, w), Type-Of-Serial (e,f,g)
- fix a few typos
- change the order of some values (u values)

To test, check if the new values are visible in the opac and staff interface.

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9134: There is no previous link on the second page of the search results page

Signed-off-by: Melia Meggs <melia@test.bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass.
Checked paging forwards, backwards, using 'Previous', 'Next'
and page numbers works correctly in staff and OPAC.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Conflicts:
	koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8781: hiding of transfer page when it's useless

The transfer page is only useful when the system
preference "IndependantBranches" is Off of when the user
is a superlibrarian. Otherwise it can be hidden.

Signed-off-by: Melia Meggs <melia@test.bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and perlcritic pass.

TEST PLAN :
It's about testing the display of the "Transfer" link on "circulation-home.pl".
The link needs to appear if IndependantBranches is off or if the user is a superlibrarian.

1) IndependantBranches = Off, user is superlibrarian : link appears
2) IndependantBranches = Off, user is not superlibrarian : link appears
3) IndependantBranches = On, user is superlibrarian : link appears
4) IndependantBranches = On, user is not superlibrarian : link does not appear
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 9123: Authorities search ordered by authid does not work

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with Zebra, marc21, grs1.
Discovered that paging through auth search results does no longer work, but that is not related to these changes.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with Zebra, marc21, dom.
All tests pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 8820 [3.8.x] Don't show orders table if there are no orders

Reworkd for 3.8.x: Patch removes the "basket empty" message in
favor of hiding the orders table altogether when a basket has
no orders.

Other textual changes:

- Correcting capitalization according to coding guidelines
- Replacing the "Order Details" heading with the more
  succinct "Orders"

Signed-off-by: Melia Meggs <melia@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests pass, template change only.

To test:
1) Create a new basket - verify 'basket empty' shows up
2) Create order line - verfiy table heading is 'Order Details'
3) Close basket, check capitalization on basket group dialog

Repeat with patch applied.
- 'basket empty' is gone
- Heading is now 'Orders'
- Capitalization on basket group dialog is correct

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 9135: updatedatabase.pl fails when DEBUG is set

When the DEBUG environment variable is set to a true value, all DBI
errors are treated as fatal. Unfortunately, duplicate keys are
incredibly common in updatedatabase.pl, since sysprefs are often added
in testing, then re-added once the patches have been pushed to master
(or added when on a maintenance branch, and then re-added when the
system is upgraded to either a newer maintenance branch or master).
This patch disables fatal errors for the updatedatabase.pl script.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and perlcritic pass.
To test, run from command line:
export DEBUG=1
installer/data/mysql/updatedatabase.pl

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
If a query causes an error, the script continues as expected.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Bug 8588 [3.8.x] Duplicate field IDs cause problems with SQL report parameter entry

Reimplemented for 3.8.x: Changes to markup and script to
enable unique ids on form fields. These changes allow for
working label+input pairs on one or more text and select
inputs and multiple working datepickers.

To test, create a report with more than one date parameter,
at least one text parameter, and one or more authorised
value parameters. The datepickers should each work properly,
and labels should by clickable.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Bug 7129 [3.8.x] actual cost showing too many zeros

Reimplemented for 3.8.x: Added a sprintf to format the actual cost

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Simple bug fix, TT plugin would be nicer but this is a perfectly
acceptable fix for now
Bug 8843 [3.8.x] Cannot export bibliographic records by call number

Reworked for 3.8.x: When building the query for exports by call
number the script has the logic reversed. It tries to select
records with call numbers less than the starting call number and
greater than the ending call number. This should be reversed.

To test, test an export in an unpatched system. An export by
call number will return an empty file. After applying the patch
an export by call number should give valid results.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>