Bug 10712: Save missing config variables to install log

The variables for AUTH_INDEX_MODE and ZEBRA_TOKENIZER were not
being saved to the koha_install_log file.  As a result when using the
--prev-install-log option in Makefile.PL the user was still prompted
to select them.

This patch adds the appropriate variables to the list saved in
the install log.

To test:

On a (non-package) system installed/upgraded without the patch running
'perl Makefile.PL --prev-install-log /path/to/koha-install-log' will
still prompt you to choose authorities indexing mode and select
between chr and icu, after upgrading with this patch applied the same
command should get the responses from the install log and not require
user intervention.

The values can be seen written into misc/koha-install-log

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 40e6f6a8f22b8af7adef79a0ece80a61a69ccc50)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 521d260a5931119c688fd872c30041ffe1c5c692)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 521d260a5931119c688fd872c30041ffe1c5c692)
Bug 10362: ensure that all messages and alerts are shown upon checkin

If an item is returned and has mutiple error or warnings (e.g.,
it both needs to be transferred and the patron was debarred
in the course of the return), because of a bug in the template,
not all of the messages would be displayed.

This patch changes the template to show both messages and alerts.

Test plan :
- Perform an checkout that will a checkin :
  * need a transfert (return in a different branch)
  * set user debarred (depends on issuing rules)
- Perform check-in
=> You get tranfert message and debarment alert

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 5192fd81adaccf9b0f4a01dcc0ffc689edc9468f)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 8525d49e0601c85807235c007f712666c2abbceb)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 8525d49e0601c85807235c007f712666c2abbceb)
Bug 10664: fix error in overdue_notices.pl if there is no active currency

If there is no active currency, when running overdue_notices.pl
you get a sofware error "Can't use an undefined value as a HASH
reference" on GetCurrency() function call.

With this patch, if there is no active currency, fines are formated
by default 0.00 and notices are correctly generated.

Test plan :
- have at least one borrower with overdue that should trigger a notice
- verify that there is no active currency (Adminitration > Currency &
  Exchange rates)
- run misc/cronjobs/overdue_notices.pl -v -n (to get the notice directly
  on output)

=> without the patch you get the software error
=> with the patch, notices are correctly generated

If an active currency is defined, the script overdue_notices.pl runs
the same with or without patch

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit a9a3bb7b3d7e8e862cf0f772246667258a20b786)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 5e12ca5684ee19c54685a4dc935fb242eaf0c3bc)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 5e12ca5684ee19c54685a4dc935fb242eaf0c3bc)
Bug 10664 [QA Followup] - fix error in overdue_notices.pl if there is no active currency

Fixes the following koha-qa.pl error:
 FAIL   misc/cronjobs/overdue_notices.pl
    OK     pod
    OK     forbidden patterns
    OK     valid
    FAIL   critic
               # Variables::ProhibitConditionalDeclarations:

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit e476378323eb8dd31e67e4741d271d88de61b59e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 22f96c6ebeb77da5efe7285d1980ce705e22726e)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 22f96c6ebeb77da5efe7285d1980ce705e22726e)
Bug 10483: fix item uniqueness check on order form

When syspref "UniqueItemFields" is defined, the item uniqueness is
tested in acquisition by an AJAX call to check_uniqueness.pl.  This
patch fixes an issue where check_uniqueness.pl wasn't looking
at the correct CGI parameters.

Test plan :
- Select an existing item with barcode
- Add "barcode" to "UniqueItemFields" syspref (use space as separator
  for multiple values)
- Set "AcqCreateItem" syspref to "Create an item when placing an order"
- Go to an acquisition basket
- Create a new order from empty
- Enter existing barcode in item form and save
=> You get an alert that barcode already exists and order is not saved
- Enter a non-existing barcode in item form and save
=> Order and item are created

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1c9135262b9233f59fd05e34c90980e7dc8be338)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit df428a49e5c8b9106771d308bd1c1dea62d64429)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit df428a49e5c8b9106771d308bd1c1dea62d64429)
Bug 10715 - MARC21 007 Plugin Editor doesn't load position 01

This patch changes the MARC21 007 plugin editor so that it uses
1 character instead of 4 characters for position 01.

TEST PLAN:

1) Create new record/edit an existing record
2) Using the tag editor for the 007 field, choose "Videorecording"
3) Click OK
4) Change the second character in the 007 from "c" to "d"
5) Open the tag editor again
6) Note that position 01 will still say "c - Videocartridge" rather
than "d - Videodisc".
7) Exit tag editor

8) Apply patch

9) Reload the page (Shift + Refresh is always useful)
10) Open the tag editor again
11) Note that position 01 will now say "d - Videodisc"

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 73ac970f734b0f04fff5561aa35bb9d9d47aa943)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
Fix worked as expected.
(cherry picked from commit 8a407d8d02463cd15423735dc6030da2c8f5e3a7)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 8a407d8d02463cd15423735dc6030da2c8f5e3a7)
Bug 10703: Add db documentation for biblioimages table

This patch adds db documentation to the biblioimages table.

To test:

Apply patch
Review kohastructure.sql to be sure that the documentation is there

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 801d8237d80d7079f3355da18ef18c60b7f37325)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 6f55deac4a976b59edd13632e11f70cbfbd22642)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 6f55deac4a976b59edd13632e11f70cbfbd22642)
Bug 10481: FIX No enrollment fee when changing patron category.

When a patron changes to a category with enrollment fee, they
are not generated.

Test plan:
- Choose a category without fee (e.g. Kid)
- Add an enrollment fee for another category (e.g. Young adult)
- Choose a kid and change his category to "Young adult".
- Note the warning message "Fees & Charges: Patron has Outstanding fees
  & charges of XX" on the check out page.

