koha-ffzg.git
3 years agoBug 28367: (follow-up) Fix plack condition in C4/Auth_with_shibboleth.pm master origin/master
Jonathan Druart [Tue, 18 May 2021 09:26:25 +0000 (11:26 +0200)]
Bug 28367: (follow-up) Fix plack condition in C4/Auth_with_shibboleth.pm

There were 2 occurrences!

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28367: Fix plack condition in C4/Auth_with_shibboleth.pm
Jonathan Druart [Tue, 18 May 2021 08:43:05 +0000 (10:43 +0200)]
Bug 28367: Fix plack condition in C4/Auth_with_shibboleth.pm

C4/Auth_with_shibboleth.pm has:
  if ( any { /(^psgi\.|^plack\.)/i } keys %ENV )
When others have:
  if ( any { /(^psgi\.|^plack\.)/i } keys %ENV )

This has been highlighted by https://gitlab.com/koha-community/koha-testing-docker/-/issues/249 that introduces a PLACK_WORKERS env vars, and t/Auth_with_shibboleth.t was failing with

 #   Failed test 'checkpw_shib tests'
 #   at t/Auth_with_shibboleth.t line 335.
 Invalid parameter passed, categorycode= does not exist# Looks like your test exited with 255 just after 5.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28189: Fix PluginRoutes.t
Jonathan Druart [Mon, 17 May 2021 14:07:17 +0000 (16:07 +0200)]
Bug 28189: Fix PluginRoutes.t

So, this one was hidden.

The failures were:
    #   Failed test 'Bad plugins raise warning'
    #   at t/db_dependent/Koha/REST/Plugin/PluginRoutes.t line 75.
    # found warning: Warning: Could not load REST API spec bundle: Invalid JSON specification HASH(0x556972b22da0):
    # found warning: Warning: Could not load REST API spec bundle: Invalid JSON specification HASH(0x5569735b8368):
    # expected to find warning: (?^u:Could not load REST API spec bundle: Invalid JSON specification)
    # expected to find warning: (?^u:The resulting spec is invalid. Skipping Bad API Route Plugin)

And the correct error was (after a debug warn in JSON::Validator):
Warning: Could not load REST API spec bundle: Invalid JSON specification HASH(0x55fd0c3d3160):
- /info/version: Expected string - got number. at /usr/share/perl5/JSON/Validator.pm line 165.

So this patch fixes it, but I don't understand why it's only failing for
plugin routes however.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28305: Remove doc reference to XML::Simple in C4::Context
David Cook [Mon, 10 May 2021 00:30:27 +0000 (10:30 +1000)]
Bug 28305: Remove doc reference to XML::Simple in C4::Context

We don't need a See Also reference to XML::Simple in the C4::Context,
especially since Bug 28278 replaced the parsing of koha-conf.xml
with XML::LibXML.

Test plan:
1. Apply patch
2. perldoc C4/Context.pm

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28345: Patron attributes no longer have option to select empty class
Owen Leonard [Thu, 13 May 2021 10:39:38 +0000 (10:39 +0000)]
Bug 28345: Patron attributes no longer have option to select empty class

This patch adds the "empty" parameter to the PROCESS directive which
builds the "Class" dropdown. This allows the user to choose a blank
option when creating or editing a patron attribute.

To test, apply the patch and go to Administration -> Patron attribute
types -> Add patron attribute type.

In the entry form the "Class" dropdown should have a blank option. When
editing an existing attribute with a class defined, the correct class
should still be preselected.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28320: Add DB connection check to the SIP SC status message
Nick Clemens [Tue, 11 May 2021 13:43:51 +0000 (13:43 +0000)]
Bug 28320: Add DB connection check to the SIP SC status message

This patch adds a lookup of the sip user during an SC status, confirming that
our DB ocnnection is working, and that our user is still valid

Additionally, it adds support for SC status to the sip_cli_emulator and adds basic
test coverage for the SC status message

To test:
1 - Apply patch
2 - Restart SP server
3 - perl misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -m sc_status_request -su term1 -sp term1
4 - prove -v t/db_dependent/SIP/Message.t

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28268: Improve memory usage when indexing authorities in Elasticsearch
Ere Maijala [Fri, 30 Apr 2021 07:00:23 +0000 (10:00 +0300)]
Bug 28268: Improve memory usage when indexing authorities in Elasticsearch

Retrieves the complete records one by one to avoid huge memory usage.

Note that this removes the call to GuessAuthTypeCode, but it is done later in Koha::SearchEngine::Elasticsearch::marc_records_to_documents (and was never done if you asked to index a single record with --authid parameter).

Test plan:
1. Apply patch
2. Reindex authorities: perl misc/search_tools/rebuild_elasticsearch.pl -a -d -v
3. Check that indexing completed successfully and results are correct.

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27844: Launch koha-worker systemd service as koha linux user
David Cook [Tue, 2 Mar 2021 23:32:28 +0000 (23:32 +0000)]
Bug 27844: Launch koha-worker systemd service as koha linux user

This patch adds the User directive to the koha-worker systemd unit file

Test plan:
0a. DO NOT APPLY PATCH YET
0b. Start a Koha testing environment running systemd
1. koha-worker --stop kohadev
2. cp debian/templates/koha-worker@.service /etc/systemd/system/.
3. systemctl start koha-worker@kohadev.service
4. ps -efww | grep "background_jobs_worker"
5. Note koha-worker is running as root
6. APPLY THE PATCH
7. cp debian/templates/koha-worker@.service /etc/systemd/system/.
8. systemctl daemon-reload
9. systemctl restart koha-worker@kohadev.service
10. ps -efww | grep "background_jobs_worker"
11. Note that koha-worker is now running as kohadev-koha

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28302: Forbid CGI::Compile 0.24
Julian Maurice [Fri, 7 May 2021 15:57:58 +0000 (17:57 +0200)]
Bug 28302: Forbid CGI::Compile 0.24

