]> git.koha-community.org Git - koha.git/log
koha.git
14 months agoBug 33028: Add TT filters for Price and pattern checks to input fields
Katrin Fischer [Fri, 16 Jun 2023 16:59:22 +0000 (16:59 +0000)]
Bug 33028: Add TT filters for Price and pattern checks to input fields

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

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

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3c2d40bb4a05687eca67a8e06befd5d43d0a4b9d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 32bddca28690bb05695d3e25fbd5764b7af0a06d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
14 months agoBug 33028: Add is_monetary to recall_overdue_fine and article_request_fee
Katrin Fischer [Fri, 16 Jun 2023 16:57:51 +0000 (16:57 +0000)]
Bug 33028: Add is_monetary to recall_overdue_fine and article_request_fee

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e2634097c15d808d4e9a96e33efa9ab245bba88c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit feb6ceaa249b938e1214c4e4bb104f043d1b5bb4)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
14 months agoBug 33028: (follow-up) Fix trailing 0 decimals
Martin Renvoize [Fri, 3 Mar 2023 11:33:46 +0000 (11:33 +0000)]
Bug 33028: (follow-up) Fix trailing 0 decimals

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 598970a1223b9af043b1977965322758565f7d06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 84076285128d986f9a75c3135d40156248636420)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
14 months agoBug 33028: (follow-up) Move monetary definition into hash
Martin Renvoize [Fri, 3 Mar 2023 11:28:20 +0000 (11:28 +0000)]
Bug 33028: (follow-up) Move monetary definition into hash

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2b48a948cbe7f14526e4ea8836e5175e38ab9d20)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4a8fdaee6695c576966ddfa78262ae4f8da10651)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
14 months agoBug 33028: Fix calculations around cronjob fines.pl
Thibaud Guillot [Tue, 21 Feb 2023 16:05:45 +0000 (17:05 +0100)]
Bug 33028: Fix calculations around cronjob fines.pl

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

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

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

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1f9e161b412621c048c55741bab56b92c0b01a15)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4f9eba2d232dcd709fe4ef74d37963f1e019569d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
14 months agoBug 33117: Make dbrev idempotent
Tomas Cohen Arazi [Mon, 7 Aug 2023 18:13:46 +0000 (15:13 -0300)]
Bug 33117: Make dbrev idempotent

QA didn't spot the issue, nor I. So fixing now.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 951e67a1b3dd1f26eddeaecd2dc63991f9667927)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit caa46019d07d89474feee02c7a2f8961e7414283)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
14 months agoBug 34181: Fix jQuery selector to make delete checkboxes reappear
Katrin Fischer [Sun, 16 Jul 2023 14:11:19 +0000 (14:11 +0000)]
Bug 34181: Fix jQuery selector to make delete checkboxes reappear

Bug 32257 changed the page structure slightly to fix a display
issue with the labels. This resulted in a broken selector in the
function for displaying the checkboxes for deleting/emptying a
certain patron field.

To test:
* Go to Tools > Batch patron modifications
* Enter some cardnumbers or borrowernumbers
* On the batch patron edit form, verify that the checkboxes
  behind each input field are missing
* Apply patch
* Verify the checkboxes reappeared
  * Verify that for mandatory fields the checkbox is locked
* Make some batch edits and verify the checkboxes work as
  intended

Signed-off-by: Lisette Scheer <lisette.scheer@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 d81b009ab0634e1ae33a1bb5cf20cad538bb361f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 625d0f812ad1c58750c032e7fdd271eaf2932f8c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
14 months agoBug 34337: (bug 33581 follow-up) Sample patrons not inserted
Jonathan Druart [Fri, 21 Jul 2023 09:27:26 +0000 (11:27 +0200)]
Bug 34337: (bug 33581 follow-up) Sample patrons not inserted

The "select all" link for the optional sample data is not selecting
holidays and patrons.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 39496af98f3d6408821636b92c5f6e3a25e5e71c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f400830a56ec12005f922e7b0de012e6c0ef9a07)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
14 months agoRMAINT: Fix permission of .08 release db_rev
Martin Renvoize [Tue, 15 Aug 2023 09:36:42 +0000 (10:36 +0100)]
RMAINT: Fix permission of .08 release db_rev

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
15 months agoBug 33881: Clear self-check JWT during auth kick out
David Cook [Tue, 6 Jun 2023 03:48:06 +0000 (03:48 +0000)]
Bug 33881: Clear self-check JWT during auth kick out

This patch clears the JWT cookie during auth kick out (ie
when a web user navigates from the self-check out/in to
the rest of Koha).

Test plan:
0. Apply patch and koha-plack --reload kohadev
1. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
2. Log in as the "koha" user
3. In another tab, go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
4. Go to http://localhost:8080/cgi-bin/koha/opac-search.pl?idx=&q=a&weight_search=1
5. Note that you are prompted to "Log in to your account" via the normal Koha prompt
6. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl
7. Note that you are prompted to "Log in to your account" within the "Self checkout system",
and note that your self-checkout session for the "koha" user has *not* persisted like
it did before the patch was applied

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1fa961b97b8f52d1c9920c72d9338d150deb829b)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoBug 30524: (QA follow-up) Fix tests
Tomas Cohen Arazi [Fri, 28 Jul 2023 13:40:28 +0000 (10:40 -0300)]
Bug 30524: (QA follow-up) Fix tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 158edb411b32253fae4f068ce416d6ad4d1a67d3)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoUpdate release notes for 22.11.08 release v22.11.08
Matt Blenkinsop [Fri, 28 Jul 2023 11:09:51 +0000 (11:09 +0000)]
Update release notes for 22.11.08 release

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoIncrement version for 22.11.08 release
Matt Blenkinsop [Fri, 28 Jul 2023 10:58:17 +0000 (10:58 +0000)]
Increment version for 22.11.08 release

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoFix translations for Koha 22.11.08
Matt Blenkinsop [Fri, 28 Jul 2023 10:37:34 +0000 (10:37 +0000)]
Fix translations for Koha 22.11.08

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 months agoTranslation updates for Koha 22.11.08
Koha translators [Fri, 28 Jul 2023 09:04:11 +0000 (06:04 -0300)]
Translation updates for Koha 22.11.08

(cherry picked from commit 1b14e70f7fb487fab02e2055f5b4f0fe860d75db)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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

15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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.

15 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.

15 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.

15 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.

15 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.

15 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.

15 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.

15 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.

15 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

15 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>
15 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

15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>
15 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>