Commit graph

55017 commits

Author SHA1 Message Date
3475ef06d4
Bug 34440: Add itemtype selection to bookings modal
Whilst we still don't need to know the specific item we will need to
know the itemtype to be able to fetch the correct circulation rules for
adjusting the datepicker with lead and trail times.

This patch adds such a picker option. You should be able to select the
item or itemtype in either order.. selecting itemtype first will limit
the items list to options available (and 'Any item').. upon selecting a
specific item the itemtype selector should become disabled and reflect
the itemtype of the item selected.

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-30 16:41:27 +02:00
620527f971
Bug 34440: Take preparation period into account at checkout
This patch ensures we catch checkouts that would interfer with the
preparation period set for an existing booking by adding said period to
the bookings search.

We also reduce the proposed due date for the checkout to be confirmed by
the preparation period for the item.

Test plan
1) Set a booking preparation period for an itemtype
2) Add a booking for an item with that itemtype to fall beyond the due
   date that the item would be assigned if you were to check it out now
   to your test user, but within the number of days you've set for your
   preparation period.
3) Attempt to check the item out to your test user.
4) Note that we catch the booking and warn and that the latest return
   date suggested take the preparation period into account.

Sponsored-by: Cuyahoga County Public Library <https://cuyahogalibrary.org/>
Signed-off-by: Kristi Krueger <KKRUEGER@cuyahogalibrary.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-30 16:41:27 +02:00
f053ca032b
Bug 34440: Add lead and trail time to circulation rules
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-30 16:41:26 +02:00
23d98a4a8a
Bug 37177: "item" should be "record" in list page
This patch rewords areas of the lists and cart templates so that the
term "record" is preferred over "item" when referring to a bibliographic
record.

To test, apply the patch and go to Lists in the staff interface.

- If necessary, create a new list.
- From the list contents view, click "Add records" in the toolbar.
  - Submit some valid barcodes and biblionumbers
  - After adding biblionumbers you should see the message "The record
    ( [number] ) has been added to the list"
  - After adding barcodes you should see the message "The record for
    this item ( [barcode] ) has been added to the list"
- Click "Add records" again
  - Submit some of the same barcodes and biblionumbers
    - You should see these messages:
      - "The record for this item ( [barcode] ) has not
         been added to the list. Please verify it is not already in the
         list."
      - "The record ( [number] ) has not been added to the
        list. Please verify it is not already in the list.
- Check the checkbox for one or more titles on your list and click
  "Remove selected"
  - You should see the message, "The record has been removed from the
    list."
- Perform a catalog search and from the results screen, select one or
  more results and add them to the cart.
  - Open the Cart and confirm that the controls at the top of the table
    of titles reads "Selected records: ..."

Sponsored-by: Athens County Public Libraries
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-30 12:45:46 +02:00
Laura_Escamilla
d5039cc657
Bug 37758: Add descriptive labels for accessibility
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-30 12:45:46 +02:00
88f65287ef
Bug 37740: Fix saved SQL reports tab switching
The tabs on the saved SQL report page are not really full tabs, they're
just styled that way. There is only one tab "panel," and clicking each
tab triggers a DataTable filter so that the tab only shows the relevant
data.

The problem with this setup is that when Bootstrap tries to "switch"
tabs, it wants to hide the initial tab and then show the new one. There
is no "new" one here.

The attached patch solves this problem by adding a CSS rule to
guided_reports_start.tt with higher specificity than our global CSS
making the relevant tab pane visible at all times.

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

- If necessary, create multiple SQL reports and assign them to different
  report groups (Accounts, Acquisitions, Catalog, etc.).
- Test that tab switching works:
  - The tab should be style as "active" after you click it.
  - The table of reports should be filtered to include only reports in
    the relevant report group.

Signed-off-by: Chloe Zermatten <chloe.zermatten@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-30 12:45:45 +02:00
e6a1d65c9a
Bug 37741: Do not send cookie back from error pages
This change stops the cookie from being sent back from error pages,
so that backcalls that cause errors don't overwrite the existing cookie
used by the foreground request page.

Test plan:
0. Apply the patch and koha-plack --reload kohadev
1. Set syspref IntranetFavicon to http://localhost:8081/cgi-bin/koha/bad.jpg
2. Open browser developer tools
3. Go to http://localhost:8081/cgi-bin/koha/mainpage.pl
4. Open the Network tab, disable the cache, and shift refresh
5. Notice that bad.jpg fails to load with a 404
6. Try to login to Koha
7. Confirm login works