CGI::Compile 0.24 has a bug:
https://github.com/miyagawa/CGI-Compile/issues/25

It can cause weird bugs, like breaking the authority detail display
after trying to modify an authority.

Steps to reproduce:
1. Install CGI::Compile 0.24
2. Restart starman with only 1 worker
3. Go to the detail page of an authority (authorities/detail.pl)
4. Go to the edit page (Edit » Edit record)
5. Check starman logs, you should see "Subroutine build_tabs redefined
at [...]"
6. Click on cancel to go back to the detail page, which should now show
a "blank" authority. Now the only way to get the authority back is to
restart starman.

Test plan:
1. Reproduce the bug
2. Install CGI::Compile 0.25 and restart starman
3. Make sure the bug is gone :)

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28220: UI changes
Jonathan Druart [Thu, 6 May 2021 10:38:52 +0000 (12:38 +0200)]
Bug 28220: UI changes

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28220: Add more tests
Jonathan Druart [Thu, 6 May 2021 10:31:47 +0000 (12:31 +0200)]
Bug 28220: Add more tests

* Add the transaction when a patron is created
* The changes in merge_and_replace_with prevent the creation of the
patron and so the attributes if several non-repeatable attributes are
passed

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28220: Add test for updating an existing patron
Jonathan Druart [Thu, 6 May 2021 09:59:23 +0000 (11:59 +0200)]
Bug 28220: Add test for updating an existing patron

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28220: Handle NonRepeatable
Jonathan Druart [Thu, 6 May 2021 08:50:07 +0000 (10:50 +0200)]
Bug 28220: Handle NonRepeatable

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28220: Handle InvalidType
Jonathan Druart [Thu, 6 May 2021 08:46:24 +0000 (10:46 +0200)]
Bug 28220: Handle InvalidType

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28220: prevent patron to be created if attributes not stored
Jonathan Druart [Thu, 6 May 2021 08:35:16 +0000 (10:35 +0200)]
Bug 28220: prevent patron to be created if attributes not stored

Using a transaction

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28220: Add tests to import
Jonathan Druart [Thu, 6 May 2021 08:13:55 +0000 (10:13 +0200)]
Bug 28220: Add tests to import

failure expected, we need to add a transaction

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28220: Deal with merge
Jonathan Druart [Wed, 5 May 2021 15:37:31 +0000 (17:37 +0200)]
Bug 28220: Deal with merge

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28200: Remove unit test using abbreviated format
David Cook [Mon, 10 May 2021 23:33:19 +0000 (23:33 +0000)]
Bug 28200: Remove unit test using abbreviated format

This patch removes the unit test that uses the abbreviated format,
since it's not supported in newer versions of Net::Netmask without
a workaround.

Test plan:
0. Set up Koha dev environment on Debian 11
1. perl t/Koha/Middleware/RealIP.t
2. Tests should pass

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Alvaro Cornejo <cornejo.alvaro@gmail.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28091: Only show for logged in users
Kyle M Hall [Fri, 7 May 2021 18:02:35 +0000 (14:02 -0400)]
Bug 28091: Only show for logged in users

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28091: add meta content with Koha version to staff client pages
Lucas Gass [Mon, 5 Apr 2021 17:58:28 +0000 (17:58 +0000)]
Bug 28091: add meta content with Koha version to staff client pages

TO test:
-apply patch
-go to the Koha staff client and inspect the page, look at the HTML <head>
-there should be a line that looks like this:
<meta name="generator" content="Koha 20.12.00">

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28189: (QA folloq-up) Fix fallback case
Tomas Cohen Arazi [Mon, 10 May 2021 11:34:41 +0000 (08:34 -0300)]
Bug 28189: (QA folloq-up) Fix fallback case

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28189: Move swagger file to YAML format
Tomas Cohen Arazi [Wed, 21 Apr 2021 15:18:31 +0000 (12:18 -0300)]
Bug 28189: Move swagger file to YAML format

This patch changes the base OpenAPI file (swagger.json) into YAML. The
motivation for this, is adding more documentation, in Markdown.

JSON doesn't accept multiline strings, so this seems like a good move
for readability.

To test:
1. Verify your API is functional
2. Apply this patch
3. Repeat 1
=> SUCCESS: No changes, really
4. Point your browser to /api/v1/.html
=> SUCCESS: Some nicely formatted description of the API can be seen. It
includes information about x-koha-library.
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18989: DBRev 20.12.00.050
Jonathan Druart [Wed, 12 May 2021 15:29:01 +0000 (15:29 +0000)]
Bug 18989: DBRev 20.12.00.050

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18989: Restore hidding items on detail
Jonathan Druart [Tue, 4 May 2021 10:18:40 +0000 (12:18 +0200)]
Bug 18989: Restore hidding items on detail

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Good catch. I forgot this file didn't get the hiding logic refactoring
yet.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18989: (QA follow-up) Make controllers use Koha::Biblio->hidden_in_opac
Tomas Cohen Arazi [Fri, 23 Apr 2021 19:55:35 +0000 (16:55 -0300)]
Bug 18989: (QA follow-up) Make controllers use Koha::Biblio->hidden_in_opac

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18989: (QA follow-up) Make Koha::Biblio->hidden_in_opac aware of OpacHiddenItemsH...
Tomas Cohen Arazi [Fri, 23 Apr 2021 18:30:03 +0000 (15:30 -0300)]
Bug 18989: (QA follow-up) Make Koha::Biblio->hidden_in_opac aware of OpacHiddenItemsHidesRecord

This patch makes the method aware of the new syspref. It will only eval
the rules against items if the OpacHiddenItemsHidesRecord syspref is
set.

Tests are added to reflect this.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18989: Fix syspref's value selection
Jonathan Druart [Tue, 13 Apr 2021 09:19:06 +0000 (11:19 +0200)]
Bug 18989: Fix syspref's value selection

