koha.git
11 months agoBug 30524: (QA follow-up) Unit tests for GenerateCSRF()
Tomas Cohen Arazi [Thu, 27 Jul 2023 18:33:55 +0000 (15:33 -0300)]
Bug 30524: (QA follow-up) Unit tests for GenerateCSRF()

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 60d11ae7251a227fab3977ecd61cb01d0f062f79)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d4187c77eb3b39977b759af7df7641e70cd96358)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 30524: (QA follow-up) Only generate CSRF token if it will be used
Kyle M Hall [Thu, 27 Jul 2023 11:45:57 +0000 (07:45 -0400)]
Bug 30524: (QA follow-up) Only generate CSRF token if it will be used

This patch avoids generating CSRF tokens unless the csrf-token.inc file
is included in the template.

Passed token doesn't need HTML escaped. The docs for WWW::CSRF state:
  The returned CSRF token is in a text-only form suitable for inserting into a HTML form without further escaping (assuming you did not send in strange things to the Time option).

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ddf1eb6cef14da365675890920ff72f010c59527)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 73ca151686b682aaa2b950ccbc89fcec14514112)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34023: Prevent HTML injection in "back to results" link from search page
Michał Górny [Fri, 16 Jun 2023 14:16:37 +0000 (16:16 +0200)]
Bug 34023: Prevent HTML injection in "back to results" link from search page

It is possible inject raw HTML into the "Back to search results" link by leading the user to a search with specially crafted URL.

For example, using the demo instance:

1. Visit https://koha.adminkuhn.ch/cgi-bin/koha/opac-search.pl?idx=&q=test&weight_search=1&%22%3Etest%3Ca%20foo=%22

2. Refresh the page (for some reason, "back to results" doesn't appear unless I do that at least once).

3. Click any result.

Note that the result page now contains:

  <a href="opac-search.pl?idx=&amp;q=test&amp;weight_search=1&amp;">test<a foo=%22" title="...

i.e. `">test<a ...` was successfully injected into the HTML.

I'm attaching a quick patch I've used to patch up our instance.  It just indiscriminately URI-escapes all parameter keys.  I didn't decode them back since as far as I understand all valid keys do not contain special characters.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e86e81a2480ec5486660bac241c694210eaefa11)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cbc2b0e8dafe7053785f98247df253f014cd632c)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 22990: (follow-up) Fix suggestion.pl
Martin Renvoize [Thu, 13 Jul 2023 09:40:38 +0000 (10:40 +0100)]
Bug 22990: (follow-up) Fix suggestion.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 64500a92130f6e879b6a49b5ee7c9f45b7554170)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6fbc51bf06ba731d35a11ad5be3cba1c154b42a4)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 22990: Fix template toolkit syntax issues in shelves_results.tt
David Cook [Wed, 11 May 2022 07:06:55 +0000 (07:06 +0000)]
Bug 22990: Fix template toolkit syntax issues in shelves_results.tt

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fd69581fcf743c6720cc8b5fba687f75fc613321)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6f820f0f6b07eff3f2c4ad8c2d3d4dd909dd47b6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 22990: Fix for shelves table
Martin Renvoize [Thu, 16 Sep 2021 14:13:23 +0000 (15:13 +0100)]
Bug 22990: Fix for shelves table

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c0f232250e1186dd217e77db7e121a0b98a789cb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 20fa891788e002a6679651397ca0782410882bb0)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 22990: Add CSRF protection to boraccount, pay and suggestion
Amit Gupta [Wed, 22 Jan 2020 16:07:22 +0000 (21:37 +0530)]
Bug 22990: Add CSRF protection to boraccount, pay and suggestion

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Test plan would have been nioe.
Tested by changing MAX_AGE with suggestions.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 833d1dc8b082cc742b88e358edef77960b5ffc2f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0c365b52f474e0fc0dd439f11bfa0a95534db029)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34368: Add CSRF token to Content Management pages
David Cook [Tue, 25 Jul 2023 05:18:00 +0000 (05:18 +0000)]
Bug 34368: Add CSRF token to Content Management pages

This change adds a CSRF token to the Content Management pages
at additional-contents.pl.

Test plan:
0. Apply patch
1. koha-plack --restart kohadev
2. Try to add "News", "HTML customizations", and "Pages".
3. Try to delete these new content entries
4. Note that you were successful in your endeavours

JD amended patch: remove empty line removal (no need to create
unecessary conflicts)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e97fae72141446b0a2fb06c454c601966e5f3494)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a759adc91730da7b57ced0f1baf59e83031197f9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 30524: Unit tests
Martin Renvoize [Fri, 23 Jun 2023 10:52:28 +0000 (11:52 +0100)]
Bug 30524: Unit tests

