koha.git
11 months agoBug 33105: DBRev 23.06.00.011
Tomas Cohen Arazi [Thu, 20 Jul 2023 13:54:11 +0000 (10:54 -0300)]
Bug 33105: DBRev 23.06.00.011

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: Avoid using $c->validation
Tomas Cohen Arazi [Thu, 20 Jul 2023 13:43:36 +0000 (10:43 -0300)]
Bug 33105: Avoid using $c->validation

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: Add missing POD
Tomas Cohen Arazi [Thu, 20 Jul 2023 13:29:52 +0000 (10:29 -0300)]
Bug 33105: Add missing POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: Tidy files
Tomas Cohen Arazi [Thu, 20 Jul 2023 13:24:41 +0000 (10:24 -0300)]
Bug 33105: Tidy files

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: Redirect to 404 if no vendor exists
Jonathan Druart [Fri, 7 Jul 2023 08:03:36 +0000 (10:03 +0200)]
Bug 33105: Redirect to 404 if no vendor exists

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: Fix vendor api spec
Jonathan Druart [Fri, 7 Jul 2023 07:55:15 +0000 (09:55 +0200)]
Bug 33105: Fix vendor api spec

vendor ID must be integer and date attributes should specify the format
accordingly.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: (QA follow-up) REST API
Marcel de Rooy [Fri, 7 Jul 2023 06:58:41 +0000 (06:58 +0000)]
Bug 33105: (QA follow-up) REST API

Includes removing q_header.
Inconsistent use of quotes for response codes.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: (QA follow-up) Changes for Koha objects
Marcel de Rooy [Fri, 7 Jul 2023 06:57:37 +0000 (06:57 +0000)]
Bug 33105: (QA follow-up) Changes for Koha objects

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: (QA follow-up) Small changes in dbrev
Marcel de Rooy [Fri, 7 Jul 2023 06:41:27 +0000 (06:41 +0000)]
Bug 33105: (QA follow-up) Small changes in dbrev

Similar edit in kohastructure added.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: DBIC specific
Jonathan Druart [Tue, 11 Apr 2023 20:38:45 +0000 (22:38 +0200)]
Bug 33105: DBIC specific

Signed-off-by: Jonathan Field <jonathan.fieeld@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: [DBIx] Schema changes
Marcel de Rooy [Fri, 30 Jun 2023 09:55:14 +0000 (09:55 +0000)]
Bug 33105: [DBIx] Schema changes

Former patches did not apply anymore. Refreshed them.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: Add tests
Jonathan Druart [Wed, 12 Apr 2023 08:45:33 +0000 (10:45 +0200)]
Bug 33105: Add tests

Signed-off-by: Jonathan Field <jonathan.fieeld@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: REST API specs
Jonathan Druart [Tue, 11 Apr 2023 21:12:18 +0000 (23:12 +0200)]
Bug 33105: REST API specs

Signed-off-by: Jonathan Field <jonathan.fieeld@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: Add vendor issues
Jonathan Druart [Tue, 11 Apr 2023 21:01:53 +0000 (23:01 +0200)]
Bug 33105: Add vendor issues

This patch is the main patch of this patch set, it contains the
controller acqui/vendor_issues.pl, its corresponding template, and some
links to this script.

It adds:
* A new DB table aqbookseller_issues linked with the aqbooksellers table
* A new subpermission acquisition.issue_manage
* A new authorised value category VENDOR_ISSUE_TYPE and two examples
MAINTENANCE and OUTAGE
* A new controller couple acqui/vendor_issues.[pl,tt]

Test plan:
0. Apply the patches, run updatedatabase and restart_all
1. Go to the acquisition module, create a new vendor or use an existing
one
2. Create a couple of issues for this vendor
3. Edit/Delete and search for those issues

This is the basics for tracking issues with vendors.
Suggestions welcome, on follow-up bug reports.

Signed-off-by: Jonathan Field <jonathan.fieeld@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: Add Koha object classes
Jonathan Druart [Tue, 11 Apr 2023 21:01:02 +0000 (23:01 +0200)]
Bug 33105: Add Koha object classes

Signed-off-by: Jonathan Field <jonathan.fieeld@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33105: DB changes
Jonathan Druart [Tue, 11 Apr 2023 13:17:24 +0000 (15:17 +0200)]
Bug 33105: DB changes

Signed-off-by: Jonathan Field <jonathan.fieeld@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34178: (QA follow-up) Tidy
Martin Renvoize [Wed, 19 Jul 2023 09:24:32 +0000 (10:24 +0100)]
Bug 34178: (QA follow-up) Tidy

Tidy the relevant lines to pass the new QA rules

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34178: Adjust tests
Nick Clemens [Fri, 30 Jun 2023 19:32:36 +0000 (19:32 +0000)]
Bug 34178: Adjust tests

We need to clear the cache when changing rules/statuses

To test:
1 - prove -v t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34178: Cache ItemsAnyAvailableAndNotRestricted in memory and don't precalculate
Nick Clemens [Fri, 30 Jun 2023 19:26:40 +0000 (19:26 +0000)]
Bug 34178: Cache ItemsAnyAvailableAndNotRestricted in memory and don't precalculate

There are several places in the code where we precalculate ItemsAnyAvailableAndNotRestricted to avoid
looping on this routine when calling IsAvailableForItemLevelRequest on a list of items form a biblio

The value of ItemsAnyAvailableAndNotRestricted is only used when there is a circulation rule for
'onshelfholds' with a value of '2' (If all unavailable)