See commit 1fe1b704f9a81172f2a6b86367b314572a854d18
    Bug 22824: Fix yes/no vs 1/0

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18989: (QA follow-up) Have new preference default to current behaviour
Katrin Fischer [Thu, 28 Jan 2021 23:00:34 +0000 (00:00 +0100)]
Bug 18989: (QA follow-up) Have new preference default to current behaviour

At the moments the records are hidden when all items are hidden, so
we need to make sure that we keep this behaviour when the preference
is added.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18989: (QA follow-up) Terminology fixes and linking the system preference in...
Katrin Fischer [Sun, 24 Jan 2021 16:33:55 +0000 (16:33 +0000)]
Bug 18989: (QA follow-up) Terminology fixes and linking the system preference in pref description

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18989: Add atomic update
Fridolin Somers [Fri, 4 Sep 2020 12:49:40 +0000 (14:49 +0200)]
Bug 18989: Add atomic update

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>
3 years agoBug 18989: Allow displaying biblios with all items hidden by OpacHiddenItems
Fridolin Somers [Fri, 4 Sep 2020 12:33:12 +0000 (14:33 +0200)]
Bug 18989: Allow displaying biblios with all items hidden by OpacHiddenItems

Bug 10584 made Koha hide biblios for which all items match some criteria (in OpacHiddenItems) so they are hidden.
Add syspref OpacHiddenItemsHidesRecord controlling this behaviour.

Test plan :
1)
1.1) Create some biblio records with one item having damaged=1
1.2) Define system preference OpacHiddenItems = damaged: 1
2)
2.1) Set system preference OpacHiddenItemsHidesRecord to 'don't hide'
2.2) At OPAC : perform a search showing those records and some more
2.3) Check you see the all the records
2.4) For a record with hidden item check you don't get HTTP 404 for : normal view, ISBD view, MARC view
2.5) Check you can had tags on this record
2.6) Add record to basket, check you see it in basket
3)
3.1) Set system preference OpacHiddenItemsHidesRecord to 'hide'
3.2) At OPAC : perform a search showing those records and some more
3.3) Check you don't see the records with hidden item
3.4) For a record with hidden item check you get HTTP 404 for : normal view, ISBD view, MARC view
3.5) Show basket, check you see the records with hidden item

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>
3 years agoBug 28135: Replace use of input type number in additem.js
Owen Leonard [Mon, 12 Apr 2021 11:25:35 +0000 (11:25 +0000)]
Bug 28135: Replace use of input type number in additem.js

This patch corrects in instance where JavaScript is creating an input
tag with type "number."

To test, apply the patch and make sure the AcqCreateItem system
preference is set to "when receiving."

- Go to Acquisitions -> Vendor -> Invoices -> Invoice -> Go to receipt
  page -> Receive.
- On the page for receiving items you should see an add item form.
- Click the "Add multiple items" button at the bottom of the form.
- Test the "Number of items to add" field. It should not accept any
  input except numbers.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23406: Don't translate suppressed authorised values
Nick Clemens [Mon, 10 May 2021 12:14:08 +0000 (12:14 +0000)]
Bug 23406: Don't translate suppressed authorised values

We have a test in C4/XSLT/transformMARCXML4HTML which is meant to exclude the 942n, however,
it doesn't work because it checks the $subfield parameter against n

$subfield is an arrayref with the code and value as members

we need to check $subfield->[0]

To test:
 1 - Apply only unit tests
 2 - prove -v t/db_dependent/XSLT.t
 3 - It fails
 4 - Confirm 952$n in default framework is tied ot authorised value 'YES_NO' or do so
 5 - Set OpacSuppression to 'Hide'
 6 - Edit a record in the default template, changing 942$n to 'Yes
 7 - Confirm the record is suppressed in opac
 8 - Note there is no suppression notice in the record in staff client
 9 - Apply second patch
10 - Reload and confirm staff side shows suppression notice
11 - Confirm record still suppressed in OPAC
12 - Edit record, set 942$n to 'no'
13 - Confirm there is no suppression notice in staff client
14 - Confirm you can view the record in OPAC
15 - prove -v t/db_dependent/XSLT.t
16 - Tests pass!

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 23406: Unit test
Nick Clemens [Mon, 10 May 2021 12:01:55 +0000 (12:01 +0000)]
Bug 23406: Unit test

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28283: Add `inputmode="numeric"` to quantity on orderreceive
Martin Renvoize [Tue, 4 May 2021 10:14:51 +0000 (11:14 +0100)]
Bug 28283: Add `inputmode="numeric"` to quantity on orderreceive

This patch adds an inputmode to the quantity field on the order receive
page in acquisitions.

Test plan
1. Go to Acquisitions -> Vendor -> Invoices -> Invoice -> Go to receipt
   page -> Receive.
2. Note that the 'Quantity received' input has an inputmode now.
3. Note that the 'Quantity received' input also has a pattern attribute.
4. Note that you should not be able to enter non-integer values.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18112: Use GetAuthValueDropbox from the template
Jonathan Druart [Tue, 11 May 2021 13:36:13 +0000 (15:36 +0200)]
Bug 18112: Use GetAuthValueDropbox from the template

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18112: (follow-up) add required class to select
Lucas Gass [Fri, 7 May 2021 18:59:26 +0000 (18:59 +0000)]
Bug 18112: (follow-up) add required class to select

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 18112: Add street type to self reg/self mod form
Lucas Gass [Tue, 4 May 2021 20:48:18 +0000 (20:48 +0000)]
Bug 18112: Add street type to self reg/self mod form

1. Add some values to the ROADTYPE authorized value
2. Go to PatronSelfRegistrationBorrowerUnwantedField and make sure
   streettype is NOT checked
3. Go the self reg form, no street type field
4. Apply patch
5. Check the self reg form, streettype should be there with all the
   options defined in ROADTYPE a.v.
6. Check the self modification form, street type should be there.
7. Make sure PatronSelfRegistrationBorrowerUnwantedField and
   PatronSelfModificationBorrowerUnwantedField hide the field correctly.
