koha.git
3 years agoBug 24055: Rephrase description of PayPalReturnURL slightly
Katrin Fischer [Sat, 11 Apr 2020 20:05:14 +0000 (20:05 +0000)]
Bug 24055: Rephrase description of PayPalReturnURL slightly

changes 'OPAC's alias' to 'specified URL' as suggested by
Tomas on comment#2.

To test:
- Go to Administration / System preferences
- Search for PayPalReturnURL
- Verify description has changed to "specified URL" as
  one of the options

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4b31073af292e391cd1df1be3894029460fa6040)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3e586acb7474c9292e7f7dbea883a0e73613d980)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 20527: (QA follow-up) Fix type 'Wiriteoff'
Nick Clemens [Thu, 21 Jan 2021 16:09:58 +0000 (16:09 +0000)]
Bug 20527: (QA follow-up) Fix type 'Wiriteoff'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c706b8aa13edd39769324ad2d5937d9d4d5ae583)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 49f01ce2985794e1e7a2e503be7fa27c6a8a36b8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 20527: Corrected paid to amountwrittenoff
Eden Bacani [Thu, 21 Jan 2021 02:54:30 +0000 (02:54 +0000)]
Bug 20527: Corrected paid to amountwrittenoff

Test Plan
1. Go to My account and go into accounting
2.Create manual invoice (If you already have invoices skip this step)
3.On the Make a payment tab click on Write off under actions of an
invoice
4. Click on Writeoff amount label and make sure that the amount written
is highlighted in green.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f3992816b20bf97de904d485e775c32b93df0726)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 21a1fb0cc239f24ee14f8659e96033f66314a226)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 11996: (follow-up) Updating the uk-UA currency
Ella Wipatene [Thu, 21 Jan 2021 01:46:21 +0000 (01:46 +0000)]
Bug 11996: (follow-up) Updating the uk-UA currency

I have changed GRN to UAH in both
installer/data/mysql/ru-RU/optional/sample_currency.sql and in
installer/data/mysql/uk-UA/optional/sample_currency.sql

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 732e69f4b25b7af22ab034f143b8df5d7ffd263a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 63babb7401c9c94ba22e5e8a65725772e84dd546)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 11996: Made RUB default currency for ru-RU
Ethan Amohia [Thu, 17 Jan 2019 02:42:32 +0000 (02:42 +0000)]
Bug 11996: Made RUB default currency for ru-RU

Didn't know how to change the uk-UA default currency.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6bb8065af69438673ca5ed0bca0664c366a87e02)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e001395c1a3afa53ea2df7cdd34738dd3ea6f0da)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24447: Changing 'DUE' to example in database that exists.
Eden Bacani [Thu, 21 Jan 2021 01:20:49 +0000 (01:20 +0000)]
Bug 24447: Changing 'DUE' to example in database that exists.

Test Plan:
1.Using  perldoc C4/Members/Messaging.pm check that message_name
attribute name example  is Item_Due and not DUE.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0a0ff7c5ceab836631be060a4571681ff40e275c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9c4aeca752210bbb504a84d84dbe49a9394ff0a3)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25381: (QA follow-up) Fix occurence in the one file that escaped
Katrin Fischer [Thu, 21 Jan 2021 23:44:10 +0000 (23:44 +0000)]
Bug 25381: (QA follow-up) Fix occurence in the one file that escaped

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 02adae8a5f7ecf8f6e44042d078e406b0aacf19a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6dcba06353386483d9a00cfcc05df821cd9f92d8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25381: XSLTs should not define entities
Didier Gautheron [Fri, 8 May 2020 13:19:54 +0000 (15:19 +0200)]
Bug 25381: XSLTs should not define entities

Bug 23290 explicitly disabled entity expansion during XML parsing for security reasons.

However, many XSLTs define the following entity:
<!ENTITY nbsp "&#160;" >

They don't use the entity &nbsp, but its presence could lead to confusion.

Signed-off-by: Eden Bacani <eden.bacani@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 10c08b6552c7063c4c029701018d6f54e6549acb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c83158f5bf80f6f4fdfd5ae7e6abfbfbc033f681)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 7143: Update about page for new devs
Jonathan Druart [Fri, 22 Jan 2021 13:52:07 +0000 (14:52 +0100)]
Bug 7143: Update about page for new devs

Eden Bacani
Ella Wipatene
Ava Li

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4b7aecb00634e2fe4c8358dd99cef880916a5fc4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c9764b5fe75553459dd34d7cbc87620128dbd1a8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 7143: Update about page for new devs
Jonathan Druart [Thu, 21 Jan 2021 15:01:19 +0000 (16:01 +0100)]
Bug 7143: Update about page for new devs

Mazen Khallaf
Amy King
Catherine Ma
James O'Keeffe
Victoria Faafia

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a57278f39b8c5b7a82b21671f266dbf32e2d41a0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9016c317f5cb1c5ce36b9dee66564336f0fec220)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27457: Set focus for cursor to Debit type code field
Catherine Ma [Tue, 19 Jan 2021 01:08:28 +0000 (01:08 +0000)]
Bug 27457: Set focus for cursor to Debit type code field

Test Plan:
1.Click administration
2.Click debit types
3.Click new debit type
4.Check if the cursor is in the first form field (it shouldn't)
5.Add patch
6.Repeat steps 1-3
7.Check if the cursor is in the first form field (it should)

Sponsored by Catalyst IT
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 958a91dc4ec3965956bfbdb8d4cdae5db07c7a0f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1868aa3a735288e98909aa9f97fefa73d92ea642)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27458: Set focus for cursor to Credit type code field
Amy King [Wed, 20 Jan 2021 00:57:35 +0000 (00:57 +0000)]
Bug 27458: Set focus for cursor to Credit type code field

Test Plan:
Before applying patch
1. Click on Administration
2. Scroll down to Accounting and click on Credit types
3. Click New credit type
4. Note how the cursor does not focus on Credit type code field
5. Apply patch
6. Repeat steps 1-3
7. Note how the cursor now focuses on Credity type code field

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JD amended patch: Edit commit title

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d05547dcb64895febca9a79b818d47119fee9a6b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f42409234a8b26fa56abc336fc77e11f03aeb834)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoRevert "Bug 27299: Remove tokenization for phrase register/index with ICU"
Andrew Fuerste-Henry [Wed, 3 Feb 2021 18:48:28 +0000 (18:48 +0000)]
Revert "Bug 27299: Remove tokenization for phrase register/index with ICU"

This reverts commit 83716bc4ac3676a151845e2e507d6aef90dd1e13.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27011: Remove unused $name variable
Amy King [Tue, 19 Jan 2021 03:27:27 +0000 (03:27 +0000)]
Bug 27011: Remove unused $name variable

The variable is no longer used in the template, it has been removed by:

  commit 76eb3a0549efe4c1f1557071a6cb4b33d4bd3e4d
  Bug 18789: (follow-up) Pass a Koha::Patron object from returns.pl

-            <td>[% name %]</td>
+            <td>[% INCLUDE 'patron-title.inc' patron=patron %]</td>

We can simply remove the $name variable from the controller script.

Test Plan:
1. Check out a book
2. Check in a book
3. Note what happens
4. Apply patch
5. Repeat step 1-2
6. Note that it doesn't break and everything still works