*. Extra points if you note that the cookie returned by the first
mainpage.pl request is used for the bad.jpg lookup and the second
mainpage.pl request.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-30 12:45:45 +02:00
7342209b34
Bug 37048: Use template wrapper for self checkout page
This patch updates the OPAC's self checkout page template to use
WRAPPERs for the Bootstrap tabs markup.

To test, apply the patch and enable the "WebBasedSelfCheck" system
preference if necessary.

- Navigate to the self checkout page
  (http://127.0.0.1:8080/cgi-bin/koha/sco/sco-main.pl)
  - Start checking out to a patron
    - You should see three tabs, "Checkouts", "Holds", and "Charges."
      The tabs should look correct and work correctly.

Sponsored-By: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 18:16:24 +02:00
34ff421c1c
Bug 36919: Remove yet another warning from Koha/Object.t
DBIx::Class::Storage::DBI::insert(): Missing value for primary key column 'currency' on Currency - perhaps you forgot to set its 'is_auto_increment' attribute during add_columns()? Treating 'currency' implicitly as an autoinc, and attempting value retrieval at /kohadevbox/koha/Koha/Object.pm line 172
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 18:16:23 +02:00
f14db22d8a
Bug 36919: Remove another warning from Koha/Object.t
C4::Context->userenv not defined! at /kohadevbox/koha/Koha/Patron.pm
line 1890.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 18:16:23 +02:00
5c905109db
Bug 36919: Remove a warning from Koha/Object.t
Use of uninitialized value in numeric eq (==) at /kohadevbox/koha/Koha/Patron.pm line 446.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 18:16:22 +02:00
bec73ea2a8
Bug 37759: Duplicated "Set library" menu item caused by bad merge
This patch removes an unnecessary block of markup accidentally left
behind during a rebase of Bug 35402, removing a duplicate "Set
library..." menu item from the header menu in the staff interface.

After the batch, users who have permission to change their logged-in
library should see only a single "Set library..." menu item in the user
menu found on the right-hand side of the header menu.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 18:16:22 +02:00
b1993dcd71
Bug 34486: (QA follow-up) Tidy changes to opac/opac-detail.pl
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 18:16:21 +02:00
21cab8a47c
Bug 34486: Show OPAC Column Due Date only if items on loan exist
This patch updates the OPAC bibliographic detail page so that in the
holdings table, the following columns are hidden if they contain no
data: Call number, date due, materials, checkouts, barcode,
and item-level holds.

To test, apply the patch and restart services.

- In the staff interface, go to Administration -> System preferences.
- Search for OPACShowHoldQueueDetails and set it to "Show holds and
  their priority level."
- Search for OPACShowHoldQueueDetails and set it to "Show holds and
  their priority level."
- In the OPAC, locate a bibliographic record with multiple items.
- View the detail page and confirm that the holdings table doesn't show
  these columns if there is no data in any of the rows: Call number,
  date due, materials, barcode, and item-level holds
- For each of the affected fields, update the record the record so that
  there is data to be shown for at least one of the items:
  - Edit an item to add: call number, materials specified, barcode
  - Check out an item to someone in order to show the date due column
  - Place an item-level hold on one of the items to show the item holds
    column.
- Go to Administration -> Table settings -> OPAC -> biblio-detail and
  configure some columns to be hidden by default. Confirm that your
  changes are correctly shown in the OPAC holdings table.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 18:16:20 +02:00
722bb10c35
Bug 34088: Add unit tests
This patch adds unit tests to cover the moved and newly introduced
methods in the Koha namespace.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Fixed QA complaint about file permissions.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 18:16:20 +02:00
8abaff7784
Bug 34088: Short circuit database upgrade check
If the database version and the code version are the same, we should
short circuit and exit immediately.

This patch adds the Koha::Installer module which can very quickly
check if a db or atomic update is needed.

It also moves the logic for C4::Installer::TransformToNum to
Koha::Installer::TransformToNum for performance reasons.

It also moves the logic for C4::Installer::get_atomic_updates to
Koha::Installer::get_atomic_updates for performance reasons.

Test plan:
1. Apply patch
2. Run `time koha-upgrade-schema kohadev`
3. Note that it completes in less than .1 seconds

4. To test db updates, change the database Version to a number
slightly behind the code version, and run
`time koha-upgrade-schema kohadev`
5. Note that the correct version update is processed

6. To test atomic updates:
cp installer/data/mysql/atomicupdate/skeleton.pl \
       installer/data/mysql/atomicupdate/bug_34088.pl
7. Run `time koha-upgrade-schema kohadev`
8. Note that it takes over 1 second to run and the atomic update
is attempted

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 18:16:19 +02:00
317456da49
Bug 37686: Fix render_resource_not_found() and render_resource_deleted() misses
This patch refactors some small pieces of code to use the helpers as
prescribed on our coding guidelines [1] instead of manually crafting
responses.

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

[1] https://wiki.koha-community.org/wiki/Coding_Guidelines_-_API#REST4:_Controller_code_.5BDRAFT.5D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 18:16:19 +02:00
ddcf2b9b70
Bug 37755: Fix batch del record (adding the missing _panel suffix)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:08 +02:00
74d06925e8
Bug 37755: Fixed JavaScript for modification tabs
This patch addresses a new bug which prevents correct submission on mod
borrowers and mod records (mod + delete). The bug appears to have been
introduced since the recent Bootstrap5 switch, and shouldn't be surfacing
anywhere else in the system

Note that the test plan focuses on tools/modborrowers.pl. The error also
appears to exist on tools/batch_record_modification.pl and
tools/batch_delete_records.pl, but is a lot harder to reproduce.

Please see https://chat.koha-community.org/koha-community/pl/fmnzzgy5cpghtpdc9a9ow75scr
and follow-up comments for details on reproducing this.

To test:
a)  go to tools/modborrowers.pl and try to enter valid cardnumbers or
    borrowernumbers
    1)  notice how you cannot proceed
