]> git.koha-community.org Git - koha.git/log
koha.git
2 years agoBug 30360: Add helper methods to Koha::BackgroundJobs
Tomas Cohen Arazi [Fri, 25 Mar 2022 14:52:39 +0000 (11:52 -0300)]
Bug 30360: Add helper methods to Koha::BackgroundJobs

This patch adds some helper methods to ease writing background jobs, and
also making it more consistent/solid.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/BackgroundJob.t
=> SUCCESS: Tests pass. The methods have the expected behaviour.
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 30693: Javascript broken on request.pl
Owen Leonard [Thu, 5 May 2022 14:21:19 +0000 (14:21 +0000)]
Bug 30693: Javascript broken on request.pl

The holds page in the staff interface has some JavaScript relating to
Bootstrap tabs, but the tabs are not always present on the page. This
leads to a JS error after you have selected the patron for the hold.

This patch adds a check for the tabs container element before executing
the code.

To test, apply the patch and locate a bibliographic record on which to
place a hold.

- On the initial holds screen should see tabs for "Patrons" and "Clubs."
  Both should work correctly.
- Select a patron to place the hold for.
- On the page where you enter hold details (pickup library, hold
  expiration, etc.) there should be no JavaScript error in the console.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 30674: x-koha-override should use collectionFormat: csv
Tomas Cohen Arazi [Tue, 3 May 2022 18:04:54 +0000 (15:04 -0300)]
Bug 30674: x-koha-override should use collectionFormat: csv

This patch makes this header parameter rely on the OpenAPI spec to
validate and document the available options.

Right now the only place is in POST and PUT /holds.

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t \
           t/db_dependent/api/v1/auth_authenticate_api_request.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass!
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 30663: Implement overrides handling in POST /suggestions
Tomas Cohen Arazi [Tue, 3 May 2022 14:23:23 +0000 (11:23 -0300)]
Bug 30663: Implement overrides handling in POST /suggestions

This patch implements the override checks in the controller as expected
by the previous patch.

To test:
1. Apply this bug patches up to 'Add x-koha-override options...'
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/suggestions.t
=> FAIL: Tests fail! The controller doesn't care about overrides or
         sysprefs about suggestions limits.
3. Apply this patch
4. Repeat 2
=> SUCCESS: Things work!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 30663: Add x-koha-override options to /suggestions
Tomas Cohen Arazi [Tue, 3 May 2022 14:20:46 +0000 (11:20 -0300)]
Bug 30663: Add x-koha-override options to /suggestions

This patch adds the x-koha-override header parameter to the route that
is used to create suggestions, POST /suggestions.

The idea is that adding suggestions will be rejected under certain
conditions unless x-koha-override is passed with appropriate values. The
added overrides are:

* any
* max_total
* max_pending

Tests are added for the expected behavior.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 30663: Add Koha::Suggestions helper methods
Tomas Cohen Arazi [Tue, 3 May 2022 14:18:10 +0000 (11:18 -0300)]
Bug 30663: Add Koha::Suggestions helper methods

This patch adds the following helper methods:

* filter_by_pending
* filter_by_suggested_days_range

This methods follow basically what's done in opac-suggestions.pl
I chose 'pending' as opposed to 'open' to follow what we use in the UI
which might be the case because of being more accurate for end users.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 29616: (QA follow-up) Use /public endpoints on OPAC
Martin Renvoize [Thu, 5 May 2022 12:11:32 +0000 (13:11 +0100)]
Bug 29616: (QA follow-up) Use /public endpoints on OPAC

This patch updates the new modal to use the /public version of the
libraries endpoint for fetching library data. This ensure the feature
works as expected prior to patron login.

2 years agoBug 28998: (QA follow-up) Silence some useless warnings
Tomas Cohen Arazi [Thu, 5 May 2022 11:39:50 +0000 (08:39 -0300)]
Bug 28998: (QA follow-up) Silence some useless warnings

This patch fixes the tests and also silences some useless warnings about
REMOTE_ADDRESS not being defined.

A test is added for a legit warning that is thrown.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 28998: Fix Auth.
Jonathan Druart [Thu, 5 May 2022 11:28:19 +0000 (13:28 +0200)]
Bug 28998: Fix Auth.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2 years agoBug 30577: Fix a missing closing tag
Nick Clemens [Thu, 21 Apr 2022 11:12:58 +0000 (11:12 +0000)]
Bug 30577: Fix a missing closing tag

This didn't affect table display, but when there was a biblioloo.warn
we were not closing the first <td> tag

Confirm multi-holds table loads correctly when one (or more) records cannot be held

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30577: Move item specific pickup locations to the left
Nick Clemens [Thu, 21 Apr 2022 11:02:54 +0000 (11:02 +0000)]
Bug 30577: Move item specific pickup locations to the left

When placing holds, staff will set the pickup location at the top,
choose an item, then place the hold.
It is easy not to notice the item specific locations dropdown.

This patch moves it in line with the other selction areas on the request screen.

To test:
 1 - Find a record on staff client, place hold
 2 - Select a patron to load the request screen
 3 - Note the location dropdown for next available hold
 4 - Note the item specific locations on the far right
 5 - Apply patch
 6 - Reload the page
 7 - Note the item specific location dropdowns are now moved to the left
 8 - Place the hold, verify it works with the dropdowns
 9 - Verify title levelholds still work as expected