Rather than calculate a value that may never be used, let's cache this value per request when we do
calculate it - and reuse the cached value

To test:
 1 - Apply patch
 2 - Set circulation rule 'On shelf holds allowed' as 'If all unavailable'
    make sure the rule applies to all of the items/patrons you test with
 3 - Find a record with two items that are available
 4 - Try to place a hold for a patron - not allowed
 5 - Check out one item to another patron
 6 - Attempt hold - still not allowed
 7 - Check out second item to another patron
 8 - Attempt hold - allowed!
 9 - Apply patch
10 - Cancel and replace hold - it is allowed!
11 - Check in one item, and cancel hold
12 - Place hold - not allowed!
13 - Check in second item
14 - Place hold - not allowed!
15 - prove -v t/db_dependent/Holds/DisallowHoldIfItemsAvailable.t

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 28493: Make koha-passwd display the username
Mason James [Wed, 21 Sep 2022 11:38:59 +0000 (23:38 +1200)]
Bug 28493: Make koha-passwd display the username

to test...

1/ run command
 $ sudo koha-passwd dev1
 Password for dev1: CraZyPa$$WoRD!!
 Press enter to clear the screen...
 ^C

2/ apply patch

3/ run command again, note 'username' section
 $ sudo koha-passwd dev1
 Username for dev1: koha_dev1  <<<<<<<<<<<<
 Password for dev1: CraZyPa$$WoRD!!
 Press enter to clear the screen...
 ^C

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34279: Don't enforce overduefinescap unless it is greater than 0
Kyle M Hall [Fri, 14 Jul 2023 11:36:47 +0000 (07:36 -0400)]
Bug 34279: Don't enforce overduefinescap unless it is greater than 0

When creating a circ rule, we can set overduefinescap to blank or 0 and no cap is enforced. If we edit that rule, the blank/0 is converted to "0.00" which perl considers true, thus zero-ing out any calculated fine.

Considering we've always ignored an overdue fines cap of 0, we should also ignore 0.00. However, perl is evaluating it as a string which makes it true instead of false as 0 is.

Test Plan:
1) Apply the first patch ( unit tests )
2) prove t/db_dependent/Circulation/CalcFine.t
3) Note the test fails
4) Apply the second patch as well
5) prove t/db_dependent/Circulation/CalcFine.t
6) Note the test passes

Test Plan 2:
1) Create an all/all/all rule with an overduefinescap of 0.00, with a
   daily fine. Enable CalculateFinesOnReturn
2) Backdate a checkout so it is overdue
3) Return this item, note the lack of a fine
4) Apply this patch set
5) Backdate a checkout and return it again
6) Note the fine is generated!

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34279: Unit tests
Kyle M Hall [Fri, 14 Jul 2023 11:32:11 +0000 (07:32 -0400)]
Bug 34279: Unit tests

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 32271: (QA follow-up) Restore $Price filtering for valid values
Martin Renvoize [Wed, 19 Jul 2023 11:41:28 +0000 (12:41 +0100)]
Bug 32271: (QA follow-up) Restore $Price filtering for valid values

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 32271: (QA follow-up) Correction to 'can_be_blank' logic
Martin Renvoize [Wed, 19 Jul 2023 11:31:14 +0000 (12:31 +0100)]
Bug 32271: (QA follow-up) Correction to 'can_be_blank' logic

The logic introducing the can_be_blank check into the monetary decimal
format check was flawed and meant we were no longer checking decimal
formatting in the majority of cases. This patch updates that so we pass
the unit tests and correctly check any value passed that's not an empty
string.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 32271: Unit test
Martin Renvoize [Wed, 19 Jul 2023 11:11:50 +0000 (12:11 +0100)]
Bug 32271: Unit test

Add a unit test for the allow blank option added to the monetary check
in CirculationRules.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 32271: (QA follow-up) Convert all positive numbers to monetary float and convert...
Kyle M Hall [Fri, 14 Jul 2023 13:08:51 +0000 (09:08 -0400)]
Bug 32271: (QA follow-up) Convert all positive numbers to monetary float and convert all 0 equivilents to blank value

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 32271: Fix overdue fines cap (amount) set to 0.00 when editing rule.
Géraud Frappier [Mon, 5 Dec 2022 17:30:40 +0000 (12:30 -0500)]
Bug 32271: Fix overdue fines cap (amount) set to 0.00 when editing rule.

Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33444: (QA follow-up) Add forgotten skipfinecalc in POD
Marcel de Rooy [Tue, 18 Jul 2023 11:18:35 +0000 (11:18 +0000)]
Bug 33444: (QA follow-up) Add forgotten skipfinecalc in POD

No test plan needed.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33444: (QA follow-up) Tidy block in automatic_renewals.pl
Marcel de Rooy [Tue, 18 Jul 2023 11:10:22 +0000 (11:10 +0000)]
Bug 33444: (QA follow-up) Tidy block in automatic_renewals.pl

Resolves:
The file is less tidy than before (bad/messy lines before: 94, now: 101)

Test plan:
Run qa tools.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33444: Update AddRenewal to take a hashref of params
Nick Clemens [Fri, 7 Apr 2023 14:54:36 +0000 (14:54 +0000)]
Bug 33444: Update AddRenewal to take a hashref of params

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Removed skip_record_index => 1 from automatic_renewals.pl. See BZ.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34133: Set default sort on first column (ID) desc
Pedro Amorim [Tue, 27 Jun 2023 15:00:00 +0000 (15:00 +0000)]
Bug 34133: Set default sort on first column (ID) desc

