Bug 10429: improve display of library and library filter on serials claim page

In serial claims page, the library code is displayed in table instead
of library name and library filter does not work.

This patch adds the display of library name by using libraries template
plugin.  It changes the Javascript library filter to make it work.

Also sets "all" filter in template (like status filter) to allow
translation and sets "all" as selected by default. The staff user's
library was selected by default, but the table was not filtered
with it.

Test plan :
- Go to serials claim of a vendor with serials of multiple libraries
=> You see branch filter with "(All)" and table shows library's names
- Check that library  filter does its work

Signed-off-by: David Cook <dcook@prosentient.com.au>
Works as described.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Table now shows the branch name instead of the branchcode.
First option was named (All), matching the status pull down.
When opening the claims page, (All) is preselected and the
result list matches with the selection. Before the patch
the library was preselected, but the result list did show
late issues from all branches.

This patch is an improvement, but there is still more work to do.

- Filters are not cumulative, but when another filter is selected
  the first filter is not reset.
- It's not possible to combine
  2 or more filters.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 42eb8b2286e8af9894ec41d3f193416ffe81815b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 6886: ensure that singleBranchMode does not display library name for reference copies

Test plan: Enable singleBranchMode and  OPACXSLTResultsDisplay. Perform
a search in the OPAC which returns results containing not-for-loan
items. Before the patch these items will show their library in search
results loan items. After the patch there will be not be a library
listed, matching other items in results.

Signed-off-by jmbroust <jean-manuel.broust@univ-lyon2.fr>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comments on second patch.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a8428e141eb533ac5fafe80d38931a36d927a329)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 6886: (follow-up) replace needless <xsl:choose> with <xsl:if>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script.
Switching SingleBranchMode:

Tested with MARC21 and UNIMARC:
- "Don't allow" - branch is not shown in result list
- "Allow" - branch is shown for available items in result list

Changes are consistent over all 3 MARC flavours.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5b855c76d07d41eff2873f6e2ba9dc3a43f98d11)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 6886: (follow-up) remove redundant test for singleBranchMode

This patch removes an unnecessary check of the singleBranchMode
preference that occurred in an <xsl:otherwise> clause where
we already know that singleBranchMode != 1.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 9d2cd6771e616b46eda936ccdf76823e6f520617)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
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>
(cherry picked from commit bbe64974b02d78fc916f76408a995ac1bf7f6228)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit fff04e59e785ce26f52da94730818c541476f7bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit 66bf3abf78a7537201fd54be7b58fbab4c716b40)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit a39b728364efaae688d508c7b253a0ab9c9c8d2e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit 3c81c7b6f3edc109d47e7b83bcd51a85ae469aad)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit 1b160802bc17ad42309e40215d9303fca2fc07b0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 11483: (follow-up) fix typos

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 00279b84802346db13f5df52c779f0c924b4b29c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit 8209bf10269c36c1bb8d4b2da23fe356ab7a3568)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit febd0312f8623c9861bd70dd61aa3fd47afb1b51)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit 7b1d49f84b17ef779fac8ab6874bf2d34037aaba)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit 5666ed77a34d48aa10e1ad2b1f06d99c0553644f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit e4387c1de9738cf19eb4d78b620b92a03fe1b131)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.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>
(cherry picked from commit 15953702bce6dcba94d351655fb42c29edd5789d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 10952: Store anonymous search history in session

Storing search history into cookie can cause problems, due to the size
limitation of 4KB.

The solution here is to store search history into the CGI::Session
object, so there is no size limitation (but anonymous search history
still remember up to 15 requests max.)

Test plan:
- Go to OPAC in anonymous mode.
- Check that the "Search history" link is *not* shown in the top right
  corner of the page
- Make some searches on /cgi-bin/koha/opac-search.pl
- The "Search history" link should appear. Click.
- Your search history should be displayed.
- Try to log in with invalid username/password
- Go back to search history, it's still there
- Now log in with valid username/password
- Your anonymous search history should be saved into your own search
  history.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Restoring original sign offs and comments below

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work as described. No koha-qa errors

Well, search history saving is similar before and after patch.
i.e. anonmymous search is saved when user logs in, but cookie
KohaOpacRecentSearches is empty.
Shows current an previous session searches

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
All tests and QA script pass, works as described.

Signed-off-by: Charlene Criton <charlene.criton@univ-lyon2.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d07df7d51250bb5a40bb556aab48afb18a67a396)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 10952: (follow-up) comments fixes and unit tests

- Remove unit tests for ParseSearchHistoryCookie, which doesn't exist
  anymore
- Add unit tests for ParseSearchHistorySession and
  SetSearchHistorySession
- Remove/Modify comments about search history cookie

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Tests fixed and moved, and comments tidied up

Signed-off-by: Charlene Criton <charlene.criton@univ-lyon2.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit bbf7cd6876e94865492e3fd19e59c31b6b95b588)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Bug 10952: (follow-up) Always flush session after deletion

This is recommended in CGI::Session documentation.

Signed-off-by: Charlene Criton <charlene.criton@univ-lyon2.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 939d68ea7b0fb7c0649531b324ad4938a5360c0e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>