JD Amended patch: fix commit message

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 113992e620095aac59253cf653acfa47f1ec7768)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6a4541776e4b8f6176de7ba85e2f2011574ddd5c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25808: (QA follow-up) Fix unit tests
Kyle M Hall [Wed, 20 Jan 2021 14:35:33 +0000 (09:35 -0500)]
Bug 25808: (QA follow-up) Fix unit tests

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6c66a88aea7579b67f869163c11fec70cd73b98c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4117732b56bdb7ce57c8c5228c9594767639f803)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25808: (QA follow-up) Add regression test
Martin Renvoize [Thu, 14 Jan 2021 14:40:31 +0000 (14:40 +0000)]
Bug 25808: (QA follow-up) Add regression test

This patch adds a basic regression test for the bug.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
JD amended patch: remove trailing space char

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bdf1ec7b71042e26a952329838093391fe8a21f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 209c97a5b4d6c913471fe369ca4e9f339942ede8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25808: Renewal via the SIP 'checkout' message gives incorrect message
Kyle M Hall [Thu, 18 Jun 2020 17:23:04 +0000 (13:23 -0400)]
Bug 25808: Renewal via the SIP 'checkout' message gives incorrect message

If a renewal via SIP cannot be made because the patron has reached the maximum number of renewals,
the AF screen message should read "Item has reached maximum renewals!",
instead we get "Item checked out to another patron".

Test Plan:
1) Check out an item to a patron
2) Using the SIP CLI tool, run checkout messages until the checkout has
   reached the maximum number of renewals
3) Note the incorrect message in the AF field
4) Apply this patch
5) Restart the SIP server
6) Run another SIP checkout message
7) Note the message is now correct!

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6cdfa37e63901c713f817fb44c279367a0c21ab0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 606a3a2e21fe230d163b2d5d3458ec5351d7f9a9)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27192: Automatically set focus to the item type input box
Andreas Roussos [Fri, 8 Jan 2021 14:45:32 +0000 (15:45 +0100)]
Bug 27192: Automatically set focus to the item type input box

When adding a new item type, you have to click inside the
"Ιtem type:" input box before you can start entering text.

This patch fixes that by adding the "focus" class to the relevant
<input> element so that cursor focus is set when the page loads.

Test plan:

1) Try to add a new item type: notice how you have to manually
   click inside the "Item type:" input box before you start typing.
2) Apply this patch.
3) Repeat step 1) -- this time the "Item type:" input box should
   gain focus automatically.

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a219a78239049245768ae3abd781136745f9a01f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 791bd8803115691b0f8567eec6d99ef9509455bf)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24272: Correctly encode output to prevent 'Wide character in say'
Jonathan Druart [Wed, 20 Jan 2021 09:02:45 +0000 (10:02 +0100)]
Bug 24272: Correctly encode output to prevent 'Wide character in say'

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 67b1b20e33f5d73ea515ea3b4d244dde73576448)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3fd8e4a13c361ad33d4cb02a7d77155f752b9f06)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24272: Use Pod2Usage and surround values with ''
Jonathan Druart [Wed, 20 Jan 2021 09:02:10 +0000 (10:02 +0100)]
Bug 24272: Use Pod2Usage and surround values with ''

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit b1915293441b7f61d0e61c6b7dd105de1bbd5d8e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1601911977dc427e11428190bf62f416023c381b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24272: (follow-up) Test defined not true
Nick Clemens [Fri, 15 Jan 2021 11:00:39 +0000 (11:00 +0000)]
Bug 24272: (follow-up) Test defined not true

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a9ea5d1ba42d8d0bbf3f8ad01e22521f20efdd38)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a8f2eaa7958f595e549b91d162ee6d8320ff12ed)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24272: add check_sysprefs_cache.pl
Nick [Thu, 19 Dec 2019 03:20:36 +0000 (03:20 +0000)]
Bug 24272: add check_sysprefs_cache.pl

This script ensure that no sysprefs have been changed directly in the database and/or
that the cache has not become corrupted. We have occasionally seen this happen on production sites

To test:
1 - In the staff interface go to Administration
2 - Search for system preference 'IntranetUserJS'
3 - Add content to the syspref:
    console.log('Hi!');
4 - On the command line launch mysql
    sudo koha-mysql kohadev
5 - Alter the syspref directly
    UPDATE systempreferences SET value = "console.log('Bye!');" WHERE variable = 'IntranetUserJS';
6 - run the script
    perl misc/maintenance/check_syspref_cache.pl
7 - You are warned about the altered system preference

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit de5527f37d898e756cac4d8ed9de63c6576c1241)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5a1e18efd87c34ef9f158c4a6f663d30ab3a4e43)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27416: Make "Modify tag" and "Add tag" translatable
Jonathan Druart [Wed, 13 Jan 2021 10:11:36 +0000 (11:11 +0100)]
Bug 27416: Make "Modify tag" and "Add tag" translatable

Those two strings are not translatable as they are passed from the
controller.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4491cdd803226c22c585f3a23f6aa77000841bed)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 054428a57d4b810bc3278d625de573a66cb5d076)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 17429: document the --plack/--noplack options of koha-list
Andreas Roussos [Tue, 29 Dec 2020 09:41:38 +0000 (10:41 +0100)]
Bug 17429: document the --plack/--noplack options of koha-list

The man page of koha-list does not list the --plack and --noplack
options.

This patch fixes that.

Test plan:

1) View the current man page for `koha-list` (with `man koha-list`)
   and notice how the --plack and --noplack options are missing.

2) Apply this patch.

3) Run the following command to re-generate the man page:

   xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl/manpages/docbook.xsl \
   debian/docs/koha-list.xml

   View the manual page again (with `man -l koha-list.8`), the
   two options are now displayed under SYNOPSIS and OPTIONS.

4) Make sure this test passes:
   prove -v xt/verify-debian-docbook.t

Signed-off-by: Mazen Khallaf <mazen.i.khallaf@gamil.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 920d3efcdfe1efc79e81017f8340227063ae2973)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dd2489c17544becb33bff1193c35875a14abad6a)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 15448: Remove items fetch
Jonathan Druart [Thu, 14 Jan 2021 09:44:46 +0000 (10:44 +0100)]
Bug 15448: Remove items fetch

We fetch them already too many times.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 6cd68dd05bdac2787fa0b67b7f90a5836c57745c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 54a9ef09bfe7fe8eff67a173dc7b79a278aba88f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 15448: Fix ISE
Jonathan Druart [Thu, 14 Jan 2021 09:42:53 +0000 (10:42 +0100)]
Bug 15448: Fix ISE

The method Koha::Items->itemnumber is not covered by tests!

Trace begun at /kohadevbox/koha/Koha/Objects.pm line 592
Koha::Objects::AUTOLOAD('Koha::Items=HASH(0x55981fd94790)') called at /kohadevbox/koha/opac/opac-reserve.pl line 465

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9790b5ca3a1b8a92d56a14207d6245c02dfe7fd6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 60e08d51bb814eb1dae834afa0c259539eaf2c61)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 15448: (follow-up) Adapt to changes on bug 24254
Tomas Cohen Arazi [Mon, 21 Dec 2020 19:30:31 +0000 (16:30 -0300)]
Bug 15448: (follow-up) Adapt to changes on bug 24254

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8af3ecdd538f22bfbf4d99bda629283fe856f3de)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 655c4427c7d2c9e4d05c016fa52833feb9c59892)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 15448: (follow-up) Fetch the patron category once
Tomas Cohen Arazi [Fri, 4 Dec 2020 11:33:43 +0000 (08:33 -0300)]
Bug 15448: (follow-up) Fetch the patron category once

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c9f66f5e6b5360a57885c26436c7eb3f2747bd28)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cdfea7001131055c8d91459d4c48dbc4adb4741e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 15448: Filter out items hidden in OPAC on placing hold
Tomas Cohen Arazi [Fri, 4 Dec 2020 11:21:36 +0000 (08:21 -0300)]
Bug 15448: Filter out items hidden in OPAC on placing hold

