Bug 7143: Adding RMaint for 3.8 to release team

As a follow-up after December 4 meeting.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Correct addition, no problems found.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10983: Remove unused private subroutines from C4::Budgets

The subroutine _filter_fields is not used by the module
and the sub _columns is only used by it

This patch removes the dead code.

To test:

[1] Verify that the following tests pass

    t/Budgets.t
    t/Budgets/CanUserModifyBudget.t
    t/Budgets/CanUserUseBudget.t
    t/db_dependent/Acquisition.t
    t/db_dependent/Acquisition/GetOrdersByBiblionumber.t
    t/db_dependent/Acquisition/Invoices.t
    t/db_dependent/Acquisition/OrderFromSubscription.t
    t/db_dependent/Acquisition/TransferOrder.t
    t/db_dependent/Acquisition/close_reopen_basket.t
    t/db_dependent/Bookseller.t
    t/db_dependent/Budgets.t
    t/db_dependent/Serials.t
    t/db_dependent/Serials_2.t

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Looks good to me.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11174: fix OPAC search links built from authority 5xx fields

In the templates opac-authoritiessearchresultlist of prog and
bootstrap the incorrect parameter 'valuec' is changed to 'value'

To test:

1) Insert an authority record with a 5xx field  (on MARC21 or UNIMARC)
2) Index the record
3) Search for the record in using OPAC authorities search.
4) Click one of the "see also" links built from the 5xx field, the link
   doesn't work
5) Apply the patch
6) Close the browser
7) Open the opac and select the english interface
8) Redo the search
9) Now the link works
10) To use the patch in others languages you need to regenerate the
    templates.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with bootstrap.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Following commit remove the use to valuec:
 commit 31f41e2c1db9d8dca82e0249050acb8f906c8164
    Bug 8206: Specify index in OPAC authority search

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8334 - Authority UNIMARC 100 field plugin

This patch adds a plugin for field 100 of UNIMARC
authorities.

To test on a UNIMARC site:
1) Apply the patch
2) Edit some authority framework, field 100
3) Link subfield 'a' to unimarc_field_100_authorities.pl
plugin, save
4) Edit or add auth record, click on '...' to bring plugin
5) Modify field 100a
6) Save record

Thanks to Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> for
converting Vitor's original patch to a Git patch and doing
some tidying.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Stephane Delaye <stephane.delaye@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8334: (follow-up) remove commented JS code

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 9224: Make acqui/finishreceive.pl Plack-compatible

Under Plack/mod_perl wrapping, sub update_item() will become a closure,
so after the 1st run it will retain its own private instances of the
following variables: $booksellerid, $datereceived, $unitprice, $rrp,
$biblionumber.

I.e., in case update_item() gets invoked 2nd+ time (inside
the same process, but for different-subsequent receives) it may
incorrectly flag the (old, wrong) biblionumber for Zebra reindexing,
and erronously modify the current item[s] with the previously
used (wrong) values.

This simple patch should make acqui/finishreceive.pl Plack-compatible.

Test plan:
Test patched acqui/finishreceive.pl script (create and receive some
orders w/ items, etc.). Ensure items are gettting added and/or modified
correctly during receiving process.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised, no regressions found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11261: make sample serial numbering patterns mandatory during installation

Test plan:
Verify all sample_numberpatterns.* files have been moved from optional
to mandatory directories.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All sample files for numbering patterns are moved from optional
to mandatory.

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 11261: make sample serial frequencies mandatory during installation

Test plan:
Verify all sample_frequencies.* files have been moved from optional
to mandatory directories.

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 11255: allow "relevance ascending" as a sort option

