]> git.koha-community.org Git - koha.git/log
koha.git
4 years agoBug 19475: Don't copy holiday if it already exists in target calendar
Emmi Takkinen [Wed, 4 Mar 2020 11:54:34 +0000 (13:54 +0200)]
Bug 19475: Don't copy holiday if it already exists in target calendar

Calendars copy tool created duplicate values to database.
Holidays in target calendar weren't checked before
inserting new holidays. This patch fixes this.

To test:
1. Add holidays for branch A
2. Copy branch A calendar to branch B
3. Repeat copy to branch B
=> Check database, branch B has now duplicate holidays
4. Delete holidays from branches A and B
5. Apply patch
6. Repeat steps 1-3
=> Check database, no duplicates

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 19475: Add unit tests
Emmi Takkinen [Thu, 12 Mar 2020 10:35:39 +0000 (12:35 +0200)]
Bug 19475: Add unit tests

To test prove:
t/db_dependent/Holidays.t

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 9422: (RM follow-up) Rebase Correction
Martin Renvoize [Fri, 3 Apr 2020 13:10:07 +0000 (14:10 +0100)]
Bug 9422: (RM follow-up) Rebase Correction

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 9422: Don't allow access to 'Upload patron images' when patronimages syspref...
Katrin Fischer [Sun, 10 Feb 2019 11:09:08 +0000 (12:09 +0100)]
Bug 9422: Don't allow access to 'Upload patron images' when patronimages syspref is off

In addition to checking the patron image upload permission, this
adds a check for the patronimages system preference to the tools
home page and sidebar.

To test:
- Check that the patron image upload tool only displays when
  - system preference patronimages is set to 'Allow'
    and user is either
  - superlibrarian or
  - has bath_upload_patron_images permission
- Save URL of patron image uploader page
- Turn off patronimages
- Verify you get redirected to the home page of Koha when trying
  to access the page

Note: this redirect is already used by the stock rotation feature.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24474: DBRev 19.12.00.061
Martin Renvoize [Fri, 3 Apr 2020 13:04:48 +0000 (14:04 +0100)]
Bug 24474: DBRev 19.12.00.061

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24474: (QA follow-up) Fix failing test
Martin Renvoize [Tue, 31 Mar 2020 08:43:34 +0000 (09:43 +0100)]
Bug 24474: (QA follow-up) Fix failing test

The test was assuming default data and would fail if you ran through the
test plan (and disabled all but `onpayment` for the
'MarkLostItemsAsReturned' preference) on the data before running the
included unit tests.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24474: (follow-up) Add LOST_FOUND logic to Koha::Account::pay
Martin Renvoize [Fri, 14 Feb 2020 10:39:21 +0000 (10:39 +0000)]
Bug 24474: (follow-up) Add LOST_FOUND logic to Koha::Account::pay

This patch adds the same updated logic as found in
Koha::Account::Line->apply to handle LOST_FOUND credits being applied
against their associated LOST debit.

Currently a 'LOST_FOUND' credit is never created via the pay method and
so the additional test will always pass, but the addition here accounts
for possible future uses.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24474: (follow-up) Add onpayment to sysprefs file
Martin Renvoize [Mon, 10 Feb 2020 10:31:37 +0000 (10:31 +0000)]
Bug 24474: (follow-up) Add onpayment to sysprefs file

This patch adds the required line to the circulation.pref file to
dispaly the onpayment option in the MarkLostItemReturned preference

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24474: Filter out LOST_FOUND
Martin Renvoize [Wed, 5 Feb 2020 13:10:49 +0000 (13:10 +0000)]
Bug 24474: Filter out LOST_FOUND

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24474: Add `onpayment` option to `MarkLostItemsReturned`
Martin Renvoize [Wed, 5 Feb 2020 10:14:05 +0000 (10:14 +0000)]
Bug 24474: Add `onpayment` option to `MarkLostItemsReturned`

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24474: Add tests
Jonathan Druart [Tue, 4 Feb 2020 14:13:47 +0000 (15:13 +0100)]
Bug 24474: Add tests

This does the following using the interface:
- Unselect all the options from MarkLostItemsAsReturned except for
  'onpayment'
- Check an item out
- Create a manual invoice LOST for the checked in item
- Renew the item
- Check that the item was not returned

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24900: Checks in MARC mod templates for when from field does not equal conditiona...
Aleisha Amohia [Thu, 19 Mar 2020 04:37:34 +0000 (04:37 +0000)]
Bug 24900: Checks in MARC mod templates for when from field does not equal conditional field

When MARC modification template actions are applied, they assume that
the from field is the same as the conditional field. This patch adds
checks for this, as well as tests to confirm the behaviour is correct.

CASE 1: Delete 1st field 020 if 651$z exists
BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020 instead
                                 of 1st
EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020

CASE 2: Delete 1st field 020 if 651$z matches Berlin. (must include '.')
BROKEN BEHAVIOUR (before patch): deletes the 2nd instance of 020
EXPECTED BEHAVIOUR (corrected by patch): deletes the 1st instance of 020

CASE 3: Delete field 020 if 650$2 does not match fast
BROKEN BEHAVIOUR (before patch): deletes all 020 fields even though
                                 650$2 does match fast
