koha.git
10 months agoBug 33727: Groundwork for Calendar.t
Marcel de Rooy [Sat, 13 May 2023 12:06:55 +0000 (12:06 +0000)]
Bug 33727: Groundwork for Calendar.t

Update test while removing need for Test::DBIx::Class.

Test plan:
Run t/Calendar.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6e736a5d5f342325651944772b74c5ace1b8814f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d77d59fcaa5cb9fbbf92777282101a64ef285df7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34243: Fix copy/pasted city references in api tests
Marcel de Rooy [Wed, 12 Jul 2023 14:53:46 +0000 (14:53 +0000)]
Bug 34243: Fix copy/pasted city references in api tests

Two occurrences.
Just comments.

Test plan:
Read the patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 308d75d05d105a5829c98617b5229fae587c32f3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ef77656e85fc959ad7f769a8dbdec8e97cc23c4e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 31082: (QA follow-up) Fix translation - we are in a .tt not in a .js file
Katrin Fischer [Sun, 9 Jul 2023 15:33:01 +0000 (15:33 +0000)]
Bug 31082: (QA follow-up) Fix translation - we are in a .tt not in a .js file

Just changing from two to one underscore.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c7a0a31a79d09b985f0fd8dd4166f7ee825bc561)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a0a0c81df2fad545461ae2de70a10f7175f2d640)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 31082: Make the string translatable
Jonathan Druart [Fri, 7 Jul 2023 09:40:32 +0000 (11:40 +0200)]
Bug 31082: Make the string translatable

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 4c21e6a3e2e97fd8fc481d84c437fefaac4bccf8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 64348926b14bc5a480e9db824f43a204f96d9d51)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 31082: (follow-up) same for "remove" action button on bundle item list
Victor Grousset/tuxayo [Sun, 18 Jun 2023 22:39:19 +0000 (00:39 +0200)]
Bug 31082: (follow-up) same for "remove" action button on bundle item list

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 826db3092bc59a5ea2f8b37b6d542973a13bca94)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit eb9ba1f875f8c32674a2f87000fdc580dc4e69b6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 31082: Add tooltip to buttons when item bundles cannot be changed while checked out
Jonathan Druart [Thu, 25 May 2023 09:46:39 +0000 (11:46 +0200)]
Bug 31082: Add tooltip to buttons when item bundles cannot be changed while checked out

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cbc46793415a531ae0041a9857520bb4f0b9b90b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3b37423d82a6a6caacd71a468b1346c976c9609c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33817: (QA follow-up) Fix tidyness
Tomas Cohen Arazi [Mon, 10 Jul 2023 17:31:40 +0000 (14:31 -0300)]
Bug 33817: (QA follow-up) Fix tidyness

This patch fixes some reported tidyness issues with the patches.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 927c5a891352e5c63fe7baa0ecb7c9eca001865b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6c381c20e202e693bc01b13e6ef532161dd6a60c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33817: (follow-up) Fix spec and messages
Martin Renvoize [Tue, 27 Jun 2023 11:03:58 +0000 (12:03 +0100)]
Bug 33817: (follow-up) Fix spec and messages

This patch should resolve the issues highlighted at signoff time by
Victor.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 34b704fb0b9da3d279c4169920d39b286d17fb39)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ba57a9aa58c4588c603d6ffb7613271b3f662a6c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33817: Enforce server-side
Jonathan Druart [Thu, 25 May 2023 09:37:38 +0000 (11:37 +0200)]
Bug 33817: Enforce server-side

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 384de4a74adb6af1296ee2ad53f1c9ad1dd0c2eb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e4ef4c5e3d3d328479677b586a0e5c3f1b423b20)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33817: Prevent item bundle that is checked out to be modified
Jonathan Druart [Wed, 24 May 2023 11:16:14 +0000 (13:16 +0200)]
Bug 33817: Prevent item bundle that is checked out to be modified

While an item bundle is checked out, we don't want any items to be
added or removed from the bundle.

To test:
* Create a record with LDR Pos. 7 = c
* Add an item for your bundle
* Add one or more existing items from other records to the bundle
* Check out the bundle item
* Verify it appears correctly on the patron account
* Verify you can still add/remove items from the bundle
* Apply patch set
* Verify that the add/remove links are now disabled (greyed out)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8cb2dd4e3077f95528ffffaa4a825aae314d034f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a29fec1b4e9de007c7a833cea3df788c3e5cac29)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34097: Prevent clicking ellipsis for dateaccessioned plugin from scrolling up
Phil Ringnalda [Tue, 27 Jun 2023 22:34:59 +0000 (15:34 -0700)]
Bug 34097: Prevent clicking ellipsis for dateaccessioned plugin from scrolling up

Test plan:
1. Find a record with several items (in ktd "MacLaren's Gaelic
   self-taught" will do nicely
2. Click the Edit button next to one of the items
3. Click the "..." to the right of "d - Date acquired" and verify that the
   page doesn't scroll up to the top, and that the current date is
   inserted in the field
4. Click the "..." to the right of "w - Price effective from" and verify
   that the page doesn't scroll up and the current date is inserted

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3824547e5c92328ae0bf54939ec0315b1cbfd98f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2d24f269f5692ca333d55381e337a5a90a1d1eff)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33808: Add aria-labels in reports-toolbar.inc
Matt Blenkinsop [Tue, 23 May 2023 14:01:40 +0000 (14:01 +0000)]
Bug 33808: Add aria-labels in reports-toolbar.inc

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8fac9067b2494cca29a2b2147b78366c6a53bcf6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit eba9d136604c6f2e4847d4d71396b08b22e6b4d5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33808: Add aria-labels in basket.tt
Matt Blenkinsop [Tue, 23 May 2023 14:00:59 +0000 (14:00 +0000)]
Bug 33808: Add aria-labels in basket.tt

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0813a3b3dc68f8498ec83cd7df2b0ebad099378)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 12ee1fde0de083d3519cee46259a3f2c8848c64b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33808: Add aria-labels in opac-basket.tt
Matt Blenkinsop [Tue, 23 May 2023 14:00:11 +0000 (14:00 +0000)]
Bug 33808: Add aria-labels in opac-basket.tt

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aa0f113f97c1b79b69fc7f3999ced00d3ac2b3c3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b1ddaa0b15124afefcfde8ff1e010d79eaa2ead3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33808: Add aria-labels in opac-shelves.tt
Matt Blenkinsop [Tue, 23 May 2023 13:58:13 +0000 (13:58 +0000)]
Bug 33808: Add aria-labels in opac-shelves.tt

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 429f0d6dce8e28fee5e63f06f63552775aadc543)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c7ab9be9b0f74468b40fa322238bdffc1dcf9410)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33974: (follow-up) Adapt the orders endpoint
Tomas Cohen Arazi [Fri, 16 Jun 2023 15:53:05 +0000 (12:53 -0300)]
Bug 33974: (follow-up) Adapt the orders endpoint

In order to reduce the technical debt carried on the orders controller,
and to highlight the decisions made on the prior patch, I adapted the
list() orders controller using the new tools in town.

The result is this endpoint can now embed bibio, without needing to have
a custom piece of code.

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

Signed-off-by: Sam Lau <samalau@gmail.com>
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 c07e43cf2afecfa6df0ba259187b90f567bc2603)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 944c6939251906542f2d8aeebb01a3af210173f6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33974: (follow-up) _order_by is not always an arrayref
Tomas Cohen Arazi [Thu, 6 Jul 2023 18:50:40 +0000 (15:50 -0300)]
Bug 33974: (follow-up) _order_by is not always an arrayref

The loop through the `_order_by` query parameter occurences introduced
by this patchset was naive regarding the possible scenarios.

When there's only one parameter passed, it shouldn't be expecting an
arrayref, but a scalar. This patch deals with that in the simplest way.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t
=> FAIL: Tests are failing
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d90d264253134a1c6fa7dbb64b959bd7d3789fce)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a16356ae2846a76b2a226d44f5498d0389f87ae9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33974: (follow-up) biblionumber column needs special handling
Tomas Cohen Arazi [Mon, 3 Jul 2023 16:30:56 +0000 (13:30 -0300)]
Bug 33974: (follow-up) biblionumber column needs special handling

This patch makes a particular use case be handled correctly: i.e. no
context is passed (e.g. 'biblio' explicitly) and the query is done
against the `biblio_id` attribute. This results in the following DBIC
error:

[ERROR] GET /api/v1/biblios: unhandled exception (DBIx::Class::Exception)<<DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'biblionumber' in where clause is ambiguous at /kohadevbox/koha/Koha/Objects.pm line 394>>

With this patch, this is no longuer the case :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ba80c71e63549e60fcdd5666bd2484b75e5a174d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 35d1f812778dcd8d538f1781b224d41a09be3e79)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33974: (QA follow-up) Remove superflous import
Martin Renvoize [Mon, 3 Jul 2023 15:28:44 +0000 (16:28 +0100)]
Bug 33974: (QA follow-up) Remove superflous import

We don't actually need the Clone import.. it's not used in Biblios.pmt

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c7be8462436350841c0b3715f007f2000e1735f5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b94aa599dd645b1ccd749f1c858e5d07b8613b24)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33974: Make biblioitem columns searchable in a generic way
Tomas Cohen Arazi [Fri, 16 Jun 2023 15:50:07 +0000 (12:50 -0300)]
Bug 33974: Make biblioitem columns searchable in a generic way

This patch makes biblioitem attributes be searchable on the biblios
endpoint. It does so by using the new method in Koha::Biblios, and by
adjusting objects.search(_rs) to accept a $query_fixer arrayref of
functions to be applied to each query or order_by parameters.

The result is cleaner code to write, but complex internals.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass! Searching for biblioitem attributes works on the
API!
3. Sign off :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
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 353f328ad3a99cc5a9ee913cd1f72a1d841705f2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 21ebede0de667f2e17d6935920c8b9cebd16b880)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33974: Add Koha::Biblios->api_query_fixer
Tomas Cohen Arazi [Fri, 16 Jun 2023 15:48:14 +0000 (12:48 -0300)]
Bug 33974: Add Koha::Biblios->api_query_fixer

This patch adds the `api_query_fixer` method to the class, and adds
tests to validate its behavior.

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

Signed-off-by: Sam Lau <samalau@gmail.com>
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 60e8998e914d8f8ba9b2153d542bf42365a41994)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 949ba13a6e51acd078535e01d74efae9756b5fcc)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33573: Add public endpoint for cancelling holds
Tomas Cohen Arazi [Wed, 7 Jun 2023 13:42:15 +0000 (10:42 -0300)]
Bug 33573: Add public endpoint for cancelling holds

This patch introduces a public endpoint for cancelling holds.
Cancellation requests are generated when the hold is waiting and
configuration allows requesting cancellation, as the OPAC does right
now.

Tests cover all the use cases.

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

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 252753f84f53a33f3fd3bd4bf3fb8ae02b53ede7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ef5422bbca8ebacee3448af309d6a91a6922bf08)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33573: Unit tests
Tomas Cohen Arazi [Wed, 7 Jun 2023 13:41:53 +0000 (10:41 -0300)]
Bug 33573: Unit tests

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 24d753cda1e5f7e6a126ffe3af87cbed97dfaea6)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f430c075c1f094cd3769e9ce39ebfde7fca87214)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33946: (QA follow-up) Add spans and classes for styling and translatability
Katrin Fischer [Mon, 10 Jul 2023 21:08:38 +0000 (21:08 +0000)]
Bug 33946: (QA follow-up) Add spans and classes for styling and translatability

Adds back the spans around No title and more spans for
'No bibliographic record' with individual classes for each
to allow for styling later.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f91cc77a68983c1c47ca785eb750dfebd3a1cdb5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7eabb2350b5a40241e0d9e0689255cd1adc9118f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33946: Resync opac/intranet includes
Martin Renvoize [Thu, 8 Jun 2023 12:19:07 +0000 (13:19 +0100)]
Bug 33946: Resync opac/intranet includes

This patch resyncs the whitespace chomping in the opac include to match
that in the intranet include so aid in diffing between the two.

No changes should be visible in the UI but there may be cleaner markup
as a result.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 04814be829ad99bb5a5302f84419528d64548465)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 36847ff51d63b5f4eaf7b08cf98f9afce519fc69)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33946: Do not display link to non-existing bibliographic record
Jonathan Druart [Thu, 8 Jun 2023 07:48:42 +0000 (09:48 +0200)]
Bug 33946: Do not display link to non-existing bibliographic record

If you use biblio-title.inc on a biblio that does not longer exist, "No title" is shown with a link to catalogue/detail?.pl?biblionumber=

We should at least remove the link.

We could even do better and display "No bibliographic record" if the biblio does not longer exist.

Test plan:
Edit mainpage.pl, add
$template->param( your_bib => Koha::Biblios->find(42) );
Edit intranet-main.tt, add
[% INCLUDE 'biblio-title.inc' biblio=your_bib link = 1 %]

Not hit the main page and see what's hapenning.
If you have a bibliographic record with biblionumber=42, its info will
be displayed.
Remove this record and try again => it's replaced with "No bibliographic record"
without a link

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f3e0abddffb8927a48dcf798f8934b5565a9b3b4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit b1ae28e5009824212bcb37073047ceb4bf754dc1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34211: Add +strings for GET /api/v1/biblios/:biblio_id/items
Jonathan Druart [Thu, 6 Jul 2023 12:08:26 +0000 (14:08 +0200)]
Bug 34211: Add +strings for GET /api/v1/biblios/:biblio_id/items

Allow to embed stringified version of attributes for the "Get items for
a biblio" endpoint

Test plan:
curl -u koha:koha --request GET 'http://localhost:8081/api/v1/biblios/47/items' --header "Content-Type: application/json" --header "x-koha-embed: +strings" | jq

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2d27d02a4d63b3d3a322db18db8420693e986fdd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 246c616fa6af223bc2fe5ac950c958308cc004d4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34211: Add tests
Jonathan Druart [Thu, 6 Jul 2023 12:08:13 +0000 (14:08 +0200)]
Bug 34211: Add tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b86ad81bbf19eb5becf0652dcd23dad99cf158be)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit d8326b64a3ed159c90d19a99fce7c9859bebb5d1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 27824: Trim column headers
Jonathan Druart [Wed, 5 Jul 2023 13:44:50 +0000 (15:44 +0200)]
Bug 27824: Trim column headers

To support additional spaces.

Using the system for defining a column name placeholder (Bug 23390), if
there is a space inside the column name placeholder it won't work. The
SQL example in Bug 5697:

SELECT
i.itemnumber,
i.itemnumber as Exemplarnummber,
[[i.itemnumber| itemnumber for batch]],
CONCAT('<a
href=\"/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=',
i.biblionumber, '&itemnumber=', i.itemnumber, '#edititem', '\">',
i.itemnumber, '</a>' ) AS "itemnumber as edit link"
FROM items i

"[[i.itemnumber| itemnumber for batch]]" has a space before "itemnumber
for batch." With that space removed it works as expected.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2c73648f77e530fdd50885bd0e72343d0d4c5c4e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 741f711d5ebad5da7e09896b66c25876a7971b62)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 27824: Add a test
Jonathan Druart [Wed, 5 Jul 2023 13:44:32 +0000 (15:44 +0200)]
Bug 27824: Add a test

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a91e80af7dc76c926c246b8f6f98bf6682345dcd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5f6f595af593c0f4dcc8a6f55177cb2a11e56096)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 31147: Recalls should not adjust due time for related checkouts
Aleisha Amohia [Mon, 10 Jul 2023 03:45:52 +0000 (03:45 +0000)]
Bug 31147: Recalls should not adjust due time for related checkouts

The current recalls behaviour adjusts the due date of the most appropriate checkout based on the 'recall due date interval' circulation rule. It also adjusts the due time, which is buggy behaviour. The due date should be adjusted based on the circulation rule, but the due time should remain the same.

To test:

1. Enable the UseRecalls system preference and configure recalls-related circulation and fines rules
2. Check out Item A to Patron A
3. Log into the database and check the due date for that checked out item, e.g.

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be YYYY-MM-DD 23:59:00

4. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be today + the number of days in your recall due date interval circulation rule, at the exact time you placed the recall. This is buggy behaviour.

5. Apply the patch and restart services
6. Check in Item A, do NOT fulfill the recall
7. Cancel the recall

8. Check out Item A to Patron A
9. Log into the database and check the due date for that checked out item, e.g.

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be YYYY-MM-DD 23:59:00

10. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be today + the number of days in your recall due date interval circulation rule, with time of 23:59:00.

