]> git.koha-community.org Git - koha.git/log
koha.git
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 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>
19 months agoBug 31801: Add REST endpoint to modify a biblio
Agustin Moyano [Fri, 23 Dec 2022 21:38:04 +0000 (18:38 -0300)]
Bug 31801: Add REST endpoint to modify a biblio

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Pick a biblio to modify, and modify it's marc record
4. Make a PUT request to /api/v1/biblios/:biblionumber with one of the following content type header
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
5. Add the following header in the request 'x-framework-id: <framework id>'
5. Check that the biblio was modified
6. Sign off

Signed-off-by: Hammat Wele <hammat.wele@inlibro.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4438c4da2e742c9383f30ea9850b8f0a1a3b5712)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 31800: Add REST endpoint to add a biblio
Agustin Moyano [Fri, 23 Dec 2022 20:15:29 +0000 (17:15 -0300)]
Bug 31800: Add REST endpoint to add a biblio

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Make a POST request to /api/v1/biblios with one of the following content type header
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
4. Add the following header to the request: "x-framework-id: <framework id>"
5. Check that the biblio is created
6. Sign off

Signed-off-by: Jan Kissig <jkissig@th-wildau.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b5d6ccdf604c82beef627360c45f4cad78739f1b)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 29354: Make overdue_notices.pl send .html
Magnus Enger [Mon, 12 Dec 2022 13:41:20 +0000 (13:41 +0000)]
Bug 29354: Make overdue_notices.pl send .html

If you have EmailOverduesNoEmail = Send and specify "--html somedir",
overdue_notices.pl will send a file by email that contains partial
HTML, as a file called attachment.txt. This patch fixes that.

To reproduce in koha-testing-docker:
- EmailOverduesNoEmail = Send
- Make sure you have a loan that was due yesterday, by backdating the
  due date
- Set up an overdue action to send "Overdue Notice" (ODUE) to the
  category you made the loan to above, when a loan is one day overdue
- Run this command:
  $ sudo koha-shell -c "perl misc/cronjobs/overdue_notices.pl -v -t -html /tmp/" kohadev
- Look at the file /tmp/notices-<DATE>.html and make sure it is a full
  HTML document, with <html>, <head>, <body> etc.
- Create a report like this:
  SELECT message_id, letter_id, borrowernumber, subject, CONCAT( '<pre>', content, '</pre>' ) AS content,
    metadata, letter_code, message_transport_type, time_queued, updated_on, to_address, content_type, failure_code
  FROM message_queue
  WHERE subject = 'Overdue Notices'
  ORDER BY message_id DESC
- Run the report and verify there is a line like this in the "content"
  of the newest message:
  Content-Type: text/plain; name=attachment.txt
- A part of the "content" will be a block of several lines of gibberish
  (base64) that look something like "RGVhciAga29oYSwNCg0KQWN...". Copy
  this block of text to somewhere like base64decode.org and decode the
  text. You should see a fragment of HTML, without <html>, <head>,
  <body> etc.

To test:
- Apply the patch
- Run overdue_notices.pl again, with the same arguments as above
- Make sure /tmp/notices-<DATE>.html is still a full HTML document
- Re-run the report, and make sure you now have this in the "content":
  Content-Type: text/html; name=attachment.html
- Decode the base64 and make sure it is now a full HTML document, with
  <html>, <head>, <body> etc.
- Re-run overdue_notices.pl as above, but replace "-html /tmp/" with
  "-csv /tmp/test.csv"
- Make sure /tmp/test.csv and the decoded base64 from the report
  contains CSV data
- Re-run overdue_notices.pl as above, but replace "-html /tmp/" with
  "-text /tmp/"
- Make sure /tmp/notices-<DATE>.txt and the decoded base64 from the
  report contains no HTML

Note:
- The actual text from the different messages will be enclosed in
  <pre>-tags
- If you have HTML in your ODUE message template and run with -v, you
  will have warnings saying "The following terms were not matched and
  replaced"
