Bug 8746: rebuild_zebra_sliced.sh now export/index records as MARCXML

This avoid indexing failures due to "bad offset" or "bad length" error
with ISO2709 format

+ minor improvements:
  -  --length parameter is optional. If not given, it will execute the
     right sql query to find the number of records to index
  -  new parameter --reset-index. If set, index is reset before indexing

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

Test: Edit record to make it longer than 9999. Without patch rebuild_sliced
fails. With patches works.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 8746: Fix indexation in DOM index mode

When in DOM index mode, files exported by `rebuild_zebra.pl -x` are
wrapped by '<collection></collection>' tag.
This is a problem because splitting files produces invalid files.
This is fixed by adding the missing <collection> tags in each generated
file.
Another problem was that the wrong zebra configuration file was used.
The script now uses C4::Context->zebraconfig($server)->{config} to know
which configuration file has to be used.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 8746 [Follow-up] Replace == by eq in string comparison

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_8746' into 3.14-master
Bug 9860 [Alternate] Incorrect box heading 'Cannot check in' when a late document is returned

The fix for Bug 9397 moved the "cannot check in" heading from within the
one conditional where it should have been displayed to the top of all
check-in errors/messages. "Cannot check in" is still only valid if the
item is withdrawn and BlockReturnOfWithdrawnItems is ON.

In order to accomplish the goal of Bug 9397 while fixing Bug 9860 this
patch puts "cannot check in" back into the correct conditional and adds
a generic heading to check in messages for accessibility purposes.

To test, check in items which will trigger a variety of errors
including:

- item must be returned to home library
- item is lost
- item is withdrawn (wtih BlockReturnOfWithdrawnItems on and off)
- item is overdue

...as well as items which should check in normally. Messages should
display correctly.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9860' into 3.14-master
Bug 10046: Standardize terms used in invoices

Changes are:
budget > where actually fund is meant
branch > library
bookseller, supplier > vendor

To test:

1) Receive a shipment, check the little form where you
   enter your invoice number for correct use of terms.
2) Receive some orders and save finish receiving.
3) Search for your created invoice. Check filters and
   results table for correct use of terms.
4) Look at the details of your invoice, repeat check there.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10046' into 3.14-master
Bug 9613: items namespace missing in XSLT

In some XSLT, "items" namespace is used in exclude-result-prefixes but is not defined.

This patch add this namespace where missing.
Also corrects a koha.org, instead of koha-community.org, in one namespace URL.

Test plan :
- Enable XSLT on search results
- Perform a search
=> Look at error logs to check that there is no xsl error like :
[Fri Feb 08 15:35:06 2013] [error] [client 127.0.0.1] [Fri Feb  8 15:35:06 2013] opac-search.pl: compilation error: file koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl line 8 element stylesheet, referer: http://opac.master.community.localhost/cgi-bin/koha/opac-detail.pl?biblionumber=299
[Fri Feb 08 15:35:06 2013] [error] [client 127.0.0.1] [Fri Feb  8 15:35:06 2013] opac-search.pl: xsl:exclude-result-prefixes : undefined namespace items, referer: http://opac.master.community.localhost/cgi-bin/koha/opac-detail.pl?biblionumber=299

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Passed-QA-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
With comment on Bugzilla.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9613' into 3.14-master
Bug 8745 - Disallow rebuild_zebra.pl from executing, when run by root user.

Added a check to warn users of execution as root user.
Added a 'runas-root' switch to allow users to force execution as root user.

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Bug 8745: General whitespace and tab tidy

http://bugs.koha-community.org/show_bug.cgi?id=8745
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
1) Runs not with root.
2) Runs with root and -run-as-root.
3) Runs using the normal koha user.

Note: Maybe the message should be clear about why
running as root is bad and which user you should
be running the script with?
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_8745' into 3.14-master
Add Barry Cannon to the history file

Welcome, Barry, you are the 208th developer with a patch in Koha!
Bug 10065 - Style invoice edit form according to standard structure

The structure of the invoice edit form does not match that of similar
forms in the staff client. This patch alters it to be consistent.

To test you must also have the patch for Bug 10046 applied.

Go to Acquisitions -> Invoices and search for invoices. Click an invoice
to view/edit details. The form displaying fields for shipment date,
billing date, etc. should look correct and work correctly.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_10065' into 3.14-master
Bug 9995 - For reference items no longer listed in XSLT result lists

Re-added the xsl that shouldn't have been removed.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with different settings for OpacItemLocation
and not for loan set in the item and for the item type.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9995' into 3.14-master
Bug 9839 - when importing MARC records, item record not created even when set to "always add"

Test Plan:
1) Catalog a new record with an ISBN
2) Add some items to the record
3) Download the record as MARCXML
4) Delete the itemnumbers from the 952 fields in the record,
   Change the barcode fields to unused barcodes
5) Use xml2marc to save as a standard MARC file
6) Import the record using the 'Stage MARC for import' tool
   Use the settings:
       Record matching rule: ISBN
       Action if matching record found: ignore
       Action if no match found: ignore
       Item processing: always_add
       Check for embedded item record data?: Yes
       How to process items: Always add items
7) Import, note the bib is ignored, and the items are not processed
8) Undo import into catalog
8) Apply this patch
9) Import this batch into the catalog
10) Note the items were processed and are now added to the matching
record

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Tested with UNIMARC record. I followed the test plan, just changing 952 by 995
Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Merge branch 'bug_9839' into 3.14-master