Test plan:

Before applying patch:
* Open incognito at /cgi-bin/koha/ill/ill-requests.pl,
* Verify order is by ASC (lowest ID first)
* Close incognito

Apply patch, then:
* Open incognito at /cgi-bin/koha/ill/ill-requests.pl,
* Verify order is by DESC (highest ID first)

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan from Bugzilla, and added it above.
Works as advertised.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33992: Only consider the date when auto-expiring problematic recalls
Aleisha Amohia [Tue, 13 Jun 2023 05:29:22 +0000 (17:29 +1200)]
Bug 33992: Only consider the date when auto-expiring problematic recalls

This patch carries this fix into the misc/cronjobs/recalls/expire_recalls.pl cronjob so that recalls are automatically expired when they have been waiting a problematic number of days, not considering hours, as expected.

To test, follow the test plan from the first patch. This will set you up with a waiting problematic recall.

Run the cronjob manually

perl misc/cronjobs/recalls/expire_recalls.pl

Refresh your 'Recalls awaiting pickup' page. Your problematic recall should be gone/expired.

Expiration dates will apply when expiring any 'unfulfilled' recall i.e. newly requested, overdue to be returned, and awaiting pickup.

Sponsored-by: Auckland University of Technology
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: (follow-up) Lower the two digits requirement
Tomas Cohen Arazi [Wed, 19 Jul 2023 14:51:54 +0000 (11:51 -0300)]
Bug 33028: (follow-up) Lower the two digits requirement

This patch makes the code not require two decimal digits, as the main
intention here is to forbid (locale) formatted strings to reach the DB.

The number of digits we support needs to be discussed on its own bug,
and a centralized check implemented.

This patch fixes tests:

prove t/db_dependent/Circulation.t
t/db_dependent/Circulation.t .. 1/67 Exception 'Koha::Exceptions::CirculationRule::NotDecimal' thrown 'The circulation rule expected a decimal value' with name => fine, value => 0.1
t/db_dependent/Circulation.t .. Dubious, test returned 11 (wstat 2816, 0xb00)
Failed 53/67 subtests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: (follow-up) Add POD to new Exception
Martin Renvoize [Wed, 19 Jul 2023 10:26:59 +0000 (11:26 +0100)]
Bug 33028: (follow-up) Add POD to new Exception

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: Unit tests
Martin Renvoize [Wed, 19 Jul 2023 10:21:46 +0000 (11:21 +0100)]
Bug 33028: Unit tests

Add unit tests for is_monetary functionality introduced in the
CirculationRules module.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: Make exception less generic
Tomas Cohen Arazi [Tue, 18 Jul 2023 18:05:50 +0000 (15:05 -0300)]
Bug 33028: Make exception less generic

While testing this bug I found Circulation.t was failing, but the
exception doesn't actually display anything useful in terms of helping
debug what's going on.

This patch makes it add the rule_name and rule_value to the message.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: (QA follow-up) Tidy introduced code
Tomas Cohen Arazi [Tue, 18 Jul 2023 17:28:27 +0000 (14:28 -0300)]
Bug 33028: (QA follow-up) Tidy introduced code

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: DBRev 23.06.00.010
Tomas Cohen Arazi [Tue, 18 Jul 2023 17:24:46 +0000 (14:24 -0300)]
Bug 33028: DBRev 23.06.00.010

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: Perltidy database update script
Katrin Fischer [Tue, 11 Jul 2023 13:23:40 +0000 (13:23 +0000)]
Bug 33028: Perltidy database update script

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: Throw exception if not passed a decimal number
Martin Renvoize [Mon, 3 Jul 2023 12:45:28 +0000 (13:45 +0100)]
Bug 33028: Throw exception if not passed a decimal number

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: (follow-up) Apply unformat_price to decimal fields
Martin Renvoize [Tue, 27 Jun 2023 15:54:02 +0000 (16:54 +0100)]
Bug 33028: (follow-up) Apply unformat_price to decimal fields

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: (follow-up) Add unformat_price js function
Martin Renvoize [Tue, 27 Jun 2023 15:22:36 +0000 (16:22 +0100)]
Bug 33028: (follow-up) Add unformat_price js function

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: (follow-up) Rewrite database update
Katrin Fischer [Fri, 16 Jun 2023 17:01:52 +0000 (17:01 +0000)]
Bug 33028: (follow-up) Rewrite database update

This rewrite the database update with some things in mind:

* We now use a positive value list of allowed characters to check
  This makes sure that all of those are recognized:
  1,00
  1.00€
  abc
* Instead of dying after finding one wrong value, we loop through
  all values first, building up an error string
* When we have errors... we die and print the full list of things
  that need fixing.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: Add TT filters for Price and pattern checks to input fields
Katrin Fischer [Fri, 16 Jun 2023 16:59:22 +0000 (16:59 +0000)]
Bug 33028: Add TT filters for Price and pattern checks to input fields

With this patch, all monetary values in the table will be displayed
formatted.

Also, the input will be checked against our agreed pattern to make
sure no false values can be entered.

Missing: When editing a rule, we need to unformat the value, so that
instead of the display format we have the input format available
for editing.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: Add is_monetary to recall_overdue_fine and article_request_fee
Katrin Fischer [Fri, 16 Jun 2023 16:57:51 +0000 (16:57 +0000)]
Bug 33028: Add is_monetary to recall_overdue_fine and article_request_fee

