koha.git
2 years agoBug 26080: Some refactoring
Jonathan Druart [Wed, 29 Jul 2020 10:12:59 +0000 (12:12 +0200)]
Bug 26080: Some refactoring

A new include file is created per background job to avoid
background_jobs.tt to grow too much

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 26080: Use the task queue for batch delete biblios
Jonathan Druart [Wed, 29 Jul 2020 09:17:34 +0000 (11:17 +0200)]
Bug 26080: Use the task queue for batch delete biblios

This patch takes advantage of the task queue to delegate the batch
delete biblios tool.

Test plan:
Delete bibliographic records using the batch record deletion tool
Confirm that the job is now delegated to the task queue and that
everything else is working as before

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28772: DBRev 21.06.00.026
Jonathan Druart [Thu, 30 Sep 2021 07:49:50 +0000 (09:49 +0200)]
Bug 28772: DBRev 21.06.00.026

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28772: Fix Koha/Object.t
Jonathan Druart [Tue, 21 Sep 2021 08:59:22 +0000 (10:59 +0200)]
Bug 28772: Fix Koha/Object.t

Koha::ApiKeys is no longer the simple object we need to test
Koha::Object->store, let use Koha::Library::Groups

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28772: Fix auth_authenticate_api_request.t
Tomas Cohen Arazi [Tue, 21 Sep 2021 16:18:52 +0000 (13:18 -0300)]
Bug 28772: Fix auth_authenticate_api_request.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28772: Make validate_secret return 1|0
Jonathan Druart [Fri, 10 Sep 2021 08:34:41 +0000 (10:34 +0200)]
Bug 28772: Make validate_secret return 1|0

Not an empty string

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28772: (QA follow-up) Fix wrong message
Tomas Cohen Arazi [Thu, 9 Sep 2021 11:53:07 +0000 (08:53 -0300)]
Bug 28772: (QA follow-up) Fix wrong message

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28772: Do not hash secrets twice
Tomas Cohen Arazi [Thu, 9 Sep 2021 11:51:02 +0000 (08:51 -0300)]
Bug 28772: Do not hash secrets twice

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28772: Make secret validation use the new method
Tomas Cohen Arazi [Thu, 9 Sep 2021 11:38:25 +0000 (08:38 -0300)]
Bug 28772: Make secret validation use the new method

This patch makes the Koha::OAuth library use the new validation method

To test:
1. In master, enable RESTOAuth2ClientCredentials and have your
   superlibrarian patron a client_id/secret pair generated
2. Use Postman to gain an access token with the client_id/secret pair
=> SUCCESS: This works in Koha
3. Use the access token to GET /api/v1/patrons
=> SUCCESS: It works
4. Apply this patchset up to the regression tests
5. Run:
   $ updatedatabase
   $ koha-plack --restart kohadev
=> SUCCESS: All good
6. Repeat 2
=> FAIL: You get an error trying to acquire an access token. Boo
7. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/oauth.t
=> FAIL: Tests fail!
8. Apply this patch
9. Run:
   $ koha-plack --restart kohadev
   $ kshell
  k$ prove t/db_dependent/api/v1/oauth.t
=> SUCCESS: Tests pass!
10. Repeat 2
=> SUCCESS: Your original client_id/secret pair works!
11. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28722: Regression tests
Tomas Cohen Arazi [Thu, 9 Sep 2021 11:23:48 +0000 (08:23 -0300)]
Bug 28722: Regression tests

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove tt/db_dependent/api/v1/oauth.t
=> FAIL: Tests fail!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
https://bugs.koha-community.org/show_bug.cgi?id=28772

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28772: Display API secret once
Tomas Cohen Arazi [Mon, 30 Aug 2021 15:07:56 +0000 (12:07 -0300)]
Bug 28772: Display API secret once

This patch makes the apikeys.pl display the generated API secret once,
when generated. After that, it won't be displayed by the UI.

To test:
1. Generate a new API key
=> FAIL: The secret is displayed in the API keys table
2. Visit some other page, and go back to the API keys page
=> FAIL: The API key secret is there
3. Apply this patch
4. Go to More > Manage API keys
=> SUCCESS: It no longer displays the secret
5. Generate a new API key
=> SUCCESS: The API key details (including the secret) are displayed.
=> SUCCESS: A message telling to copy the secret because it won't be
            displayed again is shown.
6. Repeat 4
=> SUCCESS: The secret is no longer displayed
7. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28772: Add a warning about hash_password usage in updatedatabase.pl
Tomas Cohen Arazi [Mon, 30 Aug 2021 14:08:57 +0000 (11:08 -0300)]
Bug 28772: Add a warning about hash_password usage in updatedatabase.pl

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28772: Update existing keys
Tomas Cohen Arazi [Mon, 30 Aug 2021 14:08:30 +0000 (11:08 -0300)]
Bug 28772: Update existing keys

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28772: Make Koha::ApiKey->store encrypt the secret
Tomas Cohen Arazi [Thu, 26 Aug 2021 23:24:43 +0000 (20:24 -0300)]
Bug 28772: Make Koha::ApiKey->store encrypt the secret

This patch refactors the Koha::ApiKey class so:
- It encrypts the generated secret
- Allows accessing the plain text secret only immediately after the key
  creation (this implies that it won't be accessible if the key is
  fetched from the DB).
- It implements an allow list for attributes, that are not read only.
  Changing any other of them will make ->store throw an exception.
- A method for validating plain text secrets against the encrypted one
  is added.
- A method for accessing the plain text secret is added. Returns undef
  if the object is not 'fresh'.

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28759: limit accessibility for "Manage API keys"
Petro Vashchuk [Tue, 10 Aug 2021 15:08:53 +0000 (18:08 +0300)]
Bug 28759: limit accessibility for "Manage API keys"

This patch limits the accessibility for "Manage API keys" section only
to superlibrarians and the owner of that said API key account.

The way it does it is by checking if user is superlibrarian or if
logged-in user is the same as a patron id/borrower number is the same
as logged-in user number both in template and apikeys.pl and making sure
the link is inaccessible or redirects to the 403 page if user tries to
go there directly.

To reproduce:
1) create/pick existing patron, set Staff access, allows viewing
of catalogue in staff interface (catalogue)" and "Add, modify and
iew patron information (borrowers)" permissions on;
2) enable "RESTOAuth2ClientCredentials" in sysprefs;
3) login with that user into staff interface;
4) check any other patron, go to the "More"->"Manage API keys" and
check that you can see, add delete their API keys;
5) apply patch;
6) with that same user try to access "Manage API keys" page again.
Ensure that you can't access that page of other patrons but can
access your own page and manage your own API keys.
7) log in with superlibrarian now and ensure that you can access every
"Manage API keys" page of every patron and apply changes there.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28941: Deal with OPACSuggestionUnwantedFields
Jonathan Druart [Fri, 10 Sep 2021 09:33:18 +0000 (11:33 +0200)]
Bug 28941: Deal with OPACSuggestionUnwantedFields

