]> git.koha-community.org Git - koha.git/log
koha.git
17 months agoBug 33104: DBIC schema
Tomas Cohen Arazi [Fri, 5 May 2023 12:56:19 +0000 (09:56 -0300)]
Bug 33104: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: Rename interfaces.id with interface_id
Jonathan Druart [Fri, 14 Apr 2023 06:14:47 +0000 (08:14 +0200)]
Bug 33104: Rename interfaces.id with interface_id

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: Remove fieldset
Jonathan Druart [Tue, 11 Apr 2023 10:23:32 +0000 (12:23 +0200)]
Bug 33104: Remove fieldset

For consistency with "Contacts"

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: Prevent 'Type' to be cleared
Jonathan Druart [Tue, 11 Apr 2023 10:03:42 +0000 (12:03 +0200)]
Bug 33104: Prevent 'Type' to be cleared

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: Add email validation
Jonathan Druart [Tue, 11 Apr 2023 09:59:04 +0000 (11:59 +0200)]
Bug 33104: Add email validation

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: Fix translatability
Jonathan Druart [Tue, 11 Apr 2023 09:45:00 +0000 (11:45 +0200)]
Bug 33104: Fix translatability

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: Add tests
Jonathan Druart [Thu, 2 Mar 2023 13:15:15 +0000 (14:15 +0100)]
Bug 33104: Add tests

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: Display the VENDOR_INTERFACE_TYPE AVs in the dropdown list
Jonathan Druart [Thu, 2 Mar 2023 13:40:42 +0000 (14:40 +0100)]
Bug 33104: Display the VENDOR_INTERFACE_TYPE AVs in the dropdown list

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: Encrypt password
Jonathan Druart [Thu, 2 Mar 2023 12:41:16 +0000 (13:41 +0100)]
Bug 33104: Encrypt password

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: Make the code reusable
Jonathan Druart [Thu, 2 Mar 2023 09:56:42 +0000 (10:56 +0100)]
Bug 33104: Make the code reusable

We could then reuse it for the contacts code in this same template, on
another bug report.

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: Add the ability to create vendor interfaces
Jonathan Druart [Wed, 1 Mar 2023 14:53:22 +0000 (15:53 +0100)]
Bug 33104: Add the ability to create vendor interfaces

This patchset is adding the ability to create interfaces for vendors.
An interface is a website, software, or portal that you use to manage orders or
gather statistics from the vendor/organisation.

It will help librarians to keep track of those different information
within Koha.

* new DB table aqbookseller_interfaces(id, vendor_id, type, name, uri,
login, password, account_email, notes)
* new AV category VENDOR_INTERFACE_TYPE with 3 example values ADMIN,
ORDERS, REPORTS
* new pair of Koha classes Koha::Acquisition::Bookseller::Interface[s]
* new method to retrieve the interfaces from the vendor
Koha::Acquisition::Bookseller->interfaces
* Add/Delete interfaces when editing a vendor
* Display the interfaces on the vendor show view

Test plan:
- Add a new vendor
=> Notice the new "Interfaces" block
- Create some interfaces
=> They are display on the vendor show view
=> The password is hashed and can displayed on the demand

QA Note:
The "contacts" code is not very nice and I didn't want to replicate it,
so I went another way and tried to make the code reusable, for further
reutilisation.

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: Koha classes
Jonathan Druart [Wed, 1 Mar 2023 14:27:39 +0000 (15:27 +0100)]
Bug 33104: Koha classes

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33104: DB changes
Jonathan Druart [Wed, 1 Mar 2023 14:18:17 +0000 (15:18 +0100)]
Bug 33104: DB changes

Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 31448: Replace 'Print' with 'Receipt' dropdown
Martin Renvoize [Wed, 24 Aug 2022 07:28:12 +0000 (08:28 +0100)]
Bug 31448: Replace 'Print' with 'Receipt' dropdown

This patch replaces the 'Print' button with a 'Receipt' menu dropdown
exposing 'Print' and 'Email' options when `UseEmailReceipts` is enabled

Test plan
1. Enable `UseEmailReceipts`
2. Navigate to a patron with paid charges
3. Note the new dropdown 'Receipt' menu
4. Confirm 'Print' works as expected
5. Confirm 'Email' works as expected

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 31795: (follow-up) Mock call to FindDuplicateAuthority
Tomas Cohen Arazi [Tue, 11 Apr 2023 15:04:17 +0000 (12:04 -0300)]
Bug 31795: (follow-up) Mock call to FindDuplicateAuthority

When running against Zebra, this tests fail because it requires the
record to be indexed timely. In theory, a 5 seconds delay should be
enough for the indexer to pick up. But that's not the point of the test,
and we should better just mock the query in this case.

To test:
1. Have ktd launch with zebra:
   $ ktd up -d
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/authorities.t
=> FAIL: Tests fail!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Launch ktd with ES:
   $ ktd down
   $ ktd --es7 up -d
6. Repeat 2
=> SUCCESS: Tests pass!
7. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 31795: Fix required permissions
Tomas Cohen Arazi [Mon, 10 Apr 2023 17:54:30 +0000 (14:54 -0300)]
Bug 31795: Fix required permissions

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 31795: (QA follow-up) Use x-koha-override header
Tomas Cohen Arazi [Mon, 10 Apr 2023 17:14:12 +0000 (14:14 -0300)]
Bug 31795: (QA follow-up) Use x-koha-override header

Despite its title, this patch does a couple more things.

1. The tests are rewritten to cover more things, and also to avoid
   deleting all authorities inside the transaction. It is really not
   required.
2. It makes the endpoint rely on the already generically implemented
   x-koha-override header, which is intended for the same use case as
   x-confirm-not-duplicate is for.
3. It changes the return codes to match the coding guidelines [1]
4. Only checks for duplicates if no override passed.

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

[1] https://wiki.koha-community.org/wiki/Coding_Guidelines_-_API#SWAGGER3.2.1_POST

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 31795: Add REST endpoint to add an authority
Agustin Moyano [Thu, 6 Apr 2023 18:55:26 +0000 (15:55 -0300)]
Bug 31795: Add REST endpoint to add an authority

To test:
1. Apply patch
2. Set RESTBasicAuth preference to true
3. Make a POST request to /api/v1/authorities with one of the following content type header
  - application/json
  - application/marcxml+xml
  - application/marc-in-json
  - application/marc