Test plan:
Run t/Output.t
Run t/db_dependent/Auth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2918f6ceda533719ac0da53d8245ea4826f43681)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9436074a26fe903134f71e66b0f9fcb7f6724438)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 30524: Core CSRF checking code
Martin Renvoize [Wed, 13 Apr 2022 12:55:04 +0000 (13:55 +0100)]
Bug 30524: Core CSRF checking code

Split out from bug 22990 as requested.

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.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 aba9e61cfbab1e915f1be4a527b5708b9ec59c35)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6d6d36f6df79d3df22ea299934073d903f86e64a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33167: (RMAINT fix) Revert 33167
Matt Blenkinsop [Thu, 20 Jul 2023 08:41:00 +0000 (08:41 +0000)]
Bug 33167: (RMAINT fix) Revert 33167

Bug 33167 was reverted from 22.11.x but the revert does not seem to have removed all lines causing failing tests. This patch removes remaining lines and refactors the code to its pre-33167 state

11 months agoBug 33671: (follow-up) Disable FK check for column change
Marcel de Rooy [Wed, 12 Jul 2023 14:09:35 +0000 (14:09 +0000)]
Bug 33671: (follow-up) Disable FK check for column change

See also BZ report. As suggested by Tomas.

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

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

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

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

Test plan:
Run t/00-testcritic.t

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2bc251cfdd1efdf6d0f7f299838ff067744ff17b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 835bc43d316df60882c09fb201caa75e027af0a3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 29471: Add display of MARC 520 to staff interface detail page
Katrin Fischer [Fri, 30 Jun 2023 14:22:17 +0000 (14:22 +0000)]
Bug 29471: Add display of MARC 520 to staff interface detail page

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

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

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Restored signoff line from Phil. Change only for $u.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 256518bf75f4df70a62bfe401bd911473e629efd)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2cb9fa1b52e0f09d52c9a85d3b7ca04694add6a9)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33270: (QA follow-up) Do not change param hashref
Marcel de Rooy [Mon, 17 Jul 2023 10:59:26 +0000 (10:59 +0000)]
Bug 33270: (QA follow-up) Do not change param hashref

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

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit cfbe8daf2118f0ecdeea13ef866e86d2e905b686)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 32db2823b89ae7250dbd35d5931f682e9a6ce4e2)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33270: (QA follow-up) Tidy
Marcel de Rooy [Mon, 17 Jul 2023 10:52:03 +0000 (10:52 +0000)]
Bug 33270: (QA follow-up) Tidy

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b3aba2b06527a36ad4edcf1cafbf614c974a590e)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 1d11b4360a3684ce3dad5f1f3908fed17e99ad4b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33270: (follow-up) Handle records that fail attempt to ignore bad characters
Nick Clemens [Tue, 11 Jul 2023 13:59:50 +0000 (13:59 +0000)]
Bug 33270: (follow-up) Handle records that fail attempt to ignore bad characters

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ea1a282b5e2100578354c44d273ba77ede7ae5af)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 247ebf90b226e826c96a85d3912688ccd6cd643a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33270: Attempt to recover from invalid metadata exception
Nick Clemens [Thu, 22 Jun 2023 11:22:18 +0000 (11:22 +0000)]
Bug 33270: Attempt to recover from invalid metadata exception

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

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

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

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

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c71468537b4fa589e91e7fd5823ddd4f54379e21)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2e23ed06b7d6abbb3b27f0b0728bba10532d6c63)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33270: Add record_strip_nonxml routine to Koha::Biblio::Metadata
Nick Clemens [Fri, 23 Jun 2023 13:08:31 +0000 (13:08 +0000)]
Bug 33270: Add record_strip_nonxml routine to Koha::Biblio::Metadata

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

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

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4997d59c83ec1c63a3dc2c089fed79e3ad5fa764)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 9544bd25a2b3c4811abb941b67a5684952a78da6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34251: When using the fast add framework in addbiblio.pl there is thrown a JS...
Jan Kissig [Wed, 12 Jul 2023 08:40:32 +0000 (10:40 +0200)]
Bug 34251: When using the fast add framework in addbiblio.pl there is thrown a JS error in selectTab( "#tab0XX_panel" );

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