Remove fields from OPACSuggestionUnwantedFields before creating the
suggestion

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28941: Filter suggestion inputs at the OPAC
Jonathan Druart [Thu, 2 Sep 2021 09:51:48 +0000 (11:51 +0200)]
Bug 28941: Filter suggestion inputs at the OPAC

The following sequence is bad:
46 my $suggestion      = $input->Vars;

181         &NewSuggestion($suggestion);

All columns can be set when we insert the suggestion into the DB
We definitely want to avoid the following fields to be set by the final
user: acceptedby, accepteddate, STATUS, etc...

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28947: Prevent OPAC user to create new users
Jonathan Druart [Fri, 3 Sep 2021 10:01:12 +0000 (12:01 +0200)]
Bug 28947: Prevent OPAC user to create new users

This patch prevents an existing user from exploiting the patron edit form in order to
force create new patrons

To test:
Try all combinations of PatronSelfRegistration and PatronSelfRegistrationVerifyByEmail
with and without this patch.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28935: (QA follow-up) Use BorrowerUnwantedField on staff client
Nick Clemens [Mon, 13 Sep 2021 12:56:30 +0000 (12:56 +0000)]
Bug 28935: (QA follow-up) Use BorrowerUnwantedField on staff client

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28935: No filtering on patron's data on member entry pages
Marcel de Rooy [Wed, 1 Sep 2021 14:04:31 +0000 (16:04 +0200)]
Bug 28935: No filtering on patron's data on member entry pages

Security patch. Follow-up for 28929.
Including correction for gonenoaddress and two others.
Includes unwanted fields too now.

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>
2 years agoBug 28929: Add selenium tests
Jonathan Druart [Tue, 31 Aug 2021 15:12:22 +0000 (17:12 +0200)]
Bug 28929: Add selenium tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Bug 28929: (follow-up) Add exec flag to tests

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28929: Prevent flags to be sent during patron's edition
Jonathan Druart [Tue, 31 Aug 2021 13:55:15 +0000 (15:55 +0200)]
Bug 28929: Prevent flags to be sent during patron's edition

* selfreg and selfmod for OPAC
* patron's edition on staff

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested OPAC and staff side. Prevents mangling flags column.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28937: Compiled CSS
Jonathan Druart [Wed, 29 Sep 2021 10:43:36 +0000 (12:43 +0200)]
Bug 28937: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28937: (QA follow-up) Accessability improvement
Martin Renvoize [Mon, 27 Sep 2021 11:48:54 +0000 (12:48 +0100)]
Bug 28937: (QA follow-up) Accessability improvement

This patch adds a keydown event listener onto the flatpickr instance and
looks for the down arrow key. When such an event is detected we take
that to mean the user wants to keyboard navigate the calendar widget and
so disable the buggy allowInput option allowing keyboard navigation to
work as expected.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28937: Use Flatpickr on circulation and patron pages
Owen Leonard [Tue, 31 Aug 2021 19:23:21 +0000 (19:23 +0000)]
Bug 28937: Use Flatpickr on circulation and patron pages

This patch replaces the use of jQueryUI's datepicker on circulation and
patron-related pages.

The patch modifies Flatpickr's default configuration (in calendar.inc)
so that it has the following features:

 - A Flatpickr input with a "futuredate" class will require that the
   selected date be after today.
 - The Flatpickr input field will be wrapped in a container to
   facilitate better CSS styling.
 - Generic handling of paired date fields is enabled using
   ".flatpickrfrom" and ".flatpickrto" field classes. This mimics the
   same feature we have for jQueryUI datepickers using ".datepickerfrom"
   and ".datepickerto".

This patch also removes an unused function which was repeated in three
templates: validate1.

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

- Go to Circulation and check out to a patron.
  - Open the Restrictions tab and click "Add manual restriction."
    - In the "Expiration" field, test that the Flatpickr widget works
      correctly and limits to dates after today.
  - Enable the SpecifyDueDate preference if necessary.
    - Test the behavior of the SpecifyDueDate controls: Setting a date,
      clearing a date, session persistence.
- Enable the SuspendHoldsIntranet system preference if necessary.
  - Check out to a patron with existing holds.
    - Open the Holds tab and click the "Suspend" button for one of the
      holds.
      - In the modal window which appears, check that the Flatpickr
        widget works correctly and limits to dates after today.
      - At the bottom of the table of holds, test that the "Suspend all
        holds" Flatpickr works correctly and limits to dates after
        today.
        - Perform this same test from the patron details page.
- Enable the  BatchCheckouts system preference if necessary.
  - Open a patron record and click "Batch check out" in the left-hand
    sidebar menu.
    - Test that the "Hard due date" Flatpickr works correctly as a date
      and time picker.
- Go to Circulation -> Overdues.
  - Test that the date due filters in the sidebar work correctly and
    are linked, e.g. the "to" field cannot be before the "from" field.
     - Perform the same test here: Circulation -> Holds to pull; and
       here: Circulation -> Hold ratios.
- Enable the  HouseboundModule system preference if necessary.
  - Check out to or view details of a patron.
    - Click "Housebound" in the sidebar menu.
      - Save delivery day and frequency settings for that patron.
      - Click "Add a new delivery."
      - Test that the "Date" Flatpickr widget works correctly.
- Go to Patrons -> A patron record -> Edit.
  - Test that Flatpickr widgets work on the following fields:
    - Date of birth
    - Registration date & Expiration date (linked).
    - Patron restrictions -> Add manual restriction -> Expiration.
- View a bibliographic record and start the process of placing a hold.
  - After selecting a patron, test the "Hold starts on" and "Hold
    expires on" date fields. The fields should be linked and each
    should limit to future dates.
  - Confirm that the dates are saved correctly when you submit the
    hold.
- Locate a bibliographic record with multiple holds and view the holds.
  - In the table of holds, test each date field: Date, expiration, and
    suspend-until.
- Test that Flatpickr's static "formatDate" method is working
  correctly:
  - Locate a bibliographic record's item so that there is text in both
    the "Public note" and "Non-public note" field.
  - Check that item out to a patron.
  - After the page reloads the public and non-public notes should be
    shown under the checkout title highlighted in red.
- Check for references to a "validate1" function. There should be none.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28933: Add subscription class to each subscription in opac-detail
Lucas Gass [Tue, 31 Aug 2021 20:36:37 +0000 (20:36 +0000)]
Bug 28933: Add subscription class to each subscription in opac-detail

To Test:
1. Go to a record with some subscriptions, have some closed and some
   open.
2. Go to the opac-detail page, click on the subscription tab and use
   your developer tools to inscept the element.