8. Make sure PatronSelfRegistrationBorrowerMandatoryField properly makes
   the field required.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27562: itiva notices break if record title contains quotes
Kyle M Hall [Mon, 14 Jan 2013 17:02:38 +0000 (09:02 -0800)]
Bug 27562: itiva notices break if record title contains quotes

itiva has reported to us that quotes in the title of a record cause the
call to not be made to the patron. The fix is to remove quotes from
the title, as quotes are not spoken anyway ( That is, "Queens" and
"Queen's" are pronounced the same ).

Test Plan:
1) Set up itiva to send phone notes
2) Find a record with quotes in the title
3) Trigger an itiva notice ( checkout, checkin, place hold, etc )
   using the itiva outbound cronjob
4) View the CSV, note the title has the quotes in it
5) Apply this patch
6) Repeat steps 2-3
7) View the CSV, note the title contains no quotes!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 13613: Move similar JS code to a function
Jonathan Druart [Mon, 10 May 2021 09:52:12 +0000 (11:52 +0200)]
Bug 13613: Move similar JS code to a function

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 13613: (follow-up) Add tooltip when disabled
Nick Clemens [Fri, 23 Apr 2021 12:20:07 +0000 (12:20 +0000)]
Bug 13613: (follow-up) Add tooltip when disabled

This patch adds a tooltip to the digest checkboxes when disabled.

When enabled the tooltip is hidden

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 13613: (follow-up) Use more unique classes
Nick Clemens [Wed, 17 Mar 2021 13:49:25 +0000 (13:49 +0000)]
Bug 13613: (follow-up) Use more unique classes

This resolves the issue of being unable to save email as it was being hit by the validator

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 13613: (Bug 22744 follow-up) Remove js handling for 'none'
Nick Clemens [Wed, 17 Mar 2021 13:25:44 +0000 (13:25 +0000)]
Bug 13613: (Bug 22744 follow-up) Remove js handling for 'none'

There was a function and a set of onclick events to handle the 'Do not notify'
checkboxes.

Those have been removed, so should this code

To test:
1 - Sign in to opac
2 - Click on 'your messaging' tab from 'your account'
3 - Check/uncheck some boxes
4 - Note error in the console:
    Uncaught TypeError: document.opacmessaging.none2 is undefined
5 - Apply patch
6 - repeat
7 - no more error

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 13613: Don't allow digest to be selected without a digest-able transport selected
Kyle M Hall [Thu, 22 Jan 2015 17:36:31 +0000 (12:36 -0500)]
Bug 13613: Don't allow digest to be selected without a digest-able transport selected

By default, only the email transport is enabled. This gives the
messaging preferences the look of having email and digest and two
options. I.E. to some users it appears that you check email for single
emails, *or* you check digest for a digest email.

To help remove this possible confusion, the digest mode checkbox should
be disabled if no digest-able transports are checked for a given notice.

Test Plan:
1) Apply this patch
2) For both the staff interface and the opac, note that the digest
   checkbox is disabled any time that no digest enabled transport (
   email, sms if enabled ) is checked for the patron editor.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28293: (bug 20443 follow-up) Fix wrong key in Patrons::Import->generate_patron_at...
Jonathan Druart [Thu, 6 May 2021 09:18:55 +0000 (11:18 +0200)]
Bug 28293: (bug 20443 follow-up) Fix wrong key in Patrons::Import->generate_patron_attributes

It generates warnings
Use of uninitialized value in string comparison (cmp) at /kohadevbox/koha/Koha/Patrons/Import.pm line 550, <$fh> line 2.