4. If content type is other than application/json, then add the following header to the request: "x-authority-type: <auth type code>"
5. Check that the authority is created
6. Sign off

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32412: Do not reload COCE image for biblio
Jonathan Druart [Wed, 3 May 2023 09:16:14 +0000 (11:16 +0200)]
Bug 32412: Do not reload COCE image for biblio

We do not want to fetch again the new image for the biblio record. We
only want to fetch those for the shelf browser.

Note that the third parameter 'covernewwindow' was not used.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32412: Empty coce container before appending image
Lucas Gass [Tue, 4 Apr 2023 21:50:39 +0000 (21:50 +0000)]
Bug 32412: Empty coce container before appending image

To test:
1. Apply patch and clear browser cache
2. Turn on Coce for the OPAC.
3. OPACShelfBrowser must be on
4. Find a record that returns a cover image and open it's detail page.
5. Use the next/previous navigation links in the OPACShelfBrowser
6. Notice that no extra image is being added to the biblio-cover-slider.
7. Make sure that Coce images still load correctly in on the OPAC detail page, OPAC results page, and in the shelf browser.

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33551: (QA follow-up) Fix TT filters
Katrin Fischer [Wed, 3 May 2023 20:51:49 +0000 (20:51 +0000)]
Bug 33551: (QA follow-up) Fix TT filters

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33551: Remove span from restriction-types.inc
Jonathan Druart [Wed, 3 May 2023 07:09:25 +0000 (09:09 +0200)]
Bug 33551: Remove span from restriction-types.inc

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33419: (QA follow-up) Remove changes to basic_workflow.t
Katrin Fischer [Tue, 2 May 2023 22:48:09 +0000 (22:48 +0000)]
Bug 33419: (QA follow-up) Remove changes to basic_workflow.t

These are not needed: 942 and 200 have no subfields for
homebranch and holdingbranch.

The tests pass without these changes.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33419: Make home library and current library mandatory by default
Laura Escamilla [Tue, 2 May 2023 18:35:23 +0000 (18:35 +0000)]
Bug 33419: Make home library and current library mandatory by default

Items without a home and current library can cause errors in Koha.
On the bibliographic page, items appear without the "edit" drop-down
or the selection check box. On a bulk delete page, items without
a home library create a red error that says "Cannot delete".

Making the home and current library values mandatory
helps avoid these issues.

Test plan (using koha-testing-docker (KTD)):
1. Reset KTD so that the web installer is used to setup Koha.[1]
2. Setup Koha using the web installer
   -> When setting up the default settings, don't add any of the
      optional data.
3. Once setup and logged in, check the two frameworks (default and ACQ)
    and note that $952$a and $952$b are not mandatory.
4. Apply the patch.
5. Repeat steps 1-2.
6. Once setup and logged in, check the two frameworks (default and ACQ)
   and note that $952$a and $952$b are now mandatory.

[1] How to access the web installer to setup Koha in KTD:
1. Access the database server:
   mysql -uroot -ppassword -hkoha-db-1
2. Drop the koha_kohadev database: drop database koha_kohadev;
3. Create the database: create database koha_kohadev;
4. Add privileges (for a real installation this would be limited):
   grant all on koha_kohadev.* to koha_kohadev;
5. Restart everything (there may be some errors listed):
   flush_memcached and then restart_all
6. Access the web installer: go to 127.0.0.1:8081
7. Use the database user name and password:
   get from /etc/koha/sites/kohadev/koha-conf.xml
   (default: koha_kohadev, password)
8. Continue through the installation process.

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>
17 months agoBug 33329: Correctly handle UNIMARC encoding for biblios
Tomas Cohen Arazi [Fri, 14 Apr 2023 20:21:15 +0000 (17:21 -0300)]
Bug 33329: Correctly handle UNIMARC encoding for biblios

This patch introduces the same treatment we had for bug 32336, this time
for Koha::Objects::Record::Collections.

To test:
1. Apply the regression tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/biblios.t
=> FAIL: Tests fail! Encoding is wrong for UNIMARC!
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass!
5. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33329: Regression tests
Tomas Cohen Arazi [Thu, 23 Mar 2023 23:46:44 +0000 (20:46 -0300)]
Bug 33329: Regression tests

This patch introduces tests for the bug highlighted on bug 32336, but in
the context of lists of records.

To reproduce:
1. Run:
   $ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass!
2. Apply this patch
3. Repeat 1
=> FAIL: Test fail, encoding is bad!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32701: Fix I18N JavaScript libraries on self checkout help page
Katrin Fischer [Sun, 23 Apr 2023 21:16:52 +0000 (21:16 +0000)]
Bug 32701: Fix I18N JavaScript libraries on self checkout help page

The help page was missing the fixes from bug 28488. The missing
libraries are causing a JavaScript error on the page and likely
other issues.

To test:
* Make sure WebBasedSelfCheck is activated and configured
  Note: In ktd you don't need to configure anything, it's already set up.
* In the OPAC, go to:
  /cgi-bin/koha/sco/sco-main.pl
* Click on the link to the help in the top right corner
* Verify you see the error in the console:
  jQuery.Deferred exception: __ is not defined
* Apply patch
* Restart things
* Reload the page
* Veriy the errors are gone

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>
17 months agoBug 33649: Fix use of cronlogaction
Magnus Enger [Wed, 3 May 2023 06:51:14 +0000 (08:51 +0200)]
Bug 33649: Fix use of cronlogaction

C4::Log::cronlogaction() takes a hashref as argument, with "info"
and possibly "action" as keys. But there are a couple of places
where it is called with just a string as argument, and that does
not work. Both places need lock_exec to fail to trigger the error.
I have seen this on a production server, but not been able to
reproduce in ktd.

To test:
- Run this on the Koha repo: grep -r "cronlogaction(" *
- Verify that fines.pl and process_message_queue.pl are the only
  scripts that call cronlogaction without a hashref as argument,
  but do it like this: cronlogaction( $message );
- Apply this patch
- Run the grep again and verify that all calls to cronlogaction
  now take a hashref as argument

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>
17 months agoBug 33470: Don't calculate overridden hold limits
Nick Clemens [Sun, 9 Apr 2023 18:25:41 +0000 (18:25 +0000)]
Bug 33470: Don't calculate overridden hold limits