These are due to Bug 14347, and are not adressed by the current patch.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6d1890fc8e09be2c16677c9a0f4f71e70b3696b4)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 33150: Add specific message for informing about too_soon for renewal.
Andreas Jonsson [Mon, 6 Mar 2023 15:42:05 +0000 (16:42 +0100)]
Bug 33150: Add specific message for informing about too_soon for renewal.

The message "No renewals allowed" is incorrect when it is too soon for renewal,
this patch adds a specific error message.

To test:
- Make sure the system preference  SCOAllowCheckin is set to "allow"
- Go to Koha administration -> Circulation and fine rules
- Edit the rule for all items and change "No renewal before" to 1 and save.
- Check out an item to a borrower (for instance barcode 39999000000719 to the user koha with cardnumber 42).
- Go to self checkout (http://localhost:8080/cgi-bin/koha/sco/sco-main.pl)
- Log in as the user (koha/koha)
- Verify that the error message in the Renew column is "This item cannot yet be renewed."

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 7f3a35a917412da6fd5eb3211a0ac6ab7c869e4c)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32684: (QA follow-up) Move too_many_lost to Patron
Marcel de Rooy [Wed, 8 Mar 2023 12:45:53 +0000 (12:45 +0000)]
Bug 32684: (QA follow-up) Move too_many_lost to Patron

Alternative implementation outside sub new.

Test plan:
Run t/db_dependent/SIP/Message.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e630624e5e0d6a1c1e14e2715b152be9aa139fe6)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32684: Implement SIP patron status field "too many items lost"
Kyle Hall [Thu, 19 Jan 2023 18:45:07 +0000 (13:45 -0500)]
Bug 32684: Implement SIP patron status field "too many items lost"

The SIP patron status and information responses always return false foe "too many items lost". It would be reasonable to check the count of lost items still checked out to the patron and compare that to a threshold set in the sip config file. Though not all libraries operate in this way, it seems like a good and reasonable implementation as long is it is properly documented.

This patch adds the ability to set the SIP "too many items lost" flag
for a patron based on the number of lost checkouts the patron has where
the lost flag on those items is greater than the given flag value.

For example, one could specify that the flag be set if the patron has
more than 2 items checked out where itemlost is greater than 3.

By default the feature is disabled to retain the existing functionality.
If enabled, the default itemlost minimum flag value is 1 unless
specified.

Test Plan:
1) Apply this patch
2) prove t/db_dependent/SIP/Message.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>
(cherry picked from commit 877f8ed89890d5666608749781b7ac0958900fe8)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 33144: Unescape text from authority lookup for advanced editor
Phil Ringnalda [Mon, 6 Mar 2023 05:24:56 +0000 (21:24 -0800)]
Bug 33144: Unescape text from authority lookup for advanced editor

While the basic editor is happy with an array of subfields it can
stuff into separate fields, the advanced editor needs to get a JS
string back from the authority lookup plugin, because it is going
to just add the whole thing as text. The string has to be HTML
entity encoded, both to not allow XSS and just to not break the
window, but it needs to then be unencoded before being inserted
into the editor.

Test plan:
1. Set the system preference EnableAdvancedCatalogingEditor to
   Enable
2. Edit any Topical Term authority, and at the end of tag 150
   subfield a, add & </script>
3. Cataloging - Advanced editor
4. Press return in the editor to get a new blank line, type 650
   and press tab three times, then type Ctrl-Shift-L
5. Search for your modified authority, and click Choose
6. Verify that the tiny popup opened by the search window finished
   its job and closed itself