This patch marks the 2 missing monetary values for recal over due fines
and article request fees as monetary.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: (follow-up) Fix trailing 0 decimals
Martin Renvoize [Fri, 3 Mar 2023 11:33:46 +0000 (11:33 +0000)]
Bug 33028: (follow-up) Fix trailing 0 decimals

We want to recognise the truthyness of a number vs string so we drop
trailing decimals if they're just 0.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: (follow-up) Move monetary definition into hash
Martin Renvoize [Fri, 3 Mar 2023 11:28:20 +0000 (11:28 +0000)]
Bug 33028: (follow-up) Move monetary definition into hash

This patch moves the defintion of monetary rule type into the rule kinds
hash.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33028: Fix calculations around cronjob fines.pl
Thibaud Guillot [Tue, 21 Feb 2023 16:05:45 +0000 (17:05 +0100)]
Bug 33028: Fix calculations around cronjob fines.pl

When currency format is set on FR commas are decimals separators
but when cron like fines.pl try to calculate fines it's fails due to
this format.

I changed this behavior by targetted 'fine' and 'overduefinescap' in
circulation_rules.rule_name to unformat them when we save them.

This also fix the display in smart_rules table (before with commas price
was not good displayed - without decimals)

Test Plan :
1) Set your currency format on 'FR' and 'fine' OR/AND 'overduefinescap'
with commas
2) Be sure to have some patron overdues
3) Run ~/misc/cronjobs/fines.pl with args to find overdues
4) See an error like 'isn't numeric in substraction[..] or gt > [...]'
5) Run updatedatabase script (it will replace commas in your rules
changed in step 1) )
6) Repeat step 3 and see that everything was going "fine" (:tada:)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33671: (follow-up) Disable FK check for column change
Marcel de Rooy [Wed, 12 Jul 2023 14:09:35 +0000 (14:09 +0000)]
Bug 33671: (follow-up) Disable FK check for column change

See also BZ report. As suggested by Tomas.

NOTE: The dbrev is extended too for removing records with a failing guarantor_id
foreign key (theoretically not present obviously).

Test plan:
1) cp installer/data/mysql/db_revs/220600048.pl installer/data/mysql/atomicupdate/
2) Run updatedatabase.pl
3) Remove copied file

Bonus:
Manually remove FK constraint before running updatedatabase.
Insert a record with bad guarantor_id into relationships manually.
Run the update again.
You should not see the message that the constraint is removed.
Is the bad record count reported and record removed?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[EDIT] Simplified. No longer removes the FK. Just disables during ALTER.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34303: Only perlcritic files from git repo
Marcel de Rooy [Tue, 18 Jul 2023 10:59:33 +0000 (10:59 +0000)]
Bug 34303: Only perlcritic files from git repo

Test plan:
Run t/00-testcritic.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
JD amended patch: tidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33046: Use process_tt in C4::Reports::Guided::EmailReport
Kyle Hall [Wed, 22 Feb 2023 18:23:09 +0000 (13:23 -0500)]
Bug 33046: Use process_tt in C4::Reports::Guided::EmailReport

Bug 33030 implements a new helper subroutine to standardize processing of Template Toolkit syntax outside slips and notices. We should use this subroutine in EmailReport.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Reports/Guided.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33041: Use process_tt in C4::Serial::NewIssue
Kyle Hall [Wed, 22 Feb 2023 16:47:12 +0000 (11:47 -0500)]
Bug 33041: Use process_tt in C4::Serial::NewIssue

Bug 33030 implements a new helper subroutine to standardize processing of Template Toolkit syntax outside slips and notices. We should use this subroutine in C4::Serial::NewIssue

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Items.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 31339: Add staff wrapper template include for tool plugins
David Cook [Tue, 23 Aug 2022 06:27:59 +0000 (06:27 +0000)]
Bug 31339: Add staff wrapper template include for tool plugins

This change adds a template include which can be used as a
WRAPPER for tool plugins, which makes it easy to pages in tool
templates without having to copy and maintain a lot of template
boilerplate.

Test plan:
0. Apply patch and koha-plack --restart kohadev
1. Upload koha-plugin-test-wrapper
2. Enable the plugin
3. Click "Actions" and click "Run tool"
4. Note how the plugin page looks like a perfect Koha Tools page
5. Note that the plugin only contains 6 lines of template code
to achieve this effect

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 29471: Add display of MARC 520 to staff interface detail page
Katrin Fischer [Fri, 30 Jun 2023 14:22:17 +0000 (14:22 +0000)]
Bug 29471: Add display of MARC 520 to staff interface detail page

At the moment 520 only displays in the OPAC. With this patch it
also displays in the staff interface detail page.

To test:
* Find a record with 520 or add some 520 entries to a record
  Note: different ind. 1 values will result in different labels
* View the record in the staff interface and the OPAC
* Verify only the OPAC shows the 520 entries
* Apply patch
* Verify now the staff interface displays them as well

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Updated patch for displaying $u as link.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Restored signoff line from Phil. Change only for $u.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 29732: Check alert in cataloguing authorities should be a static message
Owen Leonard [Tue, 27 Jun 2023 13:40:07 +0000 (13:40 +0000)]
Bug 29732: Check alert in cataloguing authorities should be a static message

This patch modifies the authority record editor so that form
validation errors are collected in a static "dialog" at the top of the
page instead of showing in a transient JavaScript alert.

The text of the message is roughly the same as it was in the alert, and
links have been added so that the user can click to jump directly to the
field referenced.