b)  APPLY PATCH
c)  repeat steps a
    1)  notice how you can now proceed
d)  SIGN OFF

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:07 +02:00
Eric Garcia
fc07565077
Bug 37753: Fixed navigation links when editing authority type subfields
To test:
1. Go to Koha administration > Catalog > Authority types.
2. For any authority type, select Actions > MARC structure.
3. For any tag that has multiple subfields (for example 020 ISBN), select Actions > Subfields.
4. Select Edit for any subfield.
5. Notice that the links are now in the standard tabbed style.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:07 +02:00
a297a0cd99
Bug 37752: Add missing class to navigation tab links
To test:
1. Go to  Administration > MARC bibliographic frameworks > Default framework Tag 942 > subfield structure
2. Notice the tabs at the top have no style.
3. APPLY PATCH
4. 1 -3 again, tabs should look right.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:06 +02:00
24687367b8
Bug 37739: (follow-up) Add extra space in markup
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:05 +02:00
bf6cb3bde2
Bug 37739: Adjust vendor deletion modal code after bootstrap 5 update
This patch fixes a conflict between bug 31921 and bug 35402.

Test plan:
Create a vendor then delete it using the "Delete vendor" button
Confirm that the modal looks like other modals in Koha.
Click the "x", "No" and "Yes". Confirm that "x" and "no" close the modal
but "yes" correctly delete the vendor.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:05 +02:00
92ec49fca4
Bug 37697: use shadow DOM for additional contents preview
This change uses the declarative HTML style of Shadow DOM
to encapsulate the additional contents preview so that they don't
affect the main Koha page.

Test plan:
0. Create opacheader with following content:
<style>* { background-color: red }</style>
<p>This is awesome</p>
1. Note that most background-color in /cgi-bin/koha/tools/additional-contents.pl
is now red
2. Click "Preview content" for "opacheader"
3. Note that the background-color of the "p" in "opacheader" is red

4. Apply the patch

5. Refresh the page at /cgi-bin/koha/tools/additional-contents.pl
6. Note that the background-color is normal again
7. Click "Preview content for "opacheader"
8. Note that the background-color of the "p" in "opacheader" is red

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:04 +02:00
df1ec831bf
Bug 37748: (follow-up) Move tooltip initialization to staff-global.js
This patch moves generic initializations of Bootstrap tooltips into
staff-global.js.