This patch leverages on bug 24254's
Koha::Items->filter_by_visible_in_opac to filter out items that
shouldn't be presented to the end user in the OPAC interface.

To test:
1. Circulation and Fine rules for item-level holds are set to allow.
2. Setting the OpacHiddenItems preference to "ccode: [SUPPRESS]"
3. An item with collection Code Suppress is set.
4. Search for the title in the OPAC.
=> SUCCESS: The Suppress ccode item isn't shown.
5. View the detail page for the title.
=> SUCCESS: The suppress ccode item isn't shown.
6. Place a hold on the item:
  -- Click "Show more options"
  -- Select "A specific item"
=> FAIL: the ccode with the opachiddenitems rule has an item that appear in the list to place a hold
7. Apply this patch and repeat 6
=> SUCCESS: The item doesn't show!
8. Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 051f5519861cb2365ddd06d08a9047648af2318b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 284b2da589aabb2475b1292b1cf843be818b384e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27299: Remove tokenization for phrase register/index with ICU
David Cook [Tue, 22 Dec 2020 22:57:38 +0000 (09:57 +1100)]
Bug 27299: Remove tokenization for phrase register/index with ICU

This patch removes tokenization for phrase register/index when
using ICU.

This should cause "exact" searches to work the same way with ICU
as they do with CHR.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7f9c909d5a603c40125064e7e32f24e595d596e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3a841a3a74a6165af996f8ca9c8affe8c5192f9e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24254: (QA follow-up) Inlines opachiddenitems handling
Martin Renvoize [Thu, 14 Jan 2021 11:28:35 +0000 (11:28 +0000)]
Bug 24254: (QA follow-up) Inlines opachiddenitems handling

We decided to inline the opachiddenitems filter as we don't believe it
will be used exclusively.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24254: Implement separate filters and add patron param
Tomas Cohen Arazi [Mon, 21 Dec 2020 18:50:13 +0000 (15:50 -0300)]
Bug 24254: Implement separate filters and add patron param

This patch introduces two new methods for stacking filters on
Koha::Items:

- filter_out_lost
_ filter_out_opachiddenitems

This two filters are what actually happened inside the
filter_by_visible_in_opac. Everything is covered by tests.

In the process I added a Koha::Patron param to the method that is
internally used to decide if the OPACHiddenItems syspref needs to be
honoured or not. This *could* be better done with a fallback to
C4::Context->userenv if no param is passed.

I decided to leave that part for later, if we really find it would help
(e.g. if bug 10589 gets some action and we really need something here to
 handle that).

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Items.t
=> SUCCESS: Tests pass!
3. 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: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24254: Read the OpacHiddenItems preference internally
Tomas Cohen Arazi [Sat, 19 Dec 2020 13:21:18 +0000 (10:21 -0300)]
Bug 24254: Read the OpacHiddenItems preference internally

After discussing the 'rules' parameter usefulness we decided it was not
the best idea, and the gains in terms of 'performance' would me
meaningless (in-memory caching of sysprefs). This patch makes a really
minor tweak to the tests so they mock the C4::Context->yaml_preference
method, but keeping the same original rules to highlight no behaviour
change takes place.

Then the rules parameter is removed from the calls, and the tests should
keep passing.

A minor change to make $rules = undef is made to highlight the // {}
behaviour when reading the syspref..

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24254: Compare itemlost with 0
Tomas Cohen Arazi [Sat, 19 Dec 2020 13:05:16 +0000 (10:05 -0300)]
Bug 24254: Compare itemlost with 0

On C4::Search and C4::Circulation the uses of the items.itemlost field
highlight the fact that the comparisson itemlost <= 0 was wrong, as it
is evaluated as a Perl boolean.

The column can only be an int and NOT NULL, so we need to check if it is
0 to ponder if not hidden.

This patch changes the tests to reflect this, and adjust the
Koha::Items->filter_by_visible_in_opac implementation to adapt to this.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24254: Add Koha::Items->filter_by_visible_in_opac
Tomas Cohen Arazi [Thu, 3 Dec 2020 18:11:14 +0000 (15:11 -0300)]
Bug 24254: Add Koha::Items->filter_by_visible_in_opac

This patch adds a method based on the original idea from Nick, but on
Koha::Items.

The idea is to build a proper filter, based on the current rules for
hiding things, directly on the DBIC query. The caller takes care of
knowing if the filtering should apply (i.e. checking the patron category
exceptions) and then it would do something like:

    my @items;
    if ( <patron_category_does_not_have_exception> ) {
        @items = $biblio->items->filter_by_visible_in_opac(
            {
                rules => $rules
            }
        );
    }
    else {
        # still want to enforce 'hidelostitems'
        @items = $biblio->items->filter_by_visible_in_opac;
    }

To test:
1. Apply this patches
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Items.t
=> SUCCESS: Tests pass!
3. Look at the use cases on the tests, read the code
=> SUCCESS: It all makes sense
4. Compare with Koha::Item->hidden_in_opac
=> SUCCESS: It all makes sense
5. 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: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24254: Unit tests
Tomas Cohen Arazi [Thu, 3 Dec 2020 18:11:00 +0000 (15:11 -0300)]
Bug 24254: Unit tests

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27297: Add required and blank options to av-build-dropbox.inc
Nick Clemens [Tue, 22 Dec 2020 19:28:28 +0000 (19:28 +0000)]
Bug 27297: Add required and blank options to av-build-dropbox.inc

This patch adds two options to av-build-drobx
required - which will add the required attribute to the select
blank - which will add a blank option to avoid preselecting others

To test:
1 - In OpacSuggestionMandatoryFeilds select itemtype
2 - Go to OPAC
3 - Add a suggestion
4 - Don't fill out any fields
5 - Submit
6 - Suggestion is added
7 - Delete it
8 - Apply patch
9 - Add a suggestion
10 - Note itemtyp edefaults to 'None'
11 - You cannot submit until you select a value

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit cb95c9140316d4b9dc28cd696d14106b460774aa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6124adab15d39cd94e8a8c2fa9f21bde80e0e317)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27306: (QA follow-up) Add space between title and subtitle
Katrin Fischer [Sun, 10 Jan 2021 22:41:46 +0000 (23:41 +0100)]
Bug 27306: (QA follow-up) Add space between title and subtitle

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9c8d4abeed95113ff5da56d3438a68ed64c8fedf)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7e0e1d8f8c4cf804578fc4eec2cdae5962f9e045)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27306: Add subtitle to return-claims-table
Lucas Gass [Wed, 23 Dec 2020 20:47:32 +0000 (20:47 +0000)]
Bug 27306: Add subtitle to return-claims-table

To test:
-turn on claim returned
-find some items with a 245b or add a 245b to some items
-check those items out and mark them as claimed returned
-on the borrowers /cgi-bin/koha/circ/circulation.pl page look at the return-claims-table
-no subtitle
-apply patch and clear browser cache, restart_all
-now you should see the subtitle

Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit ee6c4548ad27c3efd4c78956e70336baffb994b0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 44e986d6728e7f93618241ae28f12b11ae59faf0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26713: Add pagination to bottom of saved SQL reports table
Owen Leonard [Thu, 3 Dec 2020 12:06:46 +0000 (12:06 +0000)]
Bug 26713: Add pagination to bottom of saved SQL reports table

This patch adds a second pagination menu to the bottom of the report
results table.