10 - Verify multi-holds still work

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Rebecca Coert <rcoert@arlingtonva.us>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30475: Convert tools pages tabs to Bootstrap (part 2)
Owen Leonard [Wed, 6 Apr 2022 18:00:14 +0000 (18:00 +0000)]
Bug 30475: Convert tools pages tabs to Bootstrap (part 2)

This patch converts jQueryUI tabs on three tools templates to Bootstrap
tabs. The patch contains indentation changes, so diff accordingly.

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

- You should see at least two tabs, "Export bibliographic records" and
  "Export authority records."
- Confirm that they look correct and work correctly.

Go to Tools -> Batch patron modification.

- Check the "By card number," "By borrowernumber," and "By patron list"
  tabs.

Go to Tools -> Overdue notice/status triggers.

 - Check the "First," "Second," and "Third" tabs.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30474: (follow-up) Tie editor initialization to tab activation
Owen Leonard [Tue, 12 Apr 2022 17:26:03 +0000 (17:26 +0000)]
Bug 30474: (follow-up) Tie editor initialization to tab activation

The way Bootstrap tabs manipulate the DOM, CodeMirror has problems
initializing correctly, I think because of redraws and CodeMirror's
attemps to position things absolutely.

The solution seems to be to wait until after a Bootstrap tab has
activated before initializing the CodeMirror instance. This patch
implements that, along with a check to prevent double-initializing the
same textarea.

I've also made a similar change to the way TinyMCE is initialized, which
I hope will help with the issue of the editor not always loading
correctly.

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

- Test creation and editing of HTML customization entries using both
  the default editor and the text editor (Edit -> Edit with text
  editor).
- Verify that the editor (CodeMirror or TinyMCE) loads correctly and
  looks correct, both upon page load and upon switching tabs between
  "Default" and other language tabs
- Verify that your edits are saved correctly.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30474: Convert tools pages tabs to Bootstrap (part 1)
Owen Leonard [Wed, 6 Apr 2022 16:52:39 +0000 (16:52 +0000)]
Bug 30474: Convert tools pages tabs to Bootstrap (part 1)

This patch converts jQueryUI tabs on three tools templates to Bootstrap
tabs.

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

- Click "New entry."
- On the entry form you should see two tabs, "Default" and "English
  (en)"
- The tabs should look correct and work correctly.

Go to Tools -> Batch record deletion.

 - Test the three tabs: "Upload a file", "Select a list of records", and
   "Enter a list of record numbers."

Go to Tools -> Batch record modification.

 -  Test the same three tabs on this page.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30473: Convert suggestions page tabs to Bootstrap
Owen Leonard [Wed, 6 Apr 2022 15:35:47 +0000 (15:35 +0000)]
Bug 30473: Convert suggestions page tabs to Bootstrap

This patch updates the suggestions page to use Bootstrap tabs
instead of jQueryUI.

To test you should have multiple suggestions from different libraries,
different item types, and different statuses.

Apply the patch and go to Suggestions.

- Suggestions should initially be displayed in tabs by status.
- Confirm that the tabs look correct and work correctly.
- Test that tabs work correctly for each option in the "Organize by"
  dropdown in the left-hand sidebar.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30180: (follow-up) Add temporary deprecation warning
Tomas Cohen Arazi [Fri, 25 Feb 2022 08:54:11 +0000 (05:54 -0300)]
Bug 30180: (follow-up) Add temporary deprecation warning

This patch adds a temporary deprecation warning to let users know the
plugin needs to get updated before the next release.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Plugins/Holds_hooks.t
=> SUCCESS: Tests pass, warning is displayed
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30180: Add 'placed' after_hold_hook
Tomas Cohen Arazi [Fri, 25 Feb 2022 08:50:20 +0000 (05:50 -0300)]
Bug 30180: Add 'placed' after_hold_hook

This patch adds a new 'after_hold_action' hook, that is called with the
'placed' action parameter.

To test:
1. Apply the unit tests patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Plugins/Holds_hooks.t
=> FAIL: Boo, the hook is not called
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30180: Unit tests
Tomas Cohen Arazi [Fri, 25 Feb 2022 08:49:56 +0000 (05:49 -0300)]
Bug 30180: Unit tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29698: Make items available for PREDUEDGST
Jonathan Druart [Wed, 15 Dec 2021 09:09:22 +0000 (10:09 +0100)]
Bug 29698: Make items available for PREDUEDGST

With this patch you can access items using:
Number of items [% items.count %]
[% FOR i IN items %]
    [% SET checkout = i.checkout %]
    Item [% i.itemnumber %] is due on [% checkout.date_due | $KohaDates %]
[% END %]

== test plan ==
1. Add the following to PREDUEDGST and DUEDST:
Number of items [% items.count %]
[% FOR i IN items %]
    [% SET checkout = i.checkout %]
    Item [% i.itemnumber %] is due on [% checkout.date_due | $KohaDates %]
[% END %]

2. Find a patron and set there messaging prefs 'Item due' and 'Advanced
  notices' so they get an email and 'digest only'.
  On 'Advanced notices' set Days in advance to 1.
3. Check some things out to a patron and make them due tomorrow.
4. perl /kohadevbox/koha/misc/cronjobs/advance_notices.pl -v -c
5. Check the patrons notices and make sure the PREDUEDGST looks right.
6. Check some things out to a patron and make them due today.
7. Repeat 4.
8. Check the patrons notices and make sure the DUEDGST looks right.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30549: Replace the use of jQueryUI Accordion on pending patron updates page
Owen Leonard [Thu, 14 Apr 2022 18:02:22 +0000 (18:02 +0000)]
Bug 30549: Replace the use of jQueryUI Accordion on pending patron updates page