If the user scrolls down away from the static error message, a button
appears in the floating toolbar to jump back to the message.

- Go to Authorities and create a new authority record using a framework
  which has multiple mandatory fields defined
  (e.g. an unmodified default framework)
- Without entering anything in mandatory fields, click the "Save"
  button.
- You should see a message box appear at the top of the page.
  - It should list each missing mandatory subfield and tag, each with a
    "Go to field" link next to it.
  - Clicking the "Go to field" link should switch you to the correct tab
    and scroll the mandatory field into view.
- When you have scrolled down far enough for the error messages to be
  offscreen, an "Errors" button should appear in the floating toolbar.
  Clicking it should scroll the box back into view.
- If you fix some but not all of the missing mandatory fields the
  message should update with only the current issues.
- Confirm that the record saves when all issues are resolved.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33270: (QA follow-up) Do not change param hashref
Marcel de Rooy [Mon, 17 Jul 2023 10:59:26 +0000 (10:59 +0000)]
Bug 33270: (QA follow-up) Do not change param hashref

Might just be a theoretical thing now, but safer to clone.

Test plan:
Run t/db_dependent/Koha/Biblio/Metadata.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33270: (QA follow-up) Tidy
Marcel de Rooy [Mon, 17 Jul 2023 10:52:03 +0000 (10:52 +0000)]
Bug 33270: (QA follow-up) Tidy

Resolve:
WARN   tidiness
  The file is less tidy than before (bad/messy lines before: 21, now: 24)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33270: (follow-up) Handle records that fail attempt to ignore bad characters
Nick Clemens [Tue, 11 Jul 2023 13:59:50 +0000 (13:59 +0000)]
Bug 33270: (follow-up) Handle records that fail attempt to ignore bad characters

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33270: Attempt to recover from invalid metadata exception
Nick Clemens [Thu, 22 Jun 2023 11:22:18 +0000 (11:22 +0000)]
Bug 33270: Attempt to recover from invalid metadata exception

This patch uses the new record_strip_nonxml routine to attempt to display
the record when it contains invalid characters

Rather than silently strippg these, we warn in the logs, then add an 'about'
container to the response. It is displayed nicely in the web view or sent as "INVALID_METADATA" in
the xml response

The 'error' codes for OAI seem to be at the request level, and the offered codes don't have a match
for a bad record. Adding the about when we can recover seems the most generous response

To test:
Test plan, assumes using KTD default data - otherwise you need to find and import a record with encoding issues:
 1 - Enable OAI-PMH system preference
 2 - Browse to:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&resumptionToken=marcxml/350////0/0/352
 3 - 500 error:
    Invalid data, cannot decode metadata object (biblio_metadata.id=368, biblionumber=369, format=marcxml, schema=MARC21, decoding_error=':8: parser error : PCDATA invalid Char value 31...
 4 - Apply patch, restart all
 5 - Reload the page
 6 - It loads!
 7 - Click 'Metadata' for record 369 - it succeeds!
 8 - Check the logs - confirm you see a warning of the record problem
 9 - Confirm 369 has an about section
10 - Check the individul 'GetRecord' response as well
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=GetRecord&metadataPrefix=oai_dc&identifier=KOHA-OAI-TEST:369

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33270: Add record_strip_nonxml routine to Koha::Biblio::Metadata
Nick Clemens [Fri, 23 Jun 2023 13:08:31 +0000 (13:08 +0000)]
Bug 33270: Add record_strip_nonxml routine to Koha::Biblio::Metadata

This adds a routine that can strip non xml characters form a record.
It is intended for cases where we do not wish to throw an exception,
but rather need to process a record to allow other work to continue

To test:
prove -v t/db_dependent/Koha/Biblio/Metadata.t

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33043: Use process_tt in SIP modules
Kyle Hall [Wed, 22 Feb 2023 17:00:07 +0000 (12:00 -0500)]
Bug 33043: Use process_tt in SIP modules

Bug 33030 implements a new helper subroutine to standardize processing of
Template Toolkit syntax outside slips and notices. We should use this
subroutine in the various parts of the SIP server code where we are
currently using Template::process directly.

Test Plan:
1) Apply this patch
2) prove -r t/db_dependent/SIP

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34251: When using the fast add framework in addbiblio.pl there is thrown a JS...
Jan Kissig [Wed, 12 Jul 2023 08:40:32 +0000 (10:40 +0200)]
Bug 34251: When using the fast add framework in addbiblio.pl there is thrown a JS error in selectTab( "#tab0XX_panel" );

This is because no nav tabs are build in addbiblio.tt as BIG_LOOP has a
length(size) of 1

To test:

1) go to More>Cataloging
2) click +New record
3) Click Settings> Fast add framework
4) take a look on console
5) try selecting a different framework now, will have no effect
6) apply patch and redo steps 1 to 5
7) there should be no error in console and a change in settings works a
   expected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34288: Unit tests
Tomas Cohen Arazi [Mon, 17 Jul 2023 15:08:34 +0000 (12:08 -0300)]
Bug 34288: Unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34288: (follow-up) Tidy block
Tomas Cohen Arazi [Mon, 17 Jul 2023 13:22:39 +0000 (10:22 -0300)]
Bug 34288: (follow-up) Tidy block

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34288: Allow access to the cataloguing module with `tools` permission
Tomas Cohen Arazi [Fri, 14 Jul 2023 23:15:41 +0000 (20:15 -0300)]
Bug 34288: Allow access to the cataloguing module with `tools` permission