To test, apply the patch and go to Reports.

- Run a report which will return multiple pages of results (greater
  than 20).
- The results should display with a pagination bar at the top and bottom
  of the table.
- Confirm that both pagination menus work correctly.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit dbc74154754c4d5d03baa7c96b8511e0c2e0d036)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 544b4c44930053a8c173eaafb304fa8b362de572)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27308: Skip blank lines when inserting new
Nick Clemens [Thu, 24 Dec 2020 13:35:28 +0000 (13:35 +0000)]
Bug 27308: Skip blank lines when inserting new

The intent of the macro insert new function is to add a new field at the correct numerical place in the record. If you have a blank line while editing, however, the new line will be inserted at the blank line, rather than checking the rest of the record.

To test:
1 - Create a macro like
    new 690=‡aLOCAL SUBJECT
2 - Insert a blank line into your record somewhere before where the 690 should be inserted
3 - Run the macro
4 - Line is inserted before the blank line
5 - Apply patch
6 - Reload (ensure cache is cleared and JS files are reloaded)
7 - Remove the previously created field, but leave the blank
8 - Run the macro
9 - Field is created at correct position

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 27308: (QA follow-up) Remove commented line

I don't think we need to keep the original line as a comment.. this
patch simply cleans it up.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3b0f86b53173d30da5dbb42710a7c9bf9edaa3bb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d27b1018a96667c6fce8fc746e968e9a206858a0)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27307: Don't drop phrase directive when searching keyword index
Nick Clemens [Thu, 24 Dec 2020 14:04:55 +0000 (14:04 +0000)]
Bug 27307: Don't drop phrase directive when searching keyword index

We convert 'keyword' to '' as an index since we want it to search all fields

When we are searching 'as phrase', however, we should not drop the search type

To test:
 1 - Enable IntranetCatalogPullDown
 2 - Set searchEngine to Elasticsearch
 3 - Perform a search for 'Keyword as phrase' for a phrase that does appear in a record
 4 - You get the result
 5 - Reverse the order of words in the phrase
 6 - You still get a result?
 7 - Apply patch
 8 - Restart all the things
 9 - Reversed search does not return record
10 - Correct order and search, correct record returned

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9cfce5f010c485ee5e046bcc99a9d33a70d9213a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit d9b2c504639e3e336a0ef8a1f75c31452a556e90)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27307: Unit test
Nick Clemens [Thu, 24 Dec 2020 14:04:17 +0000 (14:04 +0000)]
Bug 27307: Unit test

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 2e9344d2e3e959f9c474d43f59ff7688d1a784ee)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 90edb4ee0ac437e87b26ca94043f2dad3f0e0326)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26957: Don't remove words that are also operators from search terms
Nick Clemens [Mon, 23 Nov 2020 18:37:48 +0000 (18:37 +0000)]
Bug 26957: Don't remove words that are also operators from search terms

FindDuplicate has a hardcoded regex to remove 'and', 'or', and 'not' from any search fields, however,
is does this with no regard for these terms being embedded in the middle of a word or phrase.

E.g.:
'Coupland' becomes 'Coupl'
'Frog and toad' becomes 'frog toad'
etc.

This patch simplay removes the substitutions as we already quote the terms as well

To test:
1 - Add records to your system like:
    The night circus by Erin Morgenstern
    Frog and toad all year
    Nothing ever happens
2 - Attempt to add purchase suggestions like
    title: the night circus, author:Morgenstern, Erin
    title: For and toad all year
    title:nothing ever happens (case is important)
3 - No warnings about existing biblios
4 - Apply patches
5 - Delete existing suggestions
6 - Repeat step 2
7 - Each attempt should warn you of existing biblio

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a52a9d787544aae384aee1a33c9d3bb35d98f8fa)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 680fc0f77d9c7c3c20dacc14c9db94b52d009ee4)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26957: Unit tests
Nick Clemens [Mon, 23 Nov 2020 18:37:39 +0000 (18:37 +0000)]
Bug 26957: Unit tests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a1f44a831e2c41da8074bca4fcf250335687135a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b99770e5b5bae85a9b6bb76be7c2b253ae7ef61f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoUpdate release notes for 20.05.08 release v20.05.08
Andrew Fuerste-Henry [Fri, 22 Jan 2021 22:07:32 +0000 (22:07 +0000)]
Update release notes for 20.05.08 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoIncrement version for 20.05.08 release
Andrew Fuerste-Henry [Fri, 22 Jan 2021 21:39:24 +0000 (21:39 +0000)]
Increment version for 20.05.08 release

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoTranslation updates for Koha 20.05.08
Koha translators [Fri, 22 Jan 2021 21:03:25 +0000 (18:03 -0300)]
Translation updates for Koha 20.05.08

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27180: (follow-up) Remove unused %is_holiday
Victor Grousset/tuxayo [Sat, 26 Dec 2020 14:19:59 +0000 (15:19 +0100)]
Bug 27180: (follow-up) Remove unused %is_holiday

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit a26d529a2bc7faee3743b4cd1e603ba29411a0b9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit dea3855db6b07861613e9b729926bab6fb39e5f1)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27180: Update fines on holidays
Nick Clemens [Wed, 9 Dec 2020 15:39:09 +0000 (15:39 +0000)]
Bug 27180: Update fines on holidays

This patch removes code that prevents fines from being update on holidays.
The fines are already being calculated, and that takes the calendar into account if
needed, so fines won't be assessed on holidays if they shouldn't.

To test:
 1 - set finesCalendar to 'ignore'
 2 - Checkout an item due yesterday
 3 - Ensure circ rules have a fine amount set
 4 - Make today a holiday
 5 - run fines.pl
 6 - No fine assessed
 7 - Apply patch
 8 - run fines.pl
 9 - Fine assessed!
10 - set finesCalendar to 'use'
11 - checkout an item, due yesterday
12 - run fines.pl
13 - no fine assessed

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 80e1b4e66f01a07cad9bf37625d879f649edf52a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 69821f7aba39009b850aef5716a0818f3cb61d54)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27003: [20.05.x] Fix test failure
Nick Clemens [Fri, 22 Jan 2021 20:16:49 +0000 (20:16 +0000)]
Bug 27003: [20.05.x] Fix test failure

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27196:[20.05.x] Don't explode if item that is waiting if checked in by SIP
Jonathan Druart [Mon, 14 Dec 2020 14:54:54 +0000 (15:54 +0100)]
Bug 27196:[20.05.x] Don't explode if item that is waiting if checked in by SIP

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27413: Restore debarred and debarredcomment to batch patron mod tools
Jonathan Druart [Fri, 15 Jan 2021 10:27:47 +0000 (11:27 +0100)]
Bug 27413: Restore debarred and debarredcomment to batch patron mod tools

It was added by bug 13552 but removed by 19793.

Test plan:
Update patron in a batch and confirm that you can modify the restriction
expiration and comment.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 85ae9bd021aef4e7423669a61df7c4c7fd5b726b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f4a8aa75ab948cc4476b01b69f6b2e1623443828)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26894: Handle subfield 0 and delete empty fields
Nick Clemens [Mon, 2 Nov 2020 12:05:47 +0000 (12:05 +0000)]
Bug 26894: Handle subfield 0 and delete empty fields

This patch corrects handling of subfield 0 when copying/moving. Before these
patches copying from subfield 0 would copy the entire field.

We also correct an error that if moving a single subfield, we can leave behind empty
fields with no subfields. They should be deleted.