3. Notice the hierarchy of HTML structure, everything is a sibling of
   the next.
4. Apply patch
5. Reload the same opac-detail page and again inscept the element.
6. Now every individual subscription should be wrapped in an element
   with the class name of 'subscription'.

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>
2 years agoBug 28454: Add Koha version number to database schema link in reports
Jonathan Druart [Wed, 25 Aug 2021 10:44:56 +0000 (12:44 +0200)]
Bug 28454: Add Koha version number to database schema link in reports

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Bug 28454: (follow-up) Add missing filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29030: Compiled CSS
Jonathan Druart [Wed, 29 Sep 2021 10:10:17 +0000 (12:10 +0200)]
Bug 29030: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29030: Make authorized value and description fields required
Owen Leonard [Wed, 15 Sep 2021 17:40:19 +0000 (17:40 +0000)]
Bug 29030: Make authorized value and description fields required

This patch modifies the markup of the "Create a new authorized value"
modal so that a minimum set of fields is required: Authorized value and
description.

The patch also modifies the JavaScript which handles the submission so
that the jQuery Validation plugin can handle the field checks.

The spelling "authorised" is changed to "authorized" following coding
guidelines.

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

- Locate a record in the catalog which has items and open an item for
  editing.
- In the add item form, test the process of adding an authorized
  value on the fly with the following fields: Withdrawn, Lost,
  Damaged, Use restrictions, Not for loan, Collection code, Shelving
  location, and Shelving control number.
  - In each case you should be able to type a new value in the
    dropdown's search box and be shown the option "Select to create."
  - Selecting should trigger a modal window, "Create a new authorized
    value."
  - Test that both "Authorized value" and "Description" fields are
    required, and the form can't be submitted without them.
  - Test that an error message shows up when you submit an authorized
    value which already exists, e.g. authval "1" for "DAMAGED."
  - After triggering this error, click the "Cancel" button and try
    creating another new authorized value. When the modal reopens the
    form should be reset: No previously-entered data, no error messages.
  - Submitting a valid form with a new authorized value should work
    correctly. The modal window should close automatically.

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>
2 years agoBug 28826: DBRev 21.06.00.025
Jonathan Druart [Wed, 29 Sep 2021 10:46:54 +0000 (12:46 +0200)]
Bug 28826: DBRev 21.06.00.025

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28826: Add FacetOrder system preference
Nick Clemens [Fri, 6 Aug 2021 18:50:35 +0000 (18:50 +0000)]
Bug 28826: Add FacetOrder system preference

This bug adds a system preference to control ordering of facets and
adds the control to both Zebra and Elasticsearch

To test:
1 - Have a koha that can use both Zebra and ES
2 - Set 'displayFacetCount' to true
3 - Search in ES and Zebra
4 - Note facets in Zebra sorted alphabetically, ES by usage
5 - Apply patch, updatedatabase
6 - Search in ES and Zebra, facets are alphabetically sorted in both
7 - Find new syspref FacetOrder and set to 'by usage'
8 - Search in both engines, facets sorted by usage

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>
2 years agoBug 27155: Include identifier test in Biblio_and_Items_plugin_hooks.t
Marcel de Rooy [Tue, 28 Sep 2021 11:50:22 +0000 (11:50 +0000)]
Bug 27155: Include identifier test in Biblio_and_Items_plugin_hooks.t

The biblio and item action hooks pass a biblionumber or itemnumber now
to the plugin at time of deletion.
This patch adds a tiny refinement to Biblio_and_Items_plugin_hooks.t
and the associated test plugin to be sure of that.

Test plan:
Run t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28484: (QA follow-up) POD fix
Nick Clemens [Tue, 28 Sep 2021 20:33:46 +0000 (20:33 +0000)]
Bug 28484: (QA follow-up) POD fix

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28484: (QA follow-up) Add fix on OPAC
Nick Clemens [Tue, 28 Sep 2021 20:24:39 +0000 (20:24 +0000)]
Bug 28484: (QA follow-up) Add fix on OPAC

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28484: ES clean title in biblio detail
Alex Arnaud [Thu, 22 Jul 2021 11:45:15 +0000 (11:45 +0000)]
Bug 28484: ES clean title in biblio detail

Test plan:
 - Create a biblio with title like "osteuropa:" or "osteuropa!"
 - Go the this biblio detail pages (cgi-bin/koha/catalogue/detail.pl)
   => Error
 - Apply bug 28316 and this one
 - test again

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
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>
2 years agoBug 29091: Compiled CSS
Jonathan Druart [Tue, 28 Sep 2021 12:55:35 +0000 (14:55 +0200)]
Bug 29091: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29091: Correct display of lists and tags on search results
Owen Leonard [Thu, 23 Sep 2021 11:54:43 +0000 (11:54 +0000)]
Bug 29091: Correct display of lists and tags on search results

This patch makes a minor change to CSS to fix the display of tags and
lists on the OPAC search results page so that the list doesn't have
extra padding.

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

- To test you should be able to perform a catalog search in the OPAC
  which will return results which have one or more tags and which are on
  one or more lists.
- In the OPAC search results, confirm that there isn't extra padding
  between the "Tags:" and "Lists:" labels and their values.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28438: (follow-up) Capitalization: Various corrections
David Nind [Sat, 18 Sep 2021 21:57:41 +0000 (21:57 +0000)]
Bug 28438: (follow-up) Capitalization: Various corrections

One mdditional correction.

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>
2 years agoBug 28438: Capitalization: Various corrections
Owen Leonard [Wed, 9 Jun 2021 12:27:29 +0000 (12:27 +0000)]
Bug 28438: Capitalization: Various corrections

This patch makes capitalization corrections to many templates in the
OPAC and staff interface. A exhaustive test plan would be huge, so I
recommend examining the patch to confirm that it contains correct case
changes.

If you want to make it easier to examine changes you can try:
https://github.com/so-fancy/diff-so-fancy

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>
2 years agoBug 29078: Resolve division by zero in touch_all scripts
Marcel de Rooy [Wed, 22 Sep 2021 14:06:07 +0000 (14:06 +0000)]
Bug 29078: Resolve division by zero in touch_all scripts

Illegal division by zero at misc/maintenance/touch_all_biblios.pl line 102.

Trivial fix.
Funny that the percentage is not even shown without verbose flag ;)

Test plan:
Run misc/maintenance/touch_all_biblios.pl -where 'biblionumber<0'
You should now see:
Good: 0, Bad: 0 (of 0) in 0 seconds

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28940: In spinelabel-print.tt call IntranetUserJS only once
Lucas Gass [Wed, 1 Sep 2021 19:16:15 +0000 (19:16 +0000)]
Bug 28940: In spinelabel-print.tt call IntranetUserJS only once