11. Check in Item A, do NOT fulfill the recall
12. Cancel the recall

13. Check out Item A to Patron A. Specify a due date and change the due time so it isn't 23:59.
14. Log into the OPAC as Patron B and place a recall on Item A. This will force a change to the recall's due date. Check the due date in the database

SELECT date_due FROM issues WHERE itemnumber = XXXX;

--> It should be today + the number of days in your recall due date interval circulation rule, with time you set in Step 13.

15. Confirm tests pass t/db_dependent/Koha/Recalls.t

Sponsored-by: Catalyst IT
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 780d6ecb51710bfc2b6978cbe8b8614b12c7eadf)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 023cbfde028fa4b0471558db4a67c337e536d91c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33933: Only show use restriction once on OPAC detail page
David Cook [Wed, 7 Jun 2023 05:30:40 +0000 (05:30 +0000)]
Bug 33933: Only show use restriction once on OPAC detail page

This patch removes a regression from bug 32611 that caused the
use restriction text to be shown twice for "Available" items.

Test plan:
0. Apply patch
1. Go to http://localhost:8081/cgi-bin/koha/cataloguing/additem.pl?biblionumber=29
2. Edit item and add "Restricted access" for "5 - Use restrictions"
3. Go to http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=29
4. Note that "Status" says "Available (Restricted access)" and there is no
duplicate "Restricted access" at the top of that table cell

Signed-off-by: ebal <eric.balluto@univ-lyon2.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0df163bfcfafb3baac6d11ab1864bdbd4d0befa)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dac3791cb82d0b67710ff66d622b7a1dea895040)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 28196: Insert searchid in URL correctly, so it doesn't follow the hash
Phil Ringnalda [Tue, 20 Jun 2023 01:32:46 +0000 (18:32 -0700)]
Bug 28196: Insert searchid in URL correctly, so it doesn't follow the hash

Test plan:
1. Search the catalog in the staff client for anything which will return
   at least two results
2. Click on any result to go to the bib detail page
3. Click the edit button for any item attached to the bib
4. Verify that the loaded URL contains &searchid=scs_(a number), and
   that the URL ends with #edititem
5. Make any change to the item, save, verify that your change was made

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 213392fd6bc02f3551a573e3a6127f3ecbaaed31)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c51968b603c7886430e0423354d418f5a2a03d55)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34220: Only show biblio-view-menu.inc if their is an associated bib
Lucas Gass [Fri, 7 Jul 2023 23:12:56 +0000 (23:12 +0000)]
Bug 34220: Only show biblio-view-menu.inc if their is an associated bib

To test:
- Go to Tools > Log viewer
- Uncheck All modules
- Check the 'Catalog' module
- Make sure "To screen in the browser" is the selected output
- Click Submit

After the page loads, instead of the tools side navbar appearing on the left, a 'catalog detail' type navbar (Normal, MARC, ISBD, etc.) is present with links that error out as there's no associated bibnumber.

-Apply patch
-Try again, you should not see the biblio-view-menu
-Try one more time but this time add a valid biblionumber to the Object: field. Now the biblio-view-menu should show with links to that particular bib.

Works as advertised.
Signed-off-by: Alexander Blanchard <alexander.blanchard@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 7118a01294c6eab2b79305d95ecf7cad64d69458)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dd7f705acc818e505c572c6d8bd7ed71de7d3ce8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33581: Add sample patrons to patch and some hints
Katrin Fischer [Thu, 8 Jun 2023 10:20:02 +0000 (10:20 +0000)]
Bug 33581: Add sample patrons to patch and some hints

* Adds sample patrons to the new dependency checking JS
* Adds a hind "requires sample libraries" to sample patrons
  and sample holidays.

To test:
* Build CSS (yarn build)
* Veriy the checkbox for sample patrons works like the
  sample holidays one
* Verify the hint shows up as intended

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 b2f5c9362138189509f09b61c8e18c2a844b432e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5d6e378e01f7ba67081992a088223f8245a5a9e8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33581: Disable sample holiday if libraries are not selected
Jonathan Druart [Wed, 7 Jun 2023 09:31:20 +0000 (11:31 +0200)]
Bug 33581: Disable sample holiday if libraries are not selected

If libraries are not selected we should not try to insert holidays, or
the installer will fail with a missing FK.

This patch simply disable and uncheck the checkbox when libraries are
not going to be inserted.

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 1137511e63e9b6fd0b1d52f34fb35b0ffb8dc363)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit afb52c1eaacf86094a830d694f0f5b1d50a4edaa)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 32801: Prevent 500 on /checkouts
Jonathan Druart [Wed, 5 Jul 2023 10:26:09 +0000 (12:26 +0200)]
Bug 32801: Prevent 500 on /checkouts

If checked_in flag is passed we return the "old checkouts". But if the
item has been deleted we explode with
  "message":"Expected integer - got null.","path":"\/0\/item_id"

The specs should reflect that an item can have been deleted.

Test plan:
Hit the endpoint and confirm the above.
Can be done easily using curl:
  curl -u koha:koha --request GET 'http://localhost:8081/api/v1/checkouts?patron_id=5&checked_in=1' --header "Content-Type: application/json" | jq

Signed-off-by: Lucas Gass <lucas@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 c4cb183ae1f7225c86a38178176c966ad9cebeda)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ac1febd685936a168f853741be45fd58a445c1c3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 32801: Add tests
Jonathan Druart [Wed, 5 Jul 2023 10:25:40 +0000 (12:25 +0200)]
Bug 32801: Add tests

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b157a2cd7fd57169850ac12e9cb18c4edf771ef7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4041d0612470a87c39a34b56b5e6dfca90fe84cf)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34094: (follow-up) Fix failing unit test
Martin Renvoize [Tue, 11 Jul 2023 13:26:46 +0000 (14:26 +0100)]
Bug 34094: (follow-up) Fix failing unit test

The unit tests were written to assume we always do a 'contains' search,
but the new system preference allows for 'starts_with' or 'contains'.

As such, for the tests to pass, we need to explicitly mock the
preference to 'contains'

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b787e66fef1f14440aa24685171d386bc41b666d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 26e4866c9dbff7758bb3e9886f37a002eea6d9e9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33893: Use template wrapper for tabs: OPAC checkout history
Owen Leonard [Mon, 5 Jun 2023 13:07:35 +0000 (13:07 +0000)]
Bug 33893: Use template wrapper for tabs: OPAC checkout history

This patch updates the OPAC checkout history page so that it uses
the new WRAPPER syntax to generate tabs markup.

This patch also updates tab WRAPPER directives in html_helpers.inc to
allow us to pass a custom id for tab links in situations like this one
where we have multiple tabs requiring unique IDs but they all point to
the same panel.

To test, apply the patch and make sure the OnSiteCheckouts system
preference is set to "disabled."

- Log into the OPAC as a patron with checkouts.
- View the checkout history page. The checkout history information
  should be displayed without any tabs.
- Enable the OnSiteCheckouts system preference and if necessary check
  out some on-site checkouts to your patron.
- On the OPAC history page there should now be three tabs: All,
  Checkouts, and On-site checokuts.
  - Switching between the tabs should filter the table accordingly.
- Test that the changes to the tab wrapper have not broken tabs on other
  pages, e.g. bibliographic details or user summary.

Signed-off-by: AlexanderBlanchardAC <alexander.blanchard@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 28d7108624d779934aad74931ef0aebdd9e732c2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a7e986e18b5ee0647c3ddd35dd1024469adbd2ee)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 26862: Improve MARC21 530 display on detail pages
Katrin Fischer [Mon, 3 Jul 2023 16:19:28 +0000 (16:19 +0000)]
Bug 26862: Improve MARC21 530 display on detail pages

This makes some changes to the way we display field 530 in OPAC
and staff interface:

* Adds missing spaces before $u and between repeated $u subfields
* Adds a description/label before the output of the subfields
* Adds display to the staff interface (was OPAC only)
* Adds separators between repeated 530 fields:
  * OPAC: updates mark-up to use the new CSS driven separators
  * Staff interface: adds | with separator class

To test:
* Find or create a records with multiple 530 entries
* Repeat $u with multiple URLs
* Verify display in staff (missing) and OPAC
* Apply patch
* Verify display is improved :D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2bed26db3b6e0e57c0ced394b51d3a9f07e6e662)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 58c24ea1657d6fb21ba7253c978152cb44011528)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34244: Improve contrast in staff interface main page layered icons
Owen Leonard [Mon, 10 Jul 2023 12:37:07 +0000 (12:37 +0000)]
Bug 34244: Improve contrast in staff interface main page layered icons