This patch can largely be checked in the code to ensure it makes sense, it
moves a conditional up one level for the two different checks that could prevent holds

To test:
1 - Attempt to place a hold via the REST API with an invalid pickup location
    Set pickup location as no in branches to make this easy
2 - Confirm you get an error
3 - Attempt again with header (bug 27760):
    x-koha-override: any
4 - Hold is placed
5 - Repeat 1-4 above but with an item that cannot be held
6 - Apply patch
7 - Repeat 1-4 above
8 - Results should be the same

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32921: Honor SelfCheckTimeout when modal is open
Lucas Gass [Wed, 8 Feb 2023 23:28:59 +0000 (23:28 +0000)]
Bug 32921: Honor SelfCheckTimeout when modal is open

To test:
1. Set the 'SelfCheckTimeout' system preference to something low for testing.
2. Make sure 'SelfCheckReceiptPrompt' is set to 'Show'.
3. Log in to SCO and press finish but leave the modal open.
4. Wait until the 'SelfCheckTimeout' time has expired, nothing happens.
5. Apply patch and try again. You should be logged out when SelfCheckTimeout expires.

Signed-off-by: Marius Mandrescu <marius.mandrescu@inLibro.com>
JD amended patch - fix indentation

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 28267: Simplify things
Jonathan Druart [Thu, 4 May 2023 07:05:17 +0000 (09:05 +0200)]
Bug 28267: Simplify things

We don't need:
* a separate Koha::Installer module when we already have
C4::Installer
* the tests as they are actually modifying the DB structure
without rolling back
* An unecessary complicated subroutine, just make is simple

WNC amended patch: Remove change to Koha.pm

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 28267: Add warnings for database row formats
David Cook [Wed, 18 Jan 2023 03:20:29 +0000 (03:20 +0000)]
Bug 28267: Add warnings for database row formats

This patch adds a warning on about.pl regarding database row formats
other than "DYNAMIC". It points to the Koha community wiki for more
information on how to resolve the problem.

This patch also stops the installer if there are any database tables
with a row format other than "DYNAMIC". It points to the Koha community
wiki for more information on how to resolve the problem.

Test plan:
0a. Apply the patch
0b. koha-plack --restart kohadev
1a. koha-mysql kohadev
1b. ALTER TABLE tags ROW_FORMAT=COMPACT;
2. Go to http://localhost:8081/cgi-bin/koha/about.pl
3. Note that there is a warning about database row formats
4a. koha-mysql kohadev
4b. ALTER TABLE tags ROW_FORMAT=DYNAMIC;
5. Go to http://localhost:8081/cgi-bin/koha/about.pl
6. Note that there is no warning about database row formats

7a. Manually change the version in Koha.pm to a higher version
7b. koha-plack --restart kohadev
8a. koha-mysql kohadev
8b. ALTER TABLE tags ROW_FORMAT=COMPACT;
9. Go to http://localhost:8081/
10. Log into the web installer and click through until you reach
a warning telling you that you have database row formats other
than 'DYNAMIC'
11. Note that you can't progress with the installer until
this problem is resolved
12a. koha-mysql kohadev
12b. ALTER TABLE tags ROW_FORMAT=DYNAMIC;
13. Refresh the page or redo the web installer process
14. Note that you're no longer blocked from running the installer
due to database row format
15. Undo your change to Koha.pm
16. Profit

Note: Due to bug 32665 you'll see an unrelated warning on
step 3

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33262: DBRev 22.12.00.027
Tomas Cohen Arazi [Fri, 5 May 2023 12:32:48 +0000 (09:32 -0300)]
Bug 33262: DBRev 22.12.00.027

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33262: DBIC schema
Tomas Cohen Arazi [Fri, 5 May 2023 12:31:58 +0000 (09:31 -0300)]
Bug 33262: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33262: Add new field to REST API route for orders
Katrin Fischer [Thu, 4 May 2023 15:06:45 +0000 (15:06 +0000)]
Bug 33262: Add new field to REST API route for orders

Without this patch the API driven list of pending orders
on the order receive page was broken.

With the patch, all should be well now.

prove -v t/db_dependent/api/v1/acquisitions_orders.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33262: Unit tests
Katrin Fischer [Thu, 4 May 2023 13:08:54 +0000 (13:08 +0000)]
Bug 33262: Unit tests

prove t/db_dependent/Biblio.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33262: Store the biblionumber of a deleted record in the order line
Katrin Fischer [Thu, 4 May 2023 12:15:36 +0000 (12:15 +0000)]
Bug 33262: Store the biblionumber of a deleted record in the order line

When a bibliographic record is deleted and linked to an order
in the acquisition module, the biblionumber in the order line is
currently deleted as well. This makes it impossible to tell what
was ordered in the first place. This is a big issue for libraries
that need to be able to track how money was spent over long periods
of time.

With this patch the biblionumber of the deleted record will be moved
to a new column deleted_biblionumber in the order line, keeping the FK
on biblionumber.

To test:
* Apply patch, run dataase update
* Create a order/basket in the acquisitions module
* Order several things, you can use existing records from the sample data
* Make sure you order one of the records at least twice
* Take a look at the aqorders table in your database, using a report:

  SELECT biblionumber, deleted_biblionumber, ordernumber from aqorders;

* From the catalog, delete the items on the records and then the records

  Note: There is a warning about attached orders warning about consequences
  for acquisitions. I have chosen to keep it at this point in time, as
  there are still visible side effects of deleting the record, like bug 10758.

* Re-run the report and compare results to the first run. deleted_biblionumber
  should now be filled with the biblionumber of the deleted record.
  biblionumber should be NULL/empty.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33262: Add deleted_biblionumber column to aqorders table
Katrin Fischer [Thu, 4 May 2023 13:23:31 +0000 (13:23 +0000)]
Bug 33262: Add deleted_biblionumber column to aqorders table