This patch updates the pending patron updates page to use Bootstrap
collapse instead of jQueryUI.

This patch contains whitespace changes, so view the diff with this in
mind.

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

- If necessary, log into the OPAC and submit an update via the "Your
  personal details" page. Ideally do this for two or more patrons.
- In the staff client, follow the "Patrons requesting modifications"
  link.
- On the "Update patron records" page you should see the headings
  representing each of the patrons with pending updates. The first panel
  should be expanded.
- Confirm that the panels expand and collapse correctly.
- Follow the "Patron details" link for one of these patrons.
- Click the "Review pending modifications" link on the patron detail
  page.
- When the update page opens that patron's panel should be expanded.

Signed-off-by: Lisette Scheer <lisetteslatah@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28138: DBRev 21.12.00.047
Fridolin Somers [Wed, 4 May 2022 20:15:14 +0000 (10:15 -1000)]
Bug 28138: DBRev 21.12.00.047

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28138: (QA follow-up) Link system preference in new system preference description
Katrin Fischer [Mon, 25 Apr 2022 16:39:37 +0000 (16:39 +0000)]
Bug 28138: (QA follow-up) Link system preference in new system preference description

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28138: (QA follow-up) Slight rephrase of system preference text
Katrin Fischer [Mon, 25 Apr 2022 16:03:37 +0000 (16:03 +0000)]
Bug 28138: (QA follow-up) Slight rephrase of system preference text

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28138: (follow-up) Add empty option to payment type selection
Owen Leonard [Thu, 21 Apr 2022 18:17:41 +0000 (18:17 +0000)]
Bug 28138: (follow-up) Add empty option to payment type selection

This patch adds an empty <option> to the "Payment type" selection when
paying fine. This forces the user to actively make a selection. I've
also added the text "None selected" to the other empty <option> on the
page for consistency.

To test, apply the patch and test the pay fine interface with and
without the RequirePaymentType preference enabled. When enabled the
payment type should be required and it should default to "None
selected."

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28138: (follow-up) New atomic update
Fridolin Somers [Fri, 11 Mar 2022 23:06:45 +0000 (13:06 -1000)]
Bug 28138: (follow-up) New atomic update

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28138: Add syspref to make the payment type required
Julian Maurice [Tue, 13 Apr 2021 08:06:24 +0000 (10:06 +0200)]
Bug 28138: Add syspref to make the payment type required

The payment type is already required when using the cash register
feature, but some users want to force selecting a payment type even
when cash registers are not used

The new system preference name is RequirePaymentType

Test plan:
1. Apply patch and run updatedatabase.pl
2. Disable UseCashRegisters and RequirePaymentType sysprefs
3. Create some authorised values in PAYMENT_TYPE category if needed
4. Create a manual invoice and pay it. Notice that the payment type is
   optional.
5. Enable RequirePaymentType
6. Create a manual invoice and pay it. Notice that the payment type is
   now required.
7. Enable UseCashRegisters and verify that the payment type is always
   required, even if RequirePaymentType is disabled

Rebased by Thibaud Guillot <thibaud.guillot@biblibre.com> on 21-12-02

Signed-off-by: shiyao <shiyao@inlibro.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30600: Fix recall reasons for branch transfers
Aleisha Amohia [Wed, 27 Apr 2022 02:41:12 +0000 (02:41 +0000)]
Bug 30600: Fix recall reasons for branch transfers

When a recall triggers a branch transfer, the reason for the transfer is
'Recall'.

When a transfer is cancelled that was triggered by a recall, depending
on where it is cancelled, will use the 'Manual' or 'CancelRecall'
cancellation reasons.

This patch ensures branchtransfers.cancellation_reason adds 'CancelRecall',
and branchtransfers.reason adds 'Recall' as options.

Sponsored-by: Catalyst IT
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30167: (follow-up) Compare dt objects
Nick Clemens [Wed, 4 May 2022 11:38:08 +0000 (11:38 +0000)]
Bug 30167: (follow-up) Compare dt objects

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30167: (follow-up) Return a hash with soonest_renew_date
Nick Clemens [Fri, 29 Apr 2022 12:58:44 +0000 (12:58 +0000)]
Bug 30167: (follow-up) Return a hash with soonest_renew_date

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30167: Use returned renewal date rather than fetching
Nick Clemens [Wed, 23 Feb 2022 16:09:07 +0000 (16:09 +0000)]
Bug 30167: Use returned renewal date rather than fetching

This patch updates the three scripts that fetched the soonest renewal date
to use the return from CanBookBeRenewed

To test:
1 - Set a circulation rule with a 'no renewal before' set to 3, loan length set to 5
2 - Check out an item to a patron that uses this rule
3 - Verify the checkouts for the patron show the correct 'No renewal before' date
4 - Sign in to the patron's opac account
5 - Verify the item shows it cannot be renewed, and shows the correct date
6 - Go to Circulation->Renew
7 - Attempt to renew using barcode
8 - Confirm error shows the soonest renewal date

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30167: Return soonest renewal date when renewal is to soon
Nick Clemens [Wed, 23 Feb 2022 16:01:22 +0000 (16:01 +0000)]
Bug 30167: Return soonest renewal date when renewal is to soon