Bug 31162 moved the cataloguing tools to a new cataloguing module home
page. This prevents people without cataloguing permissions, but with
some tools permissions to access things like the labels creator tool.

I tracked all permissions on the cataloging-home.tt template, including
the Stock Rotation ones which I initially missed because I was focusing
on tools.

This patch makes the cataloging-home.pl page require either
'cataloguing' or any relevant 'tools' permission to allow access. the
page.

The staff interface main page and the top bar dropdown are updated using
the same logic to display the cataloguing module link.

For that purpose, I wrapped the permissions on a sub in `C4::Auth`.

To test:
1. Have a patron with only 'catalogue' and some of this permissions:

* inventory
* items_batchdel
* items_batchmod
* items_batchmod
* label_creator
* manage_staged_marc
* marc_modification_templates
* records_batchdel
* records_batchmod
* stage_marc_import
* upload_cover_images
* stockrotation => manage_rotas

2. Log in
=> FAIL: No link to the cataloguing module, neither in the dropdown
3. Apply this patch
4. Repeat 2
=> SUCCESS: You have the link!
5. Play with the different combinations and notice things are sound and
   correct
6. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33745: Tell perlcritic we know what we are doing
Jonathan Druart [Tue, 18 Jul 2023 08:22:59 +0000 (10:22 +0200)]
Bug 33745: Tell perlcritic we know what we are doing

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33030: Add unit tests
Kyle Hall [Fri, 10 Mar 2023 15:20:07 +0000 (10:20 -0500)]
Bug 33030: Add unit tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33030: Add standardized subroutine for processing Template Toolkit syntax outside...
Kyle Hall [Tue, 21 Feb 2023 19:17:09 +0000 (14:17 -0500)]
Bug 33030: Add standardized subroutine for processing Template Toolkit syntax outside of notices

Koha has evolved to use Template Toolkit for many uses outside of generating slips and notices for patrons. Historically, each of these areas processed template toolkit in a slightly different way. We should add a module to allow Template Toolkit syntax to be processed in a standard and generic way such that all non-notice TT syntax is handled and processed the consistently.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/Koha/Items.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 29762: (follow-up) Change field names from phone to primary phone
Katrin Fischer [Sun, 9 Jul 2023 14:08:51 +0000 (14:08 +0000)]
Bug 29762: (follow-up) Change field names from phone to primary phone

This change is made in order to make sure that the labels on the
normal patron form and the batch patron edit tool match up.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 29762: Change field names from "Mobile" to "Other phone"
Philip Orr [Fri, 7 Jul 2023 13:21:46 +0000 (13:21 +0000)]
Bug 29762: Change field names from "Mobile" to "Other phone"

This Patch changes the field name for "Mobile" to "Other phone"
in Patron batch modification.

To test:
1. Apply the patch
2. Go to Tools -> Batch Patron Modification and add some patrons
3. Hit "continue"
4. Verify that in the list of patrons you selected, the field
"Mobile" has been replaced by the field "Other phone"
5. Verify that down below in the fields to be batch modified,
the field "Mobile" has also been replaced by the field "Other
phone"
6. Add some data into the field "Other phone" (e.g. 12345 or
some other number) and hit save
7. Confirm that the field was correctly modified and is still
named "Other phone"

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: Fix xt/api.t
Tomas Cohen Arazi [Fri, 14 Jul 2023 19:32:10 +0000 (16:32 -0300)]
Bug 30979: Fix xt/api.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34232: (QA follow-up) Remove superfluous "Use:" from each list entry
Katrin Fischer [Mon, 10 Jul 2023 21:30:41 +0000 (21:30 +0000)]
Bug 34232: (QA follow-up) Remove superfluous "Use:" from each list entry

We do have a heading "Use existing item groups" above the
entries. The added "Use:" in front of each entry is not requires and
makes entries longer and harder to scan.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34232: Make dropdown on additem page rescept display order
Lucas Gass [Fri, 7 Jul 2023 19:31:15 +0000 (19:31 +0000)]
Bug 34232: Make dropdown on additem page rescept display order

To test:
1. EnableItemGroups
2. Find a record and add some new item groups with different display orders
3. Now edit an item on the record and scroll down to the dropdown underneath "+ Add to item group"
4. Notice that the values in the dropdown do not respect the display order.
5. Apply patch and restart_all
6. The display order should now be respected

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33745: (QA follow-up) Tidy
Marcel de Rooy [Fri, 14 Jul 2023 09:29:59 +0000 (09:29 +0000)]
Bug 33745: (QA follow-up) Tidy

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33745: (QA follow-up) Remove goto
Marcel de Rooy [Fri, 14 Jul 2023 09:28:54 +0000 (09:28 +0000)]
Bug 33745: (QA follow-up) Remove goto

Test plan:
Prove t/db_dependent/Koha
Run the benchmark (on BZ) again

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33745: Lazily create attribute accessor methods in AUTOLOAD
David Gustafsson [Tue, 16 May 2023 11:42:55 +0000 (13:42 +0200)]
Bug 33745: Lazily create attribute accessor methods in AUTOLOAD

Lazily create accessor methods when getting or setting an Koha::Object
attribute resulting in a significant speed up.

To test:
1) Run the benchmark.pl script
2) Apply the patch
3) Run the script again, Koha::Object accessors should be about 7 times faster
5) Ensure tests in t/db_dependent/Item.t still pass

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33808: Add aria-labels in reports-toolbar.inc
Matt Blenkinsop [Tue, 23 May 2023 14:01:40 +0000 (14:01 +0000)]
Bug 33808: Add aria-labels in reports-toolbar.inc