This adds a new column deleted_biblionumber to the aqorders table.
This will allow us to store the biblionumber of a deleted record,
so we will still be able to tell what has been ordered once the
record is deleted.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 22440: DBRev 22.12.00.026
Tomas Cohen Arazi [Fri, 5 May 2023 12:12:47 +0000 (09:12 -0300)]
Bug 22440: DBRev 22.12.00.026

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 22440: DBIC schema
Tomas Cohen Arazi [Fri, 5 May 2023 12:10:31 +0000 (09:10 -0300)]
Bug 22440: DBIC schema

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 22440: Move backend statuses api endpoint
Pedro Amorim [Thu, 27 Apr 2023 16:08:56 +0000 (16:08 +0000)]
Bug 22440: Move backend statuses api endpoint

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 22440: Tests
Pedro Amorim [Thu, 30 Mar 2023 10:07:05 +0000 (12:07 +0200)]
Bug 22440: Tests

Updated API tests

Co-authored-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 22440: ILL API changes
Pedro Amorim [Mon, 24 Apr 2023 15:28:28 +0000 (15:28 +0000)]
Bug 22440: ILL API changes

* Add GET /illbackends/{id}/statuses
* Change API route to ill/requests

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 22440: New ILL requests table
Pedro Amorim [Thu, 30 Mar 2023 10:07:17 +0000 (12:07 +0200)]
Bug 22440: New ILL requests table

Use kohaTable requesting the REST api instead of the old KohaTable

Co-authored-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 22440: Add GET /ill_requests
Tomas Cohen Arazi [Thu, 30 Mar 2023 09:01:08 +0000 (11:01 +0200)]
Bug 22440: Add GET /ill_requests

Co-authored-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 22440: Add standard accessors for later usage
Tomas Cohen Arazi [Thu, 30 Mar 2023 08:54:51 +0000 (10:54 +0200)]
Bug 22440: Add standard accessors for later usage

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 22440: Add missing foreign key
Tomas Cohen Arazi [Thu, 30 Mar 2023 08:49:51 +0000 (10:49 +0200)]
Bug 22440: Add missing foreign key

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 22440: Add Koha::Illrequests->filter_by_visible
Tomas Cohen Arazi [Fri, 6 Jan 2023 15:48:39 +0000 (12:48 -0300)]
Bug 22440: Add Koha::Illrequests->filter_by_visible

This patch introduces a method for filtering out requests that match the
statuses specified on the *ILLHiddenRequestStatuses* system preference.

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

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32931: Fix translatability issues on 'show agreement' view
Jonathan Druart [Wed, 19 Apr 2023 06:53:03 +0000 (08:53 +0200)]
Bug 32931: Fix translatability issues on 'show agreement' view

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>
17 months agoBug 32931: Fix translatability issues on 'new agreement' form
Katrin Fischer [Sun, 16 Apr 2023 11:29:39 +0000 (11:29 +0000)]
Bug 32931: Fix translatability issues on 'new agreement' form

This fixes the "Yes" and "No" options and "License info" placeholder.

To get to the options:
1. Enable the ERMModule system preference
2. Go to E-resource management
3. Click "Agreements"
4. Click "New agreement"
   --> Field "Is perpetual", options are Yes and No
   --> At the bottom of the form "License info" with "License info"
       within the input field
5. Install (complete) language, verify those are not translated
6. Apply patch
7. Update po files
8. Verify strings exist for this file, translate if necessary
9. Re-install language
10. Verify strings are now translated

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>
17 months agoBug 32253: Load all CodeMirror lines initially when using advanced editor
Lucas Gass [Mon, 1 May 2023 22:13:02 +0000 (22:13 +0000)]
Bug 32253: Load all CodeMirror lines initially when using advanced editor

To test:
1. Have advanced editor turned on.
2. Load a record with many lines and see that not all the lines appear until you click on the visible ones.
3. Apply patch and try again
4. All lines should load.

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>
17 months agoBug 33588: Add page-section to inventory tool items list
Katrin Fischer [Fri, 21 Apr 2023 20:13:04 +0000 (20:13 +0000)]
Bug 33588: Add page-section to inventory tool items list

The table with items created by the inventory tool was
missing the page-section class and therefore had no
white background.

To test:
* Go to cataloguing > inventory
* When you don't have a lot of data: just submit the form
* Look at the result list, confirm missing white background
* Apply patch
* Confirm the background is now correct

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32874: Fix cataloguing/value_builder/unimarc_field_700-4.pl
Julian Maurice [Fri, 3 Feb 2023 10:58:55 +0000 (11:58 +0100)]
Bug 32874: Fix cataloguing/value_builder/unimarc_field_700-4.pl

Use event parameter

This is part of the refactoring happening in bug 30975

Test plan:
1. Verify that the plugin continues to work as before

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>
17 months agoBug 33490: Add test
Pedro Amorim [Fri, 21 Apr 2023 12:53:15 +0000 (12:53 +0000)]
Bug 33490: Add test

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33490: Fix ambiguous query error
Pedro Amorim [Fri, 21 Apr 2023 11:48:55 +0000 (11:48 +0000)]
Bug 33490: Fix ambiguous query error

Doing actual testing with some agreements with expired periods, this was returning a 500 error

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33490: Rollback computed
Pedro Amorim [Fri, 21 Apr 2023 11:42:05 +0000 (11:42 +0000)]
Bug 33490: Rollback computed

Use a watch instead

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33490: Use computed values
Jonathan Druart [Fri, 14 Apr 2023 10:05:44 +0000 (12:05 +0200)]
Bug 33490: Use computed values

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33490: Improve max date handling
Jonathan Druart [Fri, 14 Apr 2023 09:09:33 +0000 (11:09 +0200)]
Bug 33490: Improve max date handling

It fixes:
1. /agreements?by_expired=true do no longer explode
2. Fill date with today's date when we setup the component and when we
hit "filter"

However there are a couple of things totally wrong:
1. We should not need is_fp_disabled, we could be able to use
  :disabled="!filters.by_expired"
in the template, but it does not work
2. We should not need to deal with filters.max_expiration_date the "old
JS way", but should use a Vue computed value instead. I've failed at
that

I think those 2 problems have the same root, the way we deal with
filters in data() is wrong, and we may be loosing the ref at some point.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33490: Make url consistent
Martin Renvoize [Thu, 13 Apr 2023 17:12:13 +0000 (18:12 +0100)]
Bug 33490: Make url consistent

This ensures we populate the max_expiration_date param on the browser
url for consistency with selected dates.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33490: Prevent 400 on agreements?by_expired=true
Jonathan Druart [Wed, 12 Apr 2023 10:20:43 +0000 (12:20 +0200)]
Bug 33490: Prevent 400 on agreements?by_expired=true