7. Verify that your 650 now shows as "‡aAbduction &
   </script>‡vDrama" rather than "‡aAbduction  &amp;
   &lt;/script&gt;‡vDrama."

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e171d5fdd319ec9d955992c9340bb9a1530e3aaf)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Don't display breadcrumb if pref is off
Jonathan Druart [Thu, 2 Mar 2023 10:04:23 +0000 (11:04 +0100)]
Bug 32991: Don't display breadcrumb if pref is off

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 89d374600702f1dea792aa8713e86464bae88cf1)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Remove _is_loading warning, and improve 'ERMModule' disabled warning
Agustin Moyano [Wed, 1 Mar 2023 15:56:55 +0000 (12:56 -0300)]
Bug 32991: Remove _is_loading warning, and improve 'ERMModule' disabled warning

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e4bb554eb5adf30a40dcd54153b4d24618b9164d)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Add cypress tests for the dialog box
Jonathan Druart [Tue, 28 Feb 2023 11:21:54 +0000 (12:21 +0100)]
Bug 32991: Add cypress tests for the dialog box

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dc40b5dd08a60657e4df9f966cf0aa53644ce927)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Don't remove all messages when confirm box is closed
Jonathan Druart [Tue, 28 Feb 2023 10:48:55 +0000 (11:48 +0100)]
Bug 32991: Don't remove all messages when confirm box is closed

If we cancel the confirmation box we should not clear all the messages

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8cee1f287d81eb1693c1bde564a0a1b6d85affd2)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Flag the deletion messages as displayed already
Jonathan Druart [Tue, 28 Feb 2023 10:21:48 +0000 (11:21 +0100)]
Bug 32991: Flag the deletion messages as displayed already

Or they will be displayed again on the next view

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5709727aae2ea1687506752fde2f91d504a91eca)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Fix cypress tests. Added new test for when deleting from show view.
Pedro Amorim [Fri, 24 Feb 2023 16:06:31 +0000 (16:06 +0000)]
Bug 32991: Fix cypress tests. Added new test for when deleting from show view.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 48b39533f6855e8966ce8704985fbb01d99ced51)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Agreements: Add delete dialog to show. Removed FormConfirmDelete component...
Pedro Amorim [Mon, 27 Feb 2023 15:22:48 +0000 (15:22 +0000)]
Bug 32991: Agreements: Add delete dialog to show. Removed FormConfirmDelete component and routes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f98c63820f4fdddfc0402f2911c397ba735f57b5)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Licenses: Add delete dialog to list and show. Removed FormConfirmDelete...
Pedro Amorim [Fri, 24 Feb 2023 17:01:15 +0000 (17:01 +0000)]
Bug 32991: Licenses: Add delete dialog to list and show. Removed FormConfirmDelete component and routes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0e63e366ca0094527699eb4f4b051d0e975e2d1f)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Local Packages: Add delete dialog to list and show. Removed FormConfirmDel...
Pedro Amorim [Fri, 24 Feb 2023 18:30:54 +0000 (18:30 +0000)]
Bug 32991: Local Packages: Add delete dialog to list and show. Removed FormConfirmDelete component and routes.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dbb606983c9524efb390a100111e8f2214e09fa0)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Local titles: Add delete dialog to list and show. Removed FormConfirmDelet...
Pedro Amorim [Mon, 27 Feb 2023 11:08:35 +0000 (11:08 +0000)]
Bug 32991: Local titles: Add delete dialog to list and show. Removed FormConfirmDelete component and routes.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 70a4d4e0b42e7a1b789565806c292b691fa3481b)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Allow for a confirmation title, message, accept_label and cancel_label...
Pedro Amorim [Mon, 27 Feb 2023 15:09:41 +0000 (15:09 +0000)]
Bug 32991: Allow for a confirmation title, message, accept_label and cancel_label in Dialog.vue

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a8d6d80ad58f864bab7513d7d6f57275984dba39)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: accept is a callback, rename accept to accept_callback
Pedro Amorim [Fri, 24 Feb 2023 17:10:03 +0000 (17:10 +0000)]
Bug 32991: accept is a callback, rename accept to accept_callback

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5ceccfe0ad22b7773acf281e769b6b921d8f2610)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Style the dialog to be in line with rest of Koha; Fix duplicate HTML eleme...
Pedro Amorim [Fri, 24 Feb 2023 11:32:29 +0000 (11:32 +0000)]
Bug 32991: Style the dialog to be in line with rest of Koha; Fix duplicate HTML element ID

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 46a72d54a0a05134c52378d7b4a5d9769162a47b)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Add a confirmation message
Jonathan Druart [Fri, 17 Feb 2023 10:45:43 +0000 (11:45 +0100)]
Bug 32991: Add a confirmation message