This patch adjusts CSS for the staff interface home page so that there
is better contrast with Font Awesome icons which are layered. The
main advanced search and item search links have two icons layered one on
top of the other, and the "lower" one needs to have better contrast
after the staff interface redesign.

To test, apply the patch and rebuild the staff interface CSS. Log into
the staff interface and confirm that the advanced search and item search
link icons are clear and distinguishable from each other.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f6b935a4ca7e9b70c5627fa601b5e9edf42e566d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 84422676d60f5282397ae832ac7bb8327759ff06)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34233: Move select2 include out of patron-search.inc
Lucas Gass [Fri, 7 Jul 2023 21:58:55 +0000 (21:58 +0000)]
Bug 34233: Move select2 include out of patron-search.inc

1. Apply patch
2. Place a hold and make sure the patron pickup locations are
   populating correctly again/
3. Work through the test plan on Bug 28726 to make sure it still works.
4. Enable ArticleRequests, make sure you can still do a patron search
   there.
5. Do a patron search from members.tt, make sure that still works.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c92c893c12ea7fdc37c66916ee3f54ff666d1474)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 93877a3f8f3ca05fded88bbf47ec0d5a929cfa40)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34218: Send a record copy to avoid loss of information and display problems
Thibaud Guillot [Thu, 6 Jul 2023 11:46:47 +0000 (13:46 +0200)]
Bug 34218: Send a record copy to avoid loss of information and display problems

As I wrote in the bug description, I encountered this problem in a particular case,
so I'll explain it in the test plan, but it's certainly likely to be encountered in different ways.

Test plan:

1) Link authorised values with  a field on a MARC framework, like a 942a related to branches
2) Set it on a record with no items
3) Activate syspref "AlternateHoldingsField" and set it to field 942a
4) Go to OPAC View and you will see "Holdings: " without any values
5) Apply this patch
6) Do step 4) again and now it's fixed

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cbd0c15c8712601aff2fce3cb0e2d522146096f3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a4c53ebf7d498857999e35e3b862c2e76a6f8f44)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34137: Requested cancellation date column missing from holds awaiting pickup...
Owen Leonard [Wed, 28 Jun 2023 14:48:55 +0000 (14:48 +0000)]
Bug 34137: Requested cancellation date column missing from holds awaiting pickup table config

This patch adds an entry for the requested cancellation date column to
columns_settings.yml so that the column can be configured correctly in
table settings and on the fly.

To test you will need at least one hold with a cancellation request:

- Go to Administration -> Circulation and fine rules -> Default waiting
  hold cancellation policy
  - Add at least one rule allowing cancellation on waiting items.
- Place a hold for a patron which would fall under the rule you defined.
- Satisfy the hold by checking the item in at the hold's destination
  location.
- Cancel the hold, either by logging in to the OPAC as the patron with
  the hold, or in the staff client via the holds tab on the patron's
  record.

- Apply the patch and restart all services.
- Go to Circulation -> Holds awaiting pickup
- In the "Holds with cancellation requests" tab, confirm that there is a
  "Date cancellation requested" column and that it is one of the choices
  under the "Columns" button.
- Confirm that the correct columns are shown and hidden when making
  selections in the columns menu.
- Go to Administration -> Table settings -> Circulation -> Holds
  awaiting pickup.
   - Test setting "Is hidden by default" and "Cannot be toggled" for
     various columns in the table, including the "Date cancellation
     requested" column.

Signed-off-by: Quinn <quinn.morris@citruslibraries.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 836dc32d6237160de642750676db437599387653)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8556ed983878621bc43d66ae3740a84560e12cb8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34116: Add page-sectioning to item search in label creator
Owen Leonard [Mon, 26 Jun 2023 17:51:29 +0000 (17:51 +0000)]
Bug 34116: Add page-sectioning to item search in label creator

This patch adds a "page-section" class to search results page seen when
adding items to a label batch. The patch also makes some minor changes
to markup around the search header to make it more consistent with other
search pages.

To test, apply the patch and go to Cataloging -> Label creator.

- Click New -> Label batch
- Without entering anything in the textarea, click the "Add item(s)"
  button"
- In the pop-up window, perform a search which will return multiple
  results.
- Confirm that everything looks correct and all controls work as they
  should.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a7db3895a760922ce6371d63fd99dcd55ef1c7c9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4664ba3b25871d2f98af479eb3cbe4f2add95dad)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33047: Return 404 instead of 500 when biblio does not exist
Jonathan Druart [Thu, 11 May 2023 13:49:08 +0000 (15:49 +0200)]
Bug 33047: Return 404 instead of 500 when biblio does not exist

If the biblionumber or the itemnumber passed in parameter does not
exist we should return 404 instead of exploding with a 500.

Test plan:
Attach cover images to biblio and items
Notice that the UI is working correctly (staff and OPAC)
Hit catalogue/image.pl and opac/opac-image.pl with non-existent
biblionumber and imagenumber
Notice that you now get 404 instead of 500

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 5f43478512a884243bb56f8eac2d8b4dc8211d96)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cf31471089e856010c511dc585dfe4a6a62a38f2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34072: Remove float/clear from froms.scss
Lucas Gass [Tue, 20 Jun 2023 22:19:01 +0000 (22:19 +0000)]
Bug 34072: Remove float/clear from froms.scss

To test:
- go to /cgi-bin/koha/circ/view_holdsqueue.pl
- inspect something within the page to open the dev tools
- press ctrl-shift-m to show the device toolbar
- use the device toolbar to reduce the resolution of your window
- observe that the search controls are lost at smaller resolutions
- Apply patch, regerate CSS ( https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_interface ), clear browser cache
- Try again, you should now see the search controls
- Since this patch changes forms.scss try some other forms in Koha at different screen sizes to make sure they still look correct

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 72dd43c051f3d8435866f4fb9284541c6ef555b1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 62930d543308eb54ce30d245ff7d659c20348924)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34086: Show location on detail page when there is no permenant location
Lucas Gass [Wed, 21 Jun 2023 19:21:05 +0000 (19:21 +0000)]
Bug 34086: Show location on detail page when there is no permenant location

To test:
1. Have some items without a permanent location.
2. Go to the staff detail page.
3. In the 'Home library' column notice the span .shelvingloc is empty.
4. Add a permanent location, now the shelvingloc is populated
5. Apply patch
6. The location should now show even when there is no permenant location.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b5c6435fe8df35ef45b6cfd4cc7c4f7e7c92b52a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ee71ace105a263ecf8ecedd846c83414a8455bab)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34005: Move button toggling code outside JS for loop
Andreas Roussos [Wed, 14 Jun 2023 14:00:15 +0000 (14:00 +0000)]
Bug 34005: Move button toggling code outside JS for loop

When OpacHighlightedWords is set to "Highlight", if you search
in the OPAC and the number of keywords is odd (1, 3, 5, etc.),
then the "Unhighlight" / "Highlight" button will stop working
after a couple of clicks. The relevant commit is 9cb89b46397
from v20.11.00, where the code responsible for toggling the
"Unhighlight" / "Highlight" button was moved inside the JS
for loop that cycles through each term in the array of search
terms. This explains why the toggling only works when an even
number of search terms is being used.

This patch fixes that, by placing the button toggling code in
its original position (outside the JavaScript for loop of the
highlightOn() function).

Test plan:

0) If required, set OpacHighlightedWords to "Highlight".

1) Search for "history" in the OPAC, and view the details page
   of one of the results. Click on the "Unhighlight" button a
   few times -- after a couple of clicks the button text will
   stop toggling and you won't be able to remove the keyword
   highlight any more.

2) Apply this patch.

3) Repeat step 1): this time you should be able to toggle the
   search keyword highlighting no matter how many times you
   click on the "Unhighlight" / "Highlight" button.

4) Repeat step 1), but this time search for "century history":
   you should be able to toggle search keyword highlighting in
   the details page on and off repeatedly without any problems.