This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33808: Add aria-labels in basket.tt
Matt Blenkinsop [Tue, 23 May 2023 14:00:59 +0000 (14:00 +0000)]
Bug 33808: Add aria-labels in basket.tt

This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33808: Add aria-labels in opac-basket.tt
Matt Blenkinsop [Tue, 23 May 2023 14:00:11 +0000 (14:00 +0000)]
Bug 33808: Add aria-labels in opac-basket.tt

This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33808: Add aria-labels in opac-shelves.tt
Matt Blenkinsop [Tue, 23 May 2023 13:58:13 +0000 (13:58 +0000)]
Bug 33808: Add aria-labels in opac-shelves.tt

This patch adds an aria-label and an aria-haspopup to Download buttons
identified as non-descriptive in accessibility testing

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34209: Follow up on Bug 28726 - move whole 'select all ...' header into condition
Michael Hafen [Wed, 5 Jul 2023 17:17:09 +0000 (11:17 -0600)]
Bug 34209: Follow up on Bug 28726 - move whole 'select all ...' header into condition

Move the whole search header div into the checkbox column condition, so
that other patron search popups don't have an empty div.

To test:
* Activate the ERM module
* Create a new agreement
* Search for a user using the pop-up search
* Verify there is an empty div showing as grey box above the table
* Go to tools > label creator > new batch
* Search for patrons
* Verify the box isn't empty and shows the select all ... options
* Apply patch
* Repeat steps, verify the empty div is gone and the options remain

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34182: Don't set biblio.serial based on biblio.seriestitle in AddBiblio
Phil Ringnalda [Sat, 1 Jul 2023 15:41:15 +0000 (08:41 -0700)]
Bug 34182: Don't set biblio.serial based on biblio.seriestitle in AddBiblio

A misunderstanding of the intention of some dead code that probably wanted
to set biblio.series (which doesn't exist) left us setting biblio.serial
if biblio.seriestitle was set. The only thing series and serial have in
common is the first four letters. We shouldn't set serial on something
with a series (unless someone also sets serial on it, of course).

Test plan:
 1. Administration - MARC bibliographic framework - Actions button next to
    Default framework - MARC structure
 2. In the Search for tag input type 942 and click search
 3. Actions button next to 942 - Edit subfields
 4. Tab s - check the checkbox for Editor, uncheck the checkbox for
    Collapsed - Save changes
 5. Cataloging - New record
 6. Click in the input for 000 and hold down Tab until you get past 008
    to fill in mandatory default values, then type any character in 040
    subfield c
 7. Tab 2 - In 245 subfield a type Series not serial
 8. Tab 4 - In 490 subfield a type any character
 9. Tab 9 - Set the value of subfield c to Books
10. Click save and leave the tab open to keep the biblionumber
11. Cataloging - New record - repeat step 6
12. Tab 2 - In 245 subfield a type Serial not series
13. Tab 9 - Set the value of subfield c to Books - Type 1 in subfield s
14. Click save, the biblionumber should be one higher than the first one
15. Reports - Create from SQL
16. Type something in Report name, paste in the SQL
SELECT biblio.serial, biblio.seriestitle, biblio.title FROM biblio WHERE
biblionumber IN ("","")
    and put your first biblionumber in the first "", your second in the
    second.
17. Save report - Run report
18. Series not serial should have a blank in the serial column and the
   character you typed in the seriestitle column; Serial not series
   should have a 1 in the serial column and a blank in the seriestitle
   column.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34184: Add empty option for suggestion "document type"
Jonathan Druart [Wed, 5 Jul 2023 10:41:09 +0000 (12:41 +0200)]
Bug 34184: Add empty option for suggestion "document type"

Currently when editing a suggestion, the document type will preselect to the
first entry as we don't have an empty entry.
This can lead to data errors easily.

Test plan:
Create a new suggestion
=> Notice that "document type" is empty by default, pick one
Edit it again
=> Notice that the value is kept and empty can be picked, pick empty
Edit again
=> Empty is selected and saved in DB

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34256: Fix regression from 34092
Pedro Amorim [Fri, 14 Jul 2023 08:37:27 +0000 (08:37 +0000)]
Bug 34256: Fix regression from 34092

It appears search_fields variable got lost somewhere in my own rebases.
search_fields variable was not being considered as it should, in the function.
I think this patch fixes it.

This showed in the borrowernumer no longer being searchable:

* Use search filters in patron search
* Set 'Search field' to borrowernumber
* Search for 19 (Henry) or 41 (koha) in sample data
* No results :(
* Apply patch
* Search leads to the patron record again

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34261: Add missing argument to show_account
Matt Blenkinsop [Wed, 12 Jul 2023 13:22:54 +0000 (13:22 +0000)]
Bug 34261: Add missing argument to show_account

This patch fixes a missing $crypt in the show_account function when deleting an edifact ordering account.

Test plan:
1) In system preferences search for EDIFACT and change EDIFACT to Enable
2) Navigate to Administration > EDI accounts
3) Create a dummy account
4) Try deleting the account using the delete button in the actions column on the far right
5) An error should be thrown - "Can't call method "decrypt_hex" on an undefined value"
6) Apply patch
7) Try deleting the account again
8) This time it should work and show the confirmation dialog box
9) Sign off

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 33939: Preserve order budget dropdowns and default budget dropdowns seperately
Nick Clemens [Wed, 7 Jun 2023 13:20:40 +0000 (13:20 +0000)]
Bug 33939: Preserve order budget dropdowns and default budget dropdowns seperately