1. In IntranetUser add some JS that will target spinelabel-print.tt, I used this:
    if ( $('#labels_spinelabel-print').length ) {
      $('#labels_spinelabel-print').append('<div>TEST</div>');
      console.log('TEST');
    }
2. Generate a quick spine label
3. Once you have entered a barcode the JS will go off 2x. With the jQuery added you will see 2 div's with the word 'TEST'. Look at the console and you will also see TEST console logged 2x.
4. Apply patch
5. Try seto 2 and 3 again, the JS should only be called once.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29067: Remove duplicate conditional statement from OPAC messaging settings title
Lari Taskula [Mon, 20 Sep 2021 22:33:42 +0000 (22:33 +0000)]
Bug 29067: Remove duplicate conditional statement from OPAC messaging settings title

We can never reach the first [% ELSE %]Koha online[% END %] block in OPAC
messaging preferences title, so it's dead code.

This patch removes the useless duplicate if-statement.

To test:
1. Enable EnhancedMessagingPreferencesOPAC system preference
2. Go to /cgi-bin/koha/opac-messaging.pl
3. Observe title Your messaging settings > Koha online catalog
4. Apply patch
5. Refresh page /cgi-bin/koha/opac-messaging.pl
6. Observe same title Your messaging settings > Koha online catalog
7. See patch content
8. Confirm there are no functional changes in the new logic

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>
2 years agoBug 28934: Compiled CSS
Jonathan Druart [Tue, 28 Sep 2021 12:55:23 +0000 (14:55 +0200)]
Bug 28934: Compiled CSS

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28934: Make the OPAC registration form design consistent
Joonas Kylmälä [Tue, 21 Sep 2021 16:32:00 +0000 (16:32 +0000)]
Bug 28934: Make the OPAC registration form design consistent

The gender/sex and GDPR inputs were slightly misaligned (by
1.5em). Now they are aligned with the other inputs which have a width
of 10em (9em width + margin 1em). The label assignments and required
attributes for input elements are made also consistent.

To test:
 1) Enable GDPR_Policy syspref
 2) Apply patch, run "yarn build --view opac", restart plack
 3) Go to /cgi-bin/koha/opac-memberentry.pl
 4) Check that the GDPR input box shows the required text now in red
    color
 5) Check that the alignment of sex/gender and GDPR input matches with
    the other inputs perfectly.

Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29064: Remove duplicate term Most popular titles
Lari Taskula [Mon, 20 Sep 2021 22:07:53 +0000 (22:07 +0000)]
Bug 29064: Remove duplicate term Most popular titles

To test:
1. Enable system preference OpacTopissue
2. Go to OPAC /cgi-bin/koha/opac-topissues.pl
3. Observe title Most popular titles &rsaquo; Koha online catalogMost popular titles
4. Apply patch
5. Observe title Most popular titles &rsaquo; Koha online catalog
6. See that this path complies with Bug 27742

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28510: Remove unnecessary conditional
Kyle M Hall [Thu, 3 Jun 2021 11:29:52 +0000 (07:29 -0400)]
Bug 28510: Remove unnecessary conditional

It makes sense to use items by branch to get the list of branches, as it
already tells use which branches have available items. We could use
branches to pull from instead, but all we would accomplish is added
extra ununsed loop iterations. We already know that any additional
branches in the branches to pull loop have no items to fill holds.
If they did, they would be in the items_by_branch hash.

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>
2 years agoBug 28510: Remove marking of closed branches as 'disable_transfer'
Kyle M Hall [Thu, 3 Jun 2021 10:57:52 +0000 (06:57 -0400)]
Bug 28510: Remove marking of closed branches as 'disable_transfer'

We no longer need to act as if closed branches were marked as
disable_transfer. This allows us to clean up a nice bit of code.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 28510: Remove unused variable

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28510: Skip processing holds queue items from closed libraries when HoldsQueueSki...
Kyle M Hall [Thu, 3 Jun 2021 10:44:59 +0000 (06:44 -0400)]
Bug 28510: Skip processing holds queue items from closed libraries when HoldsQueueSkipClosed is enabled

Right now we skip closed branch's items as we iterate over all items looking for ones to fill a hold. If HoldsQueueSkipClosed is enabled, no items held be a closed library can be targeted, so it would be more efficient if we never selected the items from those branches to begin with. This is how the holds queue works if we are not using the transport cost matrix, so we should make it work the same way if we *are* using the matrix.

Test Plan:
1) Apply this patch
2) prove prove t/db_dependent/HoldsQueue.t
3) All tests should continue to pass

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>
2 years agoBug 29070: Compiled CSS
Jonathan Druart [Tue, 28 Sep 2021 12:43:46 +0000 (14:43 +0200)]
Bug 29070: Compiled CSS

It also contains the compiled CSS changes for the previous accessibility commits

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29070: Use a variable to store the #666666 color
Jonathan Druart [Tue, 28 Sep 2021 12:39:53 +0000 (14:39 +0200)]
Bug 29070: Use a variable to store the #666666 color

To prevent repetition

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29070: Accessibility OPAC Purchase suggestions box on search results page has...
Henry Bolshaw [Mon, 20 Sep 2021 23:38:17 +0000 (23:38 +0000)]
Bug 29070: Accessibility OPAC Purchase suggestions box on search results page has insufficient contrast

This patch changes the text colour for the purchase
suggestion box on the OPAC search results page to
make the text easier to read and improve accessibility.

To test:

1. Log in to the OPAC and search for something
2. Use an accessibility tool (e.g. Chrome's
   Lighthouse tool) to check the contrast ratio
3. Confirm that the Purchase suggestion text
   fails to meet accessibility requirements
4. Apply the patch and rebuild CSS:
   yarn build --view opac
5. Confirm the text contrast ratio now meets
   minimum accessibility requirements
6. Check that the OPAC still looks ok after
   the changes.

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>
2 years agoBug 29068: Accessibility OPAC search results summary text has insufficient contrast
Henry Bolshaw [Mon, 20 Sep 2021 22:45:55 +0000 (22:45 +0000)]
Bug 29068: Accessibility OPAC search results summary text has insufficient contrast

This patch changes the colour of the label text in
OPAC search results to increase the contrast ratio,
improve accessibility and make the text easier to read.

To test:

1. Search for something on the OPAC
2. Use an accessibility tool (e.g. Chrome's Lighthouse
   tool) to check the contrast ratio
3. Confirm that the labels (Edition, Format etc.) in the
   results summary have insufficient contrast
4. Apply the patch and rebuild CSS:
   yarn build --view opac
5. Use the accessibility tool to confirm the contrast
   ratio now meets minimum accessibility requirements
6. Check that the OPAC still looks ok after the changes

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>
2 years agoBug 29065: Accessibility OPAC clear search history link has insufficient contrast
Henry Bolshaw [Mon, 20 Sep 2021 22:27:23 +0000 (22:27 +0000)]
Bug 29065: Accessibility OPAC clear search history link has insufficient contrast