Looks easier to have a separate variable for the confirmation box, and
easier for styling as well.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 754c9f2862c63bdfc03a432e498b1b68d4c0c856)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 32991: Improve our Dialog component
Jonathan Druart [Fri, 17 Feb 2023 10:26:38 +0000 (11:26 +0100)]
Bug 32991: Improve our Dialog component

This is picking some improvements made by Agustin on bug 32607.
This patch is only a POC and we should apply this change to the
different delete route.

We will then remove the *FormConfirmDelete components, and the /delete routes

Initially I wanted to have the same behaviour as in other areas of Koha,
and have a separate view for the deletion step. But it's too much
overhead for not much gain.

Additionally we will have to remove messages.js, the aim of this file
was to import the methods to add messages very easily (only 1 import
line). Now we will need 2 lines (it was more when I added messages.js,
because I didn't inject the store). Not a big deal.

Finally, there is something weird in Main.vue we need to fix. The
console is showing a warning
"[Vue warn]: setup() return property "_is_loading" should not start with "$" or "_" which are reserved prefixes for Vue internals."

I had a hard time to display this "loading" modal when the app is
loading all the things it needs. Pinia/store is not available as we are
accessing the methods/actions too earlier. It will be good to fix that
before we decide to move forward with this approach.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Agustín Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0b380ecfa3f462f52758ceadb4e4161c7806dc60)
Signed-off-by: Jacob O'Mara <jacob.omara@ptfs-europe.com>
19 months agoBug 33214: (RMaint follow-up) Remove tests for unbackported feature
Martin Renvoize [Tue, 14 Mar 2023 14:49:19 +0000 (14:49 +0000)]
Bug 33214: (RMaint follow-up) Remove tests for unbackported feature