The dropdowns have different hints after bug 22802. We need to preserve those when adding
or hiding inactive budgets

To test:
1 - Add some inactive budgets to Koha
2 - Use the settings and file from bug 22802 to stage a file and begin adding to basket
3 - When adding to basket test the 'Show inactive funds' on both the 'Select to import' tab and the 'Default accounting details' tab
4 - Ensure the dropdown hints/defaults don't change when hiding/showing budgets
5 - Confirm inactive budgets are correctly shown/hidden

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 34225: KohaTable broken on batch item deletion and modification results
Owen Leonard [Fri, 7 Jul 2023 12:19:27 +0000 (12:19 +0000)]
Bug 34225: KohaTable broken on batch item deletion and modification results

This patch adds the columns_settings include file to the batch item
modification and batch item deletion templates so that the tables can be
rendered as DataTables.

To test, apply the patch and go to Cataloging -> Batch item
modification.

- Submit a batch of barcodes or item numbers for modification.
- On the next page which shows all the items you submitted, the table
  should be rendered as a DataTable.
- Confirm that sorting, filtering, and export all work correctly.
- Confirm that there are not JS errors in the browser console.
- Perform the same tests on Cataloging -> Batch item deletion.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: DBRev 23.06.00.009
Tomas Cohen Arazi [Fri, 14 Jul 2023 15:05:13 +0000 (12:05 -0300)]
Bug 30979: DBRev 23.06.00.009

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: Fix regression
Tomas Cohen Arazi [Fri, 14 Jul 2023 13:20:27 +0000 (10:20 -0300)]
Bug 30979: Fix regression

This patch fixes a regression introduced by the 'Fix public availability
500' follow-up.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/checkouts.t
=> FAIL: Tests fail!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass! Tests are useful!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: (QA follow-up) Tidy things
Tomas Cohen Arazi [Fri, 14 Jul 2023 13:07:20 +0000 (10:07 -0300)]
Bug 30979: (QA follow-up) Tidy things

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: (QA follow-up) Add missing docs on error codes
Tomas Cohen Arazi [Fri, 14 Jul 2023 12:43:29 +0000 (09:43 -0300)]
Bug 30979: (QA follow-up) Add missing docs on error codes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: (follow-up) Fix public availability 500
Martin Renvoize [Wed, 17 May 2023 18:56:43 +0000 (19:56 +0100)]
Bug 30979: (follow-up) Fix public availability 500

When we introduced the logged in user id to the token generation we
had the knock on effect of creating a 500 response for unauthenticated
availability lookups.

This patch resolves the 500, but results in a token that's not useful
for the end user.  We should consider this in the wider context down the
line.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: Add modal trigger to shibboleth target url
Martin Renvoize [Mon, 20 Feb 2023 17:02:05 +0000 (17:02 +0000)]
Bug 30979: Add modal trigger to shibboleth target url

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: Redirect to checkout summary
Martin Renvoize [Tue, 24 Jan 2023 11:03:40 +0000 (11:03 +0000)]
Bug 30979: Redirect to checkout summary

This is a temporary solution whilst we wait for the biblio api endpoints
so we may include more biblio details in the checkout modal itself.

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: Always show self-checkout when preference enabled
Martin Renvoize [Tue, 17 Jan 2023 14:14:36 +0000 (14:14 +0000)]
Bug 30979: Always show self-checkout when preference enabled

This patch updates the display logic such that if the truested
self-checkout option is enabled we always show the checkout button and
prompt a login when no user is found.

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: Add checkout modal to the OPAC
Martin Renvoize [Mon, 15 Aug 2022 11:19:31 +0000 (12:19 +0100)]
Bug 30979: Add checkout modal to the OPAC

This patch adds a new self checkout modal to the OPAC when
OpacTrustedCheckout is enabled and a user is logged in.

The new modal allows an end user to scan an item barcode to checkout.
We check for item existance and availability and then check the item
out after any confirmations have been displayed.

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: Limit public checkout endpoint using preference
Martin Renvoize [Mon, 6 Mar 2023 17:32:32 +0000 (17:32 +0000)]
Bug 30979: Limit public checkout endpoint using preference

The public api endpoint for self-checkout should only be enabled in the
case where the OpacTrustedSelfCheckout option is enabled.

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: Add 'OpacTrustedCheckout' preference
Martin Renvoize [Mon, 18 Jul 2022 09:22:06 +0000 (10:22 +0100)]
Bug 30979: Add 'OpacTrustedCheckout' preference

This patch adds a new 'OpacTrustedCheckout' system preference to govern
whether the library allows opac users to check out items to themselves
from their OPAC login.

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: Add public endpoints
Martin Renvoize [Fri, 5 May 2023 14:56:27 +0000 (15:56 +0100)]
Bug 30979: Add public endpoints

This patch expands the checkouts endpoints to allow for a public workflow.

We add the availability endpoint under `/public/checkouts/availability`
and restrict the information we send back to only those fields a public
user should be allowed to see.

We also add a new checkout endpoint at `/patrons/{patron_id}/checkouts`
that allows for users to checkout to themselves and accepts the same POST
request with checkout details including item_id and a confirmation token
in the body that the staff client endpoints accept.

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
11 months agoBug 30979: Unit tests
Martin Renvoize [Wed, 10 May 2023 10:24:17 +0000 (11:24 +0100)]
Bug 30979: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>