And does not sort correctly (no fallback on the attribute's value for repeatable attributes)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27203: Calculate tax based on ecost if unitprice not set
Nick Clemens [Thu, 17 Dec 2020 12:21:32 +0000 (12:21 +0000)]
Bug 27203: Calculate tax based on ecost if unitprice not set

There is code in populate_order_with_prices that is intended to use ecost over unitprice,
it just doens't seem to be working.

Making it more explicit seems to take care of the issue.

To test:
1 - Create a basket
2 - Add an order line, don't set 'Actual cost: ', but use vendor price
and a discount.
3 - Save
4 - Display all columns, 'Actual cost tax inc.' are GST columns aren't set.
5 - Apply batch
6 - Redo 1,2, 3
7 - Display all columns, GST is calculated correctly, unitprice remains 0.

Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27203: Adjust unit tests
Nick Clemens [Wed, 5 May 2021 15:28:26 +0000 (15:28 +0000)]
Bug 27203: Adjust unit tests

It seems the issue here is that the price passed in is a string, and not a number, so the tax
value is not calculated when no unitprice is provided

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28272: issues.notseen needs to be marked as a boolean
Tomas Cohen Arazi [Tue, 11 May 2021 11:30:59 +0000 (08:30 -0300)]
Bug 28272: issues.notseen needs to be marked as a boolean

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26995: Remove one remaining occurrence in moremember
Jonathan Druart [Tue, 11 May 2021 08:46:15 +0000 (10:46 +0200)]
Bug 26995: Remove one remaining occurrence in moremember

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28272: Add unseen_renewals for checkouts
Jonathan Druart [Tue, 11 May 2021 07:26:38 +0000 (09:26 +0200)]
Bug 28272: Add unseen_renewals for checkouts

 t/db_dependent/api/v1/checkouts.t ...................... 7/93
 #   Failed test '200 OK'
 #   at t/db_dependent/api/v1/checkouts.t line 198.
 #          got: '500'
 #     expected: '200'

 #   Failed test 'exact match for JSON Pointer ""'
 #   at t/db_dependent/api/v1/checkouts.t line 198.
 #     Structures begin differing at:
 #          $got->{unseen_renewals} = Does not exist
 #     $expected->{unseen_renewals} = '0'
 t/db_dependent/api/v1/checkouts.t ...................... 88/93
 #   Failed test '200 OK'
 #   at t/db_dependent/api/v1/checkouts.t line 218.
 #          got: '500'
 #     expected: '200'

 #   Failed test 'exact match for JSON Pointer ""'
 #   at t/db_dependent/api/v1/checkouts.t line 218.
 #     Structures begin differing at:
 #          $got->{max_renewals} = Does not exist
 #     $expected->{max_renewals} = '1'
 # Looks like you failed 4 tests of 93.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28272: Fix many things...
Tomas Cohen Arazi [Mon, 10 May 2021 20:44:23 +0000 (17:44 -0300)]
Bug 28272: Fix many things...

This patch could've been splitted into several. But, overall, adding
additionalAttributes: false made the API fail on requests that send
extra info (i.e. cases in which a dev added an attribute to the
underlaying class/table and forgot to deal with it on the API (either
adding it on the spec, or removing it from the response using
Koha::Class::to_api_mapping).

- Koha::Account::Line was missing: credit_type, interface, status,
  register_id and credit_number. I decided to call cash_register_id, and
  to remove credit_number from the response.
  FIXME: We need consensus on a name for the credit_number attribute, and
  add it to the response on the API. It deserves a separate bug. Too
  opinionated for a last-minute fix.
- Koha::Club::Hold::add was returning bad auto-calculated values on
  field that (also) wasn't specified on the spec. Needs a test.
- import_batch_profile had a typo: id_profile vs. profile_id.
- error.json: In this case I reverted the change. This is because some
  routes are adding more 'info' with the error message, and I consider
  this should be done in a more generic approach. Time is required for
  us to think about this. So don't break the API in the meantime.
  FIXME: Implement a generic way to add a payload to error messages on
  the API. Maybe something to work on while on bug 28020.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/
=> FAIL: Lots of tests fail
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28272: Fix note_seen, desk_id, cancellation_reason
Jonathan Druart [Mon, 10 May 2021 15:55:30 +0000 (17:55 +0200)]
Bug 28272: Fix note_seen, desk_id, cancellation_reason

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28108: DBRev 20.12.00.049
Jonathan Druart [Mon, 10 May 2021 13:27:04 +0000 (13:27 +0000)]
Bug 28108: DBRev 20.12.00.049

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28108: (QA follow-up) Fix syspref text
Martin Renvoize [Mon, 10 May 2021 13:34:49 +0000 (14:34 +0100)]
Bug 28108: (QA follow-up) Fix syspref text

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28108: (QA follow-up) Move 'ORDER' back into 'ACQUISITIONS'
Martin Renvoize [Mon, 10 May 2021 13:21:46 +0000 (14:21 +0100)]
Bug 28108: (QA follow-up) Move 'ORDER' back into 'ACQUISITIONS'

With the re-introduction of 'AQUISITIONS' as a logging module in Koha,
it makes sence to move the ORDER notice logging back into that module
whilst leaving the other 'CLAIMS' notices under their own logging module
code.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28108: Replace one remaining occurrence
Jonathan Druart [Mon, 10 May 2021 10:12:47 +0000 (12:12 +0200)]
Bug 28108: Replace one remaining occurrence

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28108: (QA follow-up) Add actions to log viewer
Katrin Fischer [Tue, 4 May 2021 09:34:08 +0000 (09:34 +0000)]
Bug 28108: (QA follow-up) Add actions to log viewer

The following actions were missing from the template,
so the code showed instead of a translatable description:

* ACQUISITION CLAIM
* ACQUISITION ORDER
* SERIAL ORDER

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28108: (QA follow-up) Make the system preference description more precise
Katrin Fischer [Tue, 4 May 2021 09:07:10 +0000 (09:07 +0000)]
Bug 28108: (QA follow-up) Make the system preference description more precise

There has been some confusion on what the pref really covers, so
I hope this helps to resolve.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28108: Fix filtering
Martin Renvoize [Wed, 7 Apr 2021 13:25:24 +0000 (14:25 +0100)]
Bug 28108: Fix filtering

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27625: Add currencies to custom.sql
Jonathan Druart [Wed, 10 Mar 2021 13:20:13 +0000 (14:20 +0100)]
Bug 27625: Add currencies to custom.sql

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27625: Fix sample_notices.t
Jonathan Druart [Wed, 10 Mar 2021 13:16:07 +0000 (14:16 +0100)]
Bug 27625: Fix sample_notices.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27625: Remove uk-UA installer data
Jonathan Druart [Wed, 10 Mar 2021 13:15:47 +0000 (14:15 +0100)]
Bug 27625: Remove uk-UA installer data

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27624: Add some stuffs to ru-RU custom.sql
Jonathan Druart [Mon, 8 Mar 2021 10:46:10 +0000 (11:46 +0100)]
Bug 27624: Add some stuffs to ru-RU custom.sql

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27624: Fix sample_notices.t
Jonathan Druart [Mon, 8 Mar 2021 10:37:01 +0000 (11:37 +0100)]
Bug 27624: Fix sample_notices.t

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27624: Remove ru-RU installer data
Jonathan Druart [Tue, 2 Mar 2021 10:55:35 +0000 (11:55 +0100)]
Bug 27624: Remove ru-RU installer data

With installer data in YAML format and it's translations,
there are no need for localized installer files.

This patch removes ru-RU installer files.

1) Apply the patch
2) Translate to ru-RU
   cd misc/translator
   ./translate update ru-RU
   ./translate install ru-RU
3) Do a clean install using ru-RU,
   check no problems during install

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27623: Add PLN currency to custom.sql
Jonathan Druart [Mon, 8 Mar 2021 10:32:06 +0000 (11:32 +0100)]
Bug 27623: Add PLN currency to custom.sql

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27623: Fix sample_notices.t
Jonathan Druart [Mon, 8 Mar 2021 10:31:48 +0000 (11:31 +0100)]
Bug 27623: Fix sample_notices.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27623: Remove pl-PL installer data
Jonathan Druart [Tue, 2 Mar 2021 10:57:42 +0000 (11:57 +0100)]
Bug 27623: Remove pl-PL installer data