We need to update the filter THEN update the current route

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33490: Unit tests
Martin Renvoize [Thu, 13 Apr 2023 13:38:58 +0000 (14:38 +0100)]
Bug 33490: Unit tests

This patch adds cypress tests for the filter by expired functionality in
the ERM Agreements page.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33505: Improve styling of scan index page
Katrin Fischer [Wed, 12 Apr 2023 20:59:34 +0000 (20:59 +0000)]
Bug 33505: Improve styling of scan index page

This patch makes some changes to the 'scan index' page.

* Updates second h1 heading "Scan index:" to h2 level heading "Scan index"
* Removes table from the search form
* Moves search index pull down and search term into one line
* Reorders options with search index first and search term after, matching
  the advanced search form
* Removes the catalog results toolbar from the top, card hold etc. are not needed
  here.
* Fixes doubled up id attribute: scan-index by turning one into scan-index-term.

To test:
* Go to advanced search in staff interface
* Activate 'More options'
* Check checkbox for scan indexes
* Switch to author (especially when using Elasticsearch)
* Search for C
* Check display, especially search options, options at the top of the page etc.
* Apply patch
* Verify changes listed above
* Regression test the normal search results, all should look the same with and without patch.
* If you think the scan index page is nicer now - sign off.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33506: Fix false index for series and keep selected index on scan index page
Katrin Fischer [Wed, 12 Apr 2023 20:19:38 +0000 (20:19 +0000)]
Bug 33506: Fix false index for series and keep selected index on scan index page

The pull down with search options had the wrong index
linked to the Series entry: su instead of se

To test:
* Go to advanced search in staff interface
* Activate 'More options'
* Check checkbox for scan indexes
* Switch to author (especially when using Elasticsearch)
* Search for C
* Verify search results link to authors using c
* Switch to series
* Verify search results use 'su' for subject
* Verify that search option pull down always jumps back to first
  entry: Any word
* Apply patch
* Verify the search results for series now use correct index se
* Verify that coming from advanced search, the correct search option is selected
* Verify that changing the search option also keeps the selection after searching

Note: with Elasticsearch and default configuration author, title and series will
give you results.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32745: DBRev 22.12.00.025
Tomas Cohen Arazi [Fri, 5 May 2023 12:12:01 +0000 (09:12 -0300)]
Bug 32745: DBRev 22.12.00.025

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32745: Adjust context for invalid background jobs
Jonathan Druart [Fri, 24 Mar 2023 10:17:58 +0000 (11:17 +0100)]
Bug 32745: Adjust context for invalid background jobs

We had some problems recently and it's possible to have
background_jobs.context=NULL
But the REST API specs is expecting an object.
We could either modify the specs, or adjust the incorrect entries in DB,
which is IMO better.

Test plan:
0. Don't apply the patch
1. Create some background jobs
2. Set context to NULL
UPDATE background_jobs SET context=NULL;
3. List the jobs and note the datatable error, and the error in Koha log
  OpenAPI >>> GET api/v1/jobs [{"message":"Expected object - got null.","path":"\/body\/0\/context"},{"message":"Expected object - got null.","path":"\/body\/1\/context"}]

4. Apply the patch
5. Run `updatedatabase`
6. Confirm that the list and detail view are not working correctly

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>
17 months agoBug 33597: (follow-up) Two other occurrences for holdfor
Marcel de Rooy [Mon, 24 Apr 2023 10:51:15 +0000 (10:51 +0000)]
Bug 33597: (follow-up) Two other occurrences for holdfor

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33597: Fix deleting cookie for holdfor(club)
Marcel de Rooy [Mon, 24 Apr 2023 10:35:26 +0000 (10:35 +0000)]
Bug 33597: Fix deleting cookie for holdfor(club)

Resolve:
Cookie “holdfor” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it.

Did not see warning for holdforclub. But since it is created with Lax, we should remove it with Lax.

Test plan:
Similar to previous patch. Check console on logout page.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33597: Get rid of warning about intranet_bib_list
Marcel de Rooy [Mon, 24 Apr 2023 10:23:19 +0000 (10:23 +0000)]
Bug 33597: Get rid of warning about intranet_bib_list

Resolve:
Cookie “intranet_bib_list” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it.
basket_22.1200022.js:67:65

Test plan:
Do not apply this patch.
Logout from staff.
Check browser console warnings.
Apply this patch.
Login and logout again.
Check warnings again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33598: Use template wrapper for breadcrumbs: Tools, part 5
Owen Leonard [Mon, 24 Apr 2023 11:21:42 +0000 (11:21 +0000)]
Bug 33598: Use template wrapper for breadcrumbs: Tools, part 5

This patch updates several templates in the tools directory so that they
use the new WRAPPER for displaying breadcrumbs.

To test, apply the patch and test each page and its variations.
Breadcrumbs should look correct, and each link should be correct.

- Tools ->
  - Pages ->
    - View a page in the staff interface
  - Upload patron images
    - Upload results
  - Quote editor
    - Quotes upload
  - OPAC problem reports (must have OPACReportProblem enabled)

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33566: Use template wrapper for breadcrumbs: Tools, part 1
Owen Leonard [Wed, 19 Apr 2023 19:10:18 +0000 (19:10 +0000)]
Bug 33566: Use template wrapper for breadcrumbs: Tools, part 1

This patch updates several templates in the tools directory so that they
use the new WRAPPER for displaying breadcrumbs.

To test, apply the patch and test each page and its variations.
Breadcrumbs should look correct, and each link should be correct.

- Tools ->
  - Batch extend due dates
  - Access files (it is not necessary to have file access configured to
    test, there are no variations to the breadcrumbs)
  - News, HTML customizations, and Pages: For each category check each
    variation:
    - List of entries
    - New entry
    - Edit entry
- Cataloging ->
  - Batch record deletion
  - Item modifications by age
    - Edit rules

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33564: Use template wrapper for breadcrumbs: Serials part 3
Owen Leonard [Wed, 19 Apr 2023 18:17:46 +0000 (18:17 +0000)]
Bug 33564: Use template wrapper for breadcrumbs: Serials part 3

This patch updates several serials templates so that they use the new
WRAPPER for displaying breadcrumbs.

To test, apply the patch and test each page and its variations.
Breadcrumbs should look correct, and each link should be correct.