To test:

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e3ff3a62048731c130e7185f7ac81e07f41f6ff9)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 05f5c83140860a292916a522ae042c2dbf69dc58)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34288: Unit tests
Tomas Cohen Arazi [Mon, 17 Jul 2023 15:08:34 +0000 (12:08 -0300)]
Bug 34288: Unit tests

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0db60995a8dd093210ffa772f56b7d5bac28d197)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit afacad6a2d5477870c55d8f0c56dec66bce64b9d)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoRevert "Bug 33496: Add 'host_items' param to Koha::Biblio->items"
Matt Blenkinsop [Wed, 19 Jul 2023 09:52:40 +0000 (10:52 +0100)]
Revert "Bug 33496: Add 'host_items' param to Koha::Biblio->items"

This reverts commit aac8c1e36ea84deed0f4b9ad59f9f1bd44ba607f.

11 months agoRevert "Bug 33496: (follow-up) Correct param names"
Matt Blenkinsop [Wed, 19 Jul 2023 09:52:30 +0000 (10:52 +0100)]
Revert "Bug 33496: (follow-up) Correct param names"

This reverts commit f0e208c1e7e804a9e8db2de614ad612e3d14255d.

11 months agoRevert "Bug 33496: (QA follow-up) Update POD statement"
Matt Blenkinsop [Wed, 19 Jul 2023 09:52:16 +0000 (10:52 +0100)]
Revert "Bug 33496: (QA follow-up) Update POD statement"

This reverts commit 552c25f4f95e0ab6f70d93e5581f0acff4f66d7e.

11 months agoRevert "Bug 33497: Use 'host_items' param to fetch all items at once"
Matt Blenkinsop [Wed, 19 Jul 2023 09:51:48 +0000 (10:51 +0100)]
Revert "Bug 33497: Use 'host_items' param to fetch all items at once"

This reverts commit dc273a8dfe384b7c847a23b842f1dde601537d82.

11 months agoRevert "Bug 33497: Add a filter relationship for branchtransfers"
Matt Blenkinsop [Wed, 19 Jul 2023 09:51:34 +0000 (10:51 +0100)]
Revert "Bug 33497: Add a filter relationship for branchtransfers"

This reverts commit f3890f6cb281e61d51c0712f10f9686e6c84556c.

11 months agoRevert "Bug 33497: (follow-up) Remove unecessary scalar"
Matt Blenkinsop [Wed, 19 Jul 2023 09:51:21 +0000 (10:51 +0100)]
Revert "Bug 33497: (follow-up) Remove unecessary scalar"

This reverts commit a41761b35711b61a28f037e0a3c5743307273f53.

11 months agoRevert "Bug 33497: (follow-up) Adjust relationship name from bug 33493"
Matt Blenkinsop [Wed, 19 Jul 2023 09:51:10 +0000 (10:51 +0100)]
Revert "Bug 33497: (follow-up) Adjust relationship name from bug 33493"

This reverts commit fa9118ed8daef4f34571fab963b72c8c138a63cb.

11 months agoRevert "Bug 33497: Don't get host items if the MARC record is invalid"
Matt Blenkinsop [Wed, 19 Jul 2023 09:50:55 +0000 (10:50 +0100)]
Revert "Bug 33497: Don't get host items if the MARC record is invalid"

This reverts commit a4896e3832fba1ca6a9e388c47c925dc225ddcf1.

11 months agoBug 34029: (RMAINT fix) Update DBIC file
Matt Blenkinsop [Wed, 19 Jul 2023 09:02:01 +0000 (09:02 +0000)]
Bug 34029: (RMAINT fix) Update DBIC file

Commit fb202cc3eaa12b5764fd91e2320ab82c7739bc72 was missed when cherry-picking and xt/author/podcorrectness.t was failing. This commit adds the updated DBIC file that fixes the test

11 months agoBug 34029: (QA follow-up) Fix slipped broken char
Tomas Cohen Arazi [Thu, 29 Jun 2023 12:46:13 +0000 (09:46 -0300)]
Bug 34029: (QA follow-up) Fix slipped broken char

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 12956d3e8a1a929da3c0944fe637d9511e5a2621)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit fb202cc3eaa12b5764fd91e2320ab82c7739bc72)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33974: (RMAINT fix) Fix bad rebase in biblios.t
Matt Blenkinsop [Wed, 19 Jul 2023 08:42:08 +0000 (08:42 +0000)]
Bug 33974: (RMAINT fix) Fix bad rebase in biblios.t

A line has been missed when cherry-picking/rebasing commit 83a1fbac24f6f870a25dd560181e85917b17fa52

Line added and tests now passing