This patch changes the colour of the clear search history link
on the OPAC to increase the contrast ratio, improve accessibility
and makes the text easier to read.

To test:

1. Go to the OPAC homepage
2. Use an accessibility tool (e.g Chrome's
   Lighthouse tool) to check the contrast ratio
3. Confirm that the clear search history link
   has insufficient contrast
4. Apply the patch and rebuild css:
   yarn build --view opac
5. Confirm that the contrast ratio now
   meets minimum accessibility requirements
6. Check the OPAC still looks ok after the changes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29038: Accessibility OPACUserSummary heading doesn't have sufficient contrast
Henry Bolshaw [Mon, 20 Sep 2021 21:10:15 +0000 (21:10 +0000)]
Bug 29038: Accessibility OPACUserSummary heading doesn't have sufficient contrast

This patch changes the colour of the OPAC User Summary heading text to
increase the contrast ratio, improving accessibility and making the
text easier to read.

To test:

1. Log in to the OPAC homepage as a user with items checked out
2. Use an accessibility tool (e.g. Chrome's Lighthouse tool) to test the
   contrast ratio.
3. Confirm the UserSummary heading has insufficient contrast.
4. Apply the patch and rebuild css:
   yarn build --view opac
5. Use the accessibility tool to confirm the contrast ratio now meets
   accessibility requirements
6. Check that the OPAC still looks ok after the changes

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29037: Accessibility: OPAC links don't have sufficient contrast
Henry Bolshaw [Thu, 16 Sep 2021 07:55:01 +0000 (07:55 +0000)]
Bug 29037: Accessibility: OPAC links don't have sufficient contrast

This patch changes the colour of links on the OPAC
to improve the contrast ratio and make the link
text easier to read. This accessibility issue was
identified using the WebAIM WAVE accessibility
browser extension and Google Chrome's Lighthouse
tool.

To test:
1. Use an accessibility tool (e.g. Chrome's
   Lighthouse tool) to test the contrast ratio.
2. Confirm that some links (e.g. breadcrumb links
   and title links in search results) have
   insufficient contrast.
3. Apply the patch and rebuild the OPAC CSS:
   yarn build --view opac
4. Use the accessibility tool to confirm the
   contrast ratio meets minimum requirements
5. Check that the OPAC still looks ok after the
   changes.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29035: Accessibility: OPAC masthead_search label doesn't have sufficient contrast...
Henry Bolshaw [Thu, 16 Sep 2021 12:53:12 +0000 (12:53 +0000)]
Bug 29035: Accessibility: OPAC masthead_search label doesn't have sufficient contrast ratio

This patch changes the colour of the masthead
search label to improve accessibility and make it
easier to read.

To test:
1. Use an accessibility tool (e.g. Chrome's
   Lighthouse tool) to test the contrast ratio.
2. Confirm that the search label has insufficient
   contrast.
3. Apply the patch and rebuild the OPAC CSS:
   yarn build --view opac
4. Use the accessibility tool to confirm the
   contrast ratio now meets accessibility
   requirements.
5. Check that the OPAC still looks ok after
   the changes.

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>
2 years agoBug 29034: Accessibility: OPAC nav links don't have sufficient contrast ratio
Henry Bolshaw [Thu, 16 Sep 2021 08:35:39 +0000 (08:35 +0000)]
Bug 29034: Accessibility: OPAC nav links don't have sufficient contrast ratio

This patch changes the colour of the navigation
links on the OPAC (Cart, Lists etc.) to improve
the contrast ration and make them easier to read.

To test:
1. Use an accessibility tool (e.g. Chrome's
   Lighthouse tool) to check the contrast
   ratio on the OPAC
2. Confirm that the navigation links have
   insufficient contrast
3. Apply the patch and rebuild the OPAC css:
   yarn build --view opac
4. Use the accessibility tool to confirm
   the contrast ratio meets  the minimum
   accessibility requirements
5. Check that the OPAC looks ok after the
   changes

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>
2 years agoBug 29056: Remove the demo functionality leftovers
Petro Vashchuk [Mon, 20 Sep 2021 09:36:02 +0000 (12:36 +0300)]
Bug 29056: Remove the demo functionality leftovers

Remove forgotten code of the old legacy demo functionality that was
removed from elsewhere except systempreferences, this code not only
serves no purpose but also is causing some troubles for our customers.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29049: Remove reference to optionloop
Jonathan Druart [Tue, 28 Sep 2021 12:17:36 +0000 (14:17 +0200)]
Bug 29049: Remove reference to optionloop

It's no longer used.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29049: (QA follow-up) Initialize uninitialized variable to prevent warning
Joonas Kylmälä [Sat, 25 Sep 2021 11:15:08 +0000 (11:15 +0000)]
Bug 29049: (QA follow-up) Initialize uninitialized variable to prevent warning

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29049: (QA follow-up) Remove unused variable
Joonas Kylmälä [Sat, 25 Sep 2021 10:54:44 +0000 (10:54 +0000)]
Bug 29049: (QA follow-up) Remove unused variable

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29049: (follow-up) Reduce number of line returns in page
Nick Clemens [Fri, 17 Sep 2021 16:18:09 +0000 (16:18 +0000)]
Bug 29049: (follow-up) Reduce number of line returns in page

While moving the dropdown to a block, I noticed the page size was very large when there are many holds

This patch chomps a large amoutn of whitespace, from the block and elsewhere and drecreased the paeg from about 400k lines to 25k lines for a record with ~200 holds

To test:
1 - Apply previous patch
2 - Load holds tab for a biblio
3 - Save the page as html from your browser, note the size of the file
4 - Apply patch this
5 - Reload and repeat
6 - Note the size is much smaller

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29049: Simplify holds priority dropdown logic on request.pl
Nick Clemens [Fri, 17 Sep 2021 13:59:25 +0000 (13:59 +0000)]
Bug 29049: Simplify holds priority dropdown logic on request.pl

This patch makes a few changes:
1 - If we are not splitting the queue ( HoldsSplitQueue == 'nothing' ) then
    there are no changes for 'virtual' vs 'actual' numbering
2 - If we are splitting the queue you cannot use the dropdown, so we do not need to process the options
3 - If the hold is 'found' we do not need to process the options
4 - We can simply use the 'last priority' to build the options, we do not need to process in the script
5 - We can use a block to build the options
6 - Remove a stray holds.index

To test:
 1 - Place 5 holds on a bib
 2 - 'Find' two of the holds i.e. check them in to set status to 'transit' or 'waiting'
 3 - View the holds page for the biblio
 4 - Inspect the priorty dropdown for the found holds, note they have options for 1-5 but are disabled
 5 - Note the dropdowns for other holds have options 1-5
 6 - Note options 4&5 in the dropdowns have no effect
 7 - Apply patch
 8 - Inspect the priority dopdowns on the found holds
 9 - Note they only show their found status
10 - Note the other dropdowns only show options 1-3
11 - Test with other HoldsSplitQueue options and HoldsSplitQueueNumbering
12 - When holds queue is split, no dropdowns should be active and should show only their current priority
13 - When  HoldsSplitQueueNumbering is 'virtual' the dropdown should be disabled and correctly count the number of unfound holds in the list

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
JK: Fixed grammar in commit title
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
JD: Remove trailing 'i'

Bug 29049: (QA follow-up) Remove excessive whitespace

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27461: Right pad with default elements for too short 008s
Marcel de Rooy [Thu, 19 Aug 2021 13:43:48 +0000 (13:43 +0000)]
Bug 27461: Right pad with default elements for too short 008s

Note that we treat the elements 18-34 as one block of elements,
since its subdivision may vary.
E.g. if you pass 24 characters to the form, it will use the first
18 chars (until the last complete element) and pad with default
elements from position 18-39.

Test plan:
[1] Go to addbiblio. Make sure that 008 is connected to the plugin.
[2] Backspace field 008 a bit, click on the plugin button.
[3] Verify that the last elements come from the default.
[4] Repeat for a few different lengths.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27461: Add tests for biblio_008
Marcel de Rooy [Thu, 19 Aug 2021 11:42:36 +0000 (11:42 +0000)]
Bug 27461: Add tests for biblio_008

Test plan:
Run  t/db_dependent/FrameworkPlugin.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27461: Move hardcoded value to module
Marcel de Rooy [Thu, 19 Aug 2021 09:52:14 +0000 (09:52 +0000)]
Bug 27461: Move hardcoded value to module

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27279: (bug 23916 follow-up) Fix issuer display on "Checkout history"
Jonathan Druart [Mon, 20 Sep 2021 09:07:11 +0000 (11:07 +0200)]
Bug 27279: (bug 23916 follow-up) Fix issuer display on "Checkout history"

Caused by
  commit 61a39b0dd52df4f6d743671823449e265d6add26
  Bug 23916: (QA follow-up) Adapt all the things to the new column and accessor names

- [% INCLUDE 'patron-title.inc' patron=checkout.issued_by %]

+ [% INCLUDE 'patron-title.inc' patron=checkout.issuer_id %]

It must have been patron=checkout.issuer as patron-title.inc is
expecting a Koha::Patron object, not a borrowernumber.

Test plan:
Turn RecordStaffUserOnCheckout on
Check an item out then in
Go to the biblio checkout history and confirm that the "Checked out by"
column contains the logged in librarian's name.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29026: Restore behavior when an empty barcode field is submitted in circulation
Fridolin Somers [Wed, 15 Sep 2021 07:33:47 +0000 (21:33 -1000)]
Bug 29026: Restore behavior when an empty barcode field is submitted in circulation

When preference CircAutoPrintQuickSlip is 'clear the screen', when an empty barcode field is submitted in circulation :

Before Bug 17845, behavior was to display empty circulation page (no patron selected).
Now behavior is displaying the circulation page of current patron.

I think previous behavior was used when scanner is used to clear form and wait for another patron card to be scanned.

Test plan :
1) Set system preference CircAutoPrintQuickSlip to 'clear the screen'
2) Go to a patron circulation page
3) Post form without a barcode
=> Check you go to circulation page with no patron selected
4) Set system preference CircAutoPrintQuickSlip to 'open a print quick slip window'
5) Go to a patron circulation page
6) Post form without a barcode
=> Check you go to print quick slip window with correct datas

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28927: (follow-up) remove rule on id=opacheader in opac CSS
Fridolin Somers [Wed, 8 Sep 2021 09:04:54 +0000 (23:04 -1000)]
Bug 28927: (follow-up) remove rule on id=opacheader in opac CSS

