koha.git
12 months agoBug 33029: Add wrapper method for dt_from_string to KohaDates template toolkit plugin
Kyle Hall [Tue, 21 Feb 2023 17:45:48 +0000 (12:45 -0500)]
Bug 33029: Add wrapper method for dt_from_string to KohaDates template toolkit plugin

It would be very useful to have direct access to dt_from_string in our templates. This would allow for us to handle custom date and time formatting. It would, for example, allow us to output the month name for a given date via Template Toolkit easily.

Test Plan:
1) Apply this patch
2) In a notice add '[% Use KohaDates %][% KohaDates.datetime_from_string().ymd %]' to the top of a notice
3) Generate that notice for a patron
4) Note today's date in iso format is rendered at the top of the notice

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34002: Check for stage_marc_import permssion
Lucas Gass [Tue, 13 Jun 2023 19:41:48 +0000 (19:41 +0000)]
Bug 34002: Check for stage_marc_import permssion

-1 Log in to the staff client as a user who has  Acquisition management (acquisition) permissions but not the stage_marc_import (tools) permission.
-2 Go to Acquisitions and Add to a basket.
-3 Select 'From a new file'
-4 You will be logged out as the user does not have percussion to visit that page.
-5 Apply patch
-6 Try again, you will not see the link for 'From a new file' if you don't have the permssion.
-7 Give the user the stage_marc_import, you will now see the link

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33606: (QA follow-up) Cosmetic changes
Marcel de Rooy [Fri, 23 Jun 2023 07:11:23 +0000 (07:11 +0000)]
Bug 33606: (QA follow-up) Cosmetic changes

Even the POD name wasnt changed after copying :)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33606: Fix settings
Pedro Amorim [Wed, 17 May 2023 16:28:23 +0000 (16:28 +0000)]
Bug 33606: Fix settings

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33606: Mark the endpoint as experimental
Jonathan Druart [Tue, 16 May 2023 12:33:29 +0000 (14:33 +0200)]
Bug 33606: Mark the endpoint as experimental

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33606: Add a erm/config route to retrieve the ERM config needed for the Vue app
Jonathan Druart [Tue, 25 Apr 2023 13:56:51 +0000 (15:56 +0200)]
Bug 33606: Add a erm/config route to retrieve the ERM config needed for the Vue app

This could be extended later in bug 32968 to pass the permission of the
logged in user.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34174: (bug 33341 follow-up) Fix Ris export
Jonathan Druart [Wed, 5 Jul 2023 14:45:19 +0000 (16:45 +0200)]
Bug 34174: (bug 33341 follow-up) Fix Ris export

Bug 33341 incorrectly fix the perlcritic warning.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33667: Allow copying holidays to all libraries when editing
Emmi Takkinen [Tue, 23 May 2023 12:29:12 +0000 (15:29 +0300)]
Bug 33667: Allow copying holidays to all libraries when editing

When editing an existing holiday and checking the
"copy to all libraires" checkbox, the other calendars won't
get updates. Allow this by first checking if holiday exists
in target calendar and if not, add it.

To test:
1. Add unique holiday to branch A.
2. Don't check checkbox "Copy to all libraries".
3. Save.
4. Verify the holidays shows on all calendars as
a green box.
5. Edit the holiday, now check "Copy to all libraries"
and save.
=> Verify nothing has changed in other calendars:
only the green box, no holiday in list on the right
6. Edit again, make a change to description,
check checkbox, save.
=> Verify it's still not showing in the other
calendars.
9. Apply this patch.
10. Edit holiday again, check "Copy to all libraries"
and save.
=> Verify holiday is now added to other calendars.
11. Edit again, this time do not copy and save.
=> Verify holiday was edited just in branch A.
12. Again edit, check and save.
=> Verify holiday was edited in all libraries.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 18855: Don't create duplicate overdue fines if an issue is returned
Michael Hafen [Thu, 19 Jan 2023 21:56:31 +0000 (14:56 -0700)]
Bug 18855: Don't create duplicate overdue fines if an issue is returned

This includes Jonathan's followup

If cronjobs/fines.pl is running during circulation hours, then an issue may
be considered for having it's overdue fine updated after the issue has been
returned and it's fine status flipped from 'UNRETURNED' to 'RETURNED'.  In
this case UpdateFine will create a duplicate fine because it can't find the
specific accountline for the (formerly) overdue issue.

This changes cronjobs/fines.pl to double check the issue before updating
the fine.  If the issue has changed between starting the script and updating
the fine, then the script will skip it.

There is a small amount of time between the check and calling UpdateFine
where the issue can be changed and this problem can reoccure.  The chance
of that happening is so small that it's probably fine to leave as is.

It is also possible that the fine won't be updated because the issue was
returned.  In this case the fine payed by the patron will be lower, but that
is better then the patron finding later that there is more to a fine they
thought they had paid all of.

Test plan (by Caroline):
0. Preliminary settings
   0.1. finesMode system preference must be set to Calculate and charge
   0.2. There must be a circulation rule that will charge fines (beware of bug 32271)
   0.3. In Tools > Calendar, today must not be a holiday

1. Make a lot of overdue checkouts - I used the batch checkout feature, but if your system already has a lot of overdue checkouts, you can skip to step 2

   1.1. Enable batch checkouts
        1.1.1. Go to Administration > Global system preferences
        1.1.2. Search for BatchCheckouts
        1.1.3. Set BatchCheckouts to Allow
        1.1.4. Select all categories in BatchCheckoutsValidCategories
        1.1.5. Click "Save all Circulation preferences"

   1.2. Get a list of barcodes
        1.2.1. Go to Reports
        1.2.2. Click "Create from SQL"
        1.2.3. Give the report a name
        1.2.4. For the SQL query, enter

               SELECT barcode FROM items WHERE onloan IS NULL LIMIT 60;

1.2.5. Click "Save report"
1.2.6. Click "Run report"
1.2.7. Click "Download" > "Tab separated text"

   1.3. Go to a patron's file
        1.3.1. Go to Patrons
        1.3.2. Click on "Search"
        1.3.3. Click on a patron's name

   1.4. Do a batch checkout with a due date in the past
        1.4.1. Click on the "Batch check out" tab on the left
        1.4.2. In "Use a file", click "Choose file"
        1.4.3. Choose the file downloaded from the report
        1.4.4. In "Hard due date", choose a date in the past
        1.4.5. Click "Check out"
        1.4.6. Click "Checkout or renew"

2. Find the last issue in the database

   2.1. In the database (or in reports), type the following query

        SELECT issues.*, items.itype as itemtype, items.homebranch, items.barcode, items.itemlost, items.replacementprice, items.biblionumber FROM issues  LEFT JOIN items USING (itemnumber) WHERE date_due < NOW() \G;

   2.2. Copy the barcode from the last entry

