koha.git
14 months agoBug 32845: Fix cataloguing/value_builder/unimarc_field_124c.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:53 +0000 (11:58 +0100)]
Bug 32845: Fix cataloguing/value_builder/unimarc_field_124c.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 830ea1a099005bd7ca4ae795a319469a804a8bb6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32844: Fix cataloguing/value_builder/unimarc_field_124b.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:53 +0000 (11:58 +0100)]
Bug 32844: Fix cataloguing/value_builder/unimarc_field_124b.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6b0ff0c745a1cf91b0d402f09f65dfbbdc3d3740)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32843: Fix cataloguing/value_builder/unimarc_field_124a.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:53 +0000 (11:58 +0100)]
Bug 32843: Fix cataloguing/value_builder/unimarc_field_124a.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 17e20f4ec4a1674a2faac9df9ad5231ffd9ddaf1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32842: Fix cataloguing/value_builder/unimarc_field_123j.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:53 +0000 (11:58 +0100)]
Bug 32842: Fix cataloguing/value_builder/unimarc_field_123j.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b6964253fb4b166d0a7ad703a42953ff6444f543)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32841: Fix cataloguing/value_builder/unimarc_field_123i.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:53 +0000 (11:58 +0100)]
Bug 32841: Fix cataloguing/value_builder/unimarc_field_123i.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0bc83b3673659f347979ad998dfc9d9400d4c024)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32840: Fix cataloguing/value_builder/unimarc_field_123g.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:53 +0000 (11:58 +0100)]
Bug 32840: Fix cataloguing/value_builder/unimarc_field_123g.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1f152facf7cc44a97cd2670c8ef4ca17a78528fd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32839: Fix cataloguing/value_builder/unimarc_field_123f.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:52 +0000 (11:58 +0100)]
Bug 32839: Fix cataloguing/value_builder/unimarc_field_123f.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3fc800d91a34e36de84611ef3f092eb51f552966)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32838: Fix cataloguing/value_builder/unimarc_field_123e.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:52 +0000 (11:58 +0100)]
Bug 32838: Fix cataloguing/value_builder/unimarc_field_123e.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ff97b1fe439fe3b0a4e521d4c65165137e366f4c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32837: Fix cataloguing/value_builder/unimarc_field_123d.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:52 +0000 (11:58 +0100)]
Bug 32837: Fix cataloguing/value_builder/unimarc_field_123d.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e4ff5f2704843b23853d33f2e99ffd56a5dcec00)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32834: Fix cataloguing/value_builder/unimarc_field_121b.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:52 +0000 (11:58 +0100)]
Bug 32834: Fix cataloguing/value_builder/unimarc_field_121b.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 577a237a3f15a5a3c2e27761a900994e439affcf)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32836: Fix cataloguing/value_builder/unimarc_field_123a.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:52 +0000 (11:58 +0100)]
Bug 32836: Fix cataloguing/value_builder/unimarc_field_123a.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9a8b5003dc7dd2208fcd7ef0e2ae01f4232db17d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 33341: Address some perlcritic errors in 5.36
Tomas Cohen Arazi [Mon, 27 Mar 2023 12:17:31 +0000 (14:17 +0200)]
Bug 33341: Address some perlcritic errors in 5.36

Some old-style code is making our tests fail when run in Debian Testing.

This patch addresses this.

To test:
1. Launch bookworm KTD:
   $ KOHA_IMAGE=master-bookworm ktd up -d
2. Run:
   $ ktd --shell
  k$ prove t/00-testcritic.t
=> FAIL: It fails!
3. Apply the patch
4. Repeat 2
=> SUCCESS: Tests now pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 10d12f999f9b8bff228c9c20f1ca4f0c7144201f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 33133: Move fast cataloging to first column
Nick Clemens [Tue, 14 Mar 2023 13:36:14 +0000 (13:36 +0000)]
Bug 33133: Move fast cataloging to first column

This move the link and adds its own heading

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 909dedd3f648dfc1a2d4c09be5daeb46d8b26c83)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 33133: Add fast cataloging to 'Cataloging' page
Nick Clemens [Fri, 3 Mar 2023 20:23:31 +0000 (20:23 +0000)]
Bug 33133: Add fast cataloging to 'Cataloging' page

This patch adds a check for the existence of the Fast Add framework to
the Koha mainpage and the cataloging home page

If it exists, and the user has fast cataloging permission then there
will be a link to Cataloging on the home page, and to Fast add on the
cataloging page

To test:
1 - Have two patrons, one with superlibrarian and one with only
  catalogue + fast_cataloging
2 - Make sure you have a fast add framework (code:FA)
3 - Have two windows/tabs one with each patron (one private/incognito or
  use two browsers)
4 - View mainpage.pl for both
5 - Superlibrarian has Catalogue link, other does not
6 - Browse to http://localhost:8081/cgi-bin/koha/cataloguing/cataloging-home.pl
7 - Superlibrarian sees stuff, other can access page, but has no buttons
8 - Apply patch
9 - Repeat 4 - both have a link
10 - Repeat 7 - both have a link to fast add
11 - Confirm fast add link works

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 85cfdb1f5bdee7c235516a161770a44e27ff8f62)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32807: Fix cypress tests
Jonathan Druart [Wed, 29 Mar 2023 07:38:50 +0000 (09:38 +0200)]
Bug 32807: Fix cypress tests

Cypress tests were failing, not sure I understand why exactly as I don't
recreate the failure when using the interface. We could simplify the if
logic anyway.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d183715d758735fab4079a25a2fe1d73901a3ae9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32807: Fetch count instead of all entries for agreements and licenses
Jonathan Druart [Wed, 22 Feb 2023 07:48:48 +0000 (08:48 +0100)]
Bug 32807: Fetch count instead of all entries for agreements and licenses

To list agreements and licenses we are retrieving the whole list to
simply know if at least one exists (and display the table that will
fetch the X first elements to display).

We should call count instead.

Test plan:
List agreements and licenses.
If none exists, the table is not displayed but a "There are no...
defined" message instead.
If at least one exists the table must be there

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f781fdb4a231e074b36099d0a724fad576518921)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32003: Add page-section to order search results and fix heading hierarchy
Katrin Fischer [Mon, 2 Jan 2023 22:50:48 +0000 (22:50 +0000)]
Bug 32003: Add page-section to order search results and fix heading hierarchy

This adds a page-section to the order search results and moves
the former second h1 heading 'search results' to a h2 heading
below 'Order search', so we have a proper hierarchy

In acquisitions:
* Make sure you have an order with at least one order line
* Do an empty orders search
* Verify there are 2 h1 headings on the page and the results table doesn't
  have a white background