This patch fixes a problem where if a staff member sets the
*defaultSortField/*defaultSortOrder system preferences to relevance
ascending while QueryParser is enabled, default keyword search
would break -- the query parser config did not declare relevance asc
as a possible "modifier".

Note that setting the sort order to relevance ascending does not
actually make catalog search return results with the least relevant
records showing up first; Zebra does not support such a mode.  In other
words, relevance ascending acts exactly the same as relevance descending.

Test plan:

0/ Create some biblio with "history" in the title and
   ensure that the QueryParser system preference is enabled.
1/ Define prefs defaultSortField = relevance and defaultSortOrder = asc
2/ Search "history" on the staff interface
3/ Note that no result is returned.
4/ Apply the patch
5/ Verify the queryparser config file in use takes the modification into
account (see the queryparser_config value in your $KOHA_CONF file).
6/ Relaunch the search and verify results are returned

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11124: disallow trying to run the staff benchmark script as the DB account

On step 6 (at least), the circulation and return page redirect to the
select branch page and nothing is done.

The script should die if the user used is the sql administrator account.

Test plan:
Suppose that the sql admin account is root/root and koha/koha a
superlibrarian account.

1/
perl misc/load_testing/benchmark_staff.pl --steps=6
--url=http://admin.koha.local/cgi-bin/koha/
--password="koha" --user="koha"
should produce:
  ...
  Step 6
  ...

2/
perl misc/load_testing/benchmark_staff.pl --steps=1
--url=http://admin.koha.local/cgi-bin/koha/
--password="root" --user="root"
should produce:
Authentication successful
You cannot use the database administrator account to launch this script

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11124: QA Follow-up resolving a warning and three typos

Resolves warning on uninitialized author in split on line 128.
Just adds the same behavior for title on line 129 for completeness.
Fixes typo on occurrences and two other minor typos.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 11124: QA Follow-up adding optional dependency HTTPD::Bench::ApacheBench

This dependency is used in load testing (misc/load_testing/*)

Test plan:
Check if you see the dependency listed on About/Perl modules.
Verify if the version information is correct.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8230: Display acquisition details on the catalogue detail page

This patch adds a new tab "Acquitition details" on the catalogue detail
page. It provides a list of order made for this biblio.

New system preference:

AcquisitionDetails: Hide/Show the new tab.  The default for
new and upgraded installations is to display the new tab.

Test plan:
1/ Apply the patch.
2/ Select the "placing an order" value for the AcqCreateItem pref.
3/ Create a new order with X items.
4/ Go on the catalogue detail page for the selected biblio.
5/ Click on the "Acquisition details" tab and check that your order is
displayed. Itemnumbers are present in the last column. Check that links
are not broken.
6/ Close your basket.
7/ Status become "Ordered"
8/ Receive X-1 items.
9/ Come back on the catalogue detail page. There are 2 orders: 1
complete and 1 partial. The complete one has a receive date.
10/ Receive the last item.
11/ Now you have 2 orders with a complete status.
12/ Cancel the last receipt.
13/ You have 1 ordered and 1 complete (2 items).
14/ Cancel the first receipt.
15/ You have 1 ordered (3 items).
16/ Delete your order
17/ You have 1 deleted order.
18/ Switch the AcqCreateItem pref to "receiving an order"
19/ Do again steps 3 to 17.

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8230: (follow-up) reflect the fact that order statuses are now alphabetic codes

Signed-off-by: Paola Rossi <paola.rossi@cineca.it>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, works as advertised. No regressions found.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8230: DBrev 3.15.00.005

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8230: (follow-up) don't link to basket unless user has appropriate permissions

With this patch, the basket number on the bib details page is linked
to the basket management page only if the staff user has the appropriate
permissions.

To test:

[1] Log in as a user with the acquisition/order_manage permission.
    Bring up a bib record that is attached to an order and verify
    that the basket number is an active link.
[2] Log in as a user that doesn't have the acquisition/order_manage
    permission.  Verify that the basket number displayed on the bib
    details page is not a hyperlink.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8230: (follow-up) fix detection of cancelled orders

This patch fixes a problem where the quantity / items column
in the acquisitions detail table would display ilnks to
items for cancelled orders.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8230: (follow-up) repair regression on order search

This patch repairs a regression introduced by the main
patch where it became impossible to search for cancelled
orders from the advanced order search form.

This patch also tweaks the wording on the order status
drop-down on the order search form to clarify that the
default status filter is orders that have any status
except cancelled.

To test:

[1] Before applying this patch, perform an advanced
    order search (acqui/histsearch.pl) for orders
    with status cancelled.  Observe that no hits are returned.
[2] Apply the patch and run the search again.  This time,
    the cancelled orders should be returned.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 8230: (follow-up) update POD for C4::Acquisition::GetHistory

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Bug 10852: serials search improvements

This patch adds 3 filters for the serials search:
- location
- callnumber
- expiration date

To test:
- Search serials by location and/or callnumber and/or expiration date
  and check that results are consistent.

Signed-off-by: Mathieu Saby <mathieu.saby@univ-rennes2.fr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>