With installer data in YAML format and it's translations,
there are no need for localized installer files.

This patch removes pl-PL installer files.

1) Apply the patch
2) Translate to pl-PL
   cd misc/translator
   ./translate update pl-PL
   ./translate install pl-PL
3) Do a clean install using pl-PL,
   check no problems during install

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27621: Keep COUNTRY and LANG
Jonathan Druart [Wed, 10 Feb 2021 07:00:54 +0000 (08:00 +0100)]
Bug 27621: Keep COUNTRY and LANG

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27621: Remove it-IT installer data
Jonathan Druart [Mon, 8 Feb 2021 12:25:09 +0000 (13:25 +0100)]
Bug 27621: Remove it-IT installer data

With installer data in YAML format and it's translations,
there are no need for localized installer files.

This patch removes it-IT installer files.

1) Apply the patch
2) Translate to it-IT
   cd misc/translator
   ./translate update it-IT
   ./translate install it-IT
3) Do a clean install using it-IT,
   check no problems during install

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28179: (follow-up) Remove console.log
Owen Leonard [Mon, 3 May 2021 18:08:49 +0000 (18:08 +0000)]
Bug 28179: (follow-up) Remove console.log

This patch removes a "console.log" from detail.tt and replaces it with
similar output to the user. It will probably never be triggered, but
better to handle it gracefully than have a hidden log.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28179: (follow-up) Updates to styling of lightbox controls
Owen Leonard [Fri, 23 Apr 2021 13:52:29 +0000 (13:52 +0000)]
Bug 28179: (follow-up) Updates to styling of lightbox controls

This patch fixes a bug and adds some style changes which I think are
nice. The bugfix is to change the z-index of the lightbox footer so that
it isn't hidden when there is a language menu in the footer.

The cosmetic changes replace the Chocolat image icons with new SVG
assets based on Bootstrap Icons (https://icons.getbootstrap.com/). The
color changes I think help the controls to be more visible.

License information about Bootstrap Icons has been added to the About
page.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28179: Adjust chocolat.js to display href
Jonathan Druart [Tue, 20 Apr 2021 14:35:39 +0000 (16:35 +0200)]
Bug 28179: Adjust chocolat.js to display href

In order to display link in the description we need to adjust
chocolat.js

Maybe this needs to be reported upstream

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28179: Add a lightbox gallery to display cover images - detail page, staff interface
Jonathan Druart [Mon, 19 Apr 2021 09:37:55 +0000 (11:37 +0200)]
Bug 28179: Add a lightbox gallery to display cover images - detail page, staff interface

This patch adds the ability to display the cover images of a
bibliographic record in a gallery. Cover images attached to items can
also be displayed in separated galleries.

Test plan:
All the cover images are affected, all the different sources will be
tested.
All the steps will be done on the same bibliographic record.
1. Local cover images
 a. Turn on LocalCoverImages and AllowMultipleCovers
 b. Add several local cover images to a bibliographic record
 c. Add several local cover images to an item
 d. Click on an image and confirm that it is displayed in a gallery and
 you can navigate see all the images attached to the bibliographic
 record
 e. Same for items
2. Adlibris
 a. Turn on AdlibrisCoversEnabled
 b. Edit the biliographic record and add an ISBN that will return a
 cover image for this service (9780670026623 for instance)
 c. Display the cover images in the gallery
 d. Note the link to the adlibris.com website at the bottom
3. Amazon
 a. Turn on AmazonCoverImages
 b. Display the cover images in the gallery
4. Coce
 a. Turn on IntranetCoce, set CoceHost to "http://coce.tamil.fr:8080"
 and select some values for CoceProviders.
 b. Display the cover images in the gallery
5. Custom cover images
 a. Turn on CustomCoverImages and set CustomCoverImagesURL to https://covers.openlibrary.org/b/isbn/{isbn}-M.jpg
 of anything else meaningful
 b. Display the cover images in the gallery

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28179: Add the Chocolat gallery lightbox JS library
Jonathan Druart [Mon, 19 Apr 2021 09:38:33 +0000 (11:38 +0200)]
Bug 28179: Add the Chocolat gallery lightbox JS library

Chocolat is a lightbox JS library.
https://chocolat.insipi.de
https://github.com/nicolas-t/Chocolat
https://chocolat.gitbook.io

Why Chocolat? It's released under the GPL v3 license, easy to use,
configure and extend, and is still maintained/active.

(and it has a nice name)

Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch)
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Rasmus Leißner <rasmus.leissner@solutions-factory.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27876: changed Your tags title to caption in OPAC
Wainui Witika-Park [Sun, 25 Apr 2021 04:02:04 +0000 (04:02 +0000)]
Bug 27876: changed Your tags title to caption in OPAC

On the tags page, changed the <h2> "Your tags" to a <caption> to reduce
heading redundancy but keep the information available.

To test:
1) Apply patch
2) Go to OPAC
3) Go to opac-tags.pl
4) Ensure that there is a caption above the table that says "Your tags"
and that it is not a heading tag

Sponsored-by: Catalyst IT
Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27876: took away redundant heading in OPAC full serial issues
Wainui Witika-Park [Fri, 23 Apr 2021 03:18:48 +0000 (03:18 +0000)]
Bug 27876: took away redundant heading in OPAC full serial issues

Changed <h2> to <h1> and deleted current <h1> to eliminate redundancy.

To test:
1) Apply patch
2) Go to OPAC
3) Go to opac-serial-issues.pl
4) Check there is only one main heading and it is <h1>

Sponsored-by: Catalyst IT
Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 27876: added sr-only to caption of table in Charges page
Wainui Witika-Park [Fri, 23 Apr 2021 03:09:20 +0000 (03:09 +0000)]
Bug 27876: added sr-only to caption of table in Charges page

Made the "Your charges" caption of the table in the Charges page of the
OPAC hidden and for screen-readers only so that it takes out redundancy.