- Serials ->
 - Manage frequencies
   - New frequency
   - Edit frequency
 - Manage numbering patterns
   - New numbering pattern
   - Edit numbering pattern
 - Search subscriptions -> View subscription details
   - If necessary, edit the subscription to enable "Manual
     history"
     - Under the "Planning" tab of the detail page, click
       "Edit history"
   - If necessary, edit the subscription and select a notice under
     "Patron notification."
     - Under the "Information" tab of the subscription detail page,
       click "subscribers"

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33559: Use template wrapper for breadcrumbs: Serials part 2
Owen Leonard [Tue, 18 Apr 2023 16:18:24 +0000 (16:18 +0000)]
Bug 33559: Use template wrapper for breadcrumbs: Serials part 2

This patch updates several serials templates so that they use the new
WRAPPER for displaying breadcrumbs.

To test, apply the patch and test each page and its variations.
Breadcrumbs should look correct, and each link should be correct.

- Serials ->
  - Serials home page
    - New subscription
    - Serials search results
      - Subscription details -> Edit subscription
      - Subscription details -> Serial collection -> Edit serials
      - Select one or more seach results and click the "Edit selected
        serials" to test the batch edit page

Signed-off-by: Andrew Auld <andrew.auld@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33437: Use template wrapper for breadcrumbs: Reports part 2
Owen Leonard [Mon, 17 Apr 2023 17:14:05 +0000 (17:14 +0000)]
Bug 33437: Use template wrapper for breadcrumbs: Reports part 2

This patch updates several reports templates so that they use the new
WRAPPER for displaying breadcrumbs.

To test, apply the patch and test each page and its variations.
Breadcrumbs should look correct, and each link should be correct.

- Reports ->
  - Most circulated items
    - Report results
  - Items with no checkouts
    - Report results
  - Catalog statistics wizard
    - Report results
  - View dictionary
    - New definition (steps 1-5)
  - Saved reports
    - View report
    - New report
    - Edit report
  - Guided reports
    - Build a report
      - Steps 1 through 6

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33634: Correct anchors in system preference submenu
Lucas Gass [Fri, 28 Apr 2023 15:53:19 +0000 (15:53 +0000)]
Bug 33634: Correct anchors in system preference submenu

To test:
1. Go to Koha Administration -> Global system preferences
2. Go to a tab with a few headings like Circulation
3. Click on a heading in the sidebar navigation under Circulation that takes you a bit down the page, like Recalls
4. Notice this anchor link does not work, you are not taken to the recalls preferences
5. Apply patch
6. Try again, the links should take you to the proper place.

Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 19249: Fix date inputs on patron quick add form
Jonathan Druart [Wed, 3 May 2023 14:15:28 +0000 (16:15 +0200)]
Bug 19249: Fix date inputs on patron quick add form

This patch create a "apply_flatpickr" JS function to make the code
reusable from the template, where we loop over the date inputs to
reinstantiate flatpickr.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33621: (QA follow-up) Typo formated_date
Marcel de Rooy [Fri, 28 Apr 2023 09:58:19 +0000 (09:58 +0000)]
Bug 33621: (QA follow-up) Typo formated_date

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33621: Fix claim return
Jonathan Druart [Thu, 27 Apr 2023 04:49:03 +0000 (06:49 +0200)]
Bug 33621: Fix claim return

To test:

1. Set the CaimReturnedLostValue system preference to one of your LOST authorised values
2. Check out an item
3. In the checkouts table, claim return
4. Notice the processing icon keeps spinning
5. Apply the patch
6. Check in the item and resolve the return claim to clear it
7. Check out an item
8. In the checkouts table, claim return
9. Confirm the checkouts table reloads and the return is claimed as expected

Signed-off-by: Aleisha Amohia <aleishaamohia@hotmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33328: Rename x-marc-schema => x-record-schema
Tomas Cohen Arazi [Thu, 23 Mar 2023 22:46:48 +0000 (19:46 -0300)]
Bug 33328: Rename x-marc-schema => x-record-schema

This patch renames the header on the biblio API so it is not entirely
tied to MARC, trying to follow the biblio_metadata table generic
approach.

To test:
1. Apply this patch
2. Run:
   $ prove t/db_dependent/api/v1/biblios.t
=> SUCCESS: Tests pass
3. You agree with the change?
4. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Magnus Enger <magnus@libriotech.no>
Change sounds reasonable. Tests pass before and after patch.
"grep -r "x-marc-schema" *" confirms no occurrences after patch.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32250: (follow-up) Remove use of AutoCommit=0
Nick Clemens [Wed, 26 Apr 2023 12:50:03 +0000 (12:50 +0000)]
Bug 32250: (follow-up) Remove use of AutoCommit=0

This patch moves to using txn_begin and txn_commit

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 32250: (follow-up) Remove one more dbh commit and don't start a new transaction when done

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32250: (follow-up) Commit background job to the DB
Nick Clemens [Thu, 20 Apr 2023 15:53:10 +0000 (15:53 +0000)]
Bug 32250: (follow-up) Commit background job to the DB

We can't run a background job if it isn't in the database, however,
this script runs with AutoCommit disabled. We need to enable it while
generating the background job, then disable for the updates.

I don't nkow if using a transaction would be preferable.

I tried to solve this independently, but it requires consolidating the
index requests to make this work easily

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>
17 months agoBug 32250: Only reindex records when commiting
Nick Clemens [Fri, 13 Jan 2023 20:07:01 +0000 (20:07 +0000)]
Bug 32250: Only reindex records when commiting

This patch adds an array to catch updated bibs, and defers indexing until a
batch of changes is committed

To test:
1 - Set LinkerModule system preference to either first or last match
    Alternate this between runs of the linker to ensure changes are made
2 - Set SearchEngine to Elasticsearch and reindex (to ensure index is built)
3 - perl  misc/link_bibs_to_authorities.pl -v
4 - Check Admin->Jobs and see that many ES index jobs are queued
5 - Apply patch
6 - perl  misc/link_bibs_to_authorities.pl -v
7 - Check Admin->Jobs and see that 1 index per commit from is enqueued

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>
17 months agoBug 32250: Linking authorities does not change holdability
Nick Clemens [Fri, 13 Jan 2023 19:42:53 +0000 (19:42 +0000)]
Bug 32250: Linking authorities does not change holdability