We haven't backport the strings_map functionality, so we don't need the
fixes to the tests for it here.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
19 months agoBug 32994: Remove breaking css/maps/*.map files from Makefile.PL
Mason James [Tue, 21 Feb 2023 02:01:21 +0000 (15:01 +1300)]
Bug 32994: Remove breaking css/maps/*.map files from Makefile.PL

to test:
 - run makefile, note failure

  $ perl Makefile.PL
  $ make
  $ make install
  webpack 5.74.0 compiled with 3 warnings in 20831 ms
  Done in 36.01s.
  make: *** No rule to make target 'koha-tmpl/opac-tmpl/bootstrap/css/maps/opac-rtl.css.map', needed by 'pm_to_blib'.  Stop.

 - apply patch
 - run makefile, note success

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 587ab3ddb850398cd1ba26b8ff2b9369651b7a67)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
19 months agoBug 33214: (follow-up) Make tests less fragile
Tomas Cohen Arazi [Mon, 13 Mar 2023 19:53:25 +0000 (16:53 -0300)]
Bug 33214: (follow-up) Make tests less fragile

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 12e3e91c134d9900a9712433618ae891197500e6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 33214: (follow-up) Consistency on key names
Tomas Cohen Arazi [Mon, 13 Mar 2023 19:42:26 +0000 (16:42 -0300)]
Bug 33214: (follow-up) Consistency on key names

This patch makes GetAuthorisedValueDesc used cache keys match what we
discussed on the bug, which seems to have been lost on some rebase and
highlighted by failing tests.

I also add some more cache flushes.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 52315d60f38165195b86b49c771d1861084dc9dd)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 32781: Prevent import from list to fail if package does not exist
Jonathan Druart [Wed, 1 Feb 2023 15:23:59 +0000 (16:23 +0100)]
Bug 32781: Prevent import from list to fail if package does not exist

This is theorical (caught when writting tests) but we need to deal with
it.

Can't call method "resources" on an undefined value at /kohadevbox/koha/Koha/BackgroundJob/CreateEHoldingsFromBiblios.pm line 94.

Test plan:
  prove t/db_dependent/Koha/BackgroundJob/CreateEHoldingsFromBiblios.t
must return green

Signed-off-by: Pedro Amorim <pedro.amorim@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 71bf715596769577766cbf8c21972826e766e97f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 33214: Make tests use random data and clear the cache
Tomas Cohen Arazi [Mon, 13 Mar 2023 17:29:18 +0000 (14:29 -0300)]
Bug 33214: Make tests use random data and clear the cache

This trivial patch removes some wrongly hardcoded bits, and makes the
tests also clear the cache before and after being run.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit db8261ef5e921de51e6fce0bb3a93f5c3349d040)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 30920: (follow-up) Manually flush caches in tests
Martin Renvoize [Fri, 10 Mar 2023 16:34:26 +0000 (16:34 +0000)]
Bug 30920: (follow-up) Manually flush caches in tests

We can't rely on our cache flushing in either 'store' or 'delete'
triggers as t/lib/TestBuilder::build_object skips the Koha::Object store
and uses direct DB inserts in preference.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b4c9a6cfe23a47cd9a3cb5c6a74c51b36dc15855)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 30920: (follow-up) Cleanup warning from C4::Biblio::GetAuthorisedValueDesc
Martin Renvoize [Fri, 10 Mar 2023 16:33:44 +0000 (16:33 +0000)]
Bug 30920: (follow-up) Cleanup warning from C4::Biblio::GetAuthorisedValueDesc

We simply return early and empty if $value is not passed

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4e8d76d6f98d0f28d6f1804a1435da2f4c229441)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 30920: (follow-up) Flush on delete
Martin Renvoize [Fri, 10 Mar 2023 15:26:45 +0000 (15:26 +0000)]
Bug 30920: (follow-up) Flush on delete

We missed the flush on delete triggers for the various caches introduced
here.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f7164385559002216810656fb51f89a3b2892a2b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 30920: (follow-up) Cache key fixes
Martin Renvoize [Fri, 10 Mar 2023 15:11:51 +0000 (15:11 +0000)]
Bug 30920: (follow-up) Cache key fixes

We missed a few places, namely the flushes, when renaming the cache
keys.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7d9d79566991dadfaca1a058989d03358a1df6ce)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 30920: (QA follow-up) Use get_dirty_columns to avoid DB query
Tomas Cohen Arazi [Fri, 10 Mar 2023 12:07:26 +0000 (09:07 -0300)]
Bug 30920: (QA follow-up) Use get_dirty_columns to avoid DB query

We can rely on DBIC's get_dirty_columns to check if the descriptions
have changed, and set things for flushing without an extra DB query.

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 a44f03c7156cce4ff1ae55da3772f98e7b5e89b6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 30920: (follow-up) Add missing use
Nick Clemens [Fri, 17 Jun 2022 13:36:13 +0000 (13:36 +0000)]
Bug 30920: (follow-up) Add missing use

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dde86f08fcc359d57dc94ca5b218ddfb791c342c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 30920: Add caching to GetAuthorizedValueDesc
Martin Renvoize [Thu, 26 May 2022 15:31:30 +0000 (16:31 +0100)]
Bug 30920: Add caching to GetAuthorizedValueDesc

This patch adds caching to C4::Biblio::GetAuthorisedValueDesc for performance.

We cache each hash involved in the method use for description lookup and
we're careful to clear said caches appropraitely on changes.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ab866f040dc72da28ed59f3bf16505bfba47ed21)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 33211: Fix failing test
Nick Clemens [Mon, 13 Mar 2023 14:39:03 +0000 (14:39 +0000)]
Bug 33211: Fix failing test

This patch updates the selector to use the full class and find the text
type as well

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 587615fd9f63e74fdb42f7832845fe52e3f17a74)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
19 months agoBug 31858: (RMaint follow-up) Fix test plan
Martin Renvoize [Tue, 14 Mar 2023 07:20:49 +0000 (07:20 +0000)]
Bug 31858: (RMaint follow-up) Fix test plan

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
19 months agoBug 32519: In Elasticsearch mappings table use of search field name and label
Fridolin Somers [Fri, 23 Dec 2022 06:15:09 +0000 (20:15 -1000)]
Bug 32519: In Elasticsearch mappings table use of search field name and label

In Elasticsearch mappings table, in tabs for mappings we should add search field name in addition to label ; in order to find them when searching using DataTable search field. This is very useful when debugging.

Also the lines are sorting alphabetically by search field name.
So I propose to display name and label between parenthesis.
And also add label to the form in last line.

By default label equals name so I display label only if different from name.

Test plan :
1) Go to : Administration > Search engine configuration (Elasticsearch)
2) In first tabe edit a line to change label, for example : author => Auteur
3) Save
4) Go to second tab
5) Check you see a line with 'author (Auteur)' and lines with only name when label equals name
6) Look at last line (addition form)
7) Check you see in combobox : 'author (Auteur)' and lines with only name when label equals name

Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.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 14a2cc60a404709edc97f6daed8ad8e00dd884e8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 32952: Standardize action fieldsets in authorities, cataloging, and circulation
Owen Leonard [Wed, 1 Feb 2023 11:58:04 +0000 (11:58 +0000)]
Bug 32952: Standardize action fieldsets in authorities, cataloging, and circulation

This patch updates some templates in authorities, cataloging, and
circulation so that fieldsets with the "action" class are placed outside
the form's main fieldset.

To test, apply the patch and check the following pages to confirm that
changes to form structure look correct:

- Authorities -> Authority search -> Merge
- Catalog -> Search -> Merge records
- Catalog -> Bibliographic record details -> Edit -> Attach item
- Circulation -> Check out to patron -> Batch check out
- Circulation -> Overdues -> Sidebar filter
- Circulation -> Holds to pull -> Sidebar filter

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b27dd883ca19eb1594507271aa7b8d1bd7caf328)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 32683: Convert header search tabs to Bootstrap
Owen Leonard [Thu, 19 Jan 2023 19:04:53 +0000 (19:04 +0000)]
Bug 32683: Convert header search tabs to Bootstrap

This patch updates all search header include files so that they have
Bootstrap tab markup instead of jQueryUI. jQueryUI-related JavaScript is
updated to work with Bootstrap.

To test, apply the patch and rebuild the staff interface CSS. Clear your
browser cache if necessary.

Test that keyboard shortcuts work correctly: Alt-U for circulation,
Alt-R for returns, Alt-W for renewals, and Alt-Q for search. Each
shortcut should either activate the correct search tab (if present on
the page) or redirect you to that page.

Cursor focus should be automatically placed in expanded header search
form, whether it be on page load or when switching tabs.

Test search header forms with additional search options work correctly:
Clicking the "settings" icon should expand the panel with additional
fields.

Test at least one page which uses each include file:

- acquisitions-search.inc
  - Acquisitions and related pages
- adv-search.inc
  - Advanced catalog search
- authorities-search.inc
  - Authorities and related pages
  - Check that the right tab is preselected after each kind of search,
e.g. a search by "Main heading" should return a search results page
where the "Main heading" tab is preselected.
- budgets-admin-search.inc
  - Administration -> Budgets
- cat-search.inc
  - Catalog search results, bibliographic details, etc.
- cataloging-search.inc
  - Cataloging home page and cataloging search results
- checkin-search.inc
  - Circulation -> Check in
- circ-search.inc
  - Circulation -> Check out
- cities-admin-search.inc
  - Administration -> Cities and towns
- contracts-admin-search.inc
  - Acquisitions -> Vendor -> Contracts
- currencies-admin-search.inc
  - Administration -> Currencies
- desks-admin-search.inc
  - Administration -> Desks (must have UseCirculationDesks enabled)
- erm-search.inc
  - ERM (must have ERMModule enabled)
- home-search.inc
  - Staff interface home page
- letters-search.inc
  - Tools -> Notices
- patron-search-header.inc
  - Patron details, patron accounting, etc.
- patrons-admin-search.inc
  - Administratoin -> Patron categories
- prefs-admin-search.inc
  - Administration home page and system preferences
- serials-search.inc
  - Serials and related pages
- suggestions-add-search.inc
  - Not used
- z3950-admin-search.inc
  - Administration -> Z39.50 servers

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>
(cherry picked from commit 5e6992b600f0b1ee655429e35c6be49416ccfaca)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 32886: Set focus for cursor to Code when adding a new restriction
Owen Leonard [Tue, 7 Feb 2023 13:40:29 +0000 (13:40 +0000)]
Bug 32886: Set focus for cursor to Code when adding a new restriction

This patch adds the "focus" class to the form for defining a new patron
restriction so that the cursor focus is automatically added.

To test, apply the patch and go to Administration -> Patron restrictions
-> New restriction.

The cursor should automatically move to the "Code" input field.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 546c47ab3fcd380ee3f7be5902fd969d0ebbc3a8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 32746: Standardize structure around action fieldsets in acquisitions
Owen Leonard [Mon, 30 Jan 2023 15:45:32 +0000 (15:45 +0000)]
Bug 32746: Standardize structure around action fieldsets in acquisitions

This patch updates acquisitions templates so that fieldsets with the
"action" class are placed outside the form's main fieldset. A couple of
minor changes have been made to related CSS.

To test, apply the patch and rebuild the staff interface CSS. Go to
acquisitions and check the following pages to confirm that changes to
form structure look correct:

- Open the "Late orders" page from the left-hand sidebar menu and check
  the form in the sidebar.
- Open the "Orders search" form in the search header and submit the form
  without specifying any search criteria. This should bring up a blank
  orders search form.
- Open the "Invoices" page from the left-hand sidebar menu. Check the
  form in the sidebar.
  - Perform an invoice search which will return results.
  - View one of the invoices returned by your search.
  - On the invoice detail age, the "Save" button associated with the
    invoice details at the top should look correct.
  - There should be a box below that with the heading "Adjustments" and
    a link to add an adjustment.
  - When you click "Add an adjustment," a form should be displayed with
    the correct controls at the bottom. Clicking "Cancel" should hide
    the form.
  - Click the "Manage invoice files" link, and check the form on that
    page.
- Locate a vendor and view its details.
  - Check the "Uncertain prices" page, linked from the menu in the
    left-hand sidebar.
  - Open the "Baskets" page from the left-hand sidebar. Click the "Add
    to basket" button for one of the existing baskets.
  - Click "From existing orders (copy)". Check that this form looks
    correct.
  - Open the "Basket groups" page from the left-hand sidebar menu.
    - Click "New basket group" and check that form.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1c8c90611967bd667e1e5e86f871541564d66b4b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
19 months agoBug 33063: Make sure correct subgroup is pre-selected when duplicating reports
Katrin Fischer [Mon, 27 Feb 2023 23:45:12 +0000 (23:45 +0000)]
Bug 33063: Make sure correct subgroup is pre-selected when duplicating reports

When the 'Duplicate' option for reports was used, the all options
would be copied correctly to the new report, but the report sub group.

In this case the templates were created correctly, but the JavaScript
to create the correct pull downs for each group, overwrote the
the selection.

To test:
* Create a some reports with different groups and subgroups and without
* 'Duplicate' your reports and verify that the sub group will always stay empty
* Apply patch
* Verify the correct sub group is now always selected
* Edit/Add some reports to make sure the group/subgroup controls still
  work as expected

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a651ff50a6819396cc24c5f6bc47110cdd001873)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>