Signed-off-by: Lucas Gass <lucas@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 55f3eb3919b282dd3adf7c584b57158b8eed8c25)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 3a550c39cb0dfef068b29ad58ecae2fc2f9480fb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34214: Make 'icon' configurable for Toolbar options
Jonathan Druart [Thu, 6 Jul 2023 07:19:11 +0000 (09:19 +0200)]
Bug 34214: Make 'icon' configurable for Toolbar options

Bug 33417 added a generic 'Toolbar' Vue component but always add a 'plus' icon. We should make it configurable.

Test plan:
Regenerate the Vue app: `yarn js:build`
Go to the ERM module and confirm that the toolbar has the '+' icon.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Alexander Blanchard <alexander.blanchard@ptfs-europe.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f317247776735154722cc41d3afec15bfa7ff9e2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit c77bea60725cc03090915a7c9d6383b082239540)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34201: Restore sorting indicator on ERM tables
Jonathan Druart [Wed, 5 Jul 2023 11:47:23 +0000 (13:47 +0200)]
Bug 34201: Restore sorting indicator on ERM tables

DataTable Vue component keep the 'sorting' class on the th which display
the grey up/down icon over the blue icon which indicate the current sort
column

Test plan:
Create several agreements, notice that the list view is having the
sorting indicators (blue arrows) in the top right of the first column.
Sort the columns: asc, desc, combined sort (shift+click) and confirm
that the indicators are correct

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 29063caca234f61cbf9640622164dcfce5a2b8ac)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 64ed66d2933329d4c1e08f5a14af1188fc78a0b3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33497: Don't get host items if the MARC record is invalid
Jonathan Druart [Fri, 7 Jul 2023 13:50:52 +0000 (15:50 +0200)]
Bug 33497: Don't get host items if the MARC record is invalid

When don't want to explode with "invalid data" later so we need to
condition the host_item search

call trace was
        Koha::Biblio::Metadata::record('Koha::Biblio::Metadata=HASH(0x55ab92e60120)') called at /kohadevbox/koha/Koha/Biblio.pm line 538
        Koha::Biblio::_host_itemnumbers('Koha::Biblio=HASH(0x55ab92e4d5c0)') called at /kohadevbox/koha/Koha/Biblio.pm line 498
        Koha::Biblio::items('Koha::Biblio=HASH(0x55ab92e4d5c0)', 'HASH(0x55ab934615d8)') called at /kohadevbox/koha/catalogue/detail.pl line 200

This is fixing t/db_dependent/selenium/regressions.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8bd54203126322392abeab29144c6240e0f95e27)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a4896e3832fba1ca6a9e388c47c925dc225ddcf1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34074: Improve translations of strings on the about page
Owen Leonard [Thu, 6 Apr 2023 10:21:35 +0000 (10:21 +0000)]
Bug 34074: Improve translations of strings on the about page

This patch makes a few simple changes to the about page template to
improve how the translation tool picks up strings to translate.

The patch also corrects a couple of lines where template tags contained
line breaks.

To test, apply the patch and view the about page in the staff interface.
Everything should look correct.

Signed-off-by: Sam Lau <samalau@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 1b579868d5568e40225fce079161ae98746ea0ad)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 7d63e807f85eec2f6baf3812eb09d168016af714)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33781: Terminology: Item already issued to other borrower.
Owen Leonard [Thu, 25 May 2023 13:24:28 +0000 (13:24 +0000)]
Bug 33781: Terminology: Item already issued to other borrower.

This patch updates a couple of error message strings so that they use
the correct terminology and read well.

"This item is on hold for another borrower." becomes "This item is on
hold for another patron."

"Item already issued to other borrower." becomes "This item is already
checked out to another patron."

To test, apply the patch and log into the OPAC as a patron who has items
checked out which are available for renewal.

In another tab, place a hold on one of those items on behalf of a
different patron.

Back in your OPAC tab, click the "Renew" link next to the title which is
now on hold. The page should reload and show the updated message, "This
item is on hold..."

I was not able to trigger the other message.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d20e4ebbdee270e11faf33b9ca9d0e76da675de7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2817f6fc86fe15510be28f6cf1cc36053d7543df)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33858: Format dates in offline circ
Jonathan Druart [Wed, 7 Jun 2023 08:57:37 +0000 (10:57 +0200)]
Bug 33858: Format dates in offline circ

1 - check item 3999900000001 out to a patron
2 - upload the attached KOC file from bug 33838
3 - navigate to pending offline circ actions
4 - verify that the date is shown unformatted
5 - apply patch
6 - verify that the date is now shown formatted

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Univ Brest <cecile.lambour@univ-brest.fr>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3e15d728e5698bd9afe512a53456da0560cdc5c9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6bb6b7797d2bd374c7523c9f20d3781a495e2457)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34131: (QA follow-up) Update page title to reflect breadcrumbs and side-menu...
Pedro Amorim [Fri, 7 Jul 2023 10:46:14 +0000 (10:46 +0000)]
Bug 34131: (QA follow-up) Update page title to reflect breadcrumbs and side-menu behaviour

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eef588d71c3c53884df0b8b2917528028b81f2b4)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 05c6a2c042f07a50ff573b41b1dd6b5096ae69f8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34131: (QA follow-up): Add 'ill_availability_services' to method filter check
Pedro Amorim [Fri, 7 Jul 2023 10:34:22 +0000 (10:34 +0000)]
Bug 34131: (QA follow-up): Add 'ill_availability_services' to method filter check

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cfee701b85b5e05e946440ccf9a8bc463f53a0c1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit eb0182bd2ded037976a66907d652e7c97fed5e30)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34131: Add 'current' class on correct side menu link
Pedro Amorim [Tue, 27 Jun 2023 12:38:09 +0000 (12:38 +0000)]
Bug 34131: Add 'current' class on correct side menu link

This changes the way we're looking for the correct menu item to set as
active.

If we don't find an exact match for path+params, we attempt to set
'current' to just matching on path.

What this does is it sets the 'Plugins' menu item as active, even if
the url is 'plugins-home.pl?method=report

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 680bf6af2faa3b1612e16f77ec58daf129ef431a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 919ba4ab3e1aee446e98769b94d9652aba937402)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34131: Update breadcrumbs and side bar
Pedro Amorim [Tue, 27 Jun 2023 12:33:16 +0000 (12:33 +0000)]
Bug 34131: Update breadcrumbs and side bar

Update plugins-home accordingly if tool plugins only filter is being
used or not.
Update breadcrumbs for plugins-disabled page

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 053439e50bd59a981a7f8c727818520653f484b5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5d923bf69fde1d1bd7186012a7c3d0e972a61950)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33790: Fix and add various links to the manual
Katrin Fischer [Mon, 29 May 2023 19:39:03 +0000 (19:39 +0000)]
Bug 33790: Fix and add various links to the manual

* Makes the move from tools to cataloguing for the pages linked
  from the cataloguing start page
* Adds missing help links to admin and tools pages
* Fix other existing links

To test:
* Best is to look at the patch, you'll see the pages you need
  to test on the left.
* Open the page and access the help page through the help link
  Note: for a few links you'll need to update the version in the
  URL to 23.05 (identity providers is one) as the page doesn't
  exist yet in the 22.11 manual

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 c3b1d009bf1b5eddfbb90d775846a007146ca3ae)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4c8a0e42ee13eedc35d8dfbb1f424f9a964ef1d1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34107: Switch order for id and name feeding the first column in datatables
Pedro Amorim [Tue, 4 Jul 2023 15:26:27 +0000 (15:26 +0000)]
Bug 34107: Switch order for id and name feeding the first column in datatables

Test plan:
* Create 3 agreements, agreement #1 named 'a', agreement #2 named 'c' and agreement #3 named 'b'.
* Go to agreements list, click the Name column header, notice how the agreements get sorted by id #, not by first char in name. Expected order would be abc or cba, but it's acb or bca.
* Apply patch, on k-t-d, run the following if you're not using 'yarn js:watch':
    yarn js:build
* Sort the list again on the 'name' column, notice how it now sorts alphabetically as expected, either abc or cba.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f3cc00d945ecdd74f84c9183e3fb9655248b0e68)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1009fc17dff823b9da25ab0655cae4016a94c4ea)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34002: Check for stage_marc_import permssion
Lucas Gass [Tue, 13 Jun 2023 19:41:48 +0000 (19:41 +0000)]
Bug 34002: Check for stage_marc_import permssion