3. Set up so that you can run fines.pl and check in the item at the same time (or very close to the same time)

   3.1. In Koha, click the "Check in" option in the search bar at the top of the page
   3.2. Paste the barcode in the search bar BUT DO NOT PRESS ENTER OR THE ARROW RIGHT AWAY
   3.3. In a terminal, enter the fines.pl command

        ./misc/cronjobs/fines.pl

   3.4. Execute the command and immediately click on the arrow in the staff interface to check in the item

4. Check the patron's fines

    4.1. Click on the patron's name in the check in screen
    4.2. Go to the Accounting tab on the left
    4.3. In the search box just above the table, paste in the returned item's barcode

    --> Without the patch, there are two fines, one Fine (Accruing) and one Fine (Returned) for the same item at the same time
    --> With the patch, there is only one fine, Fine (Returned)

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33497: (follow-up) Adjust relationship name from bug 33493
Nick Clemens [Wed, 31 May 2023 12:06:20 +0000 (12:06 +0000)]
Bug 33497: (follow-up) Adjust relationship name from bug 33493

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33497: (follow-up) Remove unecessary scalar
Nick Clemens [Wed, 31 May 2023 11:32:54 +0000 (11:32 +0000)]
Bug 33497: (follow-up) Remove unecessary scalar

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33497: Add a filter relationship for branchtransfers
Nick Clemens [Fri, 10 Mar 2023 16:14:50 +0000 (16:14 +0000)]
Bug 33497: Add a filter relationship for branchtransfers

This uses the new relationship from bug 33493 to fetch the transfers for items

To test:
1 - Transfer some items on a bib
2 - View the biblio details page in the staff interface
3 - Apply patch
4 - Confirm  the view is the same

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33497: Use 'host_items' param to fetch all items at once
Nick Clemens [Fri, 10 Mar 2023 12:40:30 +0000 (12:40 +0000)]
Bug 33497: Use 'host_items' param to fetch all items at once

This patch adjusts the detail page to fetch items and host items
together, and prefetches transfers and checkouts

To test:
1 - Enable easy analytics
2 - Attach some items to a bib
3 - Checkout an item on the bib
4 - View the details page
5 - Apply patch
6 - View details page, confirm nothing has changed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33496: (QA follow-up) Update POD statement
Marcel de Rooy [Fri, 19 May 2023 09:57:23 +0000 (09:57 +0000)]
Bug 33496: (QA follow-up) Update POD statement

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33496: (follow-up) Correct param names
Nick Clemens [Fri, 14 Apr 2023 12:40:55 +0000 (12:40 +0000)]
Bug 33496: (follow-up) Correct param names

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33496: Add 'host_items' param to Koha::Biblio->items
Nick Clemens [Fri, 10 Mar 2023 12:37:49 +0000 (12:37 +0000)]
Bug 33496: Add 'host_items' param to Koha::Biblio->items

This patch adds an option to the $biblio->items method to allow
retrieving the items and analytic items for a record. This is intended
to allow fetching a single Items object, and related object, rather than
having to fetch the items, and the host items, and push them together

This is step towards being able to fetch items using API/DataTables directly

To test:
1 - prove -v t/db_dependent/Koha/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33879: Do no longer overwrite interface in check_cookie_auth
Marcel de Rooy [Thu, 1 Jun 2023 13:03:50 +0000 (13:03 +0000)]
Bug 33879: Do no longer overwrite interface in check_cookie_auth

This will only have effect on installations running OPAC and staff
on the same domain name. In that case an OPAC cookie still allows
you to access intranet, and v.v.

Test plan:
Repeat the following steps WITHOUT this patch and WITH it.
Login via OPAC.
Go to staff. Perform an action that logs the interface in e.g. the
statistics table, like a checkout.
Inspect interface in the corresponding table. Observe difference
that this patch makes.

With this patch:
Run t/db_dependent/Auth.t. Should pass again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33879: Add unit test to show problem
Marcel de Rooy [Thu, 1 Jun 2023 13:42:03 +0000 (13:42 +0000)]
Bug 33879: Add unit test to show problem

Test plan:
Run t/db_dependent/Auth.t without second patch.
Should fail:
    #          got: 'opac'
    #     expected: 'intranet'

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Björn Nylén <bjorn.nylen@ub.lu.se>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34101: Limit items types that can be checked out via SIP2
Sam Lau [Tue, 27 Jun 2023 22:10:32 +0000 (22:10 +0000)]
Bug 34101: Limit items types that can be checked out via SIP2

This bug adds the ability to define a list of item types that are blocked from being issued at that SIP account

To test:
1) Apply this patch
2) Visit Administration->Item types and select edit on the music item type
3) Make the rental charge 0 and save changes (this allows for the item to be checked out via SIP)
4) In the terminal, vim /etc/koha/sites/kohadev/SIPconfig.xml
5) Edit the term1 account and add the following *inside* the login section:
     blocked_item_types="BK|MU"
     You should have something similar to this: <login id ="term1" ........... checked_in_ok="1" blocked_item_types="BK|MU" />
6) Restart SIP (sudo koha-sip --restart <instancename>)
7) Run a checkout query for an item with the item type book. Here is an example you could use:
    perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529001000463 --item 39999000011418-m checkout
8) Notice the checkout failed and you are given the screen msg "Item type cannot be checked out at this checkout location"
9) Run a checkout query for an item with the item type music. Here is an example you could use:
    perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529001000463 --item 39999000008715 -m checkout
10) Notice the checkout failed and you are given the screen msg "Item type cannot be checked out at this checkout location"
11) vim /etc/koha/sites/kohadev/SIPconfig.xml and delete the BK from the blocked_item
12) Delete the BK from blocked_item_types. It should now look like :
    blocked_item_types="MU"
13) Restart SIP (sudo koha-sip --restart <instancename>)
14) Run a checkout query for the item with the item type book
    perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529001000463 --item 39999000011418    -m checkout
15) Checkout succesful
16) Run a checkout query for the item with the item type music
    perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL --patron 23529001000463 --item 39999000008715     -m checkout
17) Still fails (because it is blocked)
18) prove t/db_dependent/SIP/Message.t
19) Congratulate yourself for making it through the long test and sign-off :)

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34101: Unit Tests
Sam Lau [Tue, 27 Jun 2023 22:54:54 +0000 (22:54 +0000)]
Bug 34101: Unit Tests

prove t/db_dependent/SIP/Message.t

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33404: Add unit tests
Marcel de Rooy [Thu, 25 May 2023 07:29:30 +0000 (07:29 +0000)]
Bug 33404: Add unit tests

Test plan:
Run t/db_dependent/Breeding.t
Run t/db_dependent/Breeding_Auth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Amended patch: perltidy

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33404: Fix serverhost and init $page
Marcel de Rooy [Thu, 25 May 2023 06:03:48 +0000 (06:03 +0000)]
Bug 33404: Fix serverhost and init $page

The array serverhost is not filled. Should be replaced with values
from servers array.