* Apply patch
* Verify the results list now has a white background and the second
  now smaller heading has been moved into this area

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
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>
(cherry picked from commit 7b2644bf2b0faf22375979bdf0fa8f4f0335425c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32964: (follow-up) Additional rewording for XSLT item display
Marcel de Rooy [Tue, 28 Mar 2023 12:57:10 +0000 (12:57 +0000)]
Bug 32964: (follow-up) Additional rewording for XSLT item display

Test plan:
Check OPAC preferences, OPACResultsMaxItems and siblings.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 487b67c3efdacb206a58ab6a8573707a1068e918)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32964: OPACResultsMaxItemsUnavailable description is misleading
Caroline Cyr La Rose [Tue, 14 Feb 2023 22:01:40 +0000 (17:01 -0500)]
Bug 32964: OPACResultsMaxItemsUnavailable description is misleading

This patch rephrases the last part of the description of the
OPACResultsMaxItemsUnavailable system preference to clarify the link
to the OPACResultsUnavailableGroupingBy option.

It also changes some terminology to follow the guidelines
(capitalization, library instead of branch).

To test:
1. Apply patch
2. Go to Administration > Global system preferences
3. Search for OPACResultsMaxItems
4. Read the sentence for OPACResultsMaxItemsUnavailable, make sure it
makes sense, the grammar and spelling are ok, respects terminology
and capitalization guidelines
5. Try the link in the description, make sure it goes to the correct
syspref
6. Read the sentence and options for OPACResultsUnavailableGroupingBy,
make sure it makes sense, the grammar and spelling are ok, respects
terminology and capitalization guidelines
7. Optionally, try the various options, they should still work as
intended

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f3fb1747752b664dea3df5824c73863f11aacbf8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32945: (QA follow-up) Fix capitalization of id in even more places
Katrin Fischer [Thu, 23 Feb 2023 22:31:09 +0000 (22:31 +0000)]
Bug 32945: (QA follow-up) Fix capitalization of id in even more places

This fixes additional strings pointed out by QA.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d22f885b064f599d753afc94ac7caf0a4ead5ce7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32945: Fix capitalization of id in more places
Katrin Fischer [Fri, 10 Feb 2023 20:49:19 +0000 (21:49 +0100)]
Bug 32945: Fix capitalization of id in more places

id should be spelled ID, ids should be IDs as it's
an abbreviation according to:

https://www.oxfordlearnersdictionaries.com/definition/english/identification

To test:
* Some of these are hard to make happen or require specific
  data, easiest will be to review the patch itself closely.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 956c8fb49117744a56b39a24800e58fed2ba1d7c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32969: (follow-up) Remove obsolete inline CSS
Owen Leonard [Thu, 23 Feb 2023 20:36:38 +0000 (20:36 +0000)]
Bug 32969: (follow-up) Remove obsolete inline CSS

A couple of templates have some inline CSS intended to style jQueryUI
tabs. These instances can be removed:

- opac-readingrecord.tt: Tabs have been replaced with Bootstrap.
- opac-idref.tt: There doens't appear to be any tab-related markup in
  the template at all.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 82859c8568d86c2c9e443d9731b68646b5d20332)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32969: Remove references to jQueryUI assets and style in the OPAC
Owen Leonard [Wed, 15 Feb 2023 15:36:23 +0000 (15:36 +0000)]
Bug 32969: Remove references to jQueryUI assets and style in the OPAC

This patch removes the jQueryUI assets from Bootstrap OPAC files and
removes the links to those assets from the templates. References in CSS
to jQueryUI-related elements are also removed.

To test, apply the patch and rebuild the OPAC CSS.

Test various pages in the OPAC to confirm that there are no visible
changes. The browser console should not warn of missing files.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6f383fe586de0b8bd6a9978953c0279d254c31dd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 33278: Correct JS for activating default tab on various pages
Owen Leonard [Mon, 20 Mar 2023 15:43:39 +0000 (15:43 +0000)]
Bug 33278: Correct JS for activating default tab on various pages

The conversion of the header search tabs to Bootstrap resulted in a bug
on several staff interface pages: The first tab isn't selected by
default. The jQuery selector isn't specific enough.

The patch also corrects a template error which was introduced to
merge-record.inc by Bug 32683.

To test, apply the patch and test the following pages to confirm that
the first tab on each page is selected by default:

- Catalog -> Advanced search
- Catalog -> MARC details
- Catalog -> Search results -> Merge
- Administration -> Authorized values -> Edit
- Administratoin -> Library transfer limits
- Administration -> Item types -> Edit
- Authorities -> Authority details
- Authorities -> Search -> Merge

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit df6432fcc833f00bb6e45894004a0ad26d5ced28)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 33198: Don't calculate pickup locations per bib unless placing multiple holds
Nick Clemens [Fri, 10 Mar 2023 18:44:21 +0000 (18:44 +0000)]
Bug 33198: Don't calculate pickup locations per bib unless placing multiple holds

For single bibs we use an ajax select2 dropdown, and we don't use this
value

To test:
1 - Place some holds on single bibs
2 - Confirm dropdowns for pickup location work as expected
3 - Do the same for multiple bibs selected from search results
4 - Apply patch
5 - Confirm there is no change after the patch

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 63772a9cb25e58ff221540c2a76a7f447bbdeecc)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32883: (QA follow-up) Adjust ordering for pickups
Nick Clemens [Tue, 14 Mar 2023 13:04:35 +0000 (13:04 +0000)]
Bug 32883: (QA follow-up) Adjust ordering for pickups

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 017694fd9547ef2e2c909b9de2246ab38c40d5c7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32883: Correct cubside pickups ordering
Jonathan Druart [Mon, 6 Feb 2023 15:48:54 +0000 (16:48 +0100)]
Bug 32883: Correct cubside pickups ordering

They are displayed by date of creation, it's not what we want for "to be
staged" for instance, where it needs to be ordered by date/time of
scheduled pickup.

Test plan:
Create several curbside pickups, to have some in the different tabs
Confirm that the order is the one you expect.
=> to be staged ordered by pickup date/time
=> stage and ready ordered by pickup date/time
=> patron is outside ordered by arrival date/time
=> delivered today ordered by *desc* delivered date/time

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4943f060712422f4f5dcf8065b1f2593e18a1a6d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 30966: Record Overlay Rules - can't use Z39.50 filter
Johanna Raisa [Fri, 29 Jul 2022 05:37:50 +0000 (08:37 +0300)]
Bug 30966: Record Overlay Rules - can't use Z39.50 filter

This patch fixes overlay rules on z39.50 import

Test plan:
1) Create protection overlay rule to some fields for z39.50.
2) Import a record via z39.50.
3) See that the protected fields are replaced on the editor.
4) Apply the patch.
5) Import a record again.
6) See that the protected fields are in place on the editor.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0970eef56df1ac8fee1f3c5f0216a164be5048ec)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 33309: Index items after renewal transaction completes
Nick Clemens [Wed, 22 Mar 2023 19:12:01 +0000 (19:12 +0000)]
Bug 33309: Index items after renewal transaction completes

This patch ensures a record is indexed only after the renewal transaction
has completed successfully. Otherwise the job cannot be found by the background process
worker, becaue it was not yet in the DB