To test:
1 - Define a new MARC Modification template with actions:
        Delete field 100$0
        Add new field 100$0 with value Test
        Update existing or add new field 100$0 with value TestUpdated
        Move field 100$0 to 600$0
        Copy field 600$0 to 100$0
        Copy and replace field 245$0 to 700$0
2 - Define a new record like:
    LDR 00334nam a22001217a 4500
    003 ff
    005 20201102111604.0
    008 201102b        xxu||||| |||| 00| 0 eng d
    040 _ _ ‡cvsd
    100 1 _ ‡012345‡aKnuth, Donal Ervin‡d1938
    245 _ _ ‡012345‡aThe aty of computer programming‡cDonald E. Knuth
    650 _ 0 ‡042‡aComputer programming‡9462
3 - Modify this record using the template above
4 - Note that entier 245 is copied to 700, same for 600 field
5 - Apply patch
6 - Now only subfields 0 are copied

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 77f3d48dee24ad51dfbed65922712064dedff1ff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit eb24579aef3b6461ac61044a5d78b0472bbcb68f)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27149: Don't strip itemnumber when adding item status via Z3950Responder
Nick Clemens [Thu, 3 Dec 2020 17:04:19 +0000 (17:04 +0000)]
Bug 27149: Don't strip itemnumber when adding item status via Z3950Responder

This breaks MARCEdit integration as svc/bib uses the itemnumber field to update items

To test:
1 - sudo koha-z3950-responder --stop kohadev
2 - Run it manually:
    perl /kohadevbox/koha/misc/z3950_responder.pl -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
3 - Connect and search to verify itemnumber is in item records
    yaz-client localhost:2100
    base biblios
    find shuffle
    show 1+1
4 - sudo koha-z3950-responder --stop kohadev
5 - Run it manually to add item status
    perl /kohadevbox/koha/misc/z3950_responder.pl --add-item-status k -c /etc/koha/sites/kohadev/z3950 -u kohadev-koha -p /var/run/koha/kohadev/z3950-responder.pid -D -d kohadev-koha-z3950 -l /var/log/koha/kohadev/z3950.log
6 - Connect and search, no itemnumber in records
7 - Apply patch
8 - Stop, restart all the things, and manually start server with item status again
9 - Connect and search, itemnumbers are included

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1d61203fab02038a615be979315e509b8fbdeafd)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 82800db317ffceb1a8b644bf9529e685ac5b42c8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27149: Unit tests
Nick Clemens [Thu, 3 Dec 2020 17:03:40 +0000 (17:03 +0000)]
Bug 27149: Unit tests

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1ae737603f3043c590e33e517d7d95ca8a8283ce)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit de9bb3872d95d4e63fc9744d5d842bb811eee3c6)

Rebase fix

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26851: Don't generate a notice to library if no content
Nick Clemens [Wed, 28 Oct 2020 19:00:28 +0000 (19:00 +0000)]
Bug 26851: Don't generate a notice to library if no content

To test:
 1 - Check out an over due to a patron
 2 - Set overdue triggers to a trigger less than number of days overdue
 3 - Make sure the patron has no email
 4 - Set content of ODUE notice to:
    [%# Comment will not print %]
 5 - perl misc/cronjobs/overdue_notices.pl
 6 - Check the message queue
 7 - There is a notice sent to the library:
    "These messages were not sent directly to the patrons."
    With no messages
 8 - Apply patch
 9 - Repeat
10 - No new message generated

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 9769160083d614601997945f29a0fe9d353bf7ec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e47ed528b2f952f582b088ab57b82fb4061eebf2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27509: Prevent cn_sort value to be lost when editing items
Jonathan Druart [Thu, 21 Jan 2021 16:21:15 +0000 (17:21 +0100)]
Bug 27509: Prevent cn_sort value to be lost when editing items

This is a bit dirty, cn_sort is not passed from the UI but built in
Koha::Item->store depending on the values of itemcallnumber and
cn_source.
It must be updated only if one of those 2 attributes are modified.
The problem is that, as it's not passed, $item->{cn_sort} does not exist,
and set_or_blank will set it to undef.
The trick here is to backup the value before set_or_blank and set it
back to the item object.
Another solution would be to force the processing of cn_sort each time
we call Koha::Item->store. I don't think that's a good idea.

Test plan:
- Create a new item with a cn_source value and an itemcallnumber value
- write a quick report to see the cn_sort value: SELECT cn_sort FROM items WHERE itemnumber=your itemnumber, see your item has a cn_sort value
- edit your item and save it without changing either the cn_source of the itemcallnumber
- run your report again, cn_sort is not modified
- edit your item, changing either the cn_source or itemcallnumber
- run report again, cn_sort is modified as expected

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27420: Use object accessor for $attr_type->class()
Martin Renvoize [Wed, 13 Jan 2021 11:22:53 +0000 (11:22 +0000)]
Bug 27420: Use object accessor for $attr_type->class()

We introduced a bug in the patron attribute forms with bug 5161.

Test plan
1/ Create two PA_CLASS authorized values
2/ Create two corresponding patron attribute types referencing the above
classes.
3/ Edit a patron, both attributes should appear within their own
fieldsets at the bottom of the member entry form.
4/ Set a value for the first of the two patron attributes and save
5/ Edit the patron again, note that the first attribute no longer
resides within it's own fieldset
6/ Apply the patch
7/ Edit the patron again, note that the first attribute now resides
inside it's own fieldset again
8/ Signoff

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 08396d4b2ffe7db4f7550631a751603f01387095)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2cb36767ad9aa80f72b1e3b6aaecaf180f4bcbeb)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27003: [20.05.x] Item creation log must be done after the item is created
Jonathan Druart [Wed, 2 Dec 2020 08:56:04 +0000 (09:56 +0100)]
Bug 27003: [20.05.x] Item creation log must be done after the item is created

Otherwise we don't have its itemnumber yet!

Test plan:
Add and modify an item and confirm that the action logs are created
correctly

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Applied the patch on a live server showing missing info in the logs.
Created and deleted an item. Verified the logs now have the same
info as in the olden days.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26593: Remove _get_discount_from_rule
Nick Clemens [Thu, 19 Nov 2020 15:46:52 +0000 (15:46 +0000)]
Bug 26593: Remove _get_discount_from_rule

This patch remove the private sub used in GetIssuingCharges in favor
of get_effective_rule

It corrects the wrong precedence for rules and adds tests to cover this
subroutine

NOTE: the 'branch' for the discount will be determined by the signed in branch,
    this is a bug to be fixed in the future

To test:
1 - Define a rentalcharge for an itemtype
2 - Define a 10% discount for library A, category A, all itemtypes
3 - Define a 50% discount for all libraries, category A, same itemtype
4 - Attempt to checkout an item from library A of the matching itemtype
5 - The 50% discount is applied
6 - Apply patches
7 - Attempt to checkout an item from library A of the matching itemtype
8 - The 10% discount is applied

prove -v t/db_dependent/Circulation.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit c055685ac4f59b2a83730c67792c6fb3c81d2123)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 50ac537d92e4596451f1b673364b74df01ddc629)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27280: revert from 20.05.x
Andrew Fuerste-Henry [Wed, 20 Jan 2021 14:04:28 +0000 (14:04 +0000)]
Bug 27280: revert from 20.05.x

This reverts commit 59b58965ad66ea831a91d425dcaceaca70a25a11.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26848: Fix Readonly dependency in cpanfile
Julian Maurice [Wed, 28 Oct 2020 15:29:16 +0000 (16:29 +0100)]
Bug 26848: Fix Readonly dependency in cpanfile