Actually this rule does nothing, it defines same background color as "body" : #fcf9fc

Test plan :
1) Without patch look at OPAC header
2) With patch OPAC header should have same background color

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28927: Fix id opacmainuserblock used twice in OPAC
Fridolin Somers [Tue, 31 Aug 2021 06:59:27 +0000 (20:59 -1000)]
Bug 28927: Fix id opacmainuserblock used twice in OPAC

Since preference OpacMainUserBlock is now an HTML customization,
there is actually an HTML tags with id="opacmainuserblock" and one with id="OpacMainUserBlock".
Same for OPACNavRight in opac-registration-confirmation.tt

This patch removed id from page to keep the one comming from HTML customization include.

Test plan :
1) Create an HTML customization for OpacMainUserBlock with some text
2) Go to OPAC main page
3) Check HTML code of the page
4) Check you see id="OpacMainUserBlock" once and not id="opacmainuserblock"
5) Same for id="opacnavright" in opac-registration-confirmation.tt

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29025: Don't prefill userid and password in user creation form
Didier Gautheron [Wed, 15 Sep 2021 05:32:34 +0000 (07:32 +0200)]
Bug 29025: Don't prefill userid and password in user creation form

Recent Firefox versions try to prefill userid and password with
logged in user credentials.

To test
1 - Log in staff as user foo password bar
2 - Save user and password in Firefox
3 - Log out
4 - Log in again, log in pop-up must be pre-filled
5 - Open Create a new patron form
6 - At least password field is pre-filled with logged in user's credentials
7 - Apply patch
8 - Redo 4 and 5
9 - Userid and password fields aren't prefilled

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>
2 years agoBug 29019: Restore eval call
Jonathan Druart [Tue, 28 Sep 2021 10:43:07 +0000 (12:43 +0200)]
Bug 29019: Restore eval call

But fix it (pass an arrayref). We need the eval to catch possible errors.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29019: Unable to delete HTML customization
Owen Leonard [Thu, 23 Sep 2021 21:14:52 +0000 (21:14 +0000)]
Bug 29019: Unable to delete HTML customization

This patch makes some corrections to additional contents to allow
content to be deleted. The wrong parameter was being passed to the
script. The script was also not handling multiple deletions correctly.

The patch also adds a "category" parameter to the delete operation so
that the page is redirected correctly.

The patch also changes some strings which referred to "news"
referencing operations which might be performed on news or on HTML
customizations, e.g.:

"Are you sure you want to delete the selected content?" instead of "Are
you sure you want to delete the selected news?"

To test, apply the patch and go to Tools -> News.

- Create multiple news items if necessary.
- Test the "Delete" button corresponding to a single news item:
  - Clicking the button should ask you to confirm.
  - Check that the wording of the message is correct.
  - After confirming the news item should be deleted.
  - Ideally, test on news items which are on the second page of the
    DataTable of news items.