This patch adds an 'info' return param to CanBookBeRenewed and passes
the soonest renewal date when returning too_soon errors

To test:
1 - prove -v t/db_dependent/Circulation.t

Fix whitespace

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28998: (QA follow-up) Improve output on error
Martin Renvoize [Fri, 22 Apr 2022 09:46:06 +0000 (10:46 +0100)]
Bug 28998: (QA follow-up) Improve output on error

This patch updates the output_and_exit call to instead pass an error
parameter in the template and use it to display the warning instead of
the rest of the page content in the 'Manage two-factor authentication'
page.

This allows for translation and makes the page adhere to normal
practices.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28998: (follow-up) Check missing encryption key in script and module
Marcel de Rooy [Fri, 22 Apr 2022 08:04:51 +0000 (08:04 +0000)]
Bug 28998: (follow-up) Check missing encryption key in script and module

Script prints a warning.
Module raises an exception.
Unit test added.

Test plan:
Run t/db_dependent/Koha/Encryption.t
Run t/db_dependent/Koha/Auth/TwoFactorAuth.t
Remove entry and check script.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28998: (follow-up) Add warning on about for missing key
Marcel de Rooy [Fri, 22 Apr 2022 07:33:28 +0000 (07:33 +0000)]
Bug 28998: (follow-up) Add warning on about for missing key

Test plan:
Make sure that you have no encryption_key in koha-conf.
Check about page, system information tab.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28998: (QA follow-up) POD Fix
Martin Renvoize [Thu, 21 Apr 2022 16:11:33 +0000 (17:11 +0100)]
Bug 28998: (QA follow-up) POD Fix

This POD fix keeps the QA script happy

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28998: Add Crypt::CBC dependency
Jonathan Druart [Fri, 10 Sep 2021 15:18:51 +0000 (17:18 +0200)]
Bug 28998: Add Crypt::CBC dependency

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28998: Add encryption_key to the config file
Jonathan Druart [Fri, 10 Sep 2021 15:16:37 +0000 (17:16 +0200)]
Bug 28998: Add encryption_key to the config file

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28998: Adjust Selenium test
Jonathan Druart [Fri, 10 Sep 2021 09:27:33 +0000 (11:27 +0200)]
Bug 28998: Adjust Selenium test

Test plan:
Run t/db_dependent/selenium/authentication_2fa.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28998: (follow-up) Apply changes to TwoFactorAuth module and script
Marcel de Rooy [Thu, 14 Apr 2022 13:24:39 +0000 (13:24 +0000)]
Bug 28998: (follow-up) Apply changes to TwoFactorAuth module and script

Test plan:
Run t/db_dependent/Koha/Auth/TwoFactorAuth.t
Walk thru cycle register - logout/login - deregister - logout/login.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28998: (follow-up) Add Patron->encode_secret and ->decoded_secret
Marcel de Rooy [Thu, 14 Apr 2022 12:35:30 +0000 (12:35 +0000)]
Bug 28998: (follow-up) Add Patron->encode_secret and ->decoded_secret

Test plan:
Run t/db_dependent/Koha/Patron.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 28998: Introduce Koha::Encryption
Jonathan Druart [Fri, 10 Sep 2021 09:27:33 +0000 (11:27 +0200)]
Bug 28998: Introduce Koha::Encryption

Test plan:
Run t/db_dependent/Koha/Encryption.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
[AMENDED] Added copyright line to module.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 22785: (follow-up) no additionalProperties
Nick Clemens [Wed, 4 May 2022 11:17:22 +0000 (11:17 +0000)]
Bug 22785: (follow-up) no additionalProperties

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2 years agoBug 30536: Fix Query.t Unit Test
Martin Renvoize [Tue, 3 May 2022 07:06:41 +0000 (08:06 +0100)]
Bug 30536: Fix Query.t Unit Test

The stash_embed method no longer validates the query so this patch drops
the validation tests and instead just focuses on varifying the correct
output structure of the stash after the method call.

We have not lost validation however, it now happens only once at the
OpenAPI level and tests are present in t/db_dependent/api/v1/query.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30536: (QA follow-up) POD + Spec Consistency
Martin Renvoize [Fri, 29 Apr 2022 15:43:36 +0000 (16:43 +0100)]
Bug 30536: (QA follow-up) POD + Spec Consistency

Well spotted, this patch fixes the specs to be consistent and adds a
little detail to the POD as requested.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30536: Update spec files
Martin Renvoize [Thu, 14 Apr 2022 15:06:24 +0000 (16:06 +0100)]
Bug 30536: Update spec files

This patch removes superflous x-koha-embed defintions at the top level
of the endpoint specifications. It also replaces a few x-koha-embeds at
the top level with parameter lists where this had been missed in
preceeding patches.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30536: Remove validation overhead
Martin Renvoize [Thu, 14 Apr 2022 12:47:06 +0000 (13:47 +0100)]
Bug 30536: Remove validation overhead

With the introduction of proper validation of collection headers in
OpenAPI we no longer need to do our own validation here.

This patch removes the early validation of x-koha-embed headers in
preference to letting OpenAPI do it once and only once instead.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30536: Refer to parameters enum
Martin Renvoize [Thu, 14 Apr 2022 11:22:27 +0000 (12:22 +0100)]
Bug 30536: Refer to parameters enum