- It is a required module. If it is missing, Koha will not start
- Set the minimum version to 2.00. While not strictly required, it's the
version that states that "Deprecation of Readonly::XS as a requirement
for fast, readonly scalars is complete", it is available in Debian
oldoldstable (jessie, 8), and Readonly::XS was not even needed with Perl
> 5.8, which allows us to:
- Remove dependency on Readonly::XS

Signed-off-by: Mason James <mtj@kohaaloha.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 3af9563a4f52e050461942e4f25c7e9e4918f3d0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f6ef3c80d3cda7ddabd415b4377fc2b17a704747)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 21301: add unit tests
Fridolin Somers [Fri, 4 Sep 2020 08:01:20 +0000 (10:01 +0200)]
Bug 21301: add unit tests

Run t/db_dependent/ILSDI_Services.t with and without previous patches

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d828feafbd5f3b788d76a1a79bc4c0522bdb600e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f345f480c2b6fdaeb000d0e68bd7bf1c367e41f1)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 21301: (follow-up) Remove borrowernumber in issues for GetRecords ILS-DI service
Fridolin Somers [Thu, 26 Mar 2020 12:02:14 +0000 (15:02 +0300)]
Bug 21301: (follow-up) Remove borrowernumber in issues for GetRecords ILS-DI service

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 83f5fef84edb0306f401f736008423a5871bdbc5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bb59e26e9ecf7245a6063ea885a52dd61f554c0d)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 21301: (QA follow-up) Fix number of tests
Marcel de Rooy [Fri, 8 Nov 2019 07:07:32 +0000 (07:07 +0000)]
Bug 21301: (QA follow-up) Fix number of tests

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 97d94bad13bc2d14a954cb67aca6c6605f9d4906)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 34e679646db33b746db5c7e025d6bd08dcb3117b)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 21301: Remove patron informations in reserves for GetRecords ILS-DI service
Fridolin Somers [Thu, 3 Oct 2019 13:43:56 +0000 (15:43 +0200)]
Bug 21301: Remove patron informations in reserves for GetRecords ILS-DI service

Actually, the GetRecords service gives many information :
borrowernumber (reserves field)

The issue data should not be sent by these service, its a privacy problem.

Test plan :
1) Enable ILS-DI webservice
2) Place hold on an item
3) Go to {opac}/cgi-bin/koha/ilsdi.pl?service=GetRecords&id={biblionumber}
4) Check the reserves tag content

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 37c042b9f3d3c307dac8e9205c65227e3c956ee3)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 813eb5afc74478f574510c0fdc197ed2ffdf54e3)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 21301: Remove patron informations in issues for GetRecords ILS-DI service
Fridolin Somers [Wed, 2 Oct 2019 14:28:21 +0000 (16:28 +0200)]
Bug 21301: Remove patron informations in issues for GetRecords ILS-DI service

Actually, the GetRecords service gives many information :
bibliographic data (marcxml field)
item data (items field)
issue data (issues field)

The issue data should not be sent by these service, its a privacy problem.
Biblio title and author are redundant.
This patch changes to use Koha::Checkouts to get issues informations with only the addition of item barcode.

Test plan :
1) Enable ILS-DI webservice
2) Checkout an item
3) Go to {opac}/cgi-bin/koha/ilsdi.pl?service=GetRecords&id={biblionumber}
4) Check the issues tag content

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8ae0ef6eb529cb866914ee8cffba469a9486a53c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b6d2ea13c7517ecfa913a1f7d85e6ab3b8775f1e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24470: Mark a batch as 'imported' if all the bib has been imported
Jonathan Druart [Wed, 9 Dec 2020 14:22:35 +0000 (15:22 +0100)]
Bug 24470: Mark a batch as 'imported' if all the bib has been imported

When a staged MARC file is used to populate a basket in acquisitions,
the status of the batch is kept as "staged" until a user repeat the operation.
The "imported" status is added to the batch when new orders are added to
a basket "from a new file" (yes!...)

Test plan:
- Create a basket
- Add to basket From a New File
- Select a marc file and stage
- Add titles to your basket
Until all your records are imported the batch will have the status
"staged"
When all your records will be imported, the status of the batch will be
"imported"

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 99cebb82dc6fd1aa3f7466f03a267cac9deedc6c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5f126b129128ecbf7a65eda4b5b62f355c7349d8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25292: Flushing L1 on every Z3950 server search
Jonathan Druart [Mon, 27 Apr 2020 14:25:32 +0000 (16:25 +0200)]
Bug 25292: Flushing L1 on every Z3950 server search

This patch flushes the L1 cache on each Z3950 server search.

There is no need to flush it in init_handler (when the connection is
made), the L1 cache is not accessed (this behaviour goes against what I
expected).

This means each search will fetch values from the
L2 cache (ie memcached) and persist the L1 cache (in Perl
memory cache) until the result are returned (or longer?).

Test plan:
% perl misc/z3950_responder.pl --config-dir=/kohadevbox/koha/etc/z3950
% zoomsh
ZOOM>connect localhost:2100
ZOOM>set databaseName biblios
ZOOM>search x
ZOOM>search x

Between the 2 searches you can modify the value of SearchEngine, you
will notice that the number of hits is different

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e466c4130406748fdd2d74d5fbee161e4f79cf92)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 46ae40d6ad489629e55c3f13cedae414e799a5f3)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBRev 20.05.07.002
Andrew Fuerste-Henry [Tue, 19 Jan 2021 22:00:43 +0000 (22:00 +0000)]
DBRev 20.05.07.002

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27349: (QA follow-up) Move DB update to perl file and add description
Nick Clemens [Fri, 8 Jan 2021 14:37:30 +0000 (14:37 +0000)]
Bug 27349: (QA follow-up) Move DB update to perl file and add description

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 37b5a14f4ca07a6b25960764a4214b00f9831542)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f42baffc94b4e910a46c94908f09e312d1139501)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27349: Fix Mana system preference wrong type
Fridolin Somers [Wed, 6 Jan 2021 10:47:59 +0000 (11:47 +0100)]
Bug 27349: Fix Mana system preference wrong type

Mana system preference type 'YesNo' is wrong since it has 3 values.
Change to 'Choice'

Test plan :
1) Run atomic update
2) Check in database 'Mana' system preference type is 'Choice'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 557d2137d6dcfa1ce6f816c1d55c254418fe581c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3b464f56d31a84a5a6cca6ce4e1d1a7009aa83a1)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27090: Opac basket: fix the 'In transit from' and 'to'
Christophe Croullebois [Wed, 25 Nov 2020 10:29:40 +0000 (11:29 +0100)]
Bug 27090: Opac basket: fix the 'In transit from' and 'to'

To see the 'In  transit from' and 'to' fields in an Opac basket we have :

<span class="item-status intransit">In transit from [% Branches.GetName( item.transfertfrom ) | html %]
    to [% Branches.GetName( item.transfertto ) | html %] since [% item.transfertwhen | $KohaDates %]</span>

But in koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc we have no :

[% USE Branches %]

This patch just corrects this lack

Test plan:
1° find an item in a transit status or create one with this status
2° put it in an Opac basket
3° note that in the location column of the Opac basket the 'In transit from' and 'to' fields are empty.
4° apply the patch
5° check again and validate that the 2 fields are now filled

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7be57c66085071fea763a572ac2a6ceb82641297)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0b9750c8f94c4b35eb1a7ef75512b7e6a70ec7b8)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27345: Add missing global permissions for superlibrarian
Jonathan Druart [Tue, 5 Jan 2021 10:35:05 +0000 (11:35 +0100)]
Bug 27345: Add missing global permissions for superlibrarian