11 months agoBug 29762: (follow-up) Change field names from phone to primary phone
Katrin Fischer [Sun, 9 Jul 2023 14:08:51 +0000 (14:08 +0000)]
Bug 29762: (follow-up) Change field names from phone to primary phone

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3f80a0fcf74be12bb12f249d79139df29455f4a5)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 853ced5fa1f2a9d203e977de318b51407f121323)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 29762: Change field names from "Mobile" to "Other phone"
Philip Orr [Fri, 7 Jul 2023 13:21:46 +0000 (13:21 +0000)]
Bug 29762: Change field names from "Mobile" to "Other phone"

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

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

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 782bb4acf96e9263fabcd6d3b3d1637f890aa9f1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cd56fda58d34bce90306fa6b3e58703653afb17f)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34232: (QA follow-up) Remove superfluous "Use:" from each list entry
Katrin Fischer [Mon, 10 Jul 2023 21:30:41 +0000 (21:30 +0000)]
Bug 34232: (QA follow-up) Remove superfluous "Use:" from each list entry

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2c0ea36a0072f0398c896bc6f3280cf7bfea48e8)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 19e79589c20fa228a61747f3b9a72a9e9d961454)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34232: Make dropdown on additem page rescept display order
Lucas Gass [Fri, 7 Jul 2023 19:31:15 +0000 (19:31 +0000)]
Bug 34232: Make dropdown on additem page rescept display order

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

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8065e3515abb79317f7c2dcddcb794529ffc9348)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit ebe3637a25fac20869acf72b23ef021dc2c185a1)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34209: Follow up on Bug 28726 - move whole 'select all ...' header into condition
Michael Hafen [Wed, 5 Jul 2023 17:17:09 +0000 (11:17 -0600)]
Bug 34209: Follow up on Bug 28726 - move whole 'select all ...' header into condition

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

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c2e5a3242529a417d75585af113f6b50e2e690f0)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6d1748ed4c7951040c0aa8ae0489cbdabcf7b732)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34182: Don't set biblio.serial based on biblio.seriestitle in AddBiblio
Phil Ringnalda [Sat, 1 Jul 2023 15:41:15 +0000 (08:41 -0700)]
Bug 34182: Don't set biblio.serial based on biblio.seriestitle in AddBiblio

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

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

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

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

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 6485f244e085fe48b796dd64178659c2f4a5e4ba)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit cb07de6a981eab80c5764beb35c774e2910359ca)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34256: Fix regression from 34092
Pedro Amorim [Fri, 14 Jul 2023 08:37:27 +0000 (08:37 +0000)]
Bug 34256: Fix regression from 34092

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

This showed in the borrowernumer no longer being searchable:

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

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bcabb5d24712b23963c4616efae19e940cf2c544)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 681c635024146ec4f4ca670207f19f6c033b6053)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 34261: Add missing argument to show_account
Matt Blenkinsop [Wed, 12 Jul 2023 13:22:54 +0000 (13:22 +0000)]
Bug 34261: Add missing argument to show_account

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

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

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0992769f6ee935d7f12c127ab5df827768361585)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 86c15fca16170eacadce4ab3fd6473cee5643fdb)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33939: Preserve order budget dropdowns and default budget dropdowns seperately
Nick Clemens [Wed, 7 Jun 2023 13:20:40 +0000 (13:20 +0000)]
Bug 33939: Preserve order budget dropdowns and default budget dropdowns seperately

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

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

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 80eb5ac35be44afd5547e1fa75da475d88f95612)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit a2a8cb86b0d73f11514158a29e1b0780f89a04a6)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33727: (QA follow-up) perl tidy whole file
Marcel de Rooy [Fri, 14 Jul 2023 07:36:03 +0000 (07:36 +0000)]
Bug 33727: (QA follow-up) perl tidy whole file

Test plan:
Run prove again. Run qa tools.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c0f2a47d3ce78a23aa1b6253188108ce3b0047b7)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 8ecb70b338d0456a73af92d50baf765bcff4f9a7)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 months agoBug 33727: Merge both Calendar tests
Marcel de Rooy [Sat, 13 May 2023 12:18:02 +0000 (12:18 +0000)]
Bug 33727: Merge both Calendar tests

The old t tests become part of the first subtest.

Test plan:
Run the new t/db_dependent/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 2eb6c36c4ddec644619486dea5520e89ef9af56b)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 6052f0ec174fb313998cbe38d17af4d9390ee319)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 months agoBug 33808: Add aria-labels in reports-toolbar.inc
Matt Blenkinsop [Tue, 23 May 2023 14:01:40 +0000 (14:01 +0000)]
Bug 33808: Add aria-labels in reports-toolbar.inc

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

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

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

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

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

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

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

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>
11 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>