-1 Log in to the staff client as a user who has  Acquisition management (acquisition) permissions but not the stage_marc_import (tools) permission.
-2 Go to Acquisitions and Add to a basket.
-3 Select 'From a new file'
-4 You will be logged out as the user does not have percussion to visit that page.
-5 Apply patch
-6 Try again, you will not see the link for 'From a new file' if you don't have the permssion.
-7 Give the user the stage_marc_import, you will now see the link

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4e1a2f148c91bc2438410f3e71c91f8deb889b91)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 44ab05d7b7ff313d1cd22489518dc9f771fdd53c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34174: (bug 33341 follow-up) Fix Ris export
Jonathan Druart [Wed, 5 Jul 2023 14:45:19 +0000 (16:45 +0200)]
Bug 34174: (bug 33341 follow-up) Fix Ris export

Bug 33341 incorrectly fix the perlcritic warning.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6a2ef1a82de62c6e245933e91ec795f39f1a4ada)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 452a98f67b440559249eb7fceddd838ce357d05c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33667: Allow copying holidays to all libraries when editing
Emmi Takkinen [Tue, 23 May 2023 12:29:12 +0000 (15:29 +0300)]
Bug 33667: Allow copying holidays to all libraries when editing

When editing an existing holiday and checking the
"copy to all libraires" checkbox, the other calendars won't
get updates. Allow this by first checking if holiday exists
in target calendar and if not, add it.

To test:
1. Add unique holiday to branch A.
2. Don't check checkbox "Copy to all libraries".
3. Save.
4. Verify the holidays shows on all calendars as
a green box.
5. Edit the holiday, now check "Copy to all libraries"
and save.
=> Verify nothing has changed in other calendars:
only the green box, no holiday in list on the right
6. Edit again, make a change to description,
check checkbox, save.
=> Verify it's still not showing in the other
calendars.
9. Apply this patch.
10. Edit holiday again, check "Copy to all libraries"
and save.
=> Verify holiday is now added to other calendars.
11. Edit again, this time do not copy and save.
=> Verify holiday was edited just in branch A.
12. Again edit, check and save.
=> Verify holiday was edited in all libraries.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 83589f0317068a5cd2da7b5524ea6b6b738dfdfe)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8a342549536ee92d4bcf84aaebff0a4e0f50e12c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 18855: Don't create duplicate overdue fines if an issue is returned
Michael Hafen [Thu, 19 Jan 2023 21:56:31 +0000 (14:56 -0700)]
Bug 18855: Don't create duplicate overdue fines if an issue is returned

This includes Jonathan's followup

If cronjobs/fines.pl is running during circulation hours, then an issue may
be considered for having it's overdue fine updated after the issue has been
returned and it's fine status flipped from 'UNRETURNED' to 'RETURNED'.  In
this case UpdateFine will create a duplicate fine because it can't find the
specific accountline for the (formerly) overdue issue.

This changes cronjobs/fines.pl to double check the issue before updating
the fine.  If the issue has changed between starting the script and updating
the fine, then the script will skip it.

There is a small amount of time between the check and calling UpdateFine
where the issue can be changed and this problem can reoccure.  The chance
of that happening is so small that it's probably fine to leave as is.

It is also possible that the fine won't be updated because the issue was
returned.  In this case the fine payed by the patron will be lower, but that
is better then the patron finding later that there is more to a fine they
thought they had paid all of.

Test plan (by Caroline):
0. Preliminary settings
   0.1. finesMode system preference must be set to Calculate and charge
   0.2. There must be a circulation rule that will charge fines (beware of bug 32271)
   0.3. In Tools > Calendar, today must not be a holiday

1. Make a lot of overdue checkouts - I used the batch checkout feature, but if your system already has a lot of overdue checkouts, you can skip to step 2

   1.1. Enable batch checkouts
        1.1.1. Go to Administration > Global system preferences
        1.1.2. Search for BatchCheckouts
        1.1.3. Set BatchCheckouts to Allow
        1.1.4. Select all categories in BatchCheckoutsValidCategories
        1.1.5. Click "Save all Circulation preferences"

   1.2. Get a list of barcodes
        1.2.1. Go to Reports
        1.2.2. Click "Create from SQL"
        1.2.3. Give the report a name
        1.2.4. For the SQL query, enter

               SELECT barcode FROM items WHERE onloan IS NULL LIMIT 60;

1.2.5. Click "Save report"
1.2.6. Click "Run report"
1.2.7. Click "Download" > "Tab separated text"

   1.3. Go to a patron's file
        1.3.1. Go to Patrons
        1.3.2. Click on "Search"
        1.3.3. Click on a patron's name

   1.4. Do a batch checkout with a due date in the past
        1.4.1. Click on the "Batch check out" tab on the left
        1.4.2. In "Use a file", click "Choose file"
        1.4.3. Choose the file downloaded from the report
        1.4.4. In "Hard due date", choose a date in the past
        1.4.5. Click "Check out"
        1.4.6. Click "Checkout or renew"

2. Find the last issue in the database

   2.1. In the database (or in reports), type the following query

        SELECT issues.*, items.itype as itemtype, items.homebranch, items.barcode, items.itemlost, items.replacementprice, items.biblionumber FROM issues  LEFT JOIN items USING (itemnumber) WHERE date_due < NOW() \G;

   2.2. Copy the barcode from the last entry

3. Set up so that you can run fines.pl and check in the item at the same time (or very close to the same time)

   3.1. In Koha, click the "Check in" option in the search bar at the top of the page
   3.2. Paste the barcode in the search bar BUT DO NOT PRESS ENTER OR THE ARROW RIGHT AWAY
   3.3. In a terminal, enter the fines.pl command

        ./misc/cronjobs/fines.pl

   3.4. Execute the command and immediately click on the arrow in the staff interface to check in the item

4. Check the patron's fines

    4.1. Click on the patron's name in the check in screen
    4.2. Go to the Accounting tab on the left
    4.3. In the search box just above the table, paste in the returned item's barcode

    --> Without the patch, there are two fines, one Fine (Accruing) and one Fine (Returned) for the same item at the same time
    --> With the patch, there is only one fine, Fine (Returned)

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7e1104da8340b3c62d3747fe75c13c8c5adea21d)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 931e2b2d52514e013bf41f7bcce96c8600dde5df)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33497: (follow-up) Adjust relationship name from bug 33493
Nick Clemens [Wed, 31 May 2023 12:06:20 +0000 (12:06 +0000)]
Bug 33497: (follow-up) Adjust relationship name from bug 33493

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 82d0021cd854787127ffdb42c769919ddb41dcdc)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fa9118ed8daef4f34571fab963b72c8c138a63cb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33497: (follow-up) Remove unecessary scalar
Nick Clemens [Wed, 31 May 2023 11:32:54 +0000 (11:32 +0000)]
Bug 33497: (follow-up) Remove unecessary scalar

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c662bfe18e6cb47671cf5cc3fb7865e59e6bc007)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a41761b35711b61a28f037e0a3c5743307273f53)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33497: Add a filter relationship for branchtransfers
Nick Clemens [Fri, 10 Mar 2023 16:14:50 +0000 (16:14 +0000)]
Bug 33497: Add a filter relationship for branchtransfers

This uses the new relationship from bug 33493 to fetch the transfers for items

To test:
1 - Transfer some items on a bib
2 - View the biblio details page in the staff interface
3 - Apply patch
4 - Confirm  the view is the same

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 2fe2a0aa03b40e143de551aaf9ee87edd592dc0f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f3890f6cb281e61d51c0712f10f9686e6c84556c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33497: Use 'host_items' param to fetch all items at once
Nick Clemens [Fri, 10 Mar 2023 12:40:30 +0000 (12:40 +0000)]
Bug 33497: Use 'host_items' param to fetch all items at once

This patch adjusts the detail page to fetch items and host items
together, and prefetches transfers and checkouts

To test:
1 - Enable easy analytics
2 - Attach some items to a bib
3 - Checkout an item on the bib
4 - View the details page
5 - Apply patch
6 - View details page, confirm nothing has changed

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 2cf00f1a49a7b9f8d5ca105e2dd1add5d5d95198)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit dc273a8dfe384b7c847a23b842f1dde601537d82)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33496: (QA follow-up) Update POD statement
Marcel de Rooy [Fri, 19 May 2023 09:57:23 +0000 (09:57 +0000)]
Bug 33496: (QA follow-up) Update POD statement

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7d72e686531a54c51534a2871909256b22832128)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 552c25f4f95e0ab6f70d93e5581f0acff4f66d7e)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33496: (follow-up) Correct param names
Nick Clemens [Fri, 14 Apr 2023 12:40:55 +0000 (12:40 +0000)]
Bug 33496: (follow-up) Correct param names

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1d4182a944e5048e307d1b554a3724041b1ce75a)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f0e208c1e7e804a9e8db2de614ad612e3d14255d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33496: Add 'host_items' param to Koha::Biblio->items
Nick Clemens [Fri, 10 Mar 2023 12:37:49 +0000 (12:37 +0000)]
Bug 33496: Add 'host_items' param to Koha::Biblio->items