EXPECTED BEHAVIOUR (corrected by patch): does not delete 020 fields

Confirm tests pass: t/db_dependent/MarcModificationTemplates.t

Sponsored-by: Catalyst IT
Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22001: Errors are no longer logged by default (!)
Jonathan Druart [Tue, 31 Mar 2020 15:56:41 +0000 (17:56 +0200)]
Bug 22001: Errors are no longer logged by default (!)

This is one of the biggest part we will have to deal with when we will
switch to DBIC handler for UI as well.
The DBI errors will not be logged if we do not deal with them correctly.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22001: execute reports in an eval
Jonathan Druart [Tue, 31 Mar 2020 15:55:28 +0000 (17:55 +0200)]
Bug 22001: execute reports in an eval

Otherwise the tests will fail. We will certainly log twice the error
when run from the UI, but not a big deal. This definitely needs more
attention in a follow-up bug report.
We want to raise proper exceptions here.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22001: Fix Koha/Patrons.t
Jonathan Druart [Tue, 31 Mar 2020 15:54:36 +0000 (17:54 +0200)]
Bug 22001: Fix Koha/Patrons.t

The message is only printed once

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22001: Make the DBD error regex less strict
Jonathan Druart [Tue, 31 Mar 2020 15:53:47 +0000 (17:53 +0200)]
Bug 22001: Make the DBD error regex less strict

Now the message is looking like
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Duplicate entry

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22001: Add the DBI error message
Jonathan Druart [Tue, 31 Mar 2020 15:27:12 +0000 (17:27 +0200)]
Bug 22001: Add the DBI error message

Using DBIx::Class error handler, we should not hide the error when
encapsulating it

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22001: Set unsafe only if RaiseError is not set
Jonathan Druart [Tue, 31 Mar 2020 13:58:21 +0000 (15:58 +0200)]
Bug 22001: Set unsafe only if RaiseError is not set

Sooooo....

That was tricky, and the solution looks trivial.
However it's not.
We have unsafe set for "historical reason".
Having it on when RaiseError is on have the effect of overwritting the
DBIC error handler.

The problem is:
t/db_dependent/Circulation/MarkIssueReturned.t (and other tests) is failing with:

  # expecting: Koha::Exceptions::Object::BadValue
  # found: DBIx::Class::Exception ({UNKNOWN}: Can't locate object method "rethrow" via package "DBD::mysql::st execute failed: Incorrect datetime value: 'bad_date' for column 'returndate' at row 1 [for Statement "UPDATE `issues` SET `returndate` = ? WHERE ( `issue_id` = ? )" with ParamValues: 0='bad_date', 1=238] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line

In Koha::Object->store, the exception is not a DBIx::Class::Exception object (as we except), but
a string (on which we cannot call rethrow).

Swithing unsafe off restores the expected behavior.
To make sure the UI will not be affected, it is only turned off when
RaiseError is set.

The situation is still wrong (for UI), from the POD https://metacpan.org/pod/DBIx::Class::Storage::DBI (/unsafe)
"""
Note that your custom settings can cause Storage to malfunction, especially if you set a HandleError handler that suppresses exceptions and/or disable RaiseError.
"""

And also https://metacpan.org/release/DBIx-Class/source/lib/DBIx/Class/Storage/DBI.pm#L1531

Many thanks Tomas for the digging exploration!

We need to turn RaiseError and remove the unsafe flag, for UI as well,
but that should be done at the beginning of a dev cycle.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23463: (follow-up 3) Fix timestamp default value
Jonathan Druart [Mon, 23 Mar 2020 16:21:24 +0000 (17:21 +0100)]
Bug 23463: (follow-up 3) Fix timestamp default value

This is the only situation I found where:
 * t/db_dependent/Koha/Item.t is passing
 * t/db_dependent/Koha/Object.t is passing
 * MySQL 8 is happy (and not fail with "Column 'timestamp' cannot be null"), which is certainly what I missed in the previous follow-up

About the change to Object.t: the next store was called without the
generated timestamp, so it is needed to call discard_changes.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22001: Fix Object.t - handle correct RaiseError and PrintError
Jonathan Druart [Mon, 30 Mar 2020 09:04:51 +0000 (11:04 +0200)]
Bug 22001: Fix Object.t - handle correct RaiseError and PrintError

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25018: Use new KOHA_TESTING envvar to detect environment testing
Jonathan Druart [Mon, 30 Mar 2020 08:16:23 +0000 (10:16 +0200)]
Bug 25018: Use new KOHA_TESTING envvar to detect environment testing

In some tests we want to know if we are in a testing environment.
When run the usual way, our trick works, the perl interpreter matches 'prove':
  $ENV{_} eq 'prove'

In other situations, we have the KOHA_NO_TABLE_LOCKS environment variables, for the SendCirculationAlert race conditions (see bug 15854 and bug 18364).

For unknown reasons, Jenkins runs the tests with /usr/bin/perl.

This patch suggests to rename KOHA_NO_TABLE_LOCKS and use KOHA_TESTING
instead, when prove is not used (or not correctly detected as it it the
case for Jenkins)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24614: Fix Reports/Guided.t
Jonathan Druart [Fri, 27 Mar 2020 16:09:27 +0000 (17:09 +0100)]
Bug 24614: Fix Reports/Guided.t