This patch updates the stash_embed method to use the parameters hash
enum instead of the top level x-koha-embed custom definition. This way
we can remove the requirement for defining this list twice.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30536: Unit tests
Tomas Cohen Arazi [Thu, 14 Apr 2022 15:07:49 +0000 (12:07 -0300)]
Bug 30536: Unit tests

This patch adds tests to make sure there's no behavior change regarding
error conditions. When requests include wrong x-koha-embed values, a 400
error should be returned, both in our original implementation or relying
on the Mojolicious::Plugin::OpenAPI features.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/query.t
=> SUCCESS: Tests pass
3. Apply the rest of the patches
4. Repeat 2
=> SUCCESS: Tests still pass
5. 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: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30632: Fix report author display in list of saved reports
Owen Leonard [Thu, 28 Apr 2022 15:17:35 +0000 (15:17 +0000)]
Bug 30632: Fix report author display in list of saved reports

This patch removes whitespace in the template around the markup of
report author first name and surname. This prevents unwanted spaces in
the output.

To test, apply the patch and go to Reports -> Use saved.

The display of report author should be like this:

Leonard, Owen (123456)

Instead of Leonard , Owen (20375)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 10517: (QA follow-up) No need to remove second true
Marcel de Rooy [Fri, 29 Apr 2022 09:18:24 +0000 (09:18 +0000)]
Bug 10517: (QA follow-up) No need to remove second true

This is just theoretical, but by removing the second true you
could end the script on another error.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 10517: Use `DROP USER IF EXISTS` and remove ` || true`.
Rudolf Byker [Wed, 8 Jan 2020 09:20:02 +0000 (11:20 +0200)]
Bug 10517: Use `DROP USER IF EXISTS` and remove ` || true`.

When restoring a Koha instance, and the database user does not exist, an error is shown,
although it is prevented from stopping the script by ` || true`. This patch removes the
` || true` guard, and rather uses `DROP USER IF EXISTS` which does exactly what one
would expect, without confusing error messages, whether the user existed or not.

To test:
1) Assume your Koha instance is called `asdf`.
1) Export the Koha instance using `koha-dump`.
2) Remove the instance completely using `koha-remove`.
3) Import it again using `koha-restore`.
4) No error should be shown, and the import should work. There was NO user to drop, therefore `DROP USER IF EXISTS` did nothing.
5) A database user called `koha_asdf` should exist, and have all privileges on the database of the same name.
6) Remove the instance again using `koha-remove`.
7) Now create a database user in MySQL called `koha_instance` where instance is the name of your dumped koha instance.
8) Import your koha instance again using `koha-restore`.
9) Again, no error should be shown, and the import should work. There WAS a user to drop, therefore `DROP USER IF EXISTS` dropped the user before creating a new one.
10) Again, a database user called `koha_asdf` should exist, and have all privileges on the database of the same name.

Sponsored-by: Reformational Study Centre
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30143: OAI-PMH: Fix SQL query used to fetch deleted records
Ere Maijala [Mon, 21 Feb 2022 14:07:00 +0000 (16:07 +0200)]
Bug 30143: OAI-PMH: Fix SQL query used to fetch deleted records

The query was missing the "ORDER BY" and "LIMIT" clauses, which could make retrieve a wrong set of records.

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29537: Remove unnecessary if-else checks for soonest renew date
Nick Clemens [Thu, 24 Mar 2022 11:42:55 +0000 (11:42 +0000)]
Bug 29537: Remove unnecessary if-else checks for soonest renew date

GetSoonestRenewDate() calculates the renewal due date now also
correctly for auto-renewals after the fixes from bug 29476 so we don't
have to add any if-else checks because of it being buggy anymore.

To test:
 1) prove t/db_dependent/Circulation.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 22785: DBRev 21.12.00.046
Fridolin Somers [Tue, 3 May 2022 20:38:04 +0000 (10:38 -1000)]
Bug 22785: DBRev 21.12.00.046

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 22785: Update DBIC schema
Fridolin Somers [Tue, 3 May 2022 20:37:04 +0000 (10:37 -1000)]
Bug 22785: Update DBIC schema

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 22785: (follow-up) Update contentType in request
Nick Clemens [Thu, 28 Apr 2022 10:28:58 +0000 (10:28 +0000)]
Bug 22785: (follow-up) Update contentType in request

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 22785: (QA follow-up) Remove superflous spec files
Martin Renvoize [Wed, 27 Apr 2022 16:31:03 +0000 (17:31 +0100)]
Bug 22785: (QA follow-up) Remove superflous spec files

We don't need these any more.. I think they crept back in during
rebases

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 22785: (follow-up) Fix translatability
Nick Clemens [Mon, 20 Dec 2021 14:54:59 +0000 (14:54 +0000)]
Bug 22785: (follow-up) Fix translatability

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 22785: (follow-up) Don't sort by chosen and fix selection of matches
Nick Clemens [Wed, 19 May 2021 10:54:49 +0000 (10:54 +0000)]
Bug 22785: (follow-up) Don't sort by chosen and fix selection of matches

Previously the sorting took 'chosen' into account and would move a selected match to the
top on next load - it is better to preserve the same sorting every time