To test:
1 - Make sure you are using ES, and the es indexer is running
2 - tail -f /var/log/koha/kohadev/*.log
3 - Issue an item to a patron and renew it
4 - Note error in es-indexer-output.log like:
    [2023/03/21 12:22:36] [WARN] No job found for id=157 main:: /kohadevbox/koha/misc/workers/es_indexer_daemon.pl (129)
5 - Apply patch
6 - Renew again
7  There should be no error
8 - Search for the record and confirm items info displays correctly
9 - View the background jobs in admin, confirm the most recent job has completed

Signed-off-by: Janusz Kaczmarek <januszop@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a63b0d00306d639241a400cecbe3b0125ee8d303)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 33137: Make column names match
Lucas Gass [Thu, 9 Mar 2023 13:17:05 +0000 (13:17 +0000)]
Bug 33137: Make column names match

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2792007245f2dfda600b6d2e2fa97a1f634b7a26)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 33137: Add call number to pay-fines-table and table settings
Lucas Gass [Wed, 8 Mar 2023 16:40:24 +0000 (16:40 +0000)]
Bug 33137: Add call number to pay-fines-table and table settings

To test:
1. Apply patch and restart_all
2. From a patron's Accounting tab add some invoices that are related to an item.
3. From the 'Make a payemnt' notice the new Call number column.
4. Using Table settings, make sure you can properly hide the column.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e657c3d5a9ec142113eba19bf106eb662796f6f0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 33137: Add Home library to pay-fines-table and table settings
Lucas Gass [Wed, 8 Mar 2023 16:24:26 +0000 (16:24 +0000)]
Bug 33137: Add Home library to pay-fines-table and table settings

To test:
1. Apply patch and restart_All
2. From a patron's Accounting tab add some invoices that are related to an item.
3. From the 'Make a payemnt' notice the new Home library column. Make sure it displays correctly and is the same as what you see on the 'Transactions' tab.
4. Using Table settings, make sure you can properly hide the column.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eae0a7e065f867b9ba729281ba83b2568045ad50)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 33019: Make sure ES records are indexed the first time
Nick Clemens [Wed, 15 Feb 2023 10:50:33 +0000 (23:50 +1300)]
Bug 33019: Make sure ES records are indexed the first time

This patch ensures records are indexed when they are created.
Previously, we were launching the indexer inside of of a transaction.
This meant that the job was being enqueued, but not being found by the
worker, becaue it was not yet in the DB

This patch skips record indexing in the transaction, and moves the indexing
command after

To test:
1 - Make sure you are using ES, and the es indexer is running
2 - tail -f /var/log/koha/kohadev/*.log
3 - Create a new record
4 - Note error in es-indexer-output.log like:
    [2023/03/21 12:22:36] [WARN] No job found for id=157 main:: /kohadevbox/koha/misc/workers/es_indexer_daemon.pl (129)
5 - Apply patch
6 - Create another record
7  There should be no error
8 - Search for the record and confirm it can be found
9 - View the background jobs in admin, confirm the most recent job has completed

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 48b1f230e8ea517450a02359e6f7fd530eda8b67)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 33290: Fix incorrect variable in http-client.js
Jonathan Druart [Tue, 21 Mar 2023 07:52:42 +0000 (08:52 +0100)]
Bug 33290: Fix incorrect variable in http-client.js

Silly error from
  commit 821808ec31176d662e518418c9ff8a71948e1a4b
  Bug 32939: Use APIClient to replace PATCH requests

+        const body = params.body
+            ? typeof str === "string"
+                ? params.body
+                : JSON.stringify(params.body)
+            : undefined;

  typeof str === "string"
must be
  typeof params.body === "string"

Test plan:
With this patch, bug 33289 is not working properly. The body contains
  "pref_var=value"
instead of
  pref_var=value
and the syspref `var` contains `value"`

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 17de3a6feeed8237108c76ac2bf8e1cfddffc127)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32833: Fix cataloguing/value_builder/unimarc_field_121a.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:52 +0000 (11:58 +0100)]
Bug 32833: Fix cataloguing/value_builder/unimarc_field_121a.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

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>
(cherry picked from commit 299903c0d3b51ea83b3c724a689609182c417b2b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32832: Fix cataloguing/value_builder/unimarc_field_120.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:52 +0000 (11:58 +0100)]
Bug 32832: Fix cataloguing/value_builder/unimarc_field_120.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

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>
(cherry picked from commit f690f59e0e5e67eca5da6f5079d922abd9225702)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32831: Fix cataloguing/value_builder/unimarc_field_117.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:52 +0000 (11:58 +0100)]
Bug 32831: Fix cataloguing/value_builder/unimarc_field_117.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

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>
(cherry picked from commit 5800082f7ffa4d85ce9c2ba5da2a23c9021934c3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
14 months agoBug 32830: Fix cataloguing/value_builder/unimarc_field_116.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:52 +0000 (11:58 +0100)]
Bug 32830: Fix cataloguing/value_builder/unimarc_field_116.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

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>
https://bugs.koha-community.org/show_bug.cgi?id=32831
(cherry picked from commit 4d196b176d6cfb258e9c729116db377cf5e17fd1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoUpdate release notes for 22.11.04 release v22.11.04
Martin Renvoize [Thu, 30 Mar 2023 13:28:31 +0000 (14:28 +0100)]
Update release notes for 22.11.04 release

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoIncrement version for 22.11.04 release
Martin Renvoize [Thu, 30 Mar 2023 12:25:45 +0000 (13:25 +0100)]
Increment version for 22.11.04 release

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoFix translations for Koha 22.11.03
Martin Renvoize [Wed, 21 Dec 2022 11:10:57 +0000 (11:10 +0000)]
Fix translations for Koha 22.11.03

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
15 months agoTranslation updates for Koha 22.11.04
Koha translators [Thu, 30 Mar 2023 09:27:10 +0000 (06:27 -0300)]
Translation updates for Koha 22.11.04

(cherry picked from commit 7cea591b4f6b9354e56be39003c5191b5162c004)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33282: Feed an array of titles so that no dialog message appears
Pedro Amorim [Mon, 20 Mar 2023 18:21:06 +0000 (17:21 -0100)]
Bug 33282: Feed an array of titles so that no dialog message appears

Including but not limited to the one we're testing for

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b88d3640181c51b8d366313c4ac7044644f627d9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33282: Move get_title to index.js to be invoked by different specs
Pedro Amorim [Mon, 20 Mar 2023 18:19:53 +0000 (17:19 -0100)]
Bug 33282: Move get_title to index.js to be invoked by different specs

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f718fe6a0aac993c08e911739e324c409ea93230)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33282: Remove useless intercept
Pedro Amorim [Mon, 20 Mar 2023 18:07:27 +0000 (17:07 -0100)]
Bug 33282: Remove useless intercept

JD amended patch: replace "redundant" with "useless". It's not the same
intercept, but we don't need the one removed by this patch.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a56cbc6d47ab11e7d4f599e2eec3a03a7c7f4690)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33282: Rename Dialog.spec.ts to Dialog_spec.ts
Pedro Amorim [Mon, 20 Mar 2023 18:05:52 +0000 (17:05 -0100)]
Bug 33282: Rename Dialog.spec.ts to Dialog_spec.ts

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7c5d0a208d473e409cc8f1e633816e5e63a74c6d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32923: Allow to embed user_roles for agreements
Jonathan Druart [Wed, 22 Mar 2023 09:25:56 +0000 (10:25 +0100)]
Bug 32923: Allow to embed user_roles for agreements

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 479d8719c548c11ae8fd26343324f085ee92b536)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 19361: (QA follow-up) Make sure "Not an authorised value" appears in the pull...
Katrin Fischer [Fri, 17 Mar 2023 17:43:18 +0000 (17:43 +0000)]
Bug 19361: (QA follow-up) Make sure "Not an authorised value" appears in the pull down

This is to make sure that the small icon with the additional tooltip
style explanation is not as easily missed.

Also updates text slightly:
* Pull downs: "X (Not an authorised value)"
* Tooltip: "The current value X is not configured for the authorised value category controlling this subfield"

Switches from exclamation triangle to the more "alerting" exclamation-triangle :)

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c123b414800a9a7f20d1a7948baa6ea43025eec6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 19361: (QA follow-up) Make sure translatable string is wrapped in double quotes
Katrin Fischer [Fri, 17 Mar 2023 16:10:26 +0000 (16:10 +0000)]
Bug 19361: (QA follow-up) Make sure translatable string is wrapped in double quotes

This fixes the QA script complaint:

 FAIL koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc
   FAIL   forbidden patterns
forbidden pattern: simple-quote string (line 125)

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0880ed3c93a07a999efab85ff18d305a158a893)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 19361: Fix advanced cataloging editor dropdowns
Nick Clemens [Wed, 19 Oct 2022 14:37:34 +0000 (14:37 +0000)]
Bug 19361: Fix advanced cataloging editor dropdowns

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fdc82e6c6dc0d9853e5950c0c07805fcc2a1e2ac)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 19361: Display unauthorized values when cataloging and add a warning
Nick Clemens [Wed, 19 Oct 2022 13:56:51 +0000 (13:56 +0000)]
Bug 19361: Display unauthorized values when cataloging and add a warning

This patch adds a warning and tool tip when an unauthorised vlaue is encountered during item
or biblio editing, and adds the value to the list to allow preserving the value (in case the
librarian is only editing another part of the record, or there is some reason to retain)

To test:
1 - Edit a record in advanced cataloging editor
2 - Under settings click 'Show fields verbatim'
3 - Edit 942$c to 'HAM' or some other invalid itemtype
4 - Save record
5 - sudo koha-mysql kohadev
    UPDATE items SET location = 'HAM' WHERE biblionumber = {biblionumber from above}
6 - Edit the biblio and items, confirm the HAM value shows in dropdowns

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1dc022513cea57afb39e49273ffc3043d0094cd5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33060: Fix yes/no setting to 1/0 in system preference YAML files
Katrin Fischer [Thu, 23 Feb 2023 22:16:56 +0000 (22:16 +0000)]
Bug 33060: Fix yes/no setting to 1/0 in system preference YAML files

Boolean system preferences need to use 1 and 0 for true and false,
not yes and no now. This fixes a few occurences that have
been added in the last release:

* EnableItemGroups
* EnableItemGroupHolds
* ArticleRequestsOpacHostRedirection
* UseLocationAsAQInSIP

To test:
* Make sure these preferences save to the db as 0/1 as expected.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d11abd548bc879aa01216f9c2b472cc8621dcda8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33227: (follow-up) Improve docs
Tomas Cohen Arazi [Mon, 20 Mar 2023 11:48:22 +0000 (08:48 -0300)]
Bug 33227: (follow-up) Improve docs

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8ba4aabf079d23680a7e40b004b1914864963659)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33227: Remove invalid spec and adjust the code accordingly
Tomas Cohen Arazi [Thu, 16 Mar 2023 13:50:33 +0000 (10:50 -0300)]
Bug 33227: Remove invalid spec and adjust the code accordingly

The spec contains a non-standard definition for the body param. Removing
it from the spec makes us need to handle the 'body' manually in the case
of JSON data.

This patch basically does that. It also changes the uses of
$c->validation, which are discouraged by the
Mojolicious::Plugin::OpenAPI dev/maintainer. I do it to highlight what
we must do in other places and the fact that there's no behavior change.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t \
           xt/api.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 185b431ebfc869dde06ab87efcd562fc786388ae)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33227: Unit tests
Tomas Cohen Arazi [Wed, 15 Mar 2023 14:14:19 +0000 (11:14 -0300)]
Bug 33227: Unit tests

This patch adds a unit test that launches the swagger-cli validator
against our spec.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 502e34e9b0f709d0ab9260da107c1c1e5c7e11d8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33076: (QA follow-up) Update context hint to "EDIFACT message QUOTE"
Katrin Fischer [Fri, 17 Mar 2023 21:46:21 +0000 (21:46 +0000)]
Bug 33076: (QA follow-up) Update context hint to "EDIFACT message QUOTE"

As discussed on the bug, this updates the hint to make it
easier for translators to decide on the correct translation.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 73edf936ae9be2a704389896e5ad316eb8cf96ec)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32713: (QA follow-up) Tests now require more complex structures
Tomas Cohen Arazi [Fri, 17 Mar 2023 21:27:09 +0000 (18:27 -0300)]
Bug 32713: (QA follow-up) Tests now require more complex structures

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit afdc1690e01daef72e6e2304bcdf7dec18fe653c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32713: Throw exception on unexpected x-koha-embed header
Martin Renvoize [Wed, 1 Mar 2023 16:42:30 +0000 (16:42 +0000)]
Bug 32713: Throw exception on unexpected x-koha-embed header

This patch adds an exception to stash_embed that is thrown when we
find an x-koha-embed header that we're not expecting.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 33de3ef9dcc8d2c0b021b2da80a2c6673cd06e82)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32713: Unit tests
Martin Renvoize [Thu, 2 Mar 2023 09:37:14 +0000 (09:37 +0000)]
Bug 32713: Unit tests

This patch adds unit tests to prove we return a 400 and an appropriate
error message when calling an endpoint that is not defined to support
x-koha-embed whilst passing an x-koha-embed header.

Test plan:
1) Run test prior to applying second patch and confirm it fails
2) Run test after applying second patch and confirm it passes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2202f7f2c29444b5cc587e09729cbf770323d96b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33083: Add a generic class to handle methods for collections of records
Agustin Moyano [Mon, 27 Feb 2023 22:10:31 +0000 (19:10 -0300)]
Bug 33083: Add a generic class to handle methods for collections of records

To test:
1. Apply patch
2. prove t/db_dependent/Koha/Objects/Record/Collections.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2055c84a9583cc53fc71f054ccaa7eea1d559aae)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33080: Adapt other use-cases
Tomas Cohen Arazi [Tue, 7 Mar 2023 11:26:51 +0000 (08:26 -0300)]
Bug 33080: Adapt other use-cases

This patch adapts the other controllers that rely on
add_pagination_headers outside of `objects.search`.

To test:
1. Apply this patchset
2. Run:
   $ ktd --shell
   $ prove t/db_dependent/api/v1/* \
           t/db_dependent/Koha/REST/Plugin/Objects.t \
           t/db_dependent/Koha/REST/Plugin/Pagination.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 347d8787dc9aa69d6a3265ef61d42014290720f2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33080: Allow pagination to be built from stashed values
Tomas Cohen Arazi [Fri, 3 Mar 2023 12:28:14 +0000 (09:28 -0300)]
Bug 33080: Allow pagination to be built from stashed values

The way the old `objects.search` was build implied several totals were
calculated there, and passed to the `$c->add_pagination_headers` helper.

With the introduction of `objects.search_rs` and the ability of doing
things to the resultset afterwards, it felt like out of place to have
the pagination headers be implicitly set inside `objects.search_rs`.

This patch makes the search_rs stash some required values (from the original request) and
makes `add_pagination_headers` accept those values. This way other
callers can still build their own pagination values, while allowing this
simplified implementation.

Full-stack tests still pass, and the helper tests are moved to the
`db_dependent` section and are now more meaningful as well

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
   $ prove t/db_dependent/Koha/REST/Plugin/Pagination.t \
           t/db_dependent/api/v1/
=> SUCCESS: Tests pass! Nothing broken!
3. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ad83d2e07d3c2c28e962b1a2e8d04b6f25a4a868)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33080: Introduce objects.search_rs, objects.find_rs and objects.to_api
Tomas Cohen Arazi [Fri, 6 Jan 2023 15:49:14 +0000 (12:49 -0300)]
Bug 33080: Introduce objects.search_rs, objects.find_rs and objects.to_api

This patch introduces the mentioned helpers, and reimplements
objects.search and objects.find in terms of them.

To test:
1. Apply patch
2. restart_all
3. Check that any API that uses objects.search helper is still running
   (GET /api/v1/items, GET /api/v1/holds, etc)
4. prove t/db_dependent/Koha/REST/Plugin/Objects.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 67a81d1328ad5f8720b3bf350ac494a0cd26f516)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32734: (RMaint follow-up) Clarify tests
Martin Renvoize [Tue, 21 Mar 2023 07:37:48 +0000 (07:37 +0000)]
Bug 32734: (RMaint follow-up) Clarify tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 31800: (RMaint follow-up) Remove git fragment
Martin Renvoize [Mon, 20 Mar 2023 17:17:18 +0000 (17:17 +0000)]
Bug 31800: (RMaint follow-up) Remove git fragment

The cherry-pick of bug 31800 also pulled in a small part of spec from
bug 31793.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32421: Add collection column to holds to pull
Lucas Gass [Wed, 7 Dec 2022 18:41:26 +0000 (18:41 +0000)]
Bug 32421: Add collection column to holds to pull

To test:

1. Place some holds
2. Go to Circulation > Holds to pull
3. Notice there is not column to indicate collection ( CCODE )
4. Apply patch and restart services
5. Step 2 again, this time you should see a column for holds to pull
6. Using both the Columns button and via 'Table setting' attempt to hide the column and other columns. Ensure everything is being heiiden correctly.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 32421: (follow-up) Correct table settings

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 375fbd1704d9f5d7d6bc729c7d2c514ccc94bb3b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32923: Fix licenses spec
Pedro Amorim [Mon, 20 Mar 2023 13:25:19 +0000 (13:25 +0000)]
Bug 32923: Fix licenses spec

Bug 32713 is now validating embed and brought this flaw to light.
Before this patch, listing licenses on ERM would result in a 400 bad request

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0fb86ccdc5696fb15bf057469a5c962f8c228211)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32118: Add optional support for `:` as the modifier
Martin Renvoize [Thu, 3 Nov 2022 11:02:21 +0000 (11:02 +0000)]
Bug 32118: Add optional support for `:` as the modifier

This patch adds optional support for using `:` as the modifier for
invoking the 'count' method for relations as discussed.

We retain support for `+` for backward compatability to prevent a
breaking change.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 64d3498da4c62f8a2fa3d28c7cfe8b0a9e251288)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33161: (QA follow-up) Fix api_strings_mapping inconsistency
Tomas Cohen Arazi [Fri, 10 Mar 2023 14:33:02 +0000 (11:33 -0300)]
Bug 33161: (QA follow-up) Fix api_strings_mapping inconsistency

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 65711c9daba5c07ffba5f7cfa6085be2116a75f8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33161: Unit tests
Tomas Cohen Arazi [Thu, 9 Mar 2023 22:23:03 +0000 (19:23 -0300)]
Bug 33161: Unit tests

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/Item.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Edit: added missing test for unmapped attribute

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 35dd17735f4e5b39b0a56a3d72d010fd7d176a32)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33161: (follow-up) Remove stray variables and fix POD
Tomas Cohen Arazi [Thu, 9 Mar 2023 14:36:27 +0000 (11:36 -0300)]
Bug 33161: (follow-up) Remove stray variables and fix POD

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7bde825a33cbc49a2363909c20adb74c6e8c6931)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33161: Clarify method names
Martin Renvoize [Thu, 9 Mar 2023 13:14:04 +0000 (13:14 +0000)]
Bug 33161: Clarify method names

The api_strings_mapping method isn't really only about api strings.. we
deal with database fields in and out.. we just happen to then use those
in to_api to map in the api.

This patch simply renames the standard method whilst we're still early.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bbff26575f59e325ba6a3db1d5b986f5356fe2ae)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33161: (follow-up) Consistent use of db fields throughout
Martin Renvoize [Thu, 9 Mar 2023 12:43:05 +0000 (12:43 +0000)]
Bug 33161: (follow-up) Consistent use of db fields throughout

We should stick to DB field names as long as possible to allow re-use
and only convert to api field names via to_api_mapping at the last
moment inside the parent to_api function.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 04736dd0bafbef608e56e8cd4dae63bb4eb93fe6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33161: Add +strings support to GET /items and /items/:item_id
Tomas Cohen Arazi [Tue, 7 Mar 2023 23:51:35 +0000 (20:51 -0300)]
Bug 33161: Add +strings support to GET /items and /items/:item_id

This patch introduces the `api_strings_mapping` method to the
*Koha::Item* class, and makes the API spec for the following routes:

* GET /items
* GET /items/:item_id
* GET /acquisitions/orders

accept the new `+strings` parameter that can be passed through the
`x-koha-embed` header and was introduced by bug 26635. In the case of
/acquisitions/orders, you will need to use

x-koha-embed: items+strings

I introduce it here to highlight the flebility we introduced with bug
26635.

The `api_strings_mapping` method has its roots on the cool
`columns_to_str` method already present. The main differences:

* It is aware of the `public_read_list` for attributes so no hidden
  information is exposed.
* Attribute names get mapped for consistency with the API (e.g.
  `homebranch` is converted into `home_library_id`, etc).
* The data structure it returns includes information about the source
  for the descriptions (e.g. it it is an authorised value, then `type`
  will be `av`, and the related category information is returned so
  dropdowns and such can be built. The same goes for other types as
 `library`, `item_type` and `call_number_source`.

To test:
1. Apply this patch
2. Reload everything
3. Play with your favourite REST tool (e.g. Postman)
4. Try:
GET http://localhost:8081/api/v1/items
x-koha-embed: +strings
=> SUCCESS: You get a list of items, they include the new _strings
structure, and the contents make sense!
5. Repeat with a specific item:
GET http://localhost:8081/api/v1/items/14
x-koha-embed: +strings
=> SUCCESS: It all makes sense!
6. Sign off :-D

Sponsored-by: Virginia Polytechnic Institute and State University
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dab02607028fadc0e8864102a9a59c7e8fb6c775)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 3831: Add a warning to about page when there is no FA framework
Nick Clemens [Fri, 3 Mar 2023 20:41:21 +0000 (20:41 +0000)]
Bug 3831: Add a warning to about page when there is no FA framework

The feature is effectively disab;ed throughout Koha when this framework
is deleted. There do not appear to be any other side effects.

We should report this on the about page for informatinal purposes

To test:
1 - Apply patch
2 - Check about page, no change
3 - sudo koha-mysql kohadev
    UPDATE biblio_framework SET frameworkcode = 'FB' WHERE
    frameworkcode = 'FA'
4 - Refresh about page
5 - Note new warning
6 - sudo koha-mysql kohadev
    UPDATE biblio_framework SET frameworkcode = 'FA' WHERE
    frameworkcode = 'FB'
7 - Refresh about page
8 - No warning

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>
(cherry picked from commit a2fa4fcc03583ef3e6a6a299b4c0e0f3145ca32d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 32734: (QA follow-up) Make use of $c->objects->to_api
Tomas Cohen Arazi [Mon, 13 Mar 2023 18:06:44 +0000 (15:06 -0300)]
Bug 32734: (QA follow-up) Make use of $c->objects->to_api

This is using plain `$biblios->to_api` but as of bug 33080, the new
helper should be used instead. This patch fixes that.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a8daacac2c0e80c70d3665a2016cbb20b16bcf5e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32734: (QA follow-up) Remove stray method
Tomas Cohen Arazi [Mon, 13 Mar 2023 17:58:21 +0000 (14:58 -0300)]
Bug 32734: (QA follow-up) Remove stray method

On bug 33083 we introduce a better way to implement a reusable method
for the same functionality.

This patch just removes the one in `Koha::Biblios` and the result should
be the same as the one inherited from  `Koha::Objects::Record::Collections` will be picked instead.

To test:
1. Run:
   $ prove t/db_dependent/Koha/Biblios.t \
           t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 79e3fd1640dd2dc96f9157745224a84c4e0cf632)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32923: (follow-up) Fix x-koha-embed from EHoldings/*/*