DBD::mysql::st execute failed: Column 'public' cannot be null [for Statement "UPDATE `saved_sql` SET `last_modified` = ?, `notes` = ?, `public` = ?, `report_group` = ?, `report_name` = ?, `report_subgroup` = ?,
`savedsql` = ? WHERE ( `id` = ? )" with ParamValues: 0='2020-03-27T16:03:04', 1=undef, 2=undef, 3=undef, 4='Just another report', 5=undef, 6=undef, 7=25] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1836.
    # Looks like you planned 17 tests but ran 6.

update_sql expect all the paramters to be set, otherwise it will be
nulled.

The best way to fix it is at test level. There is only 1 occurrence in
controller/module, and it sends all the parameters. That is the correct
way to do and will make things easier when we will removed them to use
Koha::Reports directly

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18177: (follow-up) remove aqbooksellers.currency
Jonathan Druart [Fri, 27 Mar 2020 15:46:30 +0000 (16:46 +0100)]
Bug 18177: (follow-up) remove aqbooksellers.currency

There was an occurrence in tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: Fix tests swapping fields (they are not ordered)
Jonathan Druart [Fri, 27 Mar 2020 15:36:08 +0000 (16:36 +0100)]
Bug 23204: Fix tests swapping fields (they are not ordered)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 25000: SQL report not updated
Nazlı Çetin [Fri, 27 Mar 2020 12:25:46 +0000 (12:25 +0000)]
Bug 25000: SQL report not updated

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: DBRev 19.12.00.060
Martin Renvoize [Fri, 27 Mar 2020 12:32:14 +0000 (12:32 +0000)]
Bug 23204: DBRev 19.12.00.060

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23473: (QA follow-up) Fix number of tests
Marcel de Rooy [Fri, 27 Mar 2020 09:43:55 +0000 (09:43 +0000)]
Bug 23473: (QA follow-up) Fix number of tests

=> Looks like you planned 158 tests but ran 159.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23473: (follow-up) Fix QA complaints (tabs, filters, Dumper)
Nick Clemens [Tue, 4 Feb 2020 12:14:51 +0000 (12:14 +0000)]
Bug 23473: (follow-up) Fix QA complaints (tabs, filters, Dumper)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23473: Don't allow staff password changes for imports
Nick Clemens [Wed, 8 Jan 2020 15:02:08 +0000 (15:02 +0000)]
Bug 23473: Don't allow staff password changes for imports

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23473: Don't allow setting blank passwords via import
Nick Clemens [Wed, 8 Jan 2020 14:24:04 +0000 (14:24 +0000)]
Bug 23473: Don't allow setting blank passwords via import

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23473: (follow-up) Catch and show password exceptions
Nick Clemens [Tue, 5 Nov 2019 12:58:45 +0000 (12:58 +0000)]
Bug 23473: (follow-up) Catch and show password exceptions

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23473: (follow-up) check if overwrite_passwords is set
Nick Clemens [Tue, 29 Oct 2019 10:24:42 +0000 (10:24 +0000)]
Bug 23473: (follow-up) check if overwrite_passwords is set

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23473: (follow-up) Make passwords 'secure' for tests
Nick [Thu, 3 Oct 2019 13:08:53 +0000 (13:08 +0000)]
Bug 23473: (follow-up) Make passwords 'secure' for tests

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23473: Allow overwrite of passwords during import
Nick Clemens [Mon, 19 Aug 2019 16:16:30 +0000 (16:16 +0000)]
Bug 23473: Allow overwrite of passwords during import

To test:
 1 - Have some patrons in your system
 2 - Export some of their info via reports
    SELECT cardnumber, userid, surname, firstname, password, branchcode, categorycode
 3 - Edit the file from above, changing all the password lines
 4 - Import the file with overwrite
 5 - Confirm passwords have not changed (run the report again and confirm the hashes are the same)
 6 - Apply patch
 7 - Restart all the things
 8 - Check the new box on import screen to overwrite passwrods
 9 - Import file again
10 - Confirm passwords have changed
11 - Signin using new password to verify the hash is the password as supplied
12 - Repeat via commandline import supplying --overwrite_passwords option
13 - Verify works as expected
14 - Prove -v t/db_dependent/Koha/Patrons/Import.t

Sponsored-by: ByWater Solutions
Signed-off-by: Ron Marion <ron.marion@goddard.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18177: DBRev 19.12.00.059
Martin Renvoize [Fri, 27 Mar 2020 12:19:26 +0000 (12:19 +0000)]
Bug 18177: DBRev 19.12.00.059

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18177: Do not remove columns if at least one value exists
Jonathan Druart [Tue, 24 Mar 2020 15:22:33 +0000 (16:22 +0100)]
Bug 18177: Do not remove columns if at least one value exists

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18177: DBIC changes
Jonathan Druart [Tue, 17 Mar 2020 08:55:39 +0000 (09:55 +0100)]
Bug 18177: DBIC changes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18177: DB changes
Jonathan Druart [Tue, 17 Mar 2020 08:50:18 +0000 (09:50 +0100)]
Bug 18177: DB changes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18177: remove aqbooksellers.currency
Jonathan Druart [Tue, 17 Mar 2020 08:53:04 +0000 (09:53 +0100)]
Bug 18177: remove aqbooksellers.currency

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18177: remove aqbooksellers.bookselleremail
Jonathan Druart [Tue, 17 Mar 2020 08:47:46 +0000 (09:47 +0100)]
Bug 18177: remove aqbooksellers.bookselleremail

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18177: remove aqbooksellers.booksellerurl
Jonathan Druart [Tue, 17 Mar 2020 08:43:13 +0000 (09:43 +0100)]
Bug 18177: remove aqbooksellers.booksellerurl

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18177: remove aqbooksellers.booksellerfax
Jonathan Druart [Tue, 17 Mar 2020 08:42:37 +0000 (09:42 +0100)]
Bug 18177: remove aqbooksellers.booksellerfax

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 18177: remove aqbooksellers.othersupplier
Jonathan Druart [Tue, 17 Mar 2020 08:40:04 +0000 (09:40 +0100)]
Bug 18177: remove aqbooksellers.othersupplier

This patchset removes some columns from the aqbooksellers table that are
not used:
 * booksellerfax
 * booksellerurl
 * bookselleremail
 * othersupplier
 * currency

The first 3 ones are certainly leftover from bug 10402.

Test plan:
For each for these fields you will make sure that they cannot be edited
from the interface.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23888: (follow-up) Wrap English string in translation function
Owen Leonard [Fri, 14 Feb 2020 15:07:16 +0000 (15:07 +0000)]
Bug 23888: (follow-up) Wrap English string in translation function

This patch makes alert added in subscription-add.js translatable using
the new __() function.

To test, apply the patch and confirm that the alert still works
correctly when submitting the subscription edit form with an invalid
vendor id.

Test that the string can be translated (using fr-Fr for example):

1. cd misc/translator && ./translate update fr-FR
2. Translate strings in misc/tranlator/po/fr-FR-messages-js.po
3. cd misc/translator && ./translate install fr-FR

Switch to the fr-FR translation and confirm the the alert shows your
translated string.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23888: Do not allow invalid vendor id on creating a subscription
Jonathan Druart [Mon, 11 Nov 2019 11:14:50 +0000 (12:14 +0100)]
Bug 23888: Do not allow invalid vendor id on creating a subscription

It will avoid crash and invalid data when creating/updating a
subscription.

This could have been done with a AJAX query but seems more convenient
this way.

Test plan:
- Create or update a subscription
- In the "Vendor" input try an empty string, a valid vendor's id, and
invalid one.
=> With an empty string you get the existing alert message
=> With a valid id you do not get any messages
=> With an invalid id you are not allowed to go to page 2

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24386: Prevent double form submission on adding orders to basket from a file
Nick Clemens [Thu, 9 Jan 2020 15:53:45 +0000 (15:53 +0000)]
Bug 24386: Prevent double form submission on adding orders to basket from a file

To test:
 1 - Have a marc record file
 2 - Go to Acquisitions, find a vendor, then an open basket
 3 - Add to basket from a new file (if you already have one staged you can choose that instead)
 4 - Import the file, then add to basket
 5 - On the page where you select the records and set info select a record, set matching to 'Do not check' fill in the fund for the order
 6 - When ready, click save as many times as you can
 7 - When you go to the basket there are many copies of the order added
 8 - Don't despair, apply the patch
 9 - Repeat above
10 - When ready to add orders, click furiously
11 - The order is only added once!
12 - Success!

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24883: (RM follow-up) Use Koha::Script
Martin Renvoize [Fri, 27 Mar 2020 12:12:31 +0000 (12:12 +0000)]
Bug 24883: (RM follow-up) Use Koha::Script

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24883: Add POD entry and remove unused variable
Bernardo Gonzalez Kriegel [Fri, 20 Mar 2020 22:35:29 +0000 (19:35 -0300)]
Bug 24883: Add POD entry and remove unused variable

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24883: Move new sub from load_yaml.pl
Jonathan Druart [Thu, 19 Mar 2020 12:09:33 +0000 (13:09 +0100)]
Bug 24883: Move new sub from load_yaml.pl

Use the sub from C4::Installer to avoid dup of code.

Note:
We are going to modify the script and so will do more stuffs.
We may want to rename it, maybe installer_utilities.pl,
misc/installer/yaml_utility.pl, any suggestions?

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24883: Move to a flat array with all values to an array of arrayref
Jonathan Druart [Thu, 19 Mar 2020 11:20:23 +0000 (12:20 +0100)]
Bug 24883: Move to a flat array with all values to an array of arrayref

For the following SQL query:
INSERT INTO cities(city_name, city_country) VALUES ('Madrid', 'Spain'), ('Buenos Aires', 'Argentina');

We move from:
[ 'Madrid', 'Spain', 'Buenos Aires', 'Argentina' ]
to:
[ [ 'Madrid', 'Spain' ], [ 'Buenos Aires', 'Argentina' ] ]

Which make more sense to split, build and construct the queries

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24883: Centralize code to load YAML installer files to a sub
Jonathan Druart [Thu, 19 Mar 2020 11:05:25 +0000 (12:05 +0100)]
Bug 24883: Centralize code to load YAML installer files to a sub

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24883: Command line utility to load yaml files
Bernardo Gonzalez Kriegel [Mon, 16 Mar 2020 21:44:44 +0000 (18:44 -0300)]
Bug 24883: Command line utility to load yaml files

This patch adds a command line utility to load
yaml files.

To test:
1) Apply the patch
2) Try loading a file, e.g. sample notices
 a) mysql -e "delete from letter"
 b) misc/load_yaml.pl -f installer/data/mysql/en/mandatory/sample_notices.yml