When loading matches the 'cehcked' variable was not being cleared, so multiple matches were
being marked 'checked="checked"'. Fixing this ensures the correct record displays as chosen

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 22785: Update Schema for boolean
Nick Clemens [Mon, 4 Jan 2021 14:23:52 +0000 (14:23 +0000)]
Bug 22785: Update Schema for boolean

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 22785: Allow option to choose which record match is applied during import
Nick Clemens [Mon, 31 Aug 2020 17:01:24 +0000 (17:01 +0000)]
Bug 22785: Allow option to choose which record match is applied during import

This patchset adds the display of all matches found during import to the import management screen

A staff member with the permission to manage batches will be able to select for any individual record which match, or none, should be used during import

To test:
1 - Import a batch of records or export existing records from your catalog
2 - Import the file (again) and select a matching rule that will find matches
3 - Note that you now have radio buttons allowing you to select a record, or none
4 - Test scenarios:
    I - When 'Action if matching record found' is 'Ignore'
        a - Imported record ignored if match is selected
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    II - When 'Action if matching record found' is 'Replace'
        a - The chosen record is the one overlayed (you can edit the chosen record before importing to confirm)
        b - 'Action if no match found' followed if no match is selected (Ignore matches)
    III - When 'Action if matching record found' is 'Add incoming record'
        a - Record is added regardless of matches
5 - Confirm 'Diff' 'View' links work as expected
6 - Confirm that after records are imported the radio buttons to choose are disabled

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Bug 22785: API files

Signed-off-by: Ben Daeuber <bdaeuber@cityoffargo.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30466: Compiled CSS
Fridolin Somers [Tue, 3 May 2022 20:17:52 +0000 (10:17 -1000)]
Bug 30466: Compiled CSS

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30436: Convert article requests tabs to Bootstrap
Owen Leonard [Fri, 1 Apr 2022 15:50:32 +0000 (15:50 +0000)]
Bug 30436: Convert article requests tabs to Bootstrap

This patch converts the jQuery tabs on the article requests page to
Bootstrap.

To test you should have the "ArticleRequests" system preference
enabled. If necessary, create some article requests and mark some
"Pending," some "Processing," and leave some new.

- Apply the patch and go to Circulation -> Article requests.
- The page should show three tabs: New, Pending, and Processing.
- The tabs should look correct and work correctly.
- The DataTables under each tab should work correctly.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30466: Convert serials pages tabs to Bootstrap
Owen Leonard [Wed, 20 Apr 2022 12:53:27 +0000 (12:53 +0000)]
Bug 30466: Convert serials pages tabs to Bootstrap

This patch modifies three serials templates in order to replace jQueryUI
tabs with Bootstrap tabs.

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 Serials.
- Perform a serials search which will return one or more results.
- On the search results page you should see an Open and Closed tab.
- The tabs should look correct and work correctly.
- Confirm that "Select all" and "Clear all" controls work correctly in
  each tab.

- Click one of the search results to view the details for that
  subscription.
- You should see tabs for Information, Planning, Issues, and Summary.
  You may also see an Acquisition details tab depending on your data.

- In the sidebar menu click "Serial collection."
- On this page you should see tabs corresponding to each year the serial
  has been received.
- Under each tab the "Select all" and "Clear all" controls should work
  correctly in the context of that tab. Other controls should apply to
  all tabs.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 14242: DBRev 21.12.00.045
Fridolin Somers [Tue, 3 May 2022 20:10:39 +0000 (10:10 -1000)]
Bug 14242: DBRev 21.12.00.045

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 14242: (QA follow-up) Update hint on suggestion form: 2016 > 2022
Katrin Fischer [Thu, 28 Apr 2022 14:45:21 +0000 (14:45 +0000)]
Bug 14242: (QA follow-up) Update hint on suggestion form: 2016 > 2022

First patches were written in 2015 - so I think we can safely
move the hint closer to the present.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 14242: (QA follow-up) Fix alphatic order of sysprefs.sql
Katrin Fischer [Thu, 28 Apr 2022 14:37:01 +0000 (14:37 +0000)]
Bug 14242: (QA follow-up) Fix alphatic order of sysprefs.sql

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 14242: (follow-up) Clear all text input fields
Aleisha Amohia [Wed, 2 Mar 2022 02:21:01 +0000 (15:21 +1300)]
Bug 14242: (follow-up) Clear all text input fields

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 14242: (follow-up) Hide autofil when syspref disabled, clear ISBN
Aleisha Amohia [Tue, 28 Sep 2021 02:24:48 +0000 (15:24 +1300)]
Bug 14242: (follow-up) Hide autofil when syspref disabled, clear ISBN

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 14242: (follow-up) Format copyright date before plugged into form
Aleisha Amohia [Thu, 18 Feb 2021 00:50:38 +0000 (13:50 +1300)]
Bug 14242: (follow-up) Format copyright date before plugged into form

This patch formats the copyright date so that only the year shows before
plugging the formatted version into the form.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 14242: Use ISBN-field to automatically fill out purchase suggestions
Martin Stenberg [Wed, 26 Aug 2015 18:22:30 +0000 (20:22 +0200)]
Bug 14242: Use ISBN-field to automatically fill out purchase suggestions

Add new jQuery plugin "autofill" which transforms selected element(s)
into search fields for Google Books API and automatically fills
requested fields with search result.

Use in OPAC purchase suggestions to automatically fill out fields when
entering ISBN-number.

Test plan:
1. Run updatedatabase.pl
2. Enable system precference "OPACSuggestionAutoFill"
3. Log into OPAC and go to purchase suggestions page
4. Write a valid ISBN (such as 0-9690745-2-2 or 978-1-78416-110-1) into
   the ISBN field and click the 'search google books' button, or unfocus
   the field.
