Bug 11260: Update German web installer for 3.14

Mandatory:
- adds auth_values.sql and .txt with YES_NO referenced in patron_attributes.sql
- updates sample notices with redone slip templates (ISSUESLIP, ISSUEQSLIP,
  RESERVSLIP, TRANSFERSLIP)
- adds German translations to subtag_registry.sql and copies updated file
  from en to de-DE
- adds translation for new course_reserves permission to userflags.sql
- adds translations for new permissions in userpermissions.sql
- Fixes typo IndependantBranches in English userpermissions.sql

Optional:
- adds csv_profiles.sql and translation of the serial claims profile
- adds z39.50 servers for authorities to sample_z3950_servers.sql

To test:
- Run web installer in English
  - check all sample files, make sure they all install without SQL errors
  - check language list on advanced search displays correctly still
  - check area/language list on tools > news displays correctly still
  - check permissions for correct spelling of IndependentBranches

- Run web installer in German
  - repeat checks from above
  - also check: authorised values, especially existence of YES_NO
  - all permissions are translated now
  - slip notices are all there and look right
  - new z39.50 servers for authorities are available
  - csv profile for serial claims is available and works as expected

... and anything else you can think of.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11260: Update German web installer - frequencies and numberpatterns

Translates the new files for frequencies and numberpatterns

To test:
- Run the German web installer with all sample files
- Check all files import without errors, especially frequencies and
  numbering patterns
- Check frequencies in serials
- Check numbering patterns in serials
- Create a subscription, check possible choices

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11260: Follow up - normalizing frequencies in English sample file a bit

After some discussion in IRC I am throwing in some changes for the
English sample frequencies:

- Change Vol to Vol.
- Change No to No.

We had both forms in the file, now it should be consistent.

To test:
- Run English web installer installing all sample files, especially
  frequencies
- Check installed frequencies
- Check available options creating a subscription

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11260: (follow-up) remove inadvertant change to English sample_z3950_servers.sql

Part of the patch for bug 11260 had the effect of undoing
commit 5aae737, thereby adding back two undesirable things:

- use of backticks in the SQL
- setting z3950servers.id explicitly

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11260: (follow-up) repair German sample_z3950_servers.sql

Without this patch, the sample Z39.50 servers for de-DE
would fail to load.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11483: Add missing serial help files

The help files for the Serial Numbering Patterns and Frequencies pages
were missing.  This patch adds them.

To test:

* Visit the two new serial pages
* Click Help
* Confirm text and links are right

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 11483: (follow-up) fix typos

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11457: avoid spurious test failure in t/db_dependent/Bookseller.t

This patch clears the subscription table so tests pass correctly if
there happens to have been a subscription with an end date before
2013-08-01.

To test
1/ Add a subscription in the serials module, with an end date before
2013-08-01
2/ run prove -v t/db_dependent/Bookseller.t
   Notice tests 22 and 23 fail
3/ Apply patch
4/ run test again
5/ Notice tests succeed

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tests now clean the subscription table before running
the tests, so that the will always pass.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10774: Allow individual holds to be suspended and resumed from the OPAC

Right now, holds can only be suspended and resumed from the OPAC as a
whole. It would be nice to be able to suspend and resume holds on a hold
by hold basis from the OPAC.

Test Plan:
1) Apply this patch
2) Log in to the OPAC
3) Place a number of holds
4) Browse to "my summary" and select the holds tab
5) From here, test the following actions
   a) Suspend a hold indefinitely ( no resume date )
   b) Suspend a hold with a date to automatically resume
   c) Manually resume a suspended hold
6) Disable AutoResumeSuspendedHolds, ensure the suspend until date field
   is no longer visible.
7) Disable SuspendHoldsOpac, ensure all suspension related fields are
   no longer visible.

Signed-off-by: Chris Rohde <crohde@roseville.ca.us>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10774: (QA Followup) Add support for bootstrap opac theme

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10774: (follow-up) tweak styling of buttons on Bootstrap theme

Following a discussion with Kyle, this patch applies the
btn-mini style to the per-hold cancel and suspend/unsuspend
buttons to make them a bit smaller.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 7965: Silence warns in staff log

Silence warns in C4::Bookseller::GetBooksellersWithLateOrders()