Templates which included custom tooltip initialization have been updated
to use the global function.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:04 +02:00
5b63d200a8
Bug 37748: Adjust the 'Update child to patron' selenium test
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:03 +02:00
b57868b1e4
Bug 37748: In Bootstrap 5 "disabled" class must be on anchor tag, not list item
This patch revises the markup for disabled dropdown menu items to
conform to Bootstrap 5 requirements. The patch also revises many
instances of Bootstrap tooltips which were not working -- tooltips which
should be shown with many of the disable dropdown items.

In BS5, a tooltip can't be attached to a disabled link. Instead the
tooltip must be attached to the link's container. These changes also
include the addition of "aria-disabled='true'" to the disabled menu
items.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:03 +02:00
Lari Taskula
4c93ed758f
Bug 37375: Fix holdings table not loading if MARC framework is missing certain 952 subfields
When you've catalogued a record with MARC framework that is for some reason missing
certain 952 subfields (8, a, b, c, or y), holdings table is no longer loading but
stuck in the "Processing..." loader.

To test, open Koha in two browser tabs:

IN TAB 1 (framework configuration):
1. Create a new MARC framework "TEST", based on the default MARC framework

IN TAB 2 (record view):
2. Create a new record using MARC framework "TEST"
3. Add an item to the newly created record
4. Observe item visible on the record's holdings list

IN TAB 1 (framework configuration):
5. Delete all 952 subfields in framework "TEST" except: 8, a, b, c, y

IN TAB 2 (record view):
6. Refresh page
7. Observe item visible on the record's holdings list
8. Open your browser's console for upcoming error messages

Iterating remaining subfields in following order,
| <FIELD> | <NAME>
------------------------------------------------------
| 952$8   | row._strings.collection_code
| 952$c   | row._strings.location
| 952$a   | row._strings.home_library_id
| 952$b   | row._strings.holding_library_id
| 952$y   | row._strings.item_type_id

IN TAB 1 (framework configuration):
9. Delete subfield <FIELD> in framework "TEST"

IN TAB 2 (record view):
10. Refresh page
11. Observe error "Uncaught TypeError: <NAME> is undefined" (Firefox)
(or Cannot read properties of undefined (reading 'str') (Chromium))

12. Apply patch

IN TAB 2:
13. Refresh page
14. Observe item visible on the record's holdings list

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:02 +02:00
Brendan Lawlor
afda7bcc94
Bug 37734: Fix insert runtime parameter button in reports
The drop down item links had two class attributes which
prevented javascript from opening the modal.
This patch combines the classes into one class attribute.

To test:
1. Go to Reports > Create from SQL
2. Click the Insert runtime parameter button
3. Click on any of the drop down options
4. Nothing happens :(
5. Apply patch
6. Repeat steps 2 and 3 for all different parameters
7. Notice the modal launches :)
8. Confirm the parameters are inserted as expected

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-29 17:24:01 +02:00
4f52463551
Bug 35402: Fix some selenium tests
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:26 +02:00
e1e2b21f7e
Bug 37513: Only display delete button if usage_count == 0
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:26 +02:00
68d385ca53
Bug 37513: Add a way for KohaTable to decide if a button should be displayed
This patch adds, for the case of object parameters in the actions config
entry for the KohaTable Vue component, a check for a function on the
current row, that will be used to determine if a button needs to be
displayed or not.

It checks for the function to be defined, and uses it for checking
displayability.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:25 +02:00
5cd2a870cd
Bug 37513: Allow embedding usage_count in record sources
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:25 +02:00
190205f603
Bug 37513: Add Koha::RecordSource->usage_count
This patch adds the `usage_count` method to be used for embedding from
the API. Tests cover all use cases.

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

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:24 +02:00
9b0196b7b6
Bug 37513: Handle Koha::Exceptions::Object::FKConstraintDeletio in controller
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:24 +02:00
5321e0fb09
Bug 37682: Lazy-load modules for setters in koha-preferences tool
This change lazy-loads modules for setters in the
koha-preferences tool, so that getters are free to run super fast.

Between BZ 37657 and BZ 37682 we effectively eliminate the
overhead of running "get" or "dump" commands via the koha-preferences
tool.

Test plan:

1. time misc/admin/koha-preferences get SearchEngine
2. Note time is about .35 seconds
3. time misc/admin/koha-preferences dump
4. Note time is about .35 seconds
5. Create sysprefs.yml

   ---
   marcflavour: MARC21
   viewMARC: 1