5. Title, Author, Publisher, publication year and Item Type fields should now be filled
   automatically.
6. Press "clear form" to undo - should restore all fields that the API pull
   filled to empty

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30550: (QA follow-up) Clear cleartext remainders
Marcel de Rooy [Tue, 3 May 2022 12:25:50 +0000 (12:25 +0000)]
Bug 30550: (QA follow-up) Clear cleartext remainders

Clear enough?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30550: OPAC recalls page tries to use jQueryUI datepicker
Owen Leonard [Thu, 14 Apr 2022 18:27:47 +0000 (18:27 +0000)]
Bug 30550: OPAC recalls page tries to use jQueryUI datepicker

This patch updates the recalls page in the OPAC so that it uses
Flatpickr for the "Recall not needed after" field.

To test apply the patch and enable the UseRecalls preference if
necessary. You made need to update your circulation rules as well,
defining some default values for recalls.

- Log in to the OPAC.
- Locate a bibliographic record which has one item and that item is
  checked out.
- Click "Place recall."
- The "Recall not needed after" field should be styled correctly, and
  clicking it should trigger the calendar popup.
- You should be limited to selections after today's date.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27344: Add error detail if something wrong happened
Jonathan Druart [Wed, 6 Apr 2022 14:11:29 +0000 (16:11 +0200)]
Bug 27344: Add error detail if something wrong happened

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27344: Fix call to update_index with invalid ids
Jonathan Druart [Wed, 6 Apr 2022 12:38:04 +0000 (14:38 +0200)]
Bug 27344: Fix call to update_index with invalid ids

Can't use an undefined value as an ARRAY reference at /kohadevbox/koha/Koha/SearchEngine/Elasticsearch/Indexer.pm line 121.

Caught that when working on follow-up bug reports.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27344: Fix tests
Jonathan Druart [Wed, 6 Apr 2022 12:33:05 +0000 (14:33 +0200)]
Bug 27344: Fix tests

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27344: Warn the error in the log
Jonathan Druart [Tue, 5 Apr 2022 12:52:17 +0000 (14:52 +0200)]
Bug 27344: Warn the error in the log

Otherwise info about the failure is hidden in DB

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27344: Add missing imports
Jonathan Druart [Tue, 5 Apr 2022 12:51:09 +0000 (14:51 +0200)]
Bug 27344: Add missing imports

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27344: Adapt to bug 30181 changes
Tomas Cohen Arazi [Fri, 1 Apr 2022 10:25:56 +0000 (12:25 +0200)]
Bug 27344: Adapt to bug 30181 changes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27344: Add missing include file
Jonathan Druart [Wed, 30 Mar 2022 13:20:20 +0000 (15:20 +0200)]
Bug 27344: Add missing include file

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27344: Implement Elastic's update_index_background using Koha::BackgroundJob
Jonathan Druart [Tue, 5 Jan 2021 13:42:20 +0000 (14:42 +0100)]
Bug 27344: Implement Elastic's update_index_background using Koha::BackgroundJob

This patch adds a background job submodule, UpdateElasticIndex, to deal
with async ES index update (not the deletion).

Using NYTProf (on a checkin):
Without
618ms, executing 35676 statements and 26355 subroutine calls in 266 source files and 83 string evals.

With
521ms, executing 13282 statements and 7979 subroutine calls in 195 source files and 26 string evals.

However there are some problems with this patch:
1. We don't want *all* the index update to be in the background_jobs
tabtle (we could add a filter on the list view)
2. We don't track the "progress" of the job as we are sending all the
records to Elastic. It is okish in my opinion but it must be noted.

Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 27750: Remove jquery.cookie.js plugin
Owen Leonard [Wed, 2 Feb 2022 15:15:58 +0000 (15:15 +0000)]
Bug 27750: Remove jquery.cookie.js plugin

This patch removes references to the jquery.cookie.js plugin which is
now unused, replaced by js-cookie.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29894: DBRev 21.12.00.044
Fridolin Somers [Mon, 2 May 2022 21:11:52 +0000 (11:11 -1000)]
Bug 29894: DBRev 21.12.00.044

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29894: Add Selenium tests for disable 2FA
Jonathan Druart [Fri, 22 Apr 2022 10:24:17 +0000 (12:24 +0200)]
Bug 29894: Add Selenium tests for disable 2FA

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29894: (QA follow-up) Get rid of send_confirm_notice
Marcel de Rooy [Fri, 22 Apr 2022 06:39:32 +0000 (06:39 +0000)]
Bug 29894: (QA follow-up) Get rid of send_confirm_notice

Chose here to fall back to $patron->queue_notice. Which is tested
already, so removing the additional test code.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29894: (follow-up) Update notice terms
Martin Renvoize [Thu, 21 Apr 2022 13:53:18 +0000 (14:53 +0100)]
Bug 29894: (follow-up) Update notice terms

Register and Derigister didn't sound right, in reality we we enabling
and disabling 2FA for the user so I think those terms are more
understandable.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29894: Send a confirmation notice
Marcel de Rooy [Fri, 21 Jan 2022 07:58:45 +0000 (07:58 +0000)]
Bug 29894: Send a confirmation notice

When registering or deregistering, send a confirmation.