When a superlibrarian is logged in, C4::Auth::get_template_and_user pass the CAN_user_$flag to the template, but some are missing:
suggestions, lists, cash_management

So far they are not used in the template but it will avoid a developer to spend time on it if we fix it now.

Test plan:
Compare with installer/data/mysql/mandatory/userflags.sql
Note that we don't need selfcheck

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8c9acd7f28f3204ffb13cf18894a47fcf3f17c85)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a1041bdd585a0ff1582b4ae27be3aaec9f68e3ef)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26983: Fix [un]select all links in inventory
Jonathan Druart [Wed, 2 Dec 2020 09:26:25 +0000 (10:26 +0100)]
Bug 26983: Fix [un]select all links in inventory

The select/unselect all links took into account only the items displayed
when the page was loaded (so 20).

Test plan:
1. Go to Tools-> Inventory-> Do a Search to produce more than 20 results
2. Select 50, 100 or All entries to show
3. click on Select All
=> All items must be selected, not only the first 20

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e15446af125d0986cc3d9f122e91b21a5e21c6f6)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1ca4cbf0762e5c47d3efa5a0310cbbfa70add2d2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoDBRev 20.05.07.001
Andrew Fuerste-Henry [Fri, 15 Jan 2021 23:06:00 +0000 (23:06 +0000)]
DBRev 20.05.07.001

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27351: (QA follow-up) Use skeleton.perl and add description
Nick Clemens [Fri, 8 Jan 2021 13:35:38 +0000 (13:35 +0000)]
Bug 27351: (QA follow-up) Use skeleton.perl and add description

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit e6426a540bfdc64c55abc824c901d0ed24dc8779)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1356a55d212e5d6864a7fd806cd83742cac20935)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27351: Fix UsageStatsCountry system preference wrong type
Fridolin Somers [Wed, 6 Jan 2021 14:32:37 +0000 (15:32 +0100)]
Bug 27351: Fix UsageStatsCountry system preference wrong type

UsageStatsCountry system preference type 'YesNo' is wrong since it has
several values.
Change to 'Choice'.
Looks like this error whas only in updatedabase 3.17.00.030.

Test plan :
1) Run atomic update
2) Check in database 'UsageStatsCountry' system preference type is
   'Choice'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit bbab6615637c60c757df79bdc695a606622ed96a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 32b89e216d3199bde68b95039ea8cea96548790c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27164: Fix item search CSV export
Fridolin Somers [Mon, 7 Dec 2020 16:03:40 +0000 (17:03 +0100)]
Bug 27164: Fix item search CSV export

In item search CSV export, data cells are exported with double quotes.
There should also be double quotes in header cells.
Also some spaces can be removed.
Delimiter must be from system preference 'delimiter'.
TT filter must be $raw not html, only double quotes must be espaped by
duplication of it.

This may help to open the CSV with any table/calc software.

Test plan :
1.0) Create a record with title : Laurel & "Hardy"
1.2) Create an item on this record
2.0) Without patch
2.1) Perform an item search on title 'Laurel'
2.2) Export as a CSV file and save the file locally
2.3) Open the file with a table/calc software
3.0) Apply patch
3.1) Perform same item search
3.2) Export as a CSV file and save the file locally
3.3) Open the file with a table/calc software
4.0) Compare files with diff/meld
=> you see double quotes arround header cells
   and removal of space after coma
4.1) Check that delimiter is from system preference 'delimiter'
4.2) In table/calc software they should look the same

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 1700c393b1de3c32b3b572efd0cf935255813e2b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 53e5db10f250dd7f5ce8011ffabc88ee45766815)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26417: Remove warn in Koha::Patron is_valid_age
Fridolin Somers [Wed, 9 Sep 2020 11:54:34 +0000 (13:54 +0200)]
Bug 26417: Remove warn in Koha::Patron is_valid_age

In Koha::Patron is_valid_age the is a compare : $age < $low
But $low may be undef.
It generates a warn :
Use of uninitialized value $low in numeric lt (<)

Needs a test like for $high.

Test plan :
1) Run prove t/db_dependent/Koha/Patrons.t
2) Edit a patron catetory, empty "Age required" and save
3) Edit a patron of this category
4) Check in logs you don't see "Use of uninitialized value $low in numeric lt (<)"

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit f042c804cda09deaee614f73ec9a888bea4ab99a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ba7cee5b17b13566fdf82019f5576db497d03bff)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 22284: (QA follow-up) Fix test failures
Nick Clemens [Fri, 15 Jan 2021 14:00:55 +0000 (14:00 +0000)]
Bug 22284: (QA follow-up) Fix test failures

Only libraries that are a pickup location will be returned as a pickup location

To test:
prove -v t/db_dependent/Koha/Biblio.t
it succeeds (maybe)
add a library that is not a pickup_location
prove the test
it fails
apply the patch
prove!
it passes!

https://bugs.koha-community.org/show_bug.cgi?id=25540

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl
Jonathan Druart [Fri, 18 Dec 2020 13:41:12 +0000 (14:41 +0100)]
Bug 27245: Replace AutoCommit=0 with txn_begin in bulkmarcimport.pl

To prevent
DBD::mysql::db begin_work failed: Already in a transaction at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1588, <GEN45> line 1.

Test plan:
1 - Export more than 100 records
2 - Use bulkmarcimport (with -commit=10) to import them
    perl misc/migration_tools/bulkmarcimport.pl -b -file testbmi.xml -v -m=MARCXML --commit=10
3 - Modify a record to make the import fail (for instance having a too long
lccn)
4 - Use bulkmarcimport (with -commit=10) to import them
    perl misc/migration_tools/bulkmarcimport.pl -b -file testbmi.xml -v -m=MARCXML --commit=10
5 - Notice that the import stops but that the imported record are imported (apart from the last batch of 10)

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 4a90c0b647fdfdb0a39b43f6b10adba3bca53215)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f0dadd169b08f3b486ea387cdbb7f93c13b8d3db)

3 years agoBug 26364: Don't skip records that match the isbn we passed
Nick Clemens [Wed, 9 Sep 2020 13:24:20 +0000 (13:24 +0000)]
Bug 26364: Don't skip records that match the isbn we passed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 86617ba7cd54cbeb7f2241468cd3e10f20d2bc27)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c4e45d056e097513ed0c8e90a0f212519f4bd4aa)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26364: Remove false matches on isbn
Nick Clemens [Wed, 9 Sep 2020 13:33:17 +0000 (13:33 +0000)]
Bug 26364: Remove false matches on isbn

The test here was returning 0590353403 when searched for 9780590353403
because of the regex matching

Koha doesn't work this way unless SearchWithISBNVariations is set to 'search'
and you use a dropdown to select ISBN for searching

To test:
1 - Search catalog for nb=9780590353403
2 - Confirm you don't have results, or delete the records with results
3 - Add isbn 0590353403 to a record
4 - Repeat search, fails
5 - Enable SearchWithISBNVariations
6 - Repeat search, fails
7 - Go to advanced search, select ISBN, search for 9780590353403
8 - Get results

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 854d404a9c161845731d39980165f8d641713a80)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c6ce4f6fc8f4e0177193366dcbf11a79af2aef4e)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26364: Remove useless condition
Nick Clemens [Wed, 9 Sep 2020 13:40:37 +0000 (13:40 +0000)]
Bug 26364: Remove useless condition

$response_data is a hash with one key, content