- Test the process of deleting multiple news items at once:
  - Check the checkbox next to multiple items.
  - Click the "Delete selected" button at the bottom of the page.
  - Check that the wording of the confirmation message is correct.
  - After you confirm, the items should be deleted.
- Repeat these tests under Tools -> HTML customizations to confirm that
  redirects work correctly. After deleting an HTML customization you
  should be redirected back to the list of HTML customizations.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29076: Fetch the zebraqueue entries when not confirm
Nick Clemens [Wed, 22 Sep 2021 12:02:43 +0000 (12:02 +0000)]
Bug 29076: Fetch the zebraqueue entries when not confirm

This patch remove a check for confirm when fetching the entries
for possible deletion from the zebraqueue

Without this we die when we try to access the entries for counting

To test:
1 - perl  misc/cronjobs/cleanup_database.pl --sessions --zebraqueue 10 --list-invites --z3950 --logs 180 --mail 375 -v
2 - Dies
3 - Apply patch
4 - Repeat 1
5 - Success!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29073: DBRev 21.06.00.024
Jonathan Druart [Tue, 28 Sep 2021 13:11:24 +0000 (15:11 +0200)]
Bug 29073: DBRev 21.06.00.024

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate
Nick Clemens [Tue, 21 Sep 2021 15:15:15 +0000 (15:15 +0000)]
Bug 29073: Use 0 and 1 as values for DefaultHoldExpirationdate

DefaultHldexpirationDate is set in the pref screen to 'yes/no'

The code checks if the preference is 'true', 'no' is true

We should instead use 1/0

To test:
0 - Have a fresh devbox
1 - With syspref disabled, place a hold
2 - Note no expiration date set
3 - Enable the preference
4 - Place a hold and note the expiration date is set, good
5 - Disable the pref
6 - Place a hold and note the expiration date is set, bad
7 - Apply patch
8 - Update database
9 - Repeat 1-8, date not set when pref disabled

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>
2 years agoBug 28534: DBRev 21.06.00.023
Jonathan Druart [Tue, 28 Sep 2021 13:10:20 +0000 (15:10 +0200)]
Bug 28534: DBRev 21.06.00.023

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28534: Atomic update to fix existing installs
Nick Clemens [Mon, 14 Jun 2021 12:41:50 +0000 (12:41 +0000)]
Bug 28534: Atomic update to fix existing installs

Signed-off-by: David Nind <david@davidnind.com>
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>
2 years agoBug 28534: Fix engine for pending_offline_circulations table
Nick Clemens [Wed, 9 Jun 2021 13:46:16 +0000 (13:46 +0000)]
Bug 28534: Fix engine for pending_offline_circulations table

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Bug 28534: (follow-up) Don't adjust original DB update

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28803: (QA follow-up) Reinstate UNKNOWN_ERROR in templates
Martin Renvoize [Tue, 21 Sep 2021 16:08:22 +0000 (17:08 +0100)]
Bug 28803: (QA follow-up) Reinstate UNKNOWN_ERROR in templates

I can't see how this will ever get thrown, but as it's there we should
have the template handling included.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28803: (follow-up) Error details improvement
Martin Renvoize [Mon, 13 Sep 2021 09:18:46 +0000 (10:18 +0100)]
Bug 28803: (follow-up) Error details improvement

This patch updates the exceptions thrown by Koha::Email to include the
parameter that failed email validation and then updates the failure code
to include this parameter and finally display this field in the template.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28803: Add invalid email handling in _send_message_by_email
Martin Renvoize [Thu, 5 Aug 2021 07:00:19 +0000 (08:00 +0100)]
Bug 28803: Add invalid email handling in _send_message_by_email

This patch adds a try/catch block around the call to Koha::Email->create
to catch and handle invalid emails being passed in the parameters.

The message is marked as 'failed' with an error_code of 'INVALID_EMAIL'.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28803: Add unit tests
Martin Renvoize [Thu, 5 Aug 2021 07:43:32 +0000 (08:43 +0100)]
Bug 28803: Add unit tests

This patch updates Letters.t to confirm that invalid email addresses in
the message_queue should not throw an exception when sending mail but
instead set the status to failed and pass error details to the end user.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28870: non-FQDN addresses are valid
Jonathan Druart [Thu, 26 Aug 2021 15:21:32 +0000 (17:21 +0200)]
Bug 28870: non-FQDN addresses are valid

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
2 years agoBug 28870: Use Email::Address->parse
Jonathan Druart [Thu, 26 Aug 2021 15:13:41 +0000 (17:13 +0200)]
Bug 28870: Use Email::Address->parse

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
2 years agoBug 28870: Move email address validation to a specific class method
Jonathan Druart [Thu, 26 Aug 2021 15:12:58 +0000 (17:12 +0200)]
Bug 28870: Move email address validation to a specific class method

To ease testing and future changes if needed.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
2 years agoBug 28870: Remove traces of Email::Valid
Tomas Cohen Arazi [Fri, 20 Aug 2021 21:37:37 +0000 (18:37 -0300)]
Bug 28870: Remove traces of Email::Valid

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
2 years agoBug 28870: Use Email::Address to validate email addresses
Tomas Cohen Arazi [Fri, 20 Aug 2021 21:23:30 +0000 (18:23 -0300)]
Bug 28870: Use Email::Address to validate email addresses

This patch adds a new dependency, Email::Address. It is used in
Koha::Email to replace the current use of Email::Valid, which proved to
be problematic when it comes to UTF-8 characters.

Email::Address provides suitable regexes that -when used- keep our
tests passing, but also deal better with UTF-8 data.

To test:
1. Apply the regression tests patch
2. Notice the only change is that it tweaks a couple addresses so they
   contain umlauts and also have the "Description <address>" format that
   is used when sending carts.
3. Run:
   $ kshell
  k$ prove t/Koha/Email.t
=> FAIL: Tests fail! Things die because Email::Valid doesn't like the
   from we passed.
4. Run:
   $ sudo apt install libemail-address-perl
5. Apply this patch
6. Repeat 3
=> SUCCESS: Tests pass!
7. Try what is described in comment 1
=> SUCCESS: Things are back to normal
8. Sign off :-D
9. Send cookies

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
2 years agoBug 28870: Regression tests
Tomas Cohen Arazi [Fri, 20 Aug 2021 21:22:58 +0000 (18:22 -0300)]
Bug 28870: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
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>
2 years agoBug 28412: Add information about supported authentication methods
Tomas Cohen Arazi [Thu, 27 May 2021 20:02:35 +0000 (17:02 -0300)]
Bug 28412: Add information about supported authentication methods

This patch adds an initial text explaining the valid authentication
mechanisms Koha has for the API.

My first approach included information about the controlling sysprefs,
but I decided to remove it, as it is not usual for API consumers to be
presented such detailed internal information which is probably
confusing. We could add a link to the manual, but that's not the point I
think.