To test:
1) Apply patch
2) Go to OPAC
3) Go to Charges page
4) Ensure that there is no visible caption above the table that says
"Your charges"
5) Check that the code has the caption still with sr-only class

Sponsored-by: Catalyst IT
Signed-off-by: Henry Bolshaw <bolshawh@parliament.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28160: Values from 150$a aren't prefilled in z39.50 search form from an existing...
Phil Ringnalda [Fri, 16 Apr 2021 18:44:14 +0000 (11:44 -0700)]
Bug 28160: Values from 150$a aren't prefilled in z39.50 search form from an existing authority record

For names and uniform titles, when you do a z39.50 search from an authority
record, we prefill what's in the relevant tag's subfield a in the search
form, but for subjects, we don't, both because GetMandatoryFieldZ3950 thinks
the param is topic when it's actually subject, and because
z3950_auth_search.tt doesn't bother putting the value of &subject into the
form.

Test plan:

1) Authorities - New authority - Topical Term
2) Tab 1, click on HEADING-TOPICAL TERM to expand subfields
3) In subfield a, type goats
4) Click Z39.50/SRU search and verify that the Subject heading search field
   has goats prefilled

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28159: URI-encode existing values put into query string for z39.50 authority...
Phil Ringnalda [Fri, 16 Apr 2021 16:55:25 +0000 (09:55 -0700)]
Bug 28159: URI-encode existing values put into query string for z39.50 authority search

When you trigger a z39.50 search from an existing authority record,
Koha prefills the search form with the value in the record. But because
that value passes through a URL, if it isn't URI-encoded characters like
& or ; will cut off the value.

Test plan:
1) Authorities - New authority - Corporate Name
2) Tab 1, click "HEADING-CORPORATE NAME" to expand subfields
3) Subfield a, type foo & bar ; baz
4) Click Z39.50/SRU search
5) Ensure the whole string appears in the Author (corporate) field in
   the popup

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28241: Fix regex to allow for content before and after comma
Lucas Gass [Tue, 27 Apr 2021 21:23:55 +0000 (21:23 +0000)]
Bug 28241: Fix regex to allow for content before and after comma

1. Set up the OPACNoResultsFound with the {QUERY_KW} placeholder.
2.Do a search with a comma that will return no results. Like "King, Martin Luther". If the returns results add some additional characters to the search until no results are returns.
3. Look at the #noresultsfound HTML element. Anything before (or after) the comma is omitted. So the placeholder looks something like 'Martin Luther' instead of 'King, Martin Luther'.
4. Apply patch
5. Try the search again, you should see the content before and after a comma

Signed-off-by: Lisette Scheer <lisettes@latahlibrary.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26995: DBIC schema changes
Jonathan Druart [Mon, 10 May 2021 13:50:23 +0000 (15:50 +0200)]
Bug 26995: DBIC schema changes

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26995: Remove occurrences in sample_patrons.yml
Jonathan Druart [Mon, 10 May 2021 13:41:50 +0000 (15:41 +0200)]
Bug 26995: Remove occurrences in sample_patrons.yml

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26995: DBRev 20.12.00.048
Jonathan Druart [Mon, 10 May 2021 12:45:32 +0000 (12:45 +0000)]
Bug 26995: DBRev 20.12.00.048

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26995: Fix SQL syntax error on the about page
Jonathan Druart [Mon, 10 May 2021 12:27:58 +0000 (14:27 +0200)]
Bug 26995: Fix SQL syntax error on the about page

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26995: (QA follow-up) Fix logic in database update
Martin Renvoize [Tue, 4 May 2021 12:48:23 +0000 (13:48 +0100)]
Bug 26995: (QA follow-up) Fix logic in database update

The logic was reversed.. if the column exists we want to delete it ;)

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26995: Remove references to relationship column
Kyle M Hall [Thu, 21 Jan 2021 11:59:00 +0000 (06:59 -0500)]
Bug 26995: Remove references to relationship column

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_mod...
Kyle M Hall [Thu, 21 Jan 2021 11:58:45 +0000 (06:58 -0500)]
Bug 26995: Drop column relationship from borrowers, deletedborrowers and borrower_modifications tables

Bug 14570 added a borrower_relationships table but it didn't remove the relationship column from the following tables:
- deletedborrowers
- borrowers
- borrower_modifications

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>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28266: fix spelling mistake on registers.tt
Lucas Gass [Fri, 30 Apr 2021 21:40:17 +0000 (21:40 +0000)]
Bug 28266: fix spelling mistake on registers.tt

TO test:
1. look at the cashup modal, see the wrong spelling of 'recieved'
2. Apply patch and see the right spelling

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28286: Replace < 1 with <= 0
Jonathan Druart [Mon, 10 May 2021 12:07:14 +0000 (14:07 +0200)]
Bug 28286: Replace < 1 with <= 0

It's the same but read more natural

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28286: show "Place hold" button if item is holdable
Petro Vashchuk [Wed, 5 May 2021 13:30:26 +0000 (16:30 +0300)]
Bug 28286: show "Place hold" button if item is holdable

This patch adds "filter_by_for_hold" method in "Items.pm" and
uses it in "cat-toolbar.inc" instead of "filter_by_for_load".

Also this patch removes "filter_by_for_loan" method.

To reproduce the bug:
1) go to /cgi-bin/koha/catalogue/detail.pl?biblionumber=XXX that has
item with notforloan value set as "Ordered" (-1)
2) see that button "Place hold" is not present
3) apply the patch
4) refresh the page and ensure that "Place hold" button appears even if
item is "Ordered"

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 25760: (bug 15422 follow-up) Display record with hold ratio greater than or equal...
Nick Clemens [Fri, 8 Jan 2021 20:12:28 +0000 (20:12 +0000)]
Bug 25760: (bug 15422 follow-up) Display record with hold ratio greater than or equal to the value entered

On bug 15422 we made it so that only holds with copies to buy to acheive the holds ratio
showed

Users have reported that they want to see record where there are 0 copies to buy i.e.
the holds ration matches the value entered