Test plan:
Nothing exciting here. Read the patch.
Note that we will test in the next patch if the hostname is saved
correctly in the import batch.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33404: Z3950SearchAuth: Save in UTF-8 encoding
Marcel de Rooy [Wed, 24 May 2023 14:57:46 +0000 (14:57 +0000)]
Bug 33404: Z3950SearchAuth: Save in UTF-8 encoding

Test plan:
[1] If you have access to a Z3950 MARC8 auth server, search
    for an authority record and import it.
[2] If you have access to a Z3950 UTF8 auth server, search
    for an authority record and import it.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 23336: (follow-up) Add checkout_availability schema
Martin Renvoize [Tue, 4 Jul 2023 06:21:48 +0000 (07:21 +0100)]
Bug 23336: (follow-up) Add checkout_availability schema

At some point in the patch series we lost the availability api schema.
This patch restores a basic version, but we should work towards a
clearer enum based schema for each of the available blockers, confirms
and warnings.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 23336: (follow-up) Fix failing test
Martin Renvoize [Tue, 4 Jul 2023 06:07:05 +0000 (07:07 +0100)]
Bug 23336: (follow-up) Fix failing test

Our consistency improvement to the AddIssue return in bug 23336
highlighted a bad test assumption.  The 'Reinsert the original issue'
line was silently failing and as such the subsequent test lines were
actually resulting in a renewal (which previous to this patchset
returned an empty return that happened to match the empty return of an
issue failure)

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33974: (follow-up) biblionumber column needs special handling
Tomas Cohen Arazi [Mon, 3 Jul 2023 16:30:56 +0000 (13:30 -0300)]
Bug 33974: (follow-up) biblionumber column needs special handling

This patch makes a particular use case be handled correctly: i.e. no
context is passed (e.g. 'biblio' explicitly) and the query is done
against the `biblio_id` attribute. This results in the following DBIC
error:

[ERROR] GET /api/v1/biblios: unhandled exception (DBIx::Class::Exception)<<DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Column 'biblionumber' in where clause is ambiguous at /kohadevbox/koha/Koha/Objects.pm line 394>>

With this patch, this is no longuer the case :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34180: Template variable in JavaScript prevents authority MARC preview from displ...
Owen Leonard [Wed, 16 Nov 2022 12:10:16 +0000 (12:10 +0000)]
Bug 34180: Template variable in JavaScript prevents authority MARC preview from displaying

Since template variables cannot be processed by JS, we must use a
template to declare a JS variable which the JS file can used. This patch
corrects this problem in the JS file which handles display of the
authority MARC preview from the authority search results page.

To test, apply the patch and go to Authorities.

- Perform a search which will return multiple authority results.
- Click "Actions -> MARC preview." The preview should display correctly.
- Click "Actions -> MARC preview" on another search result. This preview
  should also look correct.
- There should be no JavaScript errors in the browser console.

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33974: (QA follow-up) Remove superflous import
Martin Renvoize [Mon, 3 Jul 2023 15:28:44 +0000 (16:28 +0100)]
Bug 33974: (QA follow-up) Remove superflous import

We don't actually need the Clone import.. it's not used in Biblios.pmt

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33974: (follow-up) Adapt the orders endpoint
Tomas Cohen Arazi [Fri, 16 Jun 2023 15:53:05 +0000 (12:53 -0300)]
Bug 33974: (follow-up) Adapt the orders endpoint

In order to reduce the technical debt carried on the orders controller,
and to highlight the decisions made on the prior patch, I adapted the
list() orders controller using the new tools in town.