3) Try loading a file with a syntax error,
   edit previous file adding ':' at the end of a field without quotes
   then load again

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: (RM follow-up) Use Koha::Script
Martin Renvoize [Fri, 27 Mar 2020 12:08:54 +0000 (12:08 +0000)]
Bug 23204: (RM follow-up) Use Koha::Script

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: Adjust copyright and license
Jonathan Druart [Thu, 26 Mar 2020 14:15:11 +0000 (15:15 +0100)]
Bug 23204: Adjust copyright and license

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: Update the mappings.yaml file with the output generated
Jonathan Druart [Thu, 26 Mar 2020 14:12:25 +0000 (15:12 +0100)]
Bug 23204: Update the mappings.yaml file with the output generated

We need to be consistent and provide the mappings.yaml file generated by
the script.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: Fix ordering of fields in exported file
Nick Clemens [Wed, 25 Mar 2020 17:10:40 +0000 (17:10 +0000)]
Bug 23204: Fix ordering of fields in exported file

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: (follow-up) Also sort by marc field
Fridolin Somers [Tue, 12 Nov 2019 16:15:14 +0000 (17:15 +0100)]
Bug 23204: (follow-up) Also sort by marc field

Test plan :
Launching script several times and see that marc field is alway ordered increasing

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: Sort search fields by name
Alex Arnaud [Thu, 3 Oct 2019 07:23:07 +0000 (07:23 +0000)]
Bug 23204: Sort search fields by name

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: Add exec permission on the script
Alex Arnaud [Tue, 13 Aug 2019 08:41:03 +0000 (10:41 +0200)]
Bug 23204: Add exec permission on the script

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: Export field weights
Alex Arnaud [Tue, 6 Aug 2019 08:03:18 +0000 (08:03 +0000)]
Bug 23204: Export field weights

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: Move code in a unit tested sub
Alex Arnaud [Tue, 6 Aug 2019 07:45:39 +0000 (07:45 +0000)]
Bug 23204: Move code in a unit tested sub

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 23204: Add script for exporting Elasticsearch mappings
Alex Arnaud [Tue, 25 Jun 2019 14:14:19 +0000 (14:14 +0000)]
Bug 23204: Add script for exporting Elasticsearch mappings