6. time misc/admin/koha-preferences load -i sysprefs.yml
7. Note time is about .35 seconds
8. time misc/admin/koha-preferences set SearchEngine Elasticsearch
9. Note time is about 1 seconds

10. Apply patch
11. Repeat the koha-preferences commands above
12. Note that the "dump" and "get" commands run in about .09-.1
seconds. The "load" and "set" commands still take the same amount
of time as their behaviours haven't changed

13. misc/admin/koha-preferences set SearchEngine Elasticsearch1
14. koha-mysql kohadev
15. select * from action_logs where module = 'SYSTEMPREFERENCE'
 order by action_id desc limit 5;
16. Note that the action log showing Elasticsearch1 update says
    "interface"
 of "commandline" and "script" of "koha-preferences"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:23 +02:00
673aaaaba2
Bug 37657: Make koha-preferences CLI tool faster
By using Koha::Database->dbh() to use a minimal database handle
which doesn't preload the whole DBIx::Class schema, we're able to
run the same command 2-3 times faster.

This is beneficial when running the tool in a loop which runs the
command serially one by one.

Test plan:

1. time misc/admin/koha-preferences get SearchEngine
2. Note time is about 1 second
3. time misc/admin/koha-preferences dump
4. Note time is about 1 second
5. Create sysprefs.yml

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:22 +02:00
d95fffb8ec
Bug 37452: Modernise the view in showdiffmarc
The showdiffmarc view available from manage stage records when a match
is found looks dated.

This patch adds a page-section, centers the display as a whole and
converts the link back to the staging area to an action button.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:22 +02:00
b124cab0b7
Bug 37349: Use cache for authority types and remove extra fetch
This patch caches the authority types when fetched during linking to avoid grabbing the same type more than once.
Additionally it removes a second call to fetch the same type in some scenarios

To test:
1 - Apply patch
2 - Enable linking during cataloging/updating records
3 - Edit a record and confirm it is linked ocrrectly
4 - Run the authority linking cron and confirm it works as expected

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:21 +02:00
e2538b5e83
Bug 37620: Fix Total-Count headers
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:21 +02:00
a3a1d7e253
Bug 36915: (QA follow-up) Passing less to encourage traversal
I generally push for contextual use of accessors in TT notices and try
to reduce extra lookups.

In this case we can access the pickup library branchname directly using
the pickup_library relation available to us in the booking object we
pass.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:20 +02:00
c0af0dad35
Bug 36915: (follow-up) Add tests
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:20 +02:00
714ebfb66c
Bug 36915: (follow-up) Include branchname in sample notice
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:19 +02:00
08f5164064
Bug 36915: (follow-up) Make basic sample notice html and add breaks
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:18 +02:00
1f444a679f
Bug 36915: (follow-up) Basic sample notice
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:18 +02:00
3db1985149
Bug 36915: (follow-up) Pass object to GetPreparedLetter
This patch updates the logic to pass the object to be deleted through to
GetPreparedLetter.

This way, as we add fields and accessors to the object in the future,
they will automatically become available to the notices.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:17 +02:00
Thibaud Guillot
0ba56480a5
Bug 36915: Send email notification when a booking is cancelled
When a booking is cancelled, patron received an email based on specific
letter.

Test plan:

1) Create a letter with code "BOOKING_CANCELLATION" on "Notices and
   slips" tool.
2) Add booking or go on item already booked in advance.
3) Cancel it
4) Verify in message_queue table directly or go on patron page and click
   on "Notices" tab section.

Sponsored by: Association de Gestion des Œuvres Sociales d'Inria (AGOS)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-27 12:14:17 +02:00
0cdfb10f37
Bug 14322: (follow-up) Fix quotes for translatable string
Always use double quotes around translatable strings.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-26 18:46:14 +02:00
039eb10c7a
Bug 35402: (follow-up) Remove duplicate of import in staff-global.scss
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-26 17:39:56 +02:00
bdaa0e6cb7
Bug 35402: (follow-up) Remove bootstrap version 4 and revert import paths to 'bootstrap'
This patch
- removes bootstrap 4 from the project dependencies.
- reverts the import paths for sass back to 'bootstrap' from 'bootstrap5'.
- updates yarn's lockfile.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2024-08-26 17:39:56 +02:00