The result is this endpoint can now embed bibio, without needing to have
a custom piece of code.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/*.t
=> SUCCESS: Tests pass :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33974: Make biblioitem columns searchable in a generic way
Tomas Cohen Arazi [Fri, 16 Jun 2023 15:50:07 +0000 (12:50 -0300)]
Bug 33974: Make biblioitem columns searchable in a generic way

This patch makes biblioitem attributes be searchable on the biblios
endpoint. It does so by using the new method in Koha::Biblios, and by
adjusting objects.search(_rs) to accept a $query_fixer arrayref of
functions to be applied to each query or order_by parameters.

The result is cleaner code to write, but complex internals.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass! Searching for biblioitem attributes works on the
API!
3. Sign off :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33974: Add Koha::Biblios->api_query_fixer
Tomas Cohen Arazi [Fri, 16 Jun 2023 15:48:14 +0000 (12:48 -0300)]
Bug 33974: Add Koha::Biblios->api_query_fixer

This patch adds the `api_query_fixer` method to the class, and adds
tests to validate its behavior.

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

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33271: Add collective owing message to moremember page
Lucas Gass [Wed, 12 Apr 2023 17:29:43 +0000 (17:29 +0000)]
Bug 33271: Add collective owing message to moremember page

To test:
1. Turn on NoIssuesChargeGuarantorsWithGuarantees and set the amount to 5.
2. Create a guarantor/guarantee relationship.
3. Add a manual invoice to the guarantor that is larger than 5.00.
4. Notice the message on that circulation ( check out tab ) page. " Charges: Patron's guarantors and their other guarantees collectively owe X. Checkouts are BLOCKED because fine balance is OVER THE LIMIT. "
5. Look at the moremember ( details ) page. The same message does not appear.
6. Apply patch, restart_all
7. Try step 5 again, the message should now appear.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34092: (QA follow-up) Typo
Marcel de Rooy [Fri, 30 Jun 2023 06:55:29 +0000 (06:55 +0000)]
Bug 34092: (QA follow-up) Typo

Typo patron_searh_js.

Note for QA/RM: Ignore this qa tools warning:
    forbidden pattern: console.log (line 211)
This is an intended console warning.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34092: Move search-patron.inc logic into buildPatronSearchQuery
Pedro Amorim [Mon, 26 Jun 2023 12:51:13 +0000 (12:51 +0000)]
Bug 34092: Move search-patron.inc logic into buildPatronSearchQuery

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34092: Preparation: New buildPatronSearchQuery function
Pedro Amorim [Mon, 26 Jun 2023 12:37:08 +0000 (12:37 +0000)]
Bug 34092: Preparation: New buildPatronSearchQuery function

Move patron search query logic out of patron_autocomplete into new function

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34092: Move patron_autocomplete to staff-global.js
Pedro Amorim [Mon, 26 Jun 2023 10:22:19 +0000 (10:22 +0000)]
Bug 34092: Move patron_autocomplete to staff-global.js

Remove patron-autocomplete.js file

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34094: Use DefaultPatronSearchMethod consistently
Martin Renvoize [Thu, 22 Jun 2023 14:37:55 +0000 (15:37 +0100)]
Bug 34094: Use DefaultPatronSearchMethod consistently

This patch updates the patron search bar and pages to default search
method to that defined by DefaultPatronSearchMethod system preference.

Test plan
1) Prior to this patch confirm that regardless of what you set
   DefaultPatronSearchMethod to, the search in /members/member.pl,
   members/members-home.pl and the search from the patrons search top bar
   all default to 'contains'.
2) Apply the patch
3) Confirm that the system preference now affects the default option for
   match type upon page load.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 29664: (QA follow-up) Typo transacton
Marcel de Rooy [Fri, 30 Jun 2023 07:38:46 +0000 (07:38 +0000)]
Bug 29664: (QA follow-up) Typo transacton

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 29664: Do not show voided payments in cash_register_stats.pl
Kyle M Hall [Mon, 1 May 2023 13:50:24 +0000 (09:50 -0400)]
Bug 29664: Do not show voided payments in cash_register_stats.pl

Test Plan:
1) Set up your cash register
2) Take a payment
3) Void that payment
4) Verify the voided fee shows for the "All payments to the library" and
   "Payment" transaction type filters
5) Apply this patch
6) Restart all the things!
7) Verify the voided fee no longer shows for the "All payments to the library" and
   "Payment" transaction type filters

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33999: (follow-up) Use link-styled button
Owen Leonard [Mon, 26 Jun 2023 14:04:23 +0000 (14:04 +0000)]
Bug 33999: (follow-up) Use link-styled button

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33999: Subscription details link on bibliographic detail page should have permiss...
Owen Leonard [Tue, 13 Jun 2023 14:11:33 +0000 (14:11 +0000)]
Bug 33999: Subscription details link on bibliographic detail page should have permission check

This patch wraps the "Subscription details" link on the bibliographic
detail page with a permissions check, "CAN_user_serials," so that a user
lacking permission to access the Serials module will not be shown the
link.

To test, apply the patch and view the bibliographic detail page of a
serial record.

- When viewing the "Subscriptions" tab as a user with Serials
  permissions you should see the "Subscription details" link.
- When viewing the tab as a user without the correct permissions the
  link should not be present.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34146: Counterpart for serials-edit
Marcel de Rooy [Thu, 29 Jun 2023 06:18:04 +0000 (06:18 +0000)]
Bug 34146: Counterpart for serials-edit

Not only additem suffers from it. We can do the same with serials-edit.
This patch adds a server-side and client-side check as we did for additem.

Test plan:
Receive serial with adding items.
Try to add more than 999 items in number of copies.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34146: Add a client-side check with maxlength too
Marcel de Rooy [Thu, 29 Jun 2023 05:58:29 +0000 (05:58 +0000)]
Bug 34146: Add a client-side check with maxlength too

Test plan:
Try to add more than 3 characters now in the number of copies.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34146: Do not allow multiple copies to crash server
Marcel de Rooy [Wed, 28 Jun 2023 14:14:51 +0000 (14:14 +0000)]
Bug 34146: Do not allow multiple copies to crash server

Currently hardcoded to 1000.
Can be refined later. Let's first prevent this kind of accidents.

Test plan:
Add additem.pl. Edit the 1000 to 2. Restart all.
Add 3 multiple copies. Notice that you got 2.
Revert your code change.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33573: Add public endpoint for cancelling holds
Tomas Cohen Arazi [Wed, 7 Jun 2023 13:42:15 +0000 (10:42 -0300)]
Bug 33573: Add public endpoint for cancelling holds

This patch introduces a public endpoint for cancelling holds.
Cancellation requests are generated when the hold is waiting and
configuration allows requesting cancellation, as the OPAC does right
now.

Tests cover all the use cases.

To test:
1. Apply this patches
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/patrons_holds.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33573: Unit tests
Tomas Cohen Arazi [Wed, 7 Jun 2023 13:41:53 +0000 (10:41 -0300)]
Bug 33573: Unit tests

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 23775: Claiming a serial issue doesn't create the next one
jeremy breuillard [Mon, 4 Apr 2022 09:00:09 +0000 (11:00 +0200)]
Bug 23775: Claiming a serial issue doesn't create the next one

Whenever we need to generate manually a new serial we go to page
'serials-edit.pl'. With this patch it is possible to generate a new
serial on page 'serials.pl'.

Test Plan:
-- Previously we need a serial which is in EXPECTED status & the Date
received should not be later than today --
1) On the intra. Make sure to have at least 1 subscription for a
   bibliographic record & 1 vendor linked
2) Then Home > Serials > Claims > Claims for <your_vendor_name>
3) Tick the checkbox of the row where the status is EXPECTED then
4) Click 'Send notification'
5) Notice the status of the row : it is now CLAIMED
6) To verify: Home > Serials > Serial collection information for
   <your_record_name>
7) Here the status is CLAIMED too but nothing happened around
8) Apply patch
9) Repeat from 2) to 6)
10) The status is still CLAIMED & the new serial with status EXPECTED is
    freshly generated

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34106: Update header search box searchtype when form is submitted
Pedro Amorim [Tue, 27 Jun 2023 14:40:59 +0000 (14:40 +0000)]
Bug 34106: Update header search box searchtype when form is submitted

We're updating the side menu searchtype when the search header is submitted,
we should also update the searchtype in the search header when the form is submitted

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 34106: Retain searchtype parameter in member-search-box
Lucas Gass [Thu, 22 Jun 2023 21:59:35 +0000 (21:59 +0000)]
Bug 34106: Retain searchtype parameter in member-search-box

To test:

1. In the main search header switch to 'Search patrons'. Bring up the dropdown and look at 'Search type:'.
2. It defaults to 'Starts with'.
3. Go to '/cgi-bin/koha/members/members-home.pl' and look at the 'Search type:' on the left side.
4. It defaults to 'Contains'
5. Do a patron search from both these places, setting the 'Search type' to contains.
6. The search bar in the header always resets to 'Starts with'
7. Apply patch
8. Try everything again. By default both places should default to contain.
9. If you change the 'Search type' the search in the main header should always retain that value.

Signed-off-by: Ed Veal <eveal@mckinneytexas.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33971: Remove x-koha-query header support
Tomas Cohen Arazi [Tue, 13 Jun 2023 14:27:07 +0000 (11:27 -0300)]
Bug 33971: Remove x-koha-query header support

This patch removes support for the `x-koha-query` header entirely from
the codebase. For the purpose:

- $c->objects->search is adjusted
- Relevant tests are cleared/adapted
- The OpenAPI spec gets the header removed

To test:
1. Apply this patch and run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t \
           t/Koha/REST/Plugin/Query.t \
           t/db_dependent/api/v1/*.t
=> SUCCESS: Tests pass!
2. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33971: Remove x-koha-query handing in Orders.pm
Tomas Cohen Arazi [Tue, 13 Jun 2023 13:48:14 +0000 (10:48 -0300)]
Bug 33971: Remove x-koha-query handing in Orders.pm

This patch removes manual handling of `x-koha-query` in the
Orders:list() controller.

There are no tests for the feature but you can verify no behavior is
changed by doing:

1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/acquisitions_orders.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests pass
4. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33971: Remove x-koha-query usage in biblios.t
Tomas Cohen Arazi [Tue, 13 Jun 2023 13:44:47 +0000 (10:44 -0300)]
Bug 33971: Remove x-koha-query usage in biblios.t

This patch removes handling of x-koha-query from the tests.

To test:
1. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
=> SUCCESS: Tests still pass! Change from x-koha-header to q= gives same
results.
4. Sign off :-D

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33720: Also flush in install
Martin Renvoize [Thu, 29 Jun 2023 08:19:59 +0000 (09:19 +0100)]
Bug 33720: Also flush in install

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 33720: Update the updatedatabase.pl script to flush caches before running
Jake Deery [Wed, 7 Jun 2023 11:37:09 +0000 (13:37 +0200)]
Bug 33720: Update the updatedatabase.pl script to flush caches before running

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 31253: Item search in staff interface should call barcodedecode if the search...
Kyle Hall [Thu, 28 Jul 2022 13:13:09 +0000 (09:13 -0400)]
Bug 31253: Item search in staff interface should call barcodedecode if the search index is a barcode

We should run any inputted barcode through barcodedecode before passing it to any subroutines.
This was missed during the initial development of bug 26351.

Test Plan:
1) Set itemBarcodeInputFilter to "Remove spaces from"
2) Create an item with the barcode "MYTEST"
3) Browse to the staff side advanced search
4) Run a barcode search for "MY TEST"
5) Note no results are round
6) Apply this patch
7) Restart all the things!
8) Repeat your search
9) Note the item was found!

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit: fixed typo in comment
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 23336: (QA follow-up) Minor fixes
Tomas Cohen Arazi [Mon, 3 Jul 2023 13:15:57 +0000 (10:15 -0300)]
Bug 23336: (QA follow-up) Minor fixes

There are two leftover includes, and a couple typos in a comment and POD
title.

This patch fixes that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 23336: (QA follow-up) Minor fixes
Martin Renvoize [Wed, 17 May 2023 15:54:45 +0000 (16:54 +0100)]
Bug 23336: (QA follow-up) Minor fixes

This patch deals with some QA script warnings, and also makes some
changes in line with bug 33556.

We also adds current user id and checkout item id into the confirmation
token to improve security and fix the failing tests.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 23336: (follow-up) Switch to using Koha::Token
Martin Renvoize [Tue, 16 May 2023 09:46:43 +0000 (10:46 +0100)]
Bug 23336: (follow-up) Switch to using Koha::Token

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 23336: Fix inconsistent return of AddIssue
Martin Renvoize [Mon, 3 Oct 2022 16:07:20 +0000 (17:07 +0100)]
Bug 23336: Fix inconsistent return of AddIssue

AddIssue can on occasion create a renewal instead of a fresh issue and
in such a case we currently return undefined. We should be consistent
and return the existing issue object for the renewal.

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 23336: Add checkout API's
Martin Renvoize [Fri, 5 May 2023 14:53:50 +0000 (15:53 +0100)]
Bug 23336: Add checkout API's

This patch adds API's to allow for a checkout flow using the RESTful
API.

We add an availability endpoint to check an items current availability
status. The endpoint can be found at `/checkouts/availability` and is
a GET request that requires item_id and patron_id passed as parameters.

We return an availability object that includes blockers, confirms,
warnings and a confirmation token to be used for checkout.

We also add a corresponding checkout method to the `/checkouts` endpoint.
The method accepts a POST request with checkout details including item_id
, patron_id and the confirmation token in the body.

Future work: We should properly migrate CanBookBeIssued into Koha::* and
use that here instead of refering to C4::Circulation.

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
12 months agoBug 23336: Unit tests
Martin Renvoize [Thu, 27 Apr 2023 16:03:15 +0000 (17:03 +0100)]
Bug 23336: Unit tests

This patch adds unit tests for the new checkout availability endpoint
we're going to introduce in this patchset.

Signed-off-by: Silvia Meakins <smeakins@eso.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33972: Remove settings of batch status to importing
Nick Clemens [Tue, 27 Jun 2023 13:26:10 +0000 (13:26 +0000)]
Bug 33972: Remove settings of batch status to importing

This change was done in a transaction - it would either be set as imported
on success, or rolled back to staged on failure

There is no need for the intermediate status which is never committed

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33996: (QA follow-up) Fix mappings to match guidelines
Martin Renvoize [Mon, 26 Jun 2023 14:15:31 +0000 (15:15 +0100)]
Bug 33996: (QA follow-up) Fix mappings to match guidelines

The date field guidelines are recorded on the wiki:
https://wiki.koha-community.org/wiki/Coding_Guidelines_-_API#SWAGGER1.3.4.1_date.2Fdatetime.2Ftimestamp_fields

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33996: Add missing authority objects mapping
Tomas Cohen Arazi [Tue, 13 Jun 2023 13:13:40 +0000 (10:13 -0300)]
Bug 33996: Add missing authority objects mapping

This patch adds a minimal mapping (i.e. some things get excluded from
the API objects for now). It makes some attributes consistent with the
current API names, and the rest can be added later when they become
needed and we discuss a proper name. But right now is a mess :-/

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/authorities.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34130: Make requested_date nullable in api definition
Pedro Amorim [Tue, 27 Jun 2023 13:23:08 +0000 (13:23 +0000)]
Bug 34130: Make requested_date nullable in api definition

This patch allows the requested_date for an ILL request to be NULL to accomodate
older data

To test:
1 - Install the Koha 2 Koha ILL plugin:
    https://gitlab.com/koha-community/plugins/koha-plugin-ill-koha
2 - Enable the ILL  system preference
3 - Force an ILL request with minimal data from backend:
    INSERT INTO illrequests (borrowernumber,biblio_id,branchcode,backend,status) VALUES (5,3,'CPL','Koha','placed');
4 - View the ILL table
5 - Error:
    {"message":"Expected string - got null.","path":"\/body\/0\/requested_date"}
6 - Apply patch
7 - Table loads successfully

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33778: (QA follow-up) Update for master
Martin Renvoize [Mon, 26 Jun 2023 11:00:30 +0000 (12:00 +0100)]
Bug 33778: (QA follow-up) Update for master

The error message was updated in master.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33778: Move to db_dependent
Marcel de Rooy [Fri, 19 May 2023 08:51:42 +0000 (08:51 +0000)]
Bug 33778: Move to db_dependent

Test plan:
Run t/db_dependent/Auth_with_shibboleth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33778: Fix indentation of last subtest
Marcel de Rooy [Fri, 19 May 2023 08:38:20 +0000 (08:38 +0000)]
Bug 33778: Fix indentation of last subtest

Only whitespace.

Test plan:
git diff -w HEAD~1.. t/Auth_with_shibboleth.t
No differences.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33778: Further polishing
Marcel de Rooy [Fri, 19 May 2023 06:45:22 +0000 (06:45 +0000)]
Bug 33778: Further polishing

Use mock_preference.
Move final tests for BaseURLs into one subtest.
Change reset_config to allow passing parameters replacing some variables.
Copyright line.

Test plan:
Run t/Auth_with_shibboleth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33778: Remove T::D::C from Auth_with_shibboleth.t
Marcel de Rooy [Thu, 18 May 2023 11:19:13 +0000 (11:19 +0000)]
Bug 33778: Remove T::D::C from Auth_with_shibboleth.t

This test should be in t/db. It needs patrons, categories, branches.
T::D::C now hides e.g. the branchcode constraint.
When removing T::D::C, we therefore need to add a branchcode in the
shibboleth test config.

Test plan:
Run t/Auth_with_shibboleth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34029: DBIC schema
Tomas Cohen Arazi [Thu, 29 Jun 2023 12:51:08 +0000 (09:51 -0300)]
Bug 34029: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34029: (QA follow-up) Fix slipped broken char
Tomas Cohen Arazi [Thu, 29 Jun 2023 12:46:13 +0000 (09:46 -0300)]
Bug 34029: (QA follow-up) Fix slipped broken char

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31651: Adjust tests
Tomas Cohen Arazi [Thu, 29 Jun 2023 12:36:47 +0000 (09:36 -0300)]
Bug 31651: Adjust tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34029: DBRev 23.06.00.007
Tomas Cohen Arazi [Mon, 26 Jun 2023 13:28:55 +0000 (10:28 -0300)]
Bug 34029: DBRev 23.06.00.007

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34029: DBIC schema
Tomas Cohen Arazi [Mon, 26 Jun 2023 13:25:33 +0000 (10:25 -0300)]
Bug 34029: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34029: (QA follow-up) Fix pushing undef to biblio_ids
Marcel de Rooy [Mon, 26 Jun 2023 10:46:17 +0000 (10:46 +0000)]
Bug 34029: (QA follow-up) Fix pushing undef to biblio_ids

See comment1. Although we now fix the error on publishercode, it
is good to verify the result before pushing.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34029: Extend datatypes of biblioitems.columns to text to avoid breaking import
Katrin Fischer [Fri, 16 Jun 2023 11:14:29 +0000 (11:14 +0000)]
Bug 34029: Extend datatypes of biblioitems.columns to text to avoid breaking import

This updated the datatype of the following columns from varchar(255) to text
to avoid import problems if the mapped MARC field's data exceeds 255
characters.

This is for:
* place (260$a and 264$a)
* publishercode (260$b and 264$b)
* size (300$c)
* illus (300$b)
* pages (300$a)

To test:
* Edit a bibliographic record and enter more than 255 characters into
  the MARC fields listed above. Try to save.
* Run the updatedatabase script to modify the DB structure
* restart_all
* Edit a bibliographic record and enter more than 255 characters into
  the MARC fields listed above.
* Save
* Export the record
* Import the record using staging tools, all should work well

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33989: Only look up authorized value descriptions for items in results
David Cook [Tue, 13 Jun 2023 04:44:41 +0000 (04:44 +0000)]
Bug 33989: Only look up authorized value descriptions for items in results

This patch changes the inventory tool so that it only populates the
authorized value descriptions for items that show up in the results.
That is, items that will be viewed by a human.

This change saves a lot of time by not performing unnecessary
database lookups.

Test plan:

0. Apply patch and koha-plack --restart kohadev
1. Go to create a SQL report from SQL
/cgi-bin/koha/reports/guided_reports.pl?phase=Create%20report%20from%20SQL
2. Save a report with the following SQL:
SELECT barcode FROM items where barcode <> '';
3. Run the report
4. Download as CSV
5. Edit the CSV and remove the "barcode" heading

6. Go to edit item for barcode 3999900000001
/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=1&itemnumber=1
7. Add "Damaged status" of "Damaged"
8. Click "Save changes"

9. koha-mysql kohadev
10. update items set notforloan = 9 where barcode = 3999900000001;

11. Go to inventory tool
http://localhost:8081/cgi-bin/koha/tools/inventory.pl
12. Upload barcode file via "Choose file"
13. Uncheck "Compare barcodes list to results"
14. Open F12 tools
15. Click "Submit"
16. Click "OK" on confirm box

17. Note that the inventory job takes around 30 seconds to run
instead of 60 seconds
17b. The exact figures may vary. If you compare with before patch
inventory runs, you'll be saving roughly 18 seconds.
18. Note that "Damaged" appears in the "Damaged" column, which
demonstrates that the authorized value lookup was completed for
the item in the result list

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33976: Disable claims returned option in moredetail.pl when another lost status...
Emily Lamancusa [Fri, 9 Jun 2023 18:54:33 +0000 (14:54 -0400)]
Bug 33976: Disable claims returned option in moredetail.pl when another lost status is selected

Prevent "claims returned" from being selectable from moredetail.pl, even
if another lost status is already set

To test:
1. Configure Claims returned
    i. Go to Administration > Authorized Values > LOST
    ii. Add a new authorized value with value:6 and description:Claims returned
    iii. Go to Administration > System Preferences
    iv. Set ClaimReturnedLostValue to 6 and save
2. Go to any title record and click the barcode for any item
3. Click the Lost status drop-down.
   Note that the Claims Returned option is disabled.
4. Select a Lost status and click "Set status"
5. Click the Lost status drop-down.
   Note that the Claims Returned option is now selectable.
6. Apply the patch and refresh the page
7. Note that the Claims Returned option is now disabled.
8. Find a different item and check it out to a customer.
9. On that customer's account, click "Claim Returned" for that item
10. Click the barcode to view moredetail for that item
    Note that the Lost status drop-down is disabled with Claims Returned selected

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34080: Make suggestions_batch_ops a class
Lucas Gass [Fri, 23 Jun 2023 15:13:42 +0000 (15:13 +0000)]
Bug 34080: Make suggestions_batch_ops a class

To test:
1. Make some suggestions with different statuses.
2. Try moving some suggestion to different statuses.
3. Going from PENDING to another status works fine.
4. Moving from other status (REJECTED, ORDERED, etc ) will cause a 500 error.
5. Apply patch
6. Try 2 - 4 again, no more 500 errors, yay!

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31132: (follow-up) Reset dropdown values and style button
Aleisha Amohia [Tue, 12 Jul 2022 04:48:44 +0000 (16:48 +1200)]
Bug 31132: (follow-up) Reset dropdown values and style button

This follow-up patch resets the dropdown values of the form alongside
the text inputs. It styles the button to look like a link so it doesn't
distract the user and get 'accidentally' clicked when attempting to
submit.

Test that the button looks and behaves as expected after submitting a
search.

Signed-off-by: nicolas <nicolas@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 31132: Add button to clear the cataloguing auth finder form
Aleisha Amohia [Mon, 11 Jul 2022 23:04:03 +0000 (11:04 +1200)]
Bug 31132: Add button to clear the cataloguing auth finder form

This enhancement adds a 'Clear form' link to empty all of the input
fields on the authority finder plugin form when cataloguing
bibliographic records.

To test:
1) Search for a bibliographic record in the staff interface
2) Edit a record
3) Go to tabs 1, 6 or 7 to find a tag linked to the authority finder
plugin
4) Launch the authority finder plugin by clicking the Tag editor icon at
the end of the field
5) If the fields are empty, add some text in the text fields
6) Click the 'Clear form' link at the bottom of the form
7) Confirm the text is cleared from the input fields and the form is
empty

Sponsored-by: Education Services Australia SCIS
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: nicolas <nicolas@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34103: Capitalization: Currencies & Exchange rates
Caroline Cyr La Rose [Thu, 22 Jun 2023 20:06:50 +0000 (16:06 -0400)]
Bug 34103: Capitalization: Currencies & Exchange rates

This patch corrects the breadcrumbs in the Administration > Currencies
and exchange rates page to follow current capitalization and
typographical guidelines.

To test:
0. Apply patch
1. Go to Administration > Currencies and exchange rates
2. Verify that the breadcrumb has no spelling errors, and that
   capitalization and typography guidelines are applied
3. Click 'Delete' next to one of the currencies
4. Verify that the breadcrumb has no spelling errors, and that
   capitalization and typography guidelines are applied

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34015: Terminology: Relative issues should be Relative's checkouts
Caroline Cyr La Rose [Thu, 15 Jun 2023 13:45:50 +0000 (09:45 -0400)]
Bug 34015: Terminology: Relative issues should be Relative's checkouts

This patch changes the term 'issues' in a screen reader caption in the
OPAC to the correct term 'checkouts'.

To test:
Setup:
- Have a patron with a guarantee
- Check out an item to the guarantee
- Make sure the guarantee allows their guarantor to see their checkouts
  (AllowStaffToSetCheckoutsVisibilityForGuarantor must be on for you to
  be able to set this)

1. In the OPAC, log in with the guarantor patron
2. Click on the Relatives' checkouts tab
3. Open a screen reader (in Ubuntu, Super + Alt + S to turn on/off)
4. Navigate to the table in the Relative's checkouts tab
   --> The screen reader should say 'Relative issue table with...'
5. Apply patch
6. Refresh the page
7. Restart the screen reader (if it was off)
   --> The screen reader should now say 'Relatives' checkouts table
   with...'

Alternatively, open the page inspector and inspect the table, the
caption is in the table tag, before the thead tag.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34083: (follow-up) Prevent showing 'null'
Pedro Amorim [Thu, 22 Jun 2023 08:58:34 +0000 (08:58 +0000)]
Bug 34083: (follow-up) Prevent showing 'null'

In patron lists, if the patron added is an organization without the firstname, it presents 'null'. This fixes that

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34083: Add searching for full term on patron auto-complete
Pedro Amorim [Wed, 21 Jun 2023 16:10:17 +0000 (16:10 +0000)]
Bug 34083: Add searching for full term on patron auto-complete

To reproduce, on k-t-d:
1) Create a new patron of category 'School'
2) Enter 'Middle school high school' on the mandatory 'Name' field and put something in 'Card number:'
3) Visit patron lists at /cgi-bin/koha/patron_lists/lists.pl and click 'New patron list'
4) Put something in 'Name:' and click 'Save'
5) On the 'Patron search' input, enter 'middle school high school' slowly and observe the auto-complete behaviour
6) Notice how after you start typing the second word, the auto complete results vanish.
7) Apply patch, repeat plan and verify it now works as expected.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33968: Add missing colons to guarantor related labels
Katrin Fischer [Fri, 9 Jun 2023 09:46:47 +0000 (09:46 +0000)]
Bug 33968: Add missing colons to guarantor related labels

Fixes some inconsistencies with the labels on the
patron detail page and patron edit form.

To test:
* Activate AllowStaffToSetCheckoutsVisibilityForGuarantor
  and AllowStaffToSetFinesVisibilityForGuarantor system
  preferences
* Link a patron to a guarantor
* Verify on the details tab the options for showing fines
  and checkouts show and are missing colons on the label
* Edit the patorn and verify the same is true for the form
* Apply patch
* Verify missing colons have been added :)

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25079: (QA follow-up) FA v6 update
Tomas Cohen Arazi [Fri, 23 Jun 2023 13:27:44 +0000 (10:27 -0300)]
Bug 25079: (QA follow-up) FA v6 update

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25079: (QA follow-up) Fix TT issues
Kyle M Hall [Tue, 30 May 2023 17:42:16 +0000 (13:42 -0400)]
Bug 25079: (QA follow-up) Fix TT issues

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25079: Show club enrollment question answers in staff client
Hammat Wele [Wed, 12 Apr 2023 12:48:31 +0000 (12:48 +0000)]
Bug 25079: Show club enrollment question answers in staff client

When a patron is enrolled in a patron club, koha collects answers to library-defined enrollment questions.
Those answers go into the database but are not viewable outside of reports.

This patch make those answers viewable on club-enrollments.pl.

Test plan
1. Apply the patch

2. Create a club template
    2.1. Go to Tools > Patron clubs
    2.2. Click on 'New Club Template'
    2.3. Fill the form
    2.4. on the 'Club fields' section, Click on Add new field
    2.5. Fill in the form
    2.6. on the 'Enrollment fields' section, Click on Add new field
    2.7. Fill in the form
    2.8. Click on Save button

3. Creation of the club
    3.1. Go to Tools > Patron clubs > 'Clubs' section (bottom)
    3.2. Click on the 'New Club' button and select the club template create on step 1
    3.3. Fill in the form
    3.4. Click on Save button

4. Club enrollement
    On the intranet (or the OPAC if permitted)
    4.1. Search for a pratron and open the patron folder
    4.2. Click on the 'Clubs' tab
    4.3. Find the name of the club and click on 'Enroll'
    4.4. Fill the questionnaire
    4.5. Confirm registration

5. Check registrations on the intranet
    5.1. Go to Tools > Patron clubs
    5.2. In the bottom 'Clubs' section, find the name of the club
    5.3. check the 'Enrolled patrons' column
       ---> should not be equal to zero.
    5.4 Click on 'Action' and choose the option “Enrollments”
       ---> The Enrollment fields created on step 2.6. are viewable in the table with their values

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 25079: Add a 'edit' functionality to the Clubs tool in the staff interface
Hammat Wele [Wed, 12 Apr 2023 00:32:02 +0000 (00:32 +0000)]
Bug 25079: Add a 'edit' functionality to the Clubs tool in the staff interface

A club enrollment can be cancel but it can't be edited
This patch add a 'edit' functionality to the Clubs tool in the staff interface

Test plan
1. Create a club template
    1.1. Go to Tools > Patron clubs
    1.2. Click on 'New Club Template'
    1.3. Fill the form
    1.4. on the 'Club fields' section, Click on Add new field
    1.5. Fill in the form
    1.6. on the 'Enrollment fields' section, Click on Add new field
    1.7. Fill in the form
    1.8. Click on Save button

2. Creation of the club
    2.1. Go to Tools > Patron clubs > 'Clubs' section (bottom)
    2.2. Click on the 'New Club' button and select the club template create on step 1
    2.3. Fill in the form
    2.4. Click on Save button

3. Club enrollement
    On the intranet
    3.1. Search for a pratron and open the patron folder
    3.2. Click on the 'Clubs' tab
    3.3. Find the name of the club and click on 'Enroll'
    3.4. Fill the questionnaire
    3.5. Confirm registration
        ---> Note that the enrollement can be canceled but it cannot be modified

4.  Apply the patch
5. Click one more time on the 'Clubs' tab
   ---> Note that the enrollement can now be modified

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 30860: Cache CanItemBeReserved return value
Jonathan Druart [Wed, 22 Mar 2023 15:30:31 +0000 (16:30 +0100)]
Bug 30860: Cache CanItemBeReserved return value

This patch caches the return value of CanItemBeReserved that could
be then returned *on
demand*
We don't want to introduce side-effects hard to catch from this simple
change, so let's return the cache value only from the 2 scripts we are
dealing with.

This patch requests all item values from CanBookBeReserved on request.pl

Before this we either:
- Looped every item to find out that book could not be reserved
- Looped until we found an item that could be reserved, then looped all items to get statuses

In the worst case we avoid double processing a single item, in the best case we avoid double
processing all items (if only last on record is holdable)

To test:
1 - Find a record in staff client with several items
2 - Set AllowHoldsOnDamagedItems  to 'Dont allow'
3 - Add a damaged item to record
4 - Set a hold rule to only allow holds form homebranch and ensure record has items from other branches
5 - Setup things to prevent more items from being held
6 - Attempt hold for patron
7 - Note item statuses
8 - Apply patch
9 - Confirm statuses are as they were before

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 28726: Add sort1 and sort2 to patron card creator - patron search.
Michael Hafen [Tue, 20 Jul 2021 18:12:42 +0000 (12:12 -0600)]
Bug 28726: Add sort1 and sort2 to patron card creator - patron search.

Also adds a select all / clear all and checkboxes.

Test plan:

1. start a new batch in the patron card creator (Tools -> Patron card creator -> New -> card batch)
2. click the Add patron(s) button.  Observe that Category and Library are the only options.
3. Close search for patron window.
4. Apply patch.
5. click the Add patron(s) button.  Observe that you can now search for patrons by their sort1 and sort2 values.
6. perform a search and observe the 'Select all | Clear all | Add selected patrons' links and button.
7. use the Select all link to select all the patrons found by the search.
8. use the Add selected patrons button to add the selected patrons to the card batch's Add by borrowernumber(s) text input field.
9. close the search for patron window.

Signed-off-by: Solene Ngamga <solene.ngamga@inLibro.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34071: Change the phrasing of 'automatic checkin' to fit consistent terminology
Sam Lau [Wed, 21 Jun 2023 17:18:20 +0000 (17:18 +0000)]
Bug 34071: Change the phrasing of 'automatic checkin' to fit consistent terminology

This patch simply changes 'Automatic checkin' to be 'Automatic
check-in'.

Test plan:
1) Go to administration -> item types and click the edit button on an
   item.
2) Notice there is a checkbox labeled 'Automatic checkin'.
3) Apply patch.
4) Refresh the page and notice the checkbox now says 'Automatic
   check-in'.
5) prove t/db_dependent/Koha/Checkouts.t
6) Sign-off :)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33578: Fix controller when editing a restriction type
Jonathan Druart [Wed, 10 May 2023 11:53:20 +0000 (13:53 +0200)]
Bug 33578: Fix controller when editing a restriction type

Do not display a warning when we are editing a restriction type and no
other types with this description exists.

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33578: Fix patron restriction types edition
Jonathan Druart [Wed, 10 May 2023 09:21:19 +0000 (11:21 +0200)]
Bug 33578: Fix patron restriction types edition

When editing an existing patron restriction type you'll always get an error on saving:

Label is already in use

To test:
* Activate use of patron restriction types
* Edit any of the system types
* Create new ones

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33894: Use template wrapper for tabs: OPAC search history
Owen Leonard [Thu, 1 Jun 2023 13:40:02 +0000 (13:40 +0000)]
Bug 33894: Use template wrapper for tabs: OPAC search history

This patch updates the OPAC search history page so that it uses
the new WRAPPER syntax to generate tabs markup.

To test, apply the patch and view the OPAC search history page. With the
OpacAuthorities system preference enabled you should see two tabs:
Catalog and Authority. Confirm that each tab shows the correct
information.

Deactivate OpacAuthorities and reload the search history page. The
bibliographic search history should display without tabs.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 33894: Restructuring: Use BLOCKs for biblio and authority sections
Owen Leonard [Thu, 1 Jun 2023 13:33:38 +0000 (13:33 +0000)]
Bug 33894: Restructuring: Use BLOCKs for biblio and authority sections

In order to make the conversion to the tab wrapper markup easier I'm
putting the biblio search history and authority search history sections
into blocks. This will make it easier to include or not include the
sections using template logic.

To test, apply the patch and, if necessary, perform some searches for
bibliographic and authority records. The OPAC search history page should
be unchanged, with the correct information showing under each tab and in
each section for current and previous searches.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34013: Recalls awaiting pickup doesn't show count on each tab
Owen Leonard [Wed, 14 Jun 2023 17:23:40 +0000 (17:23 +0000)]
Bug 34013: Recalls awaiting pickup doesn't show count on each tab

This patch modifies recalls_waiting.pl so that it defines template
variables for 'recalls waiting' and 'recalls waiting over x days'
counts in the same way that waitingreserves.pl handles it.

To test you must have UseRecalls enabled, and some recalls data that
will allow you to see content under each tab.

Go to Circulation -> Recalls awaiting pickup and confirm that both tabs
show the correct count.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
13 months agoBug 34012: Use template wrapper for tabs: Recalls awaiting pickup
Owen Leonard [Wed, 14 Jun 2023 17:09:48 +0000 (17:09 +0000)]
Bug 34012: Use template wrapper for tabs: Recalls awaiting pickup

This patch updates the recalls awaiting pickup template so that it uses
the new WRAPPER directive to build tabbed navigation.

Note: this patch includes indentation changes, so check the diff
accordingly.

To test you must have UseRecalls enabled. Apply the patch and go to
Circulation -> Recalls awaiting pickup.

Both the "Recalls waiting" and "Recalls waiting over X days" tabs should
look correct and work correctly.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>