If the only change is a linked heading, we don't need to rebuild
the holds queue

To test:
1 - Set preference RealTimeHoldsQueue to enable
2 - Run link_bibs_to_authorities
3 - Note holds queue jobs generated
4 - Apply patch
5 - repeat
6 - No holds queue updates

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>
17 months agoBug 33623: Move ULSearchParams into http-client.js
Pedro Amorim [Fri, 28 Apr 2023 10:23:35 +0000 (10:23 +0000)]
Bug 33623: Move ULSearchParams into http-client.js

Remove unused getAll methods in erm-api-client.js
Make use of new getAll query in AgreementRelationships

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>
17 months agoBug 33623: Encode URL params for getAll
Jonathan Druart [Thu, 27 Apr 2023 06:43:26 +0000 (08:43 +0200)]
Bug 33623: Encode URL params for getAll

We must encode properly URL parameters when building the REST API routes

Can be tested easily using
const client = APIClient.erm
client.licenses.getAll({ "me.name:%ff%" })

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>
17 months agoBug 33504: Update patron_to_html to deal with null
Martin Renvoize [Wed, 12 Apr 2023 10:49:51 +0000 (11:49 +0100)]
Bug 33504: Update patron_to_html to deal with null

In the patron_to_html function we were dealing explicitly with the case
where patron may be passed undefined, but forgetting that it may be
returned as 'null' from the api too.  Changing from `( patron ===
undefined )` to `( patron == null )` is the recommended approach for
detecting 'undefined or null' in javascript.

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Works as advertised. Martin's test plan from Bugzilla:

To test.
1) Use ILS-DI to renew an checkout
2) View the circulation history for the item
3) Click the 'View' button next to the count of renewals
4) Note that the modal just stalls at 'Retrieving renewals'
5) Apply the patch
6) Now the 'retrieving renewals' message should list the renewals instead.

Note that step 2 should be something like "Go to the "Circulation
history" of the patron.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32782: Koha to KBart mapping for UNIMARC
Jonathan Druart [Wed, 22 Mar 2023 11:39:59 +0000 (12:39 +0100)]
Bug 32782: Koha to KBart mapping for UNIMARC

Used when creating eholdings from Koha items.

Test plan:
Add some items to a list, then use this list to create eholdings
/cgi-bin/koha/erm/eholdings/local/titles/import

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 32782: ERM UNIMARC support
Jonathan Druart [Wed, 1 Feb 2023 13:06:30 +0000 (14:06 +0100)]
Bug 32782: ERM UNIMARC support

Create the biblio record when a resource is created

Test plan:
Create a new local title and confirm that the Koha bibliographic record
is created correctly.

Signed-off-by: Laurence Rault <laurence.rault@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33482: Propagate errors from EBSCO's ws to the UI
Jonathan Druart [Tue, 11 Apr 2023 11:46:51 +0000 (13:46 +0200)]
Bug 33482: Propagate errors from EBSCO's ws to the UI

When adding or removing eholdings from EBSCO, if an error happens it is
lost and not propagated to the UI.

We were missing a return in the logic, and always returning 200

Test plan:
Do not apply (or revert) bug 33481
Configure EBSCO for ERM and add a package to your holdings
With this patch applied you will get a 500 that is propagated to the UI
Without this patch nothing happens and the user is not aware that
something bad happened

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33156: Fix JS error on batch patron modification
Katrin Fischer [Sun, 19 Mar 2023 22:06:12 +0000 (22:06 +0000)]
Bug 33156: Fix JS error on batch patron modification

The error currently breaks some of the functionality for
updating patron attributes linked to AV values. With the
bug, the input field will not change to the AV list when selected
from the pull down of patron attributes.

It was probably bug 29648 that changed the data structure
without adapting for the additional data that is pushed
to the object for the patron attribute columns.

To test:
* Create several extended patron attributes
  * Make sure at least one is linked to an AV
  * Repeatable and unique patron attributes can't be
  updated in batch patron modification, so you need some
  that can be modified.
* Go to tools > batch patron modification
* Enter one or more cardnumbers to update
* Verify the table is missing columns, export and configure
* Verify when selecting the AV tied patron attribute, the input
  remains a text one
* Apply patch
* Both should work now as expected

Note: I believe there are some more errors on this page,
but they should better be handled separately. So with this
patch we push configuration again for each column to table
columns, but the very last column keeps missing from the
columns settings.

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>
17 months agoBug 33590: Fix DOM id name for tabs after WRAPPER code added to export.tt
Slava Shishkin [Fri, 28 Apr 2023 13:36:23 +0000 (16:36 +0300)]
Bug 33590: Fix DOM id name for tabs after WRAPPER code added to export.tt

The list of CSV profiles was not displayed if the CSV format was selected in the output format settings.

To test:
1. Go to /cgi-bin/koha/tools/export.pl
2. At the bottom of the page in the Output format, select CSV format.
  *If CSV format is not active in the drop-down File format menu, create
   any profile to Usage export records on the link /cgi-bin/koha/tools/csv-profiles.pl
3. Note that the list of CSV profiles is not displayed.
4. Apply the patch.
5. Restart the page and repeat steps 2.
6. Verify that when you select the CSV format, the list of CSV profiles appears.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33590: Fix DOM id name for tabs after WRAPPER code added to modborrowers.tt
Slava Shishkin [Thu, 27 Apr 2023 13:23:42 +0000 (16:23 +0300)]
Bug 33590: Fix DOM id name for tabs after WRAPPER code added to modborrowers.tt

The submitted numbers were not processed by the search query.

To test:
1. Go to /cgi-bin/koha/circ/modborrowers.pl
2. On the relevant tab, enter the card number or the borrower number in the text area, or upload a text file with a relevant list of numbers.
3. Click "Continue" and verify that a message appears stating "No patron card numbers or borrowernumbers given".
4. Apply the patch.
5. Restart the page and repeat steps 2 and 3. Make sure you receive the correct response -- a list of borrowers or a message indicating that the specified numbers were not found.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33590: Fix DOM id name for tabs after WRAPPER code added to serials-collection.tt
Slava Shishkin [Wed, 26 Apr 2023 17:35:00 +0000 (20:35 +0300)]
Bug 33590: Fix DOM id name for tabs after WRAPPER code added to serials-collection.tt