Why are we checkiing it against a string?

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 8b22c3846caa2004b411c6bd19a5d41bc602e704)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit adb5ed80372c7a0faee2b92a244e582fb127b285)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26364: Don't discard the passed isbn
Nick Clemens [Wed, 9 Sep 2020 13:44:45 +0000 (13:44 +0000)]
Bug 26364: Don't discard the passed isbn

I don't know, if we get rid fo this check we can now check the db for the same isbn we passed

This may be useful as we may want to see the biblio with the same isbn as long as number is different?

This will make tests fail

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit feb7f5f6dd89f58f3b027898705fb0fa57a051ab)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit aaea95c7f7eab1256d2ae3be8ce547adf69b12a2)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26364: Adjust unit tests
Nick Clemens [Wed, 9 Sep 2020 14:34:26 +0000 (14:34 +0000)]
Bug 26364: Adjust unit tests

We shouldn't rely on knowing exactly which ISBNs we get, we should specifically
check for what we do or don't expect.

I believe we should return biblios that have the same isbn we passed, as it signlas we have another
biblio in the catalog that matches the one we are on.

To test:
prove -v t/db_dependent/XISBN.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d9063ba246bd020de83bc67964a08855a73ccb24)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0b2f0e0b26d462df58bd7d03246bb60bf84b11e5)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26330: Change encoding of text used as tab triggers in MARC subfield constraints
Owen Leonard [Tue, 1 Sep 2020 11:51:25 +0000 (11:51 +0000)]
Bug 26330: Change encoding of text used as tab triggers in MARC subfield constraints

This patch changes the encoding of the data being used to define
jQueryUI tabs on the MARC subfield constraints page. A jQueryUI bug
prevents non-Latin-1 characters from being used when defining tab
controls. Using Template:Toolkit's "uri" filter converts the data to
usable characters.

To test, apply the patch and go to Administration -> MARC frameworks ->
MARC structure -> tag 952 -> Edit subfields.

- Under the "New" tab, add a subfield code which is outside the basic
  Latin character set, e.g. £, §, æ.
- Save changes.
- Edit any subfield code to load the subfield constraints page again.
- Test that the subfield code tabs work correctly: Clicking each tab
  should load only the corresponding panel.
- Test a variety of tabs including the one you created with the
  non-Latin character.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 27137: Correctly show biblio title after successfully moving item
Aleisha Amohia [Thu, 3 Dec 2020 02:50:15 +0000 (15:50 +1300)]
Bug 27137: Correctly show biblio title after successfully moving item

In Bug 11529 we changed the variable that was passed to the template but
missed updating the template.

This patch ensures we correctly access the variable to show the title of
the biblio.

To test:
1) Create two biblios (Biblio A and Biblio B)
2) Add an item to Biblio A (Item A)
3) Go to Biblio B
4) In the cataloguing toolbar, click Edit, then Attach item
5) Enter the barcode for Item A and submit
6) Notice the item has successfully moved by Biblio B's title does not
show
7) Apply patch
8) Go to Biblio A
9) In the cataloguing toolbar, click Edit, then Attach item
10) Enter the barcode for Item A and submit
11) Confirm Biblio A's title shows correctly

Sponsored-by: Toi Ohomai Institute of Technology
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26397: Compiled CSS
Andrew Fuerste-Henry [Wed, 13 Jan 2021 22:12:06 +0000 (22:12 +0000)]
Bug 26397: Compiled CSS

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26397: [20.05.x] opac.scss calls non-existent image
Owen Leonard [Wed, 2 Dec 2020 14:51:53 +0000 (14:51 +0000)]
Bug 26397: [20.05.x] opac.scss calls non-existent image

This patch removes some obsolete CSS from the OPAC which calls a
non-existent image. There should be no visible change.

This patch is specifically for Koha 20.05.x. The bug does not appear in
master.

To test, apply the patch and rebuild the OPAC SCSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

View the OPAC and confirm that nothing has changed in the style of the
Koha logo in the header.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25826: fix failing test
Jonathan Druart [Mon, 10 Aug 2020 08:00:34 +0000 (10:00 +0200)]
Bug 25826: fix failing test

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25826: (QA follow-up) Add filters
Nick Clemens [Thu, 6 Aug 2020 12:40:20 +0000 (12:40 +0000)]
Bug 25826: (QA follow-up) Add filters

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25826: Forbid changing the hidden attributes for biblionumber
Tomas Cohen Arazi [Mon, 27 Jul 2020 15:18:36 +0000 (12:18 -0300)]
Bug 25826: Forbid changing the hidden attributes for biblionumber

This patch tweaks the UI so it forbids changing the hidden values when
they are correct (i.e. when they are not hidden in OPAC and intranet).

To test:
1. Apply the first patch
2. Play with the hidden values of the subfield you have mapped to
   biblio.biblionumber in your picked framework. This is usually 999$c
   in MARC21, and 001 in UNIMARC.
=> SUCCESS: When you verify the about.pl, it mentions issues when you
hide in some of the interfaces
3. Apply this patch and reload everything
4. Repeat 2
=> SUCCESS: If your framework is 'ok', it prevents you from editing this
values, otherwise you can change them.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25826: Add a warning to the about page
Jonathan Druart [Wed, 22 Jul 2020 14:43:38 +0000 (16:43 +0200)]
Bug 25826: Add a warning to the about page

This patch adds a warning to the about page if the biblionumber field is
hidden at the OPAC or staff interface.

Test plan:
Hide the biblionumber to some framework
Confirm that there is a warning on the about page

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 26698: Use is_at_destination to determine if hold is at destination
Nick Clemens [Thu, 15 Oct 2020 19:24:24 +0000 (19:24 +0000)]
Bug 26698: Use is_at_destination to determine if hold is at destination

This copies code from bug 12556 and uses a Koha::Hold method rather than
code in script

TO test:
1 - Place a hold for item from library B for delivery at library A
2 - Check the item in at library B, confirm and transfer
3 - Check item in at Library A but ignore the hold
4 - View the Holds tab of the details page:
    http://localhost:8081/cgi-bin/koha/reserve/request.pl?biblionumber=6
5 - Priority = "In transit"  Pickup Library = "Item waiting at"
6 - Apply patch
7 - Restart all the thigns
8 - Reload the page
9 - Priority="In transit" and Pickup library="Item being transferred"

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 24863: QueryFuzzy syspref says it requires Zebra but ElasticSearch has some support.
Lisette Scheer [Sat, 24 Oct 2020 19:09:59 +0000 (19:09 +0000)]
Bug 24863: QueryFuzzy syspref says it requires Zebra but ElasticSearch has some support.

This patch updates the description of the QueryFuzzy system preference
to make it more clear how it works with Zebra and how Elasticsearch has
some amount of fuzzy available for searches.

To test:
1. Go to administration
2. Search for QueryFuzzy
3. Observe the current description, which only includes Zebra.
4. Apply patch
5. Repeat steps 1-2
6. Observe the updated description.
7. Sign off

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 137cf586551be4affb112eba3a61bc49b0099342)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c0466fd4425739e464f697687cd9b0639a0bf16c)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25462: Compiled CSS
Andrew Fuerste-Henry [Tue, 12 Jan 2021 14:31:36 +0000 (14:31 +0000)]
Bug 25462: Compiled CSS

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
3 years agoBug 25462: (follow-up) Remove <br /> as it is no longer needed
Martin Renvoize [Thu, 5 Nov 2020 11:34:54 +0000 (11:34 +0000)]
Bug 25462: (follow-up) Remove <br /> as it is no longer needed

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 847ef673440733c3e76bf4c520838bf8fa3db3eb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit c3e385af7e2bcd6121d2800114e4ca652360e562)

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>