Jonathan Druart [Fri, 17 Mar 2023 14:07:37 +0000 (15:07 +0100)]
Bug 32923: (follow-up) Fix x-koha-embed from EHoldings/*/*

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 70fcbce07f2e44d40853e4b423aa1b13cfb713de)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33151: Improve translation of string in cities.tt and desks.tt
Owen Leonard [Mon, 6 Mar 2023 18:02:28 +0000 (18:02 +0000)]
Bug 33151: Improve translation of string in cities.tt and desks.tt

This patch adds a <span> tag around a string in both cities.tt and
desks.tt in order to improve translatability.

To test apply the patch and run the translation script to update the .po
files, e.g.

perl misc/translator/translate update fr-FR

Check the updated .po files:
 - Before the patch you would have found 'msgid "%s Searching: %s %s %s'
 - After the patch you should find 'msgid "Searching: %s'

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 289400379213dea3169ba30196ff4ef8f87a4b03)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32804: (QA follow-up) Typo ahs and fix ImportBatch.t
Marcel de Rooy [Fri, 17 Mar 2023 08:43:32 +0000 (08:43 +0000)]
Bug 32804: (QA follow-up) Typo ahs and fix ImportBatch.t

Resolve:
    #   Failed test 'Item's biblioitemnumber has not changed'
    #   at t/db_dependent/ImportBatch.t line 407.
    #
    #          got: '4261'
    #     expected: '2371'

Do not compare $item1->biblionumber with $original_biblioitemnumber :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bf8e0a394fb1704345e8cc4cae45d86c31e596ef)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32804: (follow-up) Test that id's have not changed
Nick Clemens [Fri, 3 Mar 2023 12:18:40 +0000 (12:18 +0000)]
Bug 32804: (follow-up) Test that id's have not changed

Rather than assuming biblionumber and biblioitemnumber are the same, we
should test that they have not changed form their original values

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 520db70bf1cdedf658527887957fc25ed921da5f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32804: Do not adjust biblionumber when replacing items during import
Nick Clemens [Thu, 2 Feb 2023 20:16:49 +0000 (20:16 +0000)]
Bug 32804: Do not adjust biblionumber when replacing items during import

This patch adjust the item matching at import to confirm that for a duplicate itemnumber or barcode
matches an existing item in the DB and uses the original biblionumber when updating the item.

When ordering in a consortium the items may be moved around, duplicate biblios added, and various matches found.
We should not allow importing of items to move them from 1 biblio to another, but  we should allow the imports
to succeed and assume itemnumber or barcode matches are authoritative. The responsibility for correct matching of items to biblio should fall on the creator of the files

To test:
 1 - Be using the sample data in koha testing docker
 2 - Stage the sample file on this report
 3 - Match on KohaBiblio(999$c) / Item processing: replace
 4 - Note the biblio match is "The complete novels / Austen, Jane"
 5 - View the staged marc, note the barcode 39999000004090 in an item
 6 - Search for that barcode
 7 - You find biblio "Five novels : complete and unabridged / Gustave Flaubert"
 8 - Import the file
 9 - Check the db:
     SELECT * FROM items WHERE biblionumber != biblioitemnumber;
10 - Note the mismatch
11 - Fix the item and set it as 'Music' type
     UPDATE items SET biblionumber = biblioitemnumber, itype='MU' WHERE biblionumber != biblioitemnumber;
12 - Apply patch, restart all
13 - Stage and import the file with the same settings
14 - Confirm the item is modified on its original biblio (99) and that item type is Book again
15 - Change itemnumber to avoid itemnumber match and reset type
     UPDATE items SET itype='MU', itemnumber=999 WHERE itemnumber=212;
16 - Stage and import with the same setttings
17 - Confirm the marcode match worked and item is updated to book on original record
18 - Delete the original item
19 - Stage and import the file with the same settings
20 - The item is successfully created
21 - Stage and import, but item processing option is 'add'
22 - Confirm 1 item ignored
23 - Check the db
     SELECT * FROM import_items WHERE barcode=39999000004090
24 - Confirm there is a line with 'error' and duplicate_barcode

JD amended patch
-        # We assume that when replaicing tiems we do not want to move them - the onus is on the importer to
+        # We assume that when replacing items we do not want to move them - the onus is on the importer to

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eeb115440a22ed035d8720ac53b7fbd0e5fd8afe)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32804: Add unit tests
Kyle Hall [Mon, 6 Feb 2023 16:55:48 +0000 (11:55 -0500)]
Bug 32804: Add unit tests

JD amended patch
-    is( $item1->homebranch, $library->branchcode, "Item was overlayed succesfully" );
+    is( $item1->homebranch, $library->branchcode, "Item was overlaid successfully" );

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8f5d3612ee74e48293667af90a03f714d87e062a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33059: Fix capitalizatoin of AV sample category descriptions
Katrin Fischer [Thu, 23 Feb 2023 21:21:02 +0000 (21:21 +0000)]
Bug 33059: Fix capitalizatoin of AV sample category descriptions

* Fixes capitalization
* Standardizes on e-book (see https://www.oxfordlearnersdictionaries.com/definition/english/e-book)
* Standardizes on audiobook (see https://www.oxfordlearnersdictionaries.com/definition/english/audiobook)

To test:
* This is a little difficult to test. What you'd need to do:
* Apply the patch
* Drop your database, recreate it, run the web installer
* Make sure to select the optional AV along with the mandatory to install
* Log into Koha after finishing the installer and go to administration >
  authorised values
* Review the existing sample values for incorrect capitalization in
  the different categories

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8e4d5279703be5f8e9313f2e497bfa98b58e422c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33100: (QA follow-up) Trivial QA fixes
Tomas Cohen Arazi [Fri, 17 Mar 2023 12:51:09 +0000 (09:51 -0300)]
Bug 33100: (QA follow-up) Trivial QA fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 057e6c2bc8f7d88ff2e86f1abab97a705e2917a3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33100: Remove all punctuation at end of record
Nick Clemens [Tue, 7 Mar 2023 20:05:36 +0000 (20:05 +0000)]
Bug 33100: Remove all punctuation at end of record

This could potentially be overkill - if you have two records that only
differ in ending punctuation, you might get a false result - I don't
know how likely that is ( as I have mentioned before '!!!' is a band )

This seems a reasonable fix

To test:
1 - Set sysprefs as in bug 33159
2 - Edit a record, biblionumebr 3 is fine
3 - Add a comma to end of author subfield a
4 - Save and note relinked
5 - Apply patch, restart all
6 - Save again
7 - Linked to original record

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 928a4cb465d7891157b1b061d144db6a808ada14)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33100: Unit test
Nick Clemens [Tue, 7 Mar 2023 20:05:28 +0000 (20:05 +0000)]
Bug 33100: Unit test

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 749045366310fe4269bb1c39a93adc5eb20a4f22)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33235: Fix cypress tests
Pedro Amorim [Wed, 15 Mar 2023 15:23:37 +0000 (14:23 -0100)]
Bug 33235: Fix cypress tests

Some inconsistencies leftovers from 32495 and 32997 were causing cypress tests to fail, this fixes them.

* Apply patch
* Run cypress tests and verify all pass

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 16e6d937632301e233d5b90b6588940eb2226636)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32495: (follow-up) Remove required property
Matt Blenkinsop [Wed, 1 Mar 2023 10:46:20 +0000 (10:46 +0000)]
Bug 32495: (follow-up) Remove required property

This follow-up removes the required property from the text area as this
was missed previously.

Test plan:
1) In the ERM module, add a new agreement and observe that the Description field is required
2) Apply patch
3) Repeat step 1 but this time the Required flag will not be visible.
4) Submit the form with the Description field blank - the submission
   should work

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0307c1bbff089312618608785414c92fc1549823)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32495: Mis-matched required fields in UI and api
Matt Blenkinsop [Mon, 9 Jan 2023 15:12:18 +0000 (15:12 +0000)]
Bug 32495: Mis-matched required fields in UI and api

The "description" field is marked as required in the UI when creating a new Agreement. This flag has been removed to match the API where it is not a required field. Is Perpetual has not been marked as required as it is a checkbox with a default selection so will always provide a value.

Test plan:
1) In the ERM module, add a new agreement and observe that the Description field is required
2) Apply patch
3) Repeat step 1 but this time the Required flag will not be visible.

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>
(cherry picked from commit e1b7591effa22f787bbf175aeb170f343ce07498)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33082: Add yellow buttons and page sections to 'copy order' pages
Katrin Fischer [Mon, 27 Feb 2023 21:44:09 +0000 (21:44 +0000)]
Bug 33082: Add yellow buttons and page sections to 'copy order' pages

When creating a new order from an existing order (copy),
there was no page section on the search results and the
submit buttons were not yellow (primary).

To test:
1. Make sure you have budgets, funds and vendors
2. In Acquisitions, search for a vendor
3. Create a basket
4. Add an order to that basket (Order from new (empty) record is easiest)
5. Add to the basket again, choosing the "From existing orders (copy)" option
6. Search for you previous order
7. The table of ordres has no white background (missing page-section) and
   the "Next" button is not yellow
8. Check the order and click Next
9. The "Duplicate orders" button is not yellow
10. Apply patch
11. Verify buttons are now yellow and the table has a white background

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f1a274c79cb827737a57686a51a8fef72c1eff75)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33263: Fix random failure in patrons_search.t
Jonathan Druart [Fri, 17 Mar 2023 10:57:22 +0000 (11:57 +0100)]
Bug 33263: Fix random failure in patrons_search.t

There is a missing wait_for_ajax. After we click "next", we need to make
sure we are using the correct response.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e81e2c9ed552cc5fa07d474a6a9d44ba0e751390)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32983: Fix dropdown list when search for EBSCO's packages
Jonathan Druart [Wed, 8 Mar 2023 14:53:15 +0000 (15:53 +0100)]
Bug 32983: Fix dropdown list when search for EBSCO's packages

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5c3693bbd2109a780c5fdb5af31d36841ea6c1fc)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33058: Update "fines" to "charges" for viewing a guarantees charges
Katrin Fischer [Thu, 23 Feb 2023 20:26:23 +0000 (20:26 +0000)]
Bug 33058: Update "fines" to "charges" for viewing a guarantees charges

Charges includes fines and fees, while fines are mostly
negative. Changing this according to our terminology
guidelines.

To test:
* Make sure the patron category of your patron is set
  to be 'can be guarantee' in administration
* Set  AllowStaffToSetFinesVisibilityForGuarantor and
   AllowPatronToSetFinesVisibilityForGuarantor to allow
* Set OpacPrivacy to allow
* Edit your patron, give it a guarantor and
  look at the "Show fines to guarantors setting" and hint
* Save and look at the label of the field on the details tab
* Go to the OPAC and log in
* Check the Privavy tab for the option to allow the guarantee
  to see your charges
* Apply patch. Verify:
  * System preference descriptions changes
  * Option and label names have changed in all steps above

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3f848e4d244ce4fa5f9f8a6d507c79de704592b5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32180: Add required class to labels in ERM
Lucas Gass [Wed, 15 Mar 2023 20:39:27 +0000 (20:39 +0000)]
Bug 32180: Add required class to labels in ERM

To test:
1. Apply patch, yarn build
2. Add/edit Agreemnets, make sure all required fields have a red 'required' label
3. Check 'Add new period', 'Add new user', 'Add new license', 'Add new related agreement'.
4. Add/edit Licenses, make sure all required fields have a red 'required' label.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2dd0a14571e59b9e4740f323e038decfef0919e2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33056: Terminology: change 'fine' to 'charge'when making a payment or writeoff
Katrin Fischer [Thu, 23 Feb 2023 20:42:54 +0000 (20:42 +0000)]
Bug 33056: Terminology: change 'fine' to 'charge'when making a payment or writeoff

In the development meeting of Feb 22, 2023, we decided to change 'fine' to 'charge' when referring to various types of fees ('fine' should be limited to overdue fines).

To test:
0. Go to patron's account accounting tab, Make a payment section
   --> It will read: X has no outstanding fines.
   0.1 Create a manual invoice
   --> Use "Write off all" button, verify confirmation message says 'fines'
1. Add a manual fee to a patron's account
   1.1. Go to a patron's account > Accounting tab
   1.2. Click 'Create manual invoice'
   1.3. Enter an amount
   1.4. Click 'Save'
2. Pay an individual charge
   2.1. Click 'Make a payment'
   2.2. Click the 'Pay' button next to an individual charge
   --> In the browser tab title, it says 'Collect fine payment for ...'
   --> In the breadcrumbs, the last section is 'Pay an individual fine'
   --> The heading of the page is 'Pay an individual fine'
   --> The heading inside the payment tab is 'Pay an individual fine'
   2.3. Click 'Cancel' and go back to the 'Make a payment' tab
3. Pay an amount toward all charges
   3.1. Click 'Pay amount'
   --> In the browser tab title, it says 'Collect fine payment for ...'
   --> In the breadcrumbs, the last section is 'Pay an amount toward all fines'
   --> The heading of the page is 'Pay an amount toward all fines'
   --> The heading inside the payment tab is 'Pay an amount toward all fines'
   3.2. Click 'Cancel' and go back to the 'Make a payment' tab
4. Pay an amount toward selected charges
   4.1. Click 'Pay selected'
   --> In the browser tab title, it says 'Collect fine payment for ...'
   --> In the breadcrumbs, the last section is 'Pay an amount toward selected fines'
   --> The heading of the page is 'Pay an amount toward selected fines'
   --> The heading inside the payment tab is 'Pay an amount toward selected fines'
   4.2. Click 'Cancel' and go back to the 'Make a payment' tab
5. Write off an individual charge
   5.1. Click the 'Write off' button next to an individual charge
   --> In the browser tab title, it says 'Collect fine payment for ...'
   --> In the breadcrumbs, the last section is 'Write off an individual fine'
   --> The heading of the page is 'Write off an individual fine'
   --> The heading inside the payment tab is 'Write off an individual fine'
   5.2. Click 'Cancel' and go back to the 'Make a payment' tab
6. Write off selected charges
   6.1. Click 'Writeoff selected'
   --> In the browser tab title, it says 'Write off an amount for ...'
   --> In the breadcrumbs, the last section is 'Write off an amount toward selected fines'
   --> The heading of the page is 'Write off an amount toward selected fines'
   --> The heading inside the payment tab is 'Write off an amount toward selected fines'
   6.2. Click 'Cancel' and go back to the 'Make a payment' tab
7. Apply patch and repeat
   --> All fines should now be charges.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6d6f763182ef11e8c36a348371925f643a78f686)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33076: Add context to "Quotes"
Katrin Fischer [Mon, 27 Feb 2023 22:13:01 +0000 (22:13 +0000)]
Bug 33076: Add context to "Quotes"

A quote as a part of quoted text and a quote as
part of the acquisition process need to be
translated differently at least in German.
This patch adds context to the terms, so we can
do that.

To test:
* Go to Tools > Quote editor
* Verify the heading of the page reads "Quotes"
* Enable EDIFACT system preference
* Go to Administration > EDI accounts
* Add a new account save
* Verify the table heading reads "Quotes"
* Apply patch - nothing should change

Verify the translation process:
* Run: gulp po:update --lang de-DE
* Verify the "Quotes" appear now separated by
  different context in
  misc/translator/po/de-DE-messages.po

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2413ab7e7986c39d5469e8f16d7be9d62bd775d8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33126: Markup error in staff interface tab wrapper
Owen Leonard [Fri, 3 Mar 2023 13:40:03 +0000 (13:40 +0000)]
Bug 33126: Markup error in staff interface tab wrapper

This patch makes a minor correction to the tab WRAPPER directives: a
<li> which should be </li>.

The patch also modifies the example WRAPPER markup to correct an error
and clarify usage.

To test, apply the patch and test a page which has been updated to use
tab wrappers: The about page, basket groups, library transfer limits.
Tabs should continue to work as expected.

Before the patch, the about page source will include this:

<li role="presentation" class="active">
    <a href="about_panel" aria-controls="about_panel" role="tab" data-toggle="tab">
       Server information
    </a>
<li>

After the patch the closing </li> will be correct.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c07ada6c851d492ad696250840cb16ed28dc9362)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 33183: Error inserting matchpoint_components when creating record matching rules...
Kyle Hall [Thu, 9 Mar 2023 16:35:42 +0000 (11:35 -0500)]
Bug 33183: Error inserting matchpoint_components when creating record matching rules with MariaDB 10.6

The word "offset" is now a keyword. At the very least we need to escape the fieldname with backticks.
It would be nice to switch to Koha::Objects for this module eventually.

C4::Matcher::_store_matchpoint(): DBI Exception: DBD::mysql::st execute failed: You have an error in
your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax
to use near 'offset, length) VALUES ('27', '1', '999'...' at line 2 at /usr/share/koha/lib/C4/Matcher.pm
line 314

Test Plan:
1) Set up Koha with MariaDB 10.6
2) Attempt to create a matching rule
3) Note the error screen
4) Apply this patch
5) Restart all the things!
6) Attempt to create another matching rule
7) No errors this time

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4628d2e81cf97951e978ae1e18a6939767ad2b09)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 32734: Add REST endpoint to list biblios
Agustin Moyano [Fri, 17 Feb 2023 01:17:43 +0000 (22:17 -0300)]
Bug 32734: Add REST endpoint to list biblios

This patch adds an endpoint to list biblios

To test:
1. apply patch
2. enable basic auth
3. call to GET /api/v1/biblios with the following Accept headers:
 * application/json
 * application/marcxml+xml
 * application/marc-in-json
 * application/marc
 * text/plain
4. notice how data changes with each Accept header
5. prove t/db_dependent/Koha/Biblios.t t/db_dependent/api/v1/biblios.t
6. sign off

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Hammat Wele <hammat.wele@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a4fb1ca3d147dfe2757bba10225088db4236d430)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>