Test plan:

  - launch perl misc/search_tools/export_elasticsearch_mappings.pl >
    /path/to/my_mappings.yaml
  - set koha-conf.elasticsearch_index_mappings to
    /path/to/my_mappings.yaml,
  - go to admin -> Search engine configuration,
  - click on "Reset mappins",
  - check that your search fields and mappings are as expected

Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24700: Avoid validating REST API spec multiple times
Ere Maijala [Thu, 20 Feb 2020 14:17:58 +0000 (16:17 +0200)]
Bug 24700: Avoid validating REST API spec multiple times

This patch changes the spec loading so that it is fully loaded and merged with any plugin routes before validation. The individual parts are separately validated only if the resulting complete spec is invalid. Note: the OpenAPI plugin validates the spec given to it, so normally no manual validation is necessary.

Test plan:
1. prove -v t/db_dependent/Koha/REST/*
2. prove -v t/db_dependent/api/v1/*

Sponsored-by: The National Library of Finland
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24982: (follow-up) Retain checkbox selections after for submit
Kyle M Hall [Thu, 26 Mar 2020 15:14:59 +0000 (11:14 -0400)]
Bug 24982: (follow-up) Retain checkbox selections after for submit

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24982: (follow-up) Move checkboxes to left side of label
Kyle M Hall [Thu, 26 Mar 2020 13:49:04 +0000 (09:49 -0400)]
Bug 24982: (follow-up) Move checkboxes to left side of label

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24982: (follow-up) Give checkboxes more structured layout
Owen Leonard [Thu, 26 Mar 2020 12:48:02 +0000 (12:48 +0000)]
Bug 24982: (follow-up) Give checkboxes more structured layout

This patch makes minor markup changes and adds some CSS so that the
module and actions checkboxes are laid out a little more clearly.

The patch includes some whitespace changes, so diff accordingly.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24982: Use checkboxes in Log Viewer
Aleisha Amohia [Tue, 24 Mar 2020 16:00:41 +0000 (16:00 +0000)]
Bug 24982: Use checkboxes in Log Viewer

So we can see all options at once, and more easily select more than one
option.

Test plan:
1) Go to Tools -> Log viewer
2) Notice the new checkboxes under Modules, Actions and Interface. 'All'
should be selected by default for all three options
3) Confirm you can deselect 'All' and the other options are enabled.
Confirm selection all of the other options automatically selects 'All'
and disables the options again.
4) Confirm the results still work as expected when clicking 'Submit'
button

Sponsored-by: Catalyst IT
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24765: Updated on date in Claims returned starts off as 12/31/1969
Kyle M Hall [Mon, 2 Mar 2020 14:36:47 +0000 (09:36 -0500)]
Bug 24765: Updated on date in Claims returned starts off as 12/31/1969

When an item is claimed returned by staff, there is a column called Updated On - this date field column should remain blank until this claimed returned has been updated.  Currently, when an item has been claimed returned, the date in the updated column states 12/31/1969. This date only shows up in the display, it is doesn't show up in the database like this.

Test Plan:
1) Enable return claims
2) Make a claim
3) Note the 'updated on' column has the date 1969-12-31
4) Apply this patch
5) Reload the page ( you may need to clear your browser cache )
6) Note the field is now blank

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22001: (RM follow-up) Allow RaiseError tests in Reports/Guided.t
Martin Renvoize [Fri, 27 Mar 2020 11:12:41 +0000 (11:12 +0000)]
Bug 22001: (RM follow-up) Allow RaiseError tests in Reports/Guided.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22001: Enable RaiseError for tests
Jonathan Druart [Fri, 14 Dec 2018 16:30:02 +0000 (13:30 -0300)]
Bug 22001: Enable RaiseError for tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22001: Add tests
Jonathan Druart [Fri, 14 Dec 2018 16:30:27 +0000 (13:30 -0300)]
Bug 22001: Add tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22001: Remove the RaiseError occurrences from tests
Jonathan Druart [Fri, 14 Dec 2018 16:30:52 +0000 (13:30 -0300)]
Bug 22001: Remove the RaiseError occurrences from tests

Unless it is needed!
Also remove $dbh when not used later.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 22685: Use DBIx::Class relationships in Koha::Acq::Bookseller methods
Jonathan Druart [Thu, 30 Jan 2020 11:26:57 +0000 (12:26 +0100)]
Bug 22685: Use DBIx::Class relationships in Koha::Acq::Bookseller methods

To match PERL15 we change the behavior of Koha::Object methods to make
them use the DBIx::Class relationships.

Test plan:
- Create a vendor, basket and contact
- Edit the vendor => the contact must appears
- Go to the view of a vendor => you cannot delete the vendor, it has
a basket attached
- Create another vendor, without basket
- Go to the view of the vendor => You can delete it

Additionally:
 % prove t/db_dependent/Koha/Acquisition/Booksellers.t
must return green

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20648: Attribute option 'Display in check-out' should be renamed
David Roberts [Wed, 25 Mar 2020 21:14:06 +0000 (21:14 +0000)]
Bug 20648: Attribute option 'Display in check-out' should be renamed

This patch rewords the 'Display in check-out' option in the patron
attribute policy

To test:

1) Apply patch
2) Go to /cgi-bin/koha/admin/patron-attr-types.pl?op=add_attribute_type
3) Check that the 8th line down has been renamed to "Display in patron's
brief information:"
4) Check the description of this same option has been changed to "Check
to show this attribute in the brief information panel in the patron's
record (staff client)."

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24475: Cronjobs don't always live in misc
Kyle M Hall [Thu, 26 Mar 2020 11:41:46 +0000 (07:41 -0400)]
Bug 24475: Cronjobs don't always live in misc

In git installs, cronjobs live in misc, but for package installs, they
live under bin. Let's just still with 'misc/cronjobs' which is always
cromulent.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24475: Reword FinesMode system preference
David Roberts [Wed, 25 Mar 2020 21:59:22 +0000 (21:59 +0000)]
Bug 24475: Reword FinesMode system preference

This patch changes the wording of the FinesMode and
CalculateFinesOnReturn system preferences explanations

1) Install Patch
2) Check that the wording of the FinesMode system preference has changed
to "NOTE: If the misc/cronjobs/fines.pl cronjob is being run, accruing
and final fines will be calculated when the cron runs and accruing fines
will be finalized when an item is returned. If CalculateFinesOnReturn is
enabled, final fines will be calculated when an item is returned."
3) Check that the wording of the CalculateFinesOnReturn system
preference has changed to add "NOTE: This system preference requires
FinesMode to be set to 'Calculate and charge.'" to the existing note.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24905: Make installer update log4perl.conf for instances
Tomas Cohen Arazi [Thu, 19 Mar 2020 13:51:40 +0000 (10:51 -0300)]
Bug 24905: Make installer update log4perl.conf for instances

This patch makes koha-common.postinst check if the log4perl.conf files
on the instances need tweaking. If they do, it appends the relevant
configuration text.

To test:
1. Install Koha 19.11 or earlier using the packages
2. Create an instance:
   $ koha-create --create-db test1
   $ koha-create --create-db test2
=> FAIL: /etc/koha/sites/test1/log4perl.conf doesn't include an entry for
z39.50
3. Apply this patch and run:
   $ docker run \
      --volume=/path/to/your/clone:/koha \
      --volume=/dest/path/for/debs:/debs \
      --privileged
      --env VERSION=19.12.00.047 \
      koha/koha-dpkg:master
Note: Paths need to be adjusted
4. Grab the .deb files and put them on the machine you're testing this
5. Edit /etc/koha/sites/test2/log4perl.conf and add the following text
   at the bottom: log4perl.logger.z3950
6. Install the debs:
   $ sudo dpkg -i koha-perldeps koha-deps koha-common
=> SUCCESS: Install process doesn't explode due to the addition
=> SUCCESS: /etc/koha/sites/test1/log4perl.conf has a new entry for log4perl.logger.z3950
=> SUCCESS: /etc/koha/sites/test2/log4perl.conf doesn't have a new entry for log4perl.logger.z3950
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24905: Add missing entry in log4perl-site.conf.in
Tomas Cohen Arazi [Thu, 19 Mar 2020 12:47:25 +0000 (09:47 -0300)]
Bug 24905: Add missing entry in log4perl-site.conf.in

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24988: Default to autorenew_checkouts for new patrons
Nick Clemens [Thu, 26 Mar 2020 13:38:07 +0000 (13:38 +0000)]
Bug 24988: Default to autorenew_checkouts for new patrons

To recreate:
1 - Create a new patron on the staff interface
2 - Note that 'Allow auto-renewal of items' defaults to 'no'
3 - Apply patch
4 - Create another patron
5 - 'Allow auto-renewal of items' defaults to 'yes'

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24964: Fix perl critic warning
Kyle M Hall [Thu, 26 Mar 2020 12:53:59 +0000 (08:53 -0400)]
Bug 24964: Fix perl critic warning

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24964: Prevent random failures sorting by borrowernumber
Jonathan Druart [Wed, 25 Mar 2020 12:50:45 +0000 (13:50 +0100)]
Bug 24964: Prevent random failures sorting by borrowernumber

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24964: Do not filter patrons after they have been fetched
Jonathan Druart [Wed, 25 Mar 2020 10:21:15 +0000 (11:21 +0100)]
Bug 24964: Do not filter patrons after they have been fetched

The svc/members/search script is called in different places.
In some places (Set owner for a fund, add users to a fund, or set a
manager to a suggestion), we need patrons to be filtered depending on
the permissions they have.
For instance you can only set a fund's owner with a patron that has
acquisition.order_manage.

Currently we have fetching X (default 20) patrons, then filter them
depending on their permission.
Says you have 3 patrons that have the correct permissions but are not in
the 20 first patrons, if you do not define a search term, the search
result will be empty.

This is not ideal and we should filter when requesting the DB.

Test plan:
- Have more than 20 patrons, remove them their permissions
- Create 3 more:
1 superlibrarian
1 with the full acq permission
1 with acquisition.order_manage
- Create a fund and set a owner
- Search for patrons, without specifying a search term (to get them all)
=> Without this patch the new patrons you created are not displayed
=> With this patch they are!

Same test plan apply to set a manager to a suggestion (freshly pushed,
see bug 23590), with suggestions and suggestions.suggestions_manage

Note: The code has been written that way to rely on
C4::Auth::haspermission, but the SQL query is quite trivial and the gain
is important.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24964: Add tests
Jonathan Druart [Wed, 25 Mar 2020 10:20:20 +0000 (11:20 +0100)]
Bug 24964: Add tests

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 24976: Guided report - "Save" button on last step is misleading
David Roberts [Wed, 25 Mar 2020 20:52:19 +0000 (20:52 +0000)]
Bug 24976: Guided report - "Save" button on last step is misleading

This patch changes the text of the save button on the final step.

To test:

1) Build a guided report (the selections are immaterial)
2) Note that after you have been through the six stages, the button on
the "Confirm custom report" screen should be labelled "Save"
3) Install patch
4) Repeat Step 1. Note that on the "Confirm custom report" screen, the
button is now labelled "Next".
5) Run the report to check that the functionality still works.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Devinim <kohadevinim@devinim.com.tr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years ago Bug 20415: (follow-up) DBRev 19.12.00.056
Jonathan Druart [Fri, 27 Mar 2020 07:20:47 +0000 (08:20 +0100)]
 Bug 20415: (follow-up) DBRev 19.12.00.056

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
4 years agoBug 13881: (RM followup) Fix incorrect idempotency test
Martin Renvoize [Thu, 26 Mar 2020 15:51:54 +0000 (15:51 +0000)]
Bug 13881: (RM followup) Fix incorrect idempotency test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20399: (RM follow-up) Fix update statement
Martin Renvoize [Thu, 26 Mar 2020 15:29:04 +0000 (15:29 +0000)]
Bug 20399: (RM follow-up) Fix update statement

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14715: DBRev 19.12.00.058
Martin Renvoize [Thu, 26 Mar 2020 12:01:57 +0000 (12:01 +0000)]
Bug 14715: DBRev 19.12.00.058

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14715: (QA follow-up) Remove limit on Zebra
Katrin Fischer [Wed, 25 Mar 2020 20:47:40 +0000 (20:47 +0000)]
Bug 14715: (QA follow-up) Remove limit on Zebra

Found in testing that this appears to work well for Elasticsearch -
so removing everything that made this Zebra only.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14715: (QA follow-up) Add missing filters
Katrin Fischer [Wed, 25 Mar 2020 20:08:53 +0000 (20:08 +0000)]
Bug 14715: (QA follow-up) Add missing filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14715: (follow-up) Keep results per page setting when selecting facets and sortin...
Aleisha Amohia [Tue, 25 Feb 2020 20:40:57 +0000 (20:40 +0000)]
Bug 14715: (follow-up) Keep results per page setting when selecting facets and sorting results

Also adding missing filters

ALSO ensuring you can switch back to library default on staff side

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 14715: Results per page dropdown for catalogue search
Aleisha Amohia [Tue, 5 Nov 2019 02:53:26 +0000 (02:53 +0000)]
Bug 14715: Results per page dropdown for catalogue search

This patch utilises an unused search facet to handle results shown per
page.

Sponsored-by: Region Halland
Signed-off-by: Gabriel DeCarufel <gabriel@inlibro.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 16457: (follow-up) Enable click event on dynamically-created elements
Owen Leonard [Tue, 24 Mar 2020 12:14:21 +0000 (12:14 +0000)]
Bug 16457: (follow-up) Enable click event on dynamically-created elements

This patch moves the click handler for patron attribute actions ("new",
"clear") from the links themselves to the container. This allows jQuery
to correctly target dynamically-created copies of the links.

To test you should have extended patron attributes enabled and you
should have some repeatable attributes defined.

 - Create or edit a patron record
 - In the "Additional attributes and identifiers" section, test the
   "Clear" and "New" links. Confirm that the controls work with both the
   original instance of the field and those created by clicking "New."

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 16457: Remove the use of "onclick" from the patron entry form
Owen Leonard [Tue, 17 Mar 2020 23:57:06 +0000 (23:57 +0000)]
Bug 16457: Remove the use of "onclick" from the patron entry form

This patch removes several event attributes from the patron entry form
and replaces them with event handlers in the <script> block.

Some event attributes were removed altogether because they weren't
functional: Onchange events on jQueryUI datepickers don't work, and they
would have been redundant even if they did work.

To test you should have some patron attributes configured
(Administration -> Patron attribute types). At least one attribute
should be configured to apply to one particular patron category.

Apply the patch and begin the process of adding a new patron.

1. Try to add a patron with details matching a patron which already
   exists. You should get a confirmation message on screen which asks if
   the patron is a duplicte. Test the link which shows the existing
   record. It should trigger a popup window with details about the
   patron.

2. Test the process of setting a patron's date of birth. Selecting a
   date should trigger the display of the patron's age immedately below
   the field.

3. Test that you cannot set a patron's expiration to a date which
   precedes the date in the registration date field.

4. Test that you can add a manual restriction's expiration date, and
   that the "Clear date" link works correctly.

5. Test that the "clear" and "new" controls links work with additional
   attributes and identifiers.

6. Test that changing the patron's category correctly affects the
   display of available attributes and identifiers: The attribute you
   have associated with a particular patron category should only show if
   that category is selected under "Category."

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20399: DBRev 19.12.00.057
Martin Renvoize [Thu, 26 Mar 2020 11:57:26 +0000 (11:57 +0000)]
Bug 20399: DBRev 19.12.00.057

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20399: (QA follow-up) Remove mention of INTRAdidyoumean from text and delete...
Katrin Fischer [Wed, 25 Mar 2020 20:34:46 +0000 (21:34 +0100)]
Bug 20399: (QA follow-up) Remove mention of INTRAdidyoumean from text and delete commented code

Removes some last "remains" of INTRAdidyoumean.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20399: Remove "did you mean" for the staff interface
Fridolin Somers [Thu, 19 Mar 2020 14:59:39 +0000 (17:59 +0300)]
Bug 20399: Remove "did you mean" for the staff interface

The amdin page for the "did you mean" feature has two block for setting it up in the staff interface, and a note saying this isn't implemented on the staff interface yet.
We remove the part about the staff interface until it actually is implemented.

Test plan :
1) Apply patch
2) Go to Administration > Did you mean?
3) See there is only the OPAC block
4) Change some checkboxes
5) Save configuration
6) Check that configuration is saved

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20415: DBRev 19.12.00.056
Martin Renvoize [Thu, 26 Mar 2020 11:54:44 +0000 (11:54 +0000)]
Bug 20415: DBRev 19.12.00.056

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20415: Add POD
Kyle M Hall [Wed, 25 Mar 2020 13:27:30 +0000 (09:27 -0400)]
Bug 20415: Add POD

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
4 years agoBug 20415: Remove UseKohaPlugins system preference
Fridolin Somers [Thu, 19 Mar 2020 14:22:30 +0000 (17:22 +0300)]
Bug 20415: Remove UseKohaPlugins system preference

Owen Leonard 2018-03-16 10:47:47 UTC :
<<
I don't think the system preference adds any security. There are already multiple permissions required for working with plugins:

- Configure plugins
- Manage plugins ( install / uninstall )
- Use report plugins
- Use tool plugins

And even with those permissions your server must be configured to allow the use of plugins.
>>

Test plan :
1) Install kitchen sink plugin https://github.com/bywatersolutions/koha-plugin-kitchen-sink
2) Run misc/devel/install_plugins.pl
3) Set config enable_plugins=1
4) Check all parts of the plugin are working
5) Set config enable_plugins=0
6) Check all parts of the plugin are disabled

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>