This patch also moves all instances of adding the enrollment fee
to a new routine in C4::Members, AddEnrolmentFeeIfNeeded(), so
additional tests include:

- Register a new patron and give it a category that has
  an enrollment fee.  Verify that the fee is charged.
- Renew the patron.  Verify that the additional fee is charged.
- Register a new patron with a child patron category.
- Use the 'update child to adult' menu option to change the
  patron's category to one that is fee-bearing.  Verify that the
  enrollment fee was charged.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit f8eb19163bd4e59e99b6dae90a5712b6a7be52f6)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 98397ed4b10b03fb0b00e9550b571c3cc47407dc)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 98397ed4b10b03fb0b00e9550b571c3cc47407dc)
Bug 10481: Unit tests for C4::Members::AddEnrolmentFeeIfNeeded

prove t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t
t/db_dependent/Members/AddEnrolmentFeeIfNeeded.t .. ok
All tests successful.
Files=1, Tests=3,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.38 cusr
0.01 csys =  0.41 CPU)
Result: PASS

Signed-off-by: Srdjan <srdjan@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1c8efaf3f9b14caf5f6512149d5fcd957bd3e487)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit af6c169f2a68296d99ad7f6908e441ababb79c98)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit af6c169f2a68296d99ad7f6908e441ababb79c98)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 9fc0c233dc5b180c3c7f3d92fdfc383c51bb2825)
Bug 10481: (follow-up) fix typo in POD

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 1e84b1217afc74f490423538b7b8808e3d34513a)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 5fde0910787f9c36caedfc12bc5af6dfedc7df36)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 5fde0910787f9c36caedfc12bc5af6dfedc7df36)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 3ae20f0a2de91bfe8318df9a63c2bd73da71de25)
Bug 8887: only display desired result when doing exact syspref search

This patch fixes an issue where entering the complete name of a system
preference when doing a syspref search in the staff interface resulted
in the display of *all* preferences belonging to the desired one's
module.

Since providing a more specific search string should result in getting
back more specific results, the previous behavior was not intuitive.

Test scenario:

a) In sysprefs, do a search with partial match (e.g. intranetcolor)
-> Result shows one entry: intranetcolorstylesheet
b) Do an exact search. e.g. intranetcolorstylesheet
-> Result shows all Staff Client preferences

Apply patch, test again. Now b) behaves like a).

Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
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 9bc53a0fccc3b673dca43791ebfcb53fd6e0a9ee)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit a4dbe6821d167908792a7665c492d0e2976aaa0a)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit a4dbe6821d167908792a7665c492d0e2976aaa0a)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 17fefb868bddf997d90799de5f9190f330c20aac)
Bug 10653: add unit tests for C4::RotatingCollections.pm

The tests are wrap in a database transaction.

Test plan:
prove t/db_dependent/RotatingCollections.t
t/db_dependent/RotatingCollections.t .. ok
All tests successful.
Files=1, Tests=41, 20 wallclock secs ( 0.02 usr  0.01 sys +  0.41 cusr  0.02 csys =  0.46 CPU)
Result: PASS

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 12061f44beb46709e03d09f7ff61551fa9297b2e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit eb0373c7eb6d1f0cb52155709c18e06c09ab55df)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit eb0373c7eb6d1f0cb52155709c18e06c09ab55df)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 338e966d651ca6c00bd8d04c7d24099ca00d1b84)
Bug 10653: (follow-up) minor tweaks to RotatingCollections tests

- remove unnecessary module import
- use parentheses for all C4 function calls

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 40aa42f31f10acad92da5f2c57319f049fba9289)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 800e1fc6d059b59a6aa0f5f0353c64ea1b606560)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 800e1fc6d059b59a6aa0f5f0353c64ea1b606560)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit d5cc7da52ac6d6e0fd21662c4f3ebc24c22d511b)
Bug 10642: fix inappropriate uses of $sth->finish() in C4::RotatingCollections.pm

From the man page

finish()
Indicate that no more data will be fetched from this statement handle
before it is either executed again or destroyed.
You almost certainly do not need to call this method.

Adding calls to "finish" after loop that fetches all rows is a common
mistake, don't do it, it can mask genuine problems like uncaught fetch errors.

To test:

Verify that prove -v t/db_dependent/RotatingCollections.t passes

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Passes koha-qa.pl, passes UT provided by bug 10653

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit d1b3e4ab6b432844e076e1eb0662a9c04a5f412e)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 0311e39c269291156f82393fbb7269caab7b679e)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 0311e39c269291156f82393fbb7269caab7b679e)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit 38e8a13b6ba331207dc7451c676e6aa868e14e79)
Bug 10728: fix log noise generated by subscription-renew.pl

Error log is showing warnings because mode is undefined
and we are doing string comparisons on it.

Set it to a default value (we were already assigning it a variable
which we were not using) and use the the result in the comparison

To test, after applying the patch:

[1] Use the renew link from the subscription detail page to renew
    a subscription.
[2] Verifying that doing this did not add a warning containing
    'subscription-renew.pl: Use of uninitialized value $mode in string eq '
    to the Apache error log.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 27edb618dd604e0a718f43e98ed97255f72eb515)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 70681a47f2cefcdee665d4d8076f3228eee891de)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 70681a47f2cefcdee665d4d8076f3228eee891de)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit f17210a19c9727a4c30f3d40a94d4649f39f557e)
Translation updates for 3.8.19

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Release notes for 3.8.19
Koha 3.8.19 release
Merge tag 'v3.08.19' into 3.8.ptfs