This patch adds an option to the $biblio->items method to allow
retrieving the items and analytic items for a record. This is intended
to allow fetching a single Items object, and related object, rather than
having to fetch the items, and the host items, and push them together

This is step towards being able to fetch items using API/DataTables directly

To test:
1 - prove -v t/db_dependent/Koha/Biblio.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 8ff2e962b2e8e41db60cbc746a849287a83ccb65)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit aac8c1e36ea84deed0f4b9ad59f9f1bd44ba607f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33879: Do no longer overwrite interface in check_cookie_auth
Marcel de Rooy [Thu, 1 Jun 2023 13:03:50 +0000 (13:03 +0000)]
Bug 33879: Do no longer overwrite interface in check_cookie_auth

This will only have effect on installations running OPAC and staff
on the same domain name. In that case an OPAC cookie still allows
you to access intranet, and v.v.

Test plan:
Repeat the following steps WITHOUT this patch and WITH it.
Login via OPAC.
Go to staff. Perform an action that logs the interface in e.g. the
statistics table, like a checkout.
Inspect interface in the corresponding table. Observe difference
that this patch makes.

With this patch:
Run t/db_dependent/Auth.t. Should pass again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 68aeaf5c4c6aeeca4347995e5f74464929c20ac5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fdc49e0fb34e138059f7b47b87c66cc8a1347162)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33879: Add unit test to show problem
Marcel de Rooy [Thu, 1 Jun 2023 13:42:03 +0000 (13:42 +0000)]
Bug 33879: Add unit test to show problem

Test plan:
Run t/db_dependent/Auth.t without second patch.
Should fail:
    #          got: 'opac'
    #     expected: 'intranet'

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a7fda386475f5d8b9c5866305ab6a4128a9ef584)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 5377331f46ff83c4dd83623d5dcb8734c7f73833)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33404: Add unit tests
Marcel de Rooy [Thu, 25 May 2023 07:29:30 +0000 (07:29 +0000)]
Bug 33404: Add unit tests

Test plan:
Run t/db_dependent/Breeding.t
Run t/db_dependent/Breeding_Auth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Amended patch: perltidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e9cab7f1fc7acc0b340d07770c750ac9fed50a58)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fdcb386548ef8bd0c6f85a17b1fa69ab1f16c298)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33404: Fix serverhost and init $page
Marcel de Rooy [Thu, 25 May 2023 06:03:48 +0000 (06:03 +0000)]
Bug 33404: Fix serverhost and init $page

The array serverhost is not filled. Should be replaced with values
from servers array.

Test plan:
Nothing exciting here. Read the patch.
Note that we will test in the next patch if the hostname is saved
correctly in the import batch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@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 eb759719908949bc5f7c388d26d4e9dd28b1e415)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ba442b1a3b1d77585c8507697c6a5d2755605bb8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33404: Z3950SearchAuth: Save in UTF-8 encoding
Marcel de Rooy [Wed, 24 May 2023 14:57:46 +0000 (14:57 +0000)]
Bug 33404: Z3950SearchAuth: Save in UTF-8 encoding

Test plan:
[1] If you have access to a Z3950 MARC8 auth server, search
    for an authority record and import it.
[2] If you have access to a Z3950 UTF8 auth server, search
    for an authority record and import it.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@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 1233480ffaecb307ae7e9279acee7b516e42776f)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 52a243e3cae0afc9d1cc9cc97f5746ba6384bf01)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34180: Template variable in JavaScript prevents authority MARC preview from displ...
Owen Leonard [Wed, 16 Nov 2022 12:10:16 +0000 (12:10 +0000)]
Bug 34180: Template variable in JavaScript prevents authority MARC preview from displaying

Since template variables cannot be processed by JS, we must use a
template to declare a JS variable which the JS file can used. This patch
corrects this problem in the JS file which handles display of the
authority MARC preview from the authority search results page.

To test, apply the patch and go to Authorities.

- Perform a search which will return multiple authority results.
- Click "Actions -> MARC preview." The preview should display correctly.
- Click "Actions -> MARC preview" on another search result. This preview
  should also look correct.
- There should be no JavaScript errors in the browser console.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6d433ffa8931487c967ec01c483e9bb13eb5700b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 955d3a53e7c1c3a29c82d7fb8754875559c05c32)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34092: (QA follow-up) Typo
Marcel de Rooy [Fri, 30 Jun 2023 06:55:29 +0000 (06:55 +0000)]
Bug 34092: (QA follow-up) Typo

Typo patron_searh_js.

Note for QA/RM: Ignore this qa tools warning:
    forbidden pattern: console.log (line 211)
This is an intended console warning.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3a805557dbce850942ec28845974dfc616e2a942)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 58efec81e3dbb9d36ccce3c52bf23cea7dd10c35)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34092: Move search-patron.inc logic into buildPatronSearchQuery
Pedro Amorim [Mon, 26 Jun 2023 12:51:13 +0000 (12:51 +0000)]
Bug 34092: Move search-patron.inc logic into buildPatronSearchQuery

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a9f8db17fed36434ef831316f53ded6a478e6747)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 0c3b4bb30f294828be1e4c3cb29250a0e3634164)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34092: Preparation: New buildPatronSearchQuery function
Pedro Amorim [Mon, 26 Jun 2023 12:37:08 +0000 (12:37 +0000)]
Bug 34092: Preparation: New buildPatronSearchQuery function

Move patron search query logic out of patron_autocomplete into new function

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ea599d774de4f43adb36a6a8382f0026246b16c1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e650fe865f53ff5f2c1d8c479a92bad98a1232f2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34092: Move patron_autocomplete to staff-global.js
Pedro Amorim [Mon, 26 Jun 2023 10:22:19 +0000 (10:22 +0000)]
Bug 34092: Move patron_autocomplete to staff-global.js

Remove patron-autocomplete.js file

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 972c847bddec64b84f85e221c4edf708bb521740)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 39345a33622fb38cc4b644c1eb05a8e199261e6f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34094: Use DefaultPatronSearchMethod consistently
Martin Renvoize [Thu, 22 Jun 2023 14:37:55 +0000 (15:37 +0100)]
Bug 34094: Use DefaultPatronSearchMethod consistently

This patch updates the patron search bar and pages to default search
method to that defined by DefaultPatronSearchMethod system preference.

Test plan
1) Prior to this patch confirm that regardless of what you set
   DefaultPatronSearchMethod to, the search in /members/member.pl,
   members/members-home.pl and the search from the patrons search top bar
   all default to 'contains'.
2) Apply the patch
3) Confirm that the system preference now affects the default option for
   match type upon page load.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b804313c20462fce7648570a4619b7b212765262)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2f3e1cd76b38452da0d23c46d33e44d49b7adea0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 28726: Add sort1 and sort2 to patron card creator - patron search.
Michael Hafen [Tue, 20 Jul 2021 18:12:42 +0000 (12:12 -0600)]
Bug 28726: Add sort1 and sort2 to patron card creator - patron search.

Also adds a select all / clear all and checkboxes.

Test plan:

1. start a new batch in the patron card creator (Tools -> Patron card creator -> New -> card batch)
2. click the Add patron(s) button.  Observe that Category and Library are the only options.
3. Close search for patron window.
4. Apply patch.
5. click the Add patron(s) button.  Observe that you can now search for patrons by their sort1 and sort2 values.
6. perform a search and observe the 'Select all | Clear all | Add selected patrons' links and button.
7. use the Select all link to select all the patrons found by the search.
8. use the Add selected patrons button to add the selected patrons to the card batch's Add by borrowernumber(s) text input field.
9. close the search for patron window.

Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.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 79f8e148af7f7f84ccf43334e73e14f919157edd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit f1e90cc4c2b75752122f540013ff9753e0111677)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 29664: (QA follow-up) Typo transacton
Marcel de Rooy [Fri, 30 Jun 2023 07:38:46 +0000 (07:38 +0000)]
Bug 29664: (QA follow-up) Typo transacton

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e3803577eedac53c26280f1a0f6837803b69d82e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 59a61fbb7258e20a2c886525387982aa40a4477d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 29664: Do not show voided payments in cash_register_stats.pl
Kyle M Hall [Mon, 1 May 2023 13:50:24 +0000 (09:50 -0400)]
Bug 29664: Do not show voided payments in cash_register_stats.pl