I've added an entry about error messages and how we thougth about them.
It is copied from Docker Engine's API docs.

This is my 2 cents.

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>
2 years agoBug 28536: Move translatable strings into overdrive.js
Owen Leonard [Tue, 8 Jun 2021 15:03:29 +0000 (15:03 +0000)]
Bug 28536: Move translatable strings into overdrive.js

This patch takes strings defined as variables in opac-bottom.inc for use
in overdrive.js and moves them to overdrive.js, wrapped in the
double-underscore translation function.

To test you must have valid credentials entered in system preferences
for the OverDrive API. Ideally you should test using a patron who has
holds and current checkouts in OverDrive.

Apply the patch and log in to the OPAC.

- On the "Your summary" page, open the "OverDrive Account" tab.
  - Log in to your OverDrive account.
  - The contents of the tab should display correctly, with correct
    labels for controls like "Log out of your OverDrive account", "Check
    in", "On hold", etc.
- Perform a catalog search which will return results also found in your
  OverDrive collection.
  - Open the OverDrive results page.
  - The page should display correctly, with correct labels on controls
    like "Check out" and "Place hold."

To test that the correct strings are translatable. In this example I'm
testing fr-FR:

 - Update a translation:

  > gulp po:update
  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file for the strings pulled from
  JavaScript  e.g.  misc/translator/po/fr-FR-messages-js.po
- Locate strings pulled from bootstrap/js/overdrive.js for
  translation, e.g.:

  koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js:124
  msgid "OverDrive account page"
  msgstr ""

- Edit the "msgstr" string however you want (it's just for testing)
- Install the updated translation:

  > perl translate install fr-FR

In the OPAC, switch to the language you're testing. Confirm that your
translated strings appear. In the above example, the string should
appear at the top of the "Overdrive Account" tab.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28356: Consolidate catalogue search box code
Nick Clemens [Fri, 14 May 2021 15:04:38 +0000 (15:04 +0000)]
Bug 28356: Consolidate catalogue search box code

To test:
1 - Apply patch
2 - Confirm searchign the catalog works from:
    Administration->Budgets
    Cataloging
    Circulation->Check in
    Administration->Cities and towns
    Acquisitions->{Vendor}->Contracts
    Administration->Currencies
    Administration->Circulation desks (requires  UseCirculationDesks preference)
    Home
    Tools->Notices and slips
    Patrons
    Adminstration
    Serials
    Acquisitions->Suggestions
    Administration->Z39.50/SRU servers

Signed-off-by: hakam <hakam@inlibro.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28022: Only show subfield "9" if subfield "a" is visible
Thomas Klausner [Mon, 29 Mar 2021 11:59:50 +0000 (13:59 +0200)]
Bug 28022: Only show subfield "9" if subfield "a" is visible

Amend the workaround (from but 2206) to only show subfield "9" in editor if
subfield "a" has the editor-visibility bit set.

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>
2 years agoBug 28898: (follow-up) Add context to some more occurrences of Term in course reserves
Katrin Fischer [Sat, 28 Aug 2021 13:01:01 +0000 (15:01 +0200)]
Bug 28898: (follow-up) Add context to some more occurrences of Term in course reserves

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28898: (follow-up) Remove comment lines before PROCESS statements
Katrin Fischer [Sat, 28 Aug 2021 12:54:29 +0000 (14:54 +0200)]
Bug 28898: (follow-up) Remove comment lines before PROCESS statements

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28898: Context for translation: term (word) vs. term (semester)
Caroline Cyr La Rose [Wed, 25 Aug 2021 20:23:02 +0000 (16:23 -0400)]
Bug 28898: Context for translation: term (word) vs. term (semester)

This patch add context to the term Term in the context of course reserves.

To test:
0- Apply patch
Set up course reserves
1- Enable UseCourseReserves
2- Create at least one authorized value for DEPARTMENT
3- Create at least one authorized value for TERM
4- Create a course
5- Add at least one item to the course

Check the terms:
6- Go to the OPAC
7- Go to Course reserves
** 8- In the list of courses, check the Term column heading
9- Go to the staff interface
10- Go to Course reserves
** 11- In the list of courses, check the Term column heading
12- Click on the course name
** 13- Check the Term line in the course description

Add a new language (fr-CA in the example, change for whatever language code you want)
14- In a terminal, run
gulp po:create --lang fr-CA
15- Then, run
gulp po:update --lang fr-CA
16- In system preferences, enable the new language in language and OpacLanguages
17- Switch the language in staff interface and OPAC

Change the translations
18- In your favourite text editor, open fr-CA-messages.po
19- Find the string 'msgctxt Semester'
20- Enter a word in msgstr
21- Save the file
22- In a terminal, go to misc/translator
23- Run
./translate install fr-CA

Check the translations
24- Redo the steps to check the terms (6-16) and make sure the terms in steps 8, 11, and 13 are changed for the word you put in step 20.
25- Optionally, check the following pages to make sure the terms are not the word you put in step 20 (these pages shouldn't have been changed)
- opac-tags (your account > your tags)
- opac-authorities (search for an authority in Authority search)
- review (tags in staff interface)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28340: Alphabetise metadata for notices
Andrew Isherwood [Thu, 13 May 2021 09:31:08 +0000 (10:31 +0100)]
Bug 28340: Alphabetise metadata for notices

This commit sorts metadata by key prior to preparing a notice with it

Test plan:

- Do not apply patch
- Create a report with the following SQL:
  SELECT * FROM message_queue;
- Create an ILL request with plenty of metadata
- Go to "Manage request"
- Send a notice to a patron
- Run the report created earlier

=> TEST:
- Observe that the metadata is in random order

- Apply the patch
- Create an ILL request with plenty of metadata
- Go to "Manage request"
- Send a notice to a patron
- Run the report created earlier

=> TEST:
- Observe that the metadata is now sorted alphabetically by key

Signed-off-by: Jill Tivey <Jill.Tivey@sasa.gov.scot>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 28340: Unit test
Nick Clemens [Fri, 30 Jul 2021 15:52:18 +0000 (15:52 +0000)]
Bug 28340: Unit test

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
JD amended patch: remove commented line

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27170: Fix bug fix
Andrew Isherwood [Fri, 18 Jun 2021 10:10:01 +0000 (11:10 +0100)]
Bug 27170: Fix bug fix

<sigh> This commit fixes the incorrect bug fix from the previous commit

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2 years agoBug 27170: Fix bug with undefined 'links'
Andrew Isherwood [Fri, 18 Jun 2021 09:59:01 +0000 (10:59 +0100)]
Bug 27170: Fix bug with undefined 'links'

If a row object doesn't have a 'links' property, calling 'length' on it
will fail. This commit fixes this.

Signed-off-by: Holly Cooper <hc@interleaf.ie>
Signed-off-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>