Test plan:
Register or deregister with patron having email address.
Verify that you got a confirmation mail.
Run t/db_dependent/Koha/Auth/TwoFactorAuth.t

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>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29894: Db rev for adding notices
Marcel de Rooy [Fri, 21 Jan 2022 08:42:08 +0000 (08:42 +0000)]
Bug 29894: Db rev for adding notices

This dbrev adds two notices:
2FA_REGISTER and 2FA_DEREGISTER

Test plan:
Run the dbrev.
Check if you see them on Tools/Notices.

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>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29894: Clear secret when disabling 2FA
Marcel de Rooy [Thu, 20 Jan 2022 15:07:30 +0000 (15:07 +0000)]
Bug 29894: Clear secret when disabling 2FA

Test plan:
Deregister 2FA for patron.
Check if secret is empty in borrowers.secret.

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>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29894: Add some exceptions to TwoFactorAuth module
Marcel de Rooy [Thu, 20 Jan 2022 14:43:42 +0000 (14:43 +0000)]
Bug 29894: Add some exceptions to TwoFactorAuth module

Test updated accordingly.
Adding utf8 flag to CGI in staff script.

Test plan:
Run t/db_dependent/Koha/Auth/TwoFactorAuth.t

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>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29873: Add unit test
Marcel de Rooy [Thu, 13 Jan 2022 15:33:42 +0000 (15:33 +0000)]
Bug 29873: Add unit test

Test plan:
Run t/db_dependent/Koha/Auth/TwoFactorAuth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended to reflect requested changes.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 29873: Create QR code
Marcel de Rooy [Thu, 13 Jan 2022 14:27:36 +0000 (14:27 +0000)]
Bug 29873: Create QR code

Instead of using deprecated Google Charts API, and exposing our
secret in a GET parameter, we generate QR data ourselves.

Test plan:
[1] Enable two factor authentication in the prefs.
[2] Login in staff. Go to account. Select Manage 2FA.
[3] Verify that QR code is displayed.
[4] Register the QR in your authenticator app and test 2FA
    by logging in again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tested with Google Authenticator and FreeOTP.

Bug 29873: (follow-up) Rename qr_dataurl

As requested by a QA team member.
We're moving to qr_code as method name. This is the same name as
the method in the underlying base class.
Apart from one sed statement, changing to self->SUPER on one line.

Test plan:
Can you still register, logout and login?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Bug 29873: (follow-up) Switch to GD

We do not need a new module, we could use GD instead.

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>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30108: (follow-up) Make require label translatable
Fridolin Somers [Mon, 2 May 2022 21:03:00 +0000 (11:03 -1000)]
Bug 30108: (follow-up) Make require label translatable

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30108: DBRev 21.12.00.043
Fridolin Somers [Mon, 2 May 2022 20:50:35 +0000 (10:50 -1000)]
Bug 30108: DBRev 21.12.00.043

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30108: (follow-up) Add required indication, differentiate alert
Marcel de Rooy [Fri, 4 Mar 2022 10:47:19 +0000 (10:47 +0000)]
Bug 30108: (follow-up) Add required indication, differentiate alert

As asked on comment4:
[1] Add a required div as a visible hint when applicable.
[2] Differentiate alert for hold start and end date.

Test plan:
See former patch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30108: Allow making hold dates required
Marcel de Rooy [Tue, 15 Feb 2022 15:25:59 +0000 (16:25 +0100)]
Bug 30108: Allow making hold dates required

Side note: Template still referred to class holddateto while not
being used any longer. Replaced this occurrence by futuredate.

Test plan:
[1] Disable OPACAllowHoldDateInFuture.
[2] Set pref OPACMandatoryHoldDates to "end date".
[3] Verify that the end date is mandatory on opac-reserve.
[4] Set pref OPACMandatoryHoldDates to "start date".
[5] Verify that no dates are required.
[6] Enable OPACAllowHoldDateInFuture.
[7] Verify that start dates are required.
[8] Set pref OPACMandatoryHoldDates to "no dates".
[9] Verify that no dates are required again.

Bonus:
Check that more options box is opened when a date still is required.
In case of item level being forced, verify that more options is opened
regardless of pref setting.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30108: Preference description
Marcel de Rooy [Thu, 17 Feb 2022 13:22:35 +0000 (13:22 +0000)]
Bug 30108: Preference description

Test plan:
Check the preferences form, tab Circulation, tab Hold policy.
Look for OPACMandatoryHoldDates.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30108: Database revision, adding new preference
Marcel de Rooy [Thu, 17 Feb 2022 12:55:20 +0000 (12:55 +0000)]
Bug 30108: Database revision, adding new preference

Test plan:
Run upgrade or new install.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30433: Convert advanced search tabs to Bootstrap
Owen Leonard [Fri, 1 Apr 2022 13:10:49 +0000 (13:10 +0000)]
Bug 30433: Convert advanced search tabs to Bootstrap

This patch updates the advanced search page in the staff interface to
use Bootstrap tabs instead of jQueryUI.

To test, apply the patch and test the advanced search interface. The
tabs should look correct and work correctly.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2 years agoBug 30424: (follow-up) Markup comments
Owen Leonard [Thu, 31 Mar 2022 18:46:16 +0000 (18:46 +0000)]
Bug 30424: (follow-up) Markup comments

This patch adds comments to the template to highlight the markup
structure.

This patch should have no effect on the page's appearance or
functionality.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>