Test Plan:
1) Set up your cash register
2) Take a payment
3) Void that payment
4) Verify the voided fee shows for the "All payments to the library" and
   "Payment" transaction type filters
5) Apply this patch
6) Restart all the things!
7) Verify the voided fee no longer shows for the "All payments to the library" and
   "Payment" transaction type filters

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 65a45b761b65b784ac03d2c5901fb60e0dfe06b2)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 586fe347993093a49e2158c47796450e743618c8)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33999: (follow-up) Use link-styled button
Owen Leonard [Mon, 26 Jun 2023 14:04:23 +0000 (14:04 +0000)]
Bug 33999: (follow-up) Use link-styled button

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 35c6d94d251e87ab2e09724e8b30fae4c882d0af)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 698067dea19dcbd1823e151f967acf56662d4ee5)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33999: Subscription details link on bibliographic detail page should have permiss...
Owen Leonard [Tue, 13 Jun 2023 14:11:33 +0000 (14:11 +0000)]
Bug 33999: Subscription details link on bibliographic detail page should have permission check

This patch wraps the "Subscription details" link on the bibliographic
detail page with a permissions check, "CAN_user_serials," so that a user
lacking permission to access the Serials module will not be shown the
link.

To test, apply the patch and view the bibliographic detail page of a
serial record.

- When viewing the "Subscriptions" tab as a user with Serials
  permissions you should see the "Subscription details" link.
- When viewing the tab as a user without the correct permissions the
  link should not be present.

Signed-off-by: Lucas Gass <lucas@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 72524c3fbf3caf67c29c6f1f14afaacf04abd232)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4cc64fc6362122a8bf7222e86c5e6416ee344c81)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34146: Counterpart for serials-edit
Marcel de Rooy [Thu, 29 Jun 2023 06:18:04 +0000 (06:18 +0000)]
Bug 34146: Counterpart for serials-edit

Not only additem suffers from it. We can do the same with serials-edit.
This patch adds a server-side and client-side check as we did for additem.

Test plan:
Receive serial with adding items.
Try to add more than 999 items in number of copies.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f88d2e7983a8962e6c7de424dee7cc20200f2c74)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 505b4354a9e2cfeea9e9f71bbb9e47fbc4a125dc)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34146: Add a client-side check with maxlength too
Marcel de Rooy [Thu, 29 Jun 2023 05:58:29 +0000 (05:58 +0000)]
Bug 34146: Add a client-side check with maxlength too

Test plan:
Try to add more than 3 characters now in the number of copies.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 143693e217c2ef4616678aa1b1cf9e53e2b0e456)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e11650c69c1ed08524935d7eb20d02aeb59fe595)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34146: Do not allow multiple copies to crash server
Marcel de Rooy [Wed, 28 Jun 2023 14:14:51 +0000 (14:14 +0000)]
Bug 34146: Do not allow multiple copies to crash server

Currently hardcoded to 1000.
Can be refined later. Let's first prevent this kind of accidents.

Test plan:
Add additem.pl. Edit the 1000 to 2. Restart all.
Add 3 multiple copies. Notice that you got 2.
Revert your code change.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2eba689a5a5db2ac6a747c927d6daf01e7c64002)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 4945626e32cf5387694485261f26a3f18588704c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 23775: Claiming a serial issue doesn't create the next one
jeremy breuillard [Mon, 4 Apr 2022 09:00:09 +0000 (11:00 +0200)]
Bug 23775: Claiming a serial issue doesn't create the next one

Whenever we need to generate manually a new serial we go to page
'serials-edit.pl'. With this patch it is possible to generate a new
serial on page 'serials.pl'.

Test Plan:
-- Previously we need a serial which is in EXPECTED status & the Date
received should not be later than today --
1) On the intra. Make sure to have at least 1 subscription for a
   bibliographic record & 1 vendor linked
2) Then Home > Serials > Claims > Claims for <your_vendor_name>
3) Tick the checkbox of the row where the status is EXPECTED then
4) Click 'Send notification'
5) Notice the status of the row : it is now CLAIMED
6) To verify: Home > Serials > Serial collection information for
   <your_record_name>
7) Here the status is CLAIMED too but nothing happened around
8) Apply patch
9) Repeat from 2) to 6)
10) The status is still CLAIMED & the new serial with status EXPECTED is
    freshly generated

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bd72f24d04a9843cdb6a86b2ee7a7adff1fc46bb)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e495547b8bb6bd7115ef3bc6aff819a8b61ffce7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34106: Retain searchtype parameter in member-search-box
Lucas Gass [Thu, 22 Jun 2023 21:59:35 +0000 (21:59 +0000)]
Bug 34106: Retain searchtype parameter in member-search-box

To test:

1. In the main search header switch to 'Search patrons'. Bring up the dropdown and look at 'Search type:'.
2. It defaults to 'Starts with'.
3. Go to '/cgi-bin/koha/members/members-home.pl' and look at the 'Search type:' on the left side.
4. It defaults to 'Contains'
5. Do a patron search from both these places, setting the 'Search type' to contains.
6. The search bar in the header always resets to 'Starts with'
7. Apply patch
8. Try everything again. By default both places should default to contain.
9. If you change the 'Search type' the search in the main header should always retain that value.

Signed-off-by: Ed Veal <eveal@mckinneytexas.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6f1d3883c81184e067e334f3d29f1366f62508d3)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit e27e5cd886323f211417330bc7f074399f329c7f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34106: Update header search box searchtype when form is submitted
Pedro Amorim [Tue, 27 Jun 2023 14:40:59 +0000 (14:40 +0000)]
Bug 34106: Update header search box searchtype when form is submitted

We're updating the side menu searchtype when the search header is submitted,
we should also update the searchtype in the search header when the form is submitted

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b9ffc47100dbb13e966af73c713a6857cb9e8ca0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 252f297a5a9b6ce51d2973dcfcc8a1131e2f3e8c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33720: Also flush in install
Martin Renvoize [Thu, 29 Jun 2023 08:19:59 +0000 (09:19 +0100)]
Bug 33720: Also flush in install

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 41c43449c6c2e2e926ed04cc06647d223a5864dd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1961490c2e677d1e8f5fdf2b9344b0264abc1587)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 33720: Update the updatedatabase.pl script to flush caches before running
Jake Deery [Wed, 7 Jun 2023 11:37:09 +0000 (13:37 +0200)]
Bug 33720: Update the updatedatabase.pl script to flush caches before running

Signed-off-by: Martin Renvoize <martin.renvoize@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 4391e23ea573bdf4ebec4e5abfc86eb87d504390)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 834245b70996f842eea08c33c7dd62a8f94ee99d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
10 months agoBug 34029: DBRev 22.11.07.003
Tomas Cohen Arazi [Mon, 26 Jun 2023 13:28:55 +0000 (10:28 -0300)]
Bug 34029: DBRev 22.11.07.003

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 532cf4ab9f5549c1e8f41d6c7191f9e1a9ed9e3c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a0cc737bc649d1446af06b6cd04900d17069caea)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34029: DBIC schema
Tomas Cohen Arazi [Mon, 26 Jun 2023 13:25:33 +0000 (10:25 -0300)]
Bug 34029: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 16ad89bb96630fd9fb74fe69a30cb37dc3c1a411)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 41a86239d2f226e3b2736f7d661421052138d1ee)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
10 months agoBug 34029: (QA follow-up) Fix pushing undef to biblio_ids
Marcel de Rooy [Mon, 26 Jun 2023 10:46:17 +0000 (10:46 +0000)]
Bug 34029: (QA follow-up) Fix pushing undef to biblio_ids

See comment1. Although we now fix the error on publishercode, it
is good to verify the result before pushing.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 377e2a70dec073063443c23e9b6a06f54da6b53c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 561f6e5bd8dc5c9a671168fde67d412dbe3a0895)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>