This patch changes the criteria for returning holds to be if the ratio for a given title
is equal to or greater then the ratio specified in the form

I also renamed 'ratiocalc' to 'copies_to_buy' since that is what is contains

Test plan:
1. Create bibliographic records with 1, 2 and 3 items
2. Place 1 hold on each of them
3. Go to the Hold ratios report and search with ratio = 1, 2 then 3
4. You expect to see:
   the title with 1 item with ratio 1
   nothing otherwise
5. Place another hold on each of the record
6. Repeat 3 you expect to see:
   titles with 1 or 2 items with ratio 1
   title with 1 item for ratio 2
   nothing with ratio 3
7. Place another hold on each of the record
8. Repeat 3 you expect to see:
   titles with 1 or 2 or 3 items with ratio 1
   title with 1 item or 2 items for ratio 2
   nothing with ratio 3
9. Make sure there is no regression in the test plan of bug 15422

Comments from Frank Hansen:

Some comments.
When I adding the third hold on each record in step 7, It will result in
the following result:

titles with 1 or 2 or 3 items with ratio 1
title with 1 items with ratio 2 because the title with 2 items will get
a ratio of 1.50 and not 2.
title with 1 items with with ratio 3

Signed-off-by: Frank Hansen <frank.hansen@ub.lu.se>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28181: Filter out archived debit types in point of sale
Martin Renvoize [Thu, 22 Apr 2021 12:11:59 +0000 (13:11 +0100)]
Bug 28181: Filter out archived debit types in point of sale

The filter for only displaying un-archived debit types on the point of
sale page had been missed.

NOTE: It would be beneficial to move this to a default filter in the
Koha:: objects search method for both debit_types and credit_types.. but
I opted for the quick fix here to resolve the bug and will impliment
default filtering in a subsequent enhancement bug.

Test plan
1/ Archive a debit type that is marked as 'Can be sold'
2/ Go to the point of sale page and confirm the above debit type appears
3/ Apply the patch
4/ Confirm the debit type no longer appears in the point of sale page.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28229: Count only if needed
Jonathan Druart [Mon, 10 May 2021 10:08:21 +0000 (12:08 +0200)]
Bug 28229: Count only if needed

We don't need to count the number of clubs if we selected a patron or
club already

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28229: (follow-up) Adjust for easier translation
Owen Leonard [Fri, 7 May 2021 11:20:48 +0000 (11:20 +0000)]
Bug 28229: (follow-up) Adjust for easier translation

I think moving the [% IF %] out of the HTML tag makes for easier
translation.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28229: Only show clubs on request.tt if clubs exist
Lucas Gass [Wed, 5 May 2021 21:27:25 +0000 (21:27 +0000)]
Bug 28229: Only show clubs on request.tt if clubs exist

1. Have no existing clubs
2. Apply patch
3. Go to request.tt and you will not see the club tab or any mention of clubs
4. Create at least 1 club
5. Go back to request.tt and now see the tab for clubs
6. Make sure you can place holds as an individual with and without clubs.
7. Make sure you can place holds for clubs.
8. rejoice and sign-off

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28276: Do not fetch config ($KOHA_CONF) from memcached
Julian Maurice [Sun, 2 May 2021 11:37:38 +0000 (13:37 +0200)]
Bug 28276: Do not fetch config ($KOHA_CONF) from memcached

memcached address and namespace are in $KOHA_CONF, so it is required to
read it before being able to access the cache. And after that,
configuration is kept in memory forever. Storing this in memcached is
useless and even counter-productive, since Koha reads both the file and
the cache

This patch addresses this issue by removing the cache-related code from
C4::Context->new.
It means that C4::Context->new will always read the configuration file,
so this patch also replaces inappropriate calls to
C4::Context->new->config by appropriate calls to C4::Context->config

It also fixes a bug where C4::Context->new would ignore the filepath
given in parameters if there was something in cache.

It also removes a problematic call to Koha::Caches->get_instance.
Because this call was outside of any subroutine, it would have happened
before the initialization of $C4::Context::context (which happen in
C4::Context::import)

Test plan:
1. Do not apply the patch yet
2. Add the following line at the beginning of Koha::Config::read_from_file
    warn "read_from_file($file)";
   This will allow you to check how many times the file is read.
3. Flush memcached and restart starman
4. Check the logs, you should see "read_from_file" a bunch of times
5. Apply the patch
6. Re-add the line from step 2
7. Flush memcached and restart starman
8. Check the logs, you should see "read_from_file" only once
9. Make sure the memcached config from $KOHA_CONF (memcached_servers,
   memcached_namespace) is taken into account by checking the About page

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 28272: Prevent api spec to accept extra parameters
Jonathan Druart [Thu, 6 May 2021 13:11:51 +0000 (15:11 +0200)]
Bug 28272: Prevent api spec to accept extra parameters

Some of our definition files are missing { additionalProperties: false }
We must have it to make sure all properties are defined and prevent the
spec to accept extra parameters (being more strict but also allowing to
catch errors more easily)

grep -rL additionalProperties api/v1/swagger/definitions/*.json

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 26471: Remove invalid Map URL
Jonathan Druart [Tue, 9 Feb 2021 15:20:36 +0000 (16:20 +0100)]
Bug 26471: Remove invalid Map URL

There is a warning in the console:
Error en el mapeo fuente: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
URL del recurso: http://kohadev-intra.mydnsname.org:8081/intranet-tmpl/lib/datatables/datatables.min_20.1200011.js
URL del mapa fuente: pdfmake.min.js.map

https://developer.mozilla.org/en-US/docs/Tools/Debugger/Source_map_errors

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
3 years agoBug 24154: Adjust assignment
Nick Clemens [Wed, 5 May 2021 18:41:47 +0000 (18:41 +0000)]
Bug 24154: Adjust assignment

The code seems to work either way
We have a mix in our code:
git grep "}) %]"

Using '=>' over '=' does look nicer

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>