to test
1/ run prove t/db_dependent/Bookseller.t
   Notice lots of Use of uninitialized value $delay in numeric lt (<) at /var/lib/jenkins/jobs/Koha_master/workspace/C4/Bookseller.pm line 134 type lines
2/ apply patch
3/ run prove t/db_dependent/Bookseller.t
   Notice warns are gone

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tiny change, positive consequences.
Passes QA script and all tests.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11480: Fix invalid assumptions in JSONStream test

Tests for C4::Output::JSONStream made the invalid assumption
that the hash keys of the modules internal structure
will always be returned in the same sequence.
A hash is an unordered structure. as of perl 5.18
this has beem reinforced by random seeding of the
hashing function. See the info in perldelta and
the doc for JSON.

This patch changes the tests to be sequence-neutral
where the previous test was testing that a new element
was added and an existing one was untouched these have
been separated into individual tests.

Some typos in the messages have been corrected

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

Test Plan

1/ Run t/Output_JSONStream.t , 8 tests should pass (or perhaps fail,
   but inconsistently under perl 5.18 or greater)
2/ Apply patch
3/ Run t/Output_JSONStream.t 10 tests should pass now

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11439: (follow up) add missing rollback call

This UT got wrapped inside a transaction with autocommit=0 but
the rollback call was inadvertedly ommited. Adding it.

[RM note: an explicit rollback is not required, as the
 transaction will roll back automatically at the end of
 the DB session. Nonetheless, it hurts nothing to have
 it be explicit.]

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11499: (regression tests) indexing modes not properly set on generated koha-conf.xml

t/db_dependent/Search.t creates its own temporary koha-conf.xml and
related files, and it fails to properly set indexing modes for
bibliographic and authority records.

This patch adds regression tests for that.

To test:

 $ prove -v t/db_dependent/Search.t 2> /dev/null | grep 11499

The test should fail unless the main page is applied.

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11499: UT: Make zebra_setup.pl correctly set indexing mode

By adding the relevant environment variables to the script the generated
koha-conf.xml file for the unit tests is correct now.

Test plan:
- Verify that tests pass now:
  $ prove -v t/db_dependent/Search.t 2> /dev/null | grep 11499

Sponsored-by: Universidad Nacional de Cordoba
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes unit test, koha-qa.pl

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11452: Add unit tests for Koha::Template::Plugin::Cache

To test

run prove t/Koha_Template_Plugin_Cache.t

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works nicely.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10646 - warn if mod_rewrite is not enabled

Koha requires mod_rewrite. If it's not enabled in Apache, then
koha-create will now abort with a helpful error message. Also adds a
warning when not run as root to avoid confusing errors.

Test plan:
 * apply the patch
 * a2dismod rewrite
 * run koha-create without sudo, note the error about being root
 * run koha-create with sudo, note the error about rewrite
 * a2enmod rewrute
 * repeat test above, note that it works

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Works as expected.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11475: fix return link after editing/deleting items in batch

Bug introduced by bug 9044.

Test plan:
1- First we search for records with multiple items (books or serials,
does not matter)
2- We open this record we found with multiple items for editing
3- We chose "Edit items in batch" option from the "Edit" menu
4- We make corrections on the fields under the "Edit item"  (For example
we change the collection code as "fiction")
5- We save this using "Save button" at the bottom, after we are done.
6- Just after we save, there will be a button named "Done" available
just under the page, and when we click on "Done" we encounter the Error
screen.

Before the patch, the "Done" link points to
/cgi-bin/koha/tools/CATALOGUING.
After applying the patch, the "Done" link points to the biblio detail
page.

Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
All tests pass

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11051: remove unneccessary SQL queries in GetBranches

The way GetBranches was written, it will issue one query to get all
branches, and then one query per branch for the branch relations.
This patch pre-fetches the relations table (as we need it all anyway)
and so makes the whole process happen in two queries, rather than take
1+N, where N is the number of branches.

This might not seem like much, but when you do a search, GetBranches is
called once for each result, so 25. And you might have 10 branches. This
causes 275 database requests when you could get away with 50.

From profiling, when you run a search, this is the thing that calls
DBI::st::execute the most. Refer:
http://debian.koha-community.org/~robin/opac-search/usr-share-koha-lib-C4-Branch-pm-146-line.html#125

Test Plan:
* Have a database with branches and relationships between the branches.
  (these are 'Library groups' in the UI.
* Make sure the relationships show up correctly after applying the
  patch.

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>