To test:
* Add a subscription
* From the subscription detail page, click on serial collection link in left hand navigation
* Create some additional issues
* "Clear all" link for selecting issues to edit won't work, "Select all" link neither
* Apply the patch *
* "Clear all" link for selecting issues to edit works now, "Select all" link works too.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33590: Fix DOM id name for tabs after WRAPPER code added to article-requests.tt
Slava Shishkin [Wed, 26 Apr 2023 16:59:14 +0000 (19:59 +0300)]
Bug 33590: Fix DOM id name for tabs after WRAPPER code added to article-requests.tt

This commit fixed two cases:
1. Fixing "Select all" and "Clear all" links on the page.
2. Fixing the interaction with selected entries when switching between the "New" and "Pending" tabs.

To test:
(Create article requests if they don't exist)

Case 1:
1. Go to /cgi-bin/koha/circ/article-requests.pl and don't switch between tabs.
2. Click on "Select all" and verify that it's not working -- the checkboxes are not selected.
3. Activate any checkbox and click "Clear all" -- the checkbox is not cleared.
4. Apply the patch.
5. Restart the page and, without switching between tabs, repeat steps 2 and 3. Verify that it works now.

Case 2:
1. Go to /cgi-bin/koha/circ/article-requests.pl.
2. Switch between tabs and leave "New" active.
3. Select any entry and delete or move it to another tab.
4. Verify that the entry remains in the table until the page reloads.
5. Apply the patch.
6. Restart the page and repeat steps 2 and 3. Make sure that everything works now.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33629: allow pbuilder to use network via build-git-snapshot
Mason James [Thu, 27 Apr 2023 14:15:05 +0000 (02:15 +1200)]
Bug 33629: allow pbuilder to use network via build-git-snapshot

to test...

- build master packages, observe failure :(

   debian/build-git-snapshot -d -v 22.12.00-24~git1 -D dev -b base_22.12.00+deb10 --noautoversion
     "/usr/bin/perl" build-resources.PL
    yarn install v1.22.19
    warning You don't appear to have an internet connection. Try the --offline flag to use the  cache for registry queries.

- apply patch

- build master packages, observe success :)

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
17 months agoBug 33603: Fix misc/maintenance/search_for_data_inconsistencies.pl when biblio.biblio...
Fridolin Somers [Tue, 25 Apr 2023 06:05:50 +0000 (20:05 -1000)]
Bug 33603: Fix misc/maintenance/search_for_data_inconsistencies.pl when biblio.biblionumber on control field

Since bug 29486, misc/maintenance/search_for_data_inconsistencies.pl search for biblio.biblionumber in MARC record with $record->subfield().
This fails when field is a control field (< 10).
Idem for biblioitems.biblioitemnumber

Test plan :
1.0) On a UNIMARC database (biblio.biblionumber is on 001)
1.1) Run misc/maintenance/search_for_data_inconsistencies.pl
=> Without patch you get error : Control fields (generally, just tags below 010) do not have subfields, use data()
=> With patch no error
2.0) On a MARC21 database (biblio.biblionumber is on 999c)
2.1) Run misc/maintenance/search_for_data_inconsistencies.pl
=> Check you see no error

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33584: (follow-up) Remove DEFAULT_GENERATED from column info
Marcel de Rooy [Mon, 24 Apr 2023 12:28:46 +0000 (12:28 +0000)]
Bug 33584: (follow-up) Remove DEFAULT_GENERATED from column info

MySQL 8 returns this additional information for a timestamp such
as the timestamp2 in the Commenter test.
Which results in the following alter:
    ALTER TABLE koha_myclone.database_commenter_1 MODIFY COLUMN `timestamp2` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP DEFAULT_GENERATED COMMENT 'Column_5'
And that statement fails again on that keyword.
For now, it seems sufficient to ignore this keyword when building the alter statement.

Test plan:
Run t/db_dependent/Koha/Database/Commenter.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Did test it now under MySQL 8.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33584: Fix failures for Commenter.t on MySQL8
Marcel de Rooy [Fri, 21 Apr 2023 17:09:08 +0000 (17:09 +0000)]
Bug 33584: Fix failures for Commenter.t on MySQL8

The column names from information_schema are uppercase now in MySQL8.
In the arrayref with sliced hashes, we expected lowercase.

See e.g. https://stackoverflow.com/questions/54538448/what-are-the-changes-in-mysql-8-result-rowset-case

Test plan:
Run t/db_dependent/Koha/Database/Commenter.t
Do it again if possible with a MySQL 8 db server.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33128: DBRev 22.12.00.024
Tomas Cohen Arazi [Mon, 24 Apr 2023 13:43:00 +0000 (10:43 -0300)]
Bug 33128: DBRev 22.12.00.024

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33128: Add Polish translations for language descriptions
Janusz Kaczmarek [Fri, 3 Mar 2023 15:26:52 +0000 (16:26 +0100)]
Bug 33128: Add Polish translations for language descriptions

This adds the Polish translations for the different languages to
subtag_registry.sql that is used by all languages during installation.

* Apply patch
* Run database update
* Install pl-PL and activate it for the OPAC
* Go to advanced search
* Look at the language pull down - it shows the languages in their
  language and then translated to English
* Switch to Polish - verify the Polish translations are used now
  There are 2-3 cases where the translation = name, so only name is shown.
* Drop your database, create your database
* Run the web installer
* Everything should complete without error and the language pull down
  should look exactly the same and be translated

Signed-off-by: Nick <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
18 months agoBug 33560: Batch edit link broken if subscriptions are selected using "select all...
Owen Leonard [Tue, 18 Apr 2023 16:51:04 +0000 (16:51 +0000)]
Bug 33560: Batch edit link broken if subscriptions are selected using "select all" link

This patch revises the process by which the serials search results page
redirects to the batch edit page based on which checkboxes are checked.

To test, apply the patch and go to serials. You should have some
subscriptions which are open and some which are closed.

- Perform a search which will return at least one result under each tab
  (Open and Closed).
  - Checking one or more checkboxes should activate the "Edit selected
    serials" link, which should work correctly to redirect you to the
    batch edit page.
  - Unchecking all the checkboxes should make the edit link disappear.
  - Check that the "Select all" and "Clear all" links work the same way
    manually checking checkboxes does.
  - Confirm that controls under each tab work correctly just for the
    results under that tab.

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>