]> git.koha-community.org Git - koha.git/log
koha.git
2 months agoBug 37513: Add a way for KohaTable to decide if a button should be displayed
Tomas Cohen Arazi [Mon, 19 Aug 2024 17:50:20 +0000 (14:50 -0300)]
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>
2 months agoBug 37513: Allow embedding usage_count in record sources
Tomas Cohen Arazi [Mon, 19 Aug 2024 14:42:21 +0000 (11:42 -0300)]
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>
2 months agoBug 37513: Add Koha::RecordSource->usage_count
Tomas Cohen Arazi [Mon, 19 Aug 2024 14:35:13 +0000 (11:35 -0300)]
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>
2 months agoBug 37513: Handle Koha::Exceptions::Object::FKConstraintDeletio in controller
Tomas Cohen Arazi [Mon, 19 Aug 2024 14:16:00 +0000 (11:16 -0300)]
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>
2 months agoBug 37682: Lazy-load modules for setters in koha-preferences tool
David Cook [Tue, 20 Aug 2024 04:31:31 +0000 (04:31 +0000)]
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>
2 months agoBug 37657: Make koha-preferences CLI tool faster
David Cook [Tue, 20 Aug 2024 04:13:38 +0000 (04:13 +0000)]
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>
2 months agoBug 37452: Modernise the view in showdiffmarc
Martin Renvoize [Wed, 24 Jul 2024 14:59:31 +0000 (15:59 +0100)]
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>
2 months agoBug 37349: Use cache for authority types and remove extra fetch
Nick Clemens [Fri, 12 Jul 2024 15:56:45 +0000 (15:56 +0000)]
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>
2 months agoBug 37620: Fix Total-Count headers
Matt Blenkinsop [Tue, 27 Aug 2024 09:21:30 +0000 (09:21 +0000)]
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>
2 months agoBug 36915: (QA follow-up) Passing less to encourage traversal
Martin Renvoize [Thu, 15 Aug 2024 14:29:30 +0000 (15:29 +0100)]
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>
2 months agoBug 36915: (follow-up) Add tests
Paul Derscheid [Thu, 8 Aug 2024 10:35:21 +0000 (10:35 +0000)]
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>
2 months agoBug 36915: (follow-up) Include branchname in sample notice
Paul Derscheid [Tue, 6 Aug 2024 13:22:10 +0000 (13:22 +0000)]
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>
2 months agoBug 36915: (follow-up) Make basic sample notice html and add breaks
Paul Derscheid [Mon, 5 Aug 2024 12:07:48 +0000 (12:07 +0000)]
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>
2 months agoBug 36915: (follow-up) Basic sample notice
Martin Renvoize [Wed, 26 Jun 2024 14:56:59 +0000 (15:56 +0100)]
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>
2 months agoBug 36915: (follow-up) Pass object to GetPreparedLetter
Martin Renvoize [Wed, 26 Jun 2024 14:27:14 +0000 (15:27 +0100)]
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>
2 months agoBug 36915: Send email notification when a booking is cancelled
Thibaud Guillot [Wed, 22 May 2024 07:59:51 +0000 (09:59 +0200)]
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>
2 months agoBug 14322: (follow-up) Fix quotes for translatable string
Katrin Fischer [Mon, 26 Aug 2024 16:42:35 +0000 (16:42 +0000)]
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>
2 months agoBug 35402: (follow-up) Remove duplicate of import in staff-global.scss
Paul Derscheid [Mon, 26 Aug 2024 12:08:51 +0000 (14:08 +0200)]
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>
2 months agoBug 35402: (follow-up) Remove bootstrap version 4 and revert import paths to 'bootstrap'
Paul Derscheid [Mon, 26 Aug 2024 12:00:10 +0000 (14:00 +0200)]
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>
2 months agoBug 35402: (follow-up) Reintroduce bsBanner includes
Paul Derscheid [Mon, 26 Aug 2024 11:51:19 +0000 (13:51 +0200)]
Bug 35402: (follow-up) Reintroduce bsBanner includes

I initially removed this because it failed to build, but this issue seems to be resolved.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35402: (follow-up) Use ~ to resolve to nearest node_modules when building css
Paul Derscheid [Mon, 26 Aug 2024 11:31:46 +0000 (13:31 +0200)]
Bug 35402: (follow-up) Use ~ to resolve to nearest node_modules when building css

- This patch adds a new dev dependency node-sass-tilde-importer.
- We use the tilde to resolve to the nearest node_moduldes, meaning
- /kohadevbox/koha/node_modules
or
- /kohadevbox/node_modules
- We explicitly prefix the last path component with an underscore to prevent the
  resolution from failing (this doesn't seem necessary for all cases, though)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36707: Links on itemnumbers in report should say "item", not "record"
Owen Leonard [Fri, 9 Aug 2024 12:49:55 +0000 (12:49 +0000)]
Bug 36707: Links on itemnumbers in report should say "item", not "record"

This patch changes the labels on SQL report result links so that the
term "item" is used for editing or viewing an item.

To test, apply the patch and go to Reports -> Saved reports

- If necessary, create a report which will return biblionumbers and
  itemnumbers, e.g.

  SELECT itemnumber, biblionumber FROM items LIMIT 20

- Save and run the report. In the results, test the menus which can be
  triggered by clicking a biblionumber or itemnumber.
  - A biblionumber's menu should have "Edit record" and "View record."
  - An itemnumber's menu should have "Edit item" and "View item."

Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37574: (follow-up) Fix translatability in .tt file
Katrin Fischer [Mon, 26 Aug 2024 08:35:03 +0000 (08:35 +0000)]
Bug 37574: (follow-up) Fix translatability in .tt file

JS in a .tt file needs to use the single underscore.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37574: (follow-up) disable ordering and searching on status column
Paul Derscheid [Thu, 8 Aug 2024 07:38:05 +0000 (07:38 +0000)]
Bug 37574: (follow-up) disable ordering and searching on status column

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>
2 months agoBug 37574: Add visual indicator that bookings are expired
Paul Derscheid [Wed, 7 Aug 2024 10:51:31 +0000 (10:51 +0000)]
Bug 37574: Add visual indicator that bookings are expired

Adds a status column to the table configuration that displays whether a
booking is active or expired (at the moment).
This column is conditionally shown in the 'Show Expired' state, meaning
after expired bookings are loaded into the table.

To test:
1) Create a couple booking for any item for a single patron.
2) Open a db shell with `koha-mysql <INSTANCE>`
3) Update one or two of the created bookings with:
   update bookings set start_date = '<date in the past>', end_date = '<date also in the past'> where booking_id = '<booking id of the booking you just created>'.
4) Go the the bookings tab of said item.
5) Click the 'Show Expired' option in the top left of the table.
6) Note that bookings are tagged with 'Expired' and 'Active'.
7) Repeat 5 and 6 for the bookings tab in the patron's details view.
8) Sign off.

Note: the bootstrap classes for v5 are already included so they become
colored once the patch is in.

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>
2 months agoBug 14322: (follow-up) Make 'Copied!' tooltip translatable
Brendan Lawlor [Mon, 26 Aug 2024 14:49:01 +0000 (14:49 +0000)]
Bug 14322: (follow-up) Make 'Copied!' tooltip translatable

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 14322: (QA follow-up) Tidy itemsearch.tt
Paul Derscheid [Thu, 15 Aug 2024 10:31:40 +0000 (10:31 +0000)]
Bug 14322: (QA follow-up) Tidy itemsearch.tt

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 14322: (follow-up) Perl tidy
Brendan Lawlor [Thu, 1 Aug 2024 13:59:28 +0000 (13:59 +0000)]
Bug 14322: (follow-up) Perl tidy

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 14322: (follow-up) add check for single logical operator param
Brendan Lawlor [Wed, 31 Jul 2024 20:25:33 +0000 (20:25 +0000)]
Bug 14322: (follow-up) add check for single logical operator param

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 14322: (follow-up) make shareable link load results immediately
Brendan Lawlor [Mon, 22 Jul 2024 14:20:46 +0000 (14:20 +0000)]
Bug 14322: (follow-up) make shareable link load results immediately

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 14322: (follow-up) update shareable link button style
Brendan Lawlor [Mon, 22 Jul 2024 14:17:06 +0000 (14:17 +0000)]
Bug 14322: (follow-up) update shareable link button style

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 14322: Add shareable link button to item search
Brendan Lawlor [Fri, 12 Jul 2024 16:03:57 +0000 (16:03 +0000)]
Bug 14322: Add shareable link button to item search

This patch adds a 'Copy shareable link' button to the item search results page.
When pasted into the browser the item search form will be prefilled.
The item search form submission still gets it's parameters from the form.

Test plan:
1. Apply patch
2. Try some item searches (try searches using the '+ New field' button too)
3. On the results page click the 'Copy shareable link' button
4. Paste the link into the browser and hit enter
5. Notice the item search form is filled out exactly as you did earlier
6. Click 'Search' and confirm the results are as you would expect
7. Click 'Edit search', modify the search and search again
8. Test the 'Copy shareable link' button again
9. Test pasting the example link below
10. With default ktd data the search will return one result for:
     Intermediate Perl / Schwartz, Randal L.

http://localhost:8081/cgi-bin/koha/catalogue/itemsearch.pl?homebranch_op=%3D&homebranch=CPL&holdingbranch_op=%3D&holdingbranch=CPL&location_op=%3D&location=GEN&itype_op=%3D&itype=BK&ccode_op=%3D&ccode=REF&notforloan_op=!%3D&notforloan=1&itemlost_op=!%3D&itemlost=1&withdrawn_op=!%3D&withdrawn=1&damaged_op=!%3D&damaged=1&onloan=&f=publishercode&op=like&q=O'Reilly%2C&c=and&f=publicationyear&op=like&q=2006&c=and&f=title&op=not%20like&q=Javascript%20%3A&c=and&f=author&op=not%20like&q=Carlson%2C%20Lucas.&itemcallnumber_from=&itemcallnumber_to=&issues_op=%3E&issues=&datelastborrowed_op=%3E&datelastborrowed=&format=shareable

Sponsored-by: CLAMS
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35838: Use template wrapper for tabs: Curbside pickups administration
Owen Leonard [Thu, 18 Jan 2024 16:21:56 +0000 (16:21 +0000)]
Bug 35838: Use template wrapper for tabs: Curbside pickups administration

This patch updates the curbside pickups administration template so that
it uses the new WRAPPER directive to build tabbed navigation.

To test, apply the patch and enable curbside pickups if necessary:
Administration -> System preferences -> CurbsidePickup.

- Go to Administration -> Curbside pickups.
- Confirm that the tabs look correct and behave as expected.

Signed-off-by: LoĂŻc Vassaux--Artur <loic.vassaux-artur@outlook.fr>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 20411: DBRev 24.06.00.026
Katrin Fischer [Mon, 26 Aug 2024 08:35:00 +0000 (08:35 +0000)]
Bug 20411: DBRev 24.06.00.026

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 20411: Output only if pref has been deleted
Jonathan Druart [Wed, 14 Aug 2024 08:19:16 +0000 (10:19 +0200)]
Bug 20411: Output only if pref has been deleted

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 20411: Remove StaffDetailItemSelection system preference
Sam Lau [Wed, 10 Jul 2024 17:03:04 +0000 (17:03 +0000)]
Bug 20411: Remove StaffDetailItemSelection system preference

This patch removes the 'StaffDetailItemSelection' along with any usages of it. Now, the checkboxes on an item details page are always there.

To test:
1) Apply patch, restart_all, updatedatabase
2) In sys prefs, search for 'StaffDetailItemSelection', nothing should show up.
3) Visit an items details page, make sure there are checkboxes next each item that allow you to perform modification/deletion.

Signed-off-by: Eric Garcia <cubingguy714@gmail.com>
Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37309: Adjust test
Jonathan Druart [Mon, 26 Aug 2024 08:57:56 +0000 (10:57 +0200)]
Bug 37309: Adjust test

The test to catch wrong "op" in posted form was not supporting single
quotes.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37309: Adjustment for 33526
Jonathan Druart [Wed, 14 Aug 2024 09:09:55 +0000 (11:09 +0200)]
Bug 37309: Adjustment for 33526

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37309: Clear itemnumbers array before 'select all'
Jonathan Druart [Thu, 11 Jul 2024 12:47:09 +0000 (14:47 +0200)]
Bug 37309: Clear itemnumbers array before 'select all'

Otherwise the same itemnumber can appear several times in the array.
It could be moved to its own bug but this is only code cleaning it
seems, there is no impact on the UX

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37309: Fix behaviour when SeparateHoldings is in use
Jonathan Druart [Thu, 11 Jul 2024 12:41:54 +0000 (14:41 +0200)]
Bug 37309: Fix behaviour when SeparateHoldings is in use

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37309: (follow-up) Adjust appearance of controls
Owen Leonard [Thu, 11 Jul 2024 11:51:45 +0000 (11:51 +0000)]
Bug 37309: (follow-up) Adjust appearance of controls

This patch makes an adjustment to the style of .btn-link controls
associated with the holdings table. I've also updated the markup of the
other controls so that they match the updated batch controls.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37309: Improve Delete and Modify items links on the biblio detail page
Jonathan Druart [Thu, 11 Jul 2024 07:50:43 +0000 (09:50 +0200)]
Bug 37309: Improve Delete and Modify items links on the biblio detail page

The way the "Delete selected items" and "Modify selected items" links
are build on the bibliographic detail page is not nice. We could do
better, for instance using a proper form element instead of building an
URL.

Test plan:
Go to the detail page of a bibliographic record which has several items.
In the items table check some checkboxes and play with "select all",
"clear all" and the action buttons.
Notice that everything works as before.

Minor UI regression that must be fixed: there are CSS rules that cause
problem. When the action links are displayed or hidden the table is
moving up and down.
I think the problematic rules are:
  .btn {
    padding: 6px 12px;
    font-size: 12px;
  }
It makes the UI better if I remove them but still get the bumping
issue.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 2486: Show user comments in staff interface
Owen Leonard [Wed, 12 Jun 2024 12:54:47 +0000 (12:54 +0000)]
Bug 2486: Show user comments in staff interface

This patch the staff interface's bibliographic detail page, adding a tab
that shows comments submitted by users from the OPAC.

To test, apply the patch and restart services.

- If necessary, enable the "OPACComments" system preference and submit
  some comments in the OPAC.
- In the staff interface, locate the title you submitted comments on.
  - The bibliographic detail page should show a "Comments" tab with a
    count of the number of all comments (approved and unapproved).

Sponsored-By: Athens County Public Libraries
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37141: (follow-up) Fix new strings for translation
Katrin Fischer [Mon, 26 Aug 2024 08:34:57 +0000 (08:34 +0000)]
Bug 37141: (follow-up) Fix new strings for translation

Adding underscores to make single double.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37141: Tidy JS
Nick Clemens [Tue, 6 Aug 2024 11:39:37 +0000 (11:39 +0000)]
Bug 37141: Tidy JS

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37141: (follow-up) Check for expired bookings when rendering bookings table
Paul Derscheid [Mon, 5 Aug 2024 13:41:23 +0000 (13:41 +0000)]
Bug 37141: (follow-up) Check for expired bookings when rendering bookings table

We preserve the existing logic of this bug and add another case
for when we just encounter expired bookings.

In that case we render the fieldset without the 'filtered' class and
determine the value of filter_expired in bookings.js by the class being set.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37141: (follow-up) Move filter_expired to outer scope
Paul Derscheid [Mon, 5 Aug 2024 12:37:05 +0000 (12:37 +0000)]
Bug 37141: (follow-up) Move filter_expired to outer scope

This allows access by the bookings-tab and the expired_filter click handlers
which are both required for the state change to work.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37141: Add 'Show completed' option to bookings tab
Martin Renvoize [Thu, 20 Jun 2024 11:01:34 +0000 (12:01 +0100)]
Bug 37141: Add 'Show completed' option to bookings tab

This patch adds the 'Show completed' filter toggle option to the
bookings display tab on both the patron details and circulation pages.

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: (follow-up) Fix path to opac.css file
Katrin Fischer [Mon, 26 Aug 2024 08:35:52 +0000 (08:35 +0000)]
Bug 26777: (follow-up) Fix path to opac.css file

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: (follow-up) Translatability: 'Error:'
Katrin Fischer [Mon, 26 Aug 2024 08:34:54 +0000 (08:34 +0000)]
Bug 26777: (follow-up) Translatability: 'Error:'

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: (follow-up) Capitalization - My Virtual Card
Katrin Fischer [Mon, 26 Aug 2024 08:34:49 +0000 (08:34 +0000)]
Bug 26777: (follow-up) Capitalization - My Virtual Card

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: DBRev 24.06.00.025
Katrin Fischer [Mon, 26 Aug 2024 08:34:32 +0000 (08:34 +0000)]
Bug 26777: DBRev 24.06.00.025

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: Allow ability to select diffferent barcode types
Sam Lau [Mon, 24 Jun 2024 16:29:34 +0000 (16:29 +0000)]
Bug 26777: Allow ability to select diffferent barcode types

These cumalation of patches introduce a new patron page on the OPAC: "My virtual card." This page and its contents are reliant on the system preferences 'OPACVirtualCard' and 'OPACVirtualCardBarcode'. OPACVirutalCard determines whether the virtual card page is even displayed on the OPAC whereas OPACVirtualCardBarcode selects the type of barcode to display on this page (if page is displayed). Currently, the virtual card page consits of a patron image (if available), the patron's barcode, and the library name. A potential follow up would be to allow customization of this page. The barcode generation is handled by a new library bwip-js.

To test:
1) Apply patch, updatedatabase, restart_all, build yarn
2) In system preferences, search for 'OPACVirtualCard'. Both this and the barcode sys. pref should show up with the same search. Notice they are dependent on one another. The default for the first pref should be "Don't allow". Leave this as is for now.
3) Leave the preference page open and log into the OPAC. Visit the user page. Notice that the navbar on the left consiting of 'Summary', 'Charges', etc. looks the same.
4) Go back to the sys. pref page and set the OPACVirtualCard to "Allow"
5) Also in the sys. prefs, make a search for "patron images" and set 'OPACpatronimages' to "Show" and 'patronimages' to allow.
6) Visit the patron's page that you used to sign in to the OPAC. Add a patron image if there is not one already.
7) Now, edit their details and change their card number to '00012345678905'
8) Venture back to the OPAC patron page. Refresh this and you should see a new "My Virtual Card" page at the bottom.
9) Click this page and you should see a new virtual card for you patron, consiting of their image, a barcode, and their library.
10) Open the dev tools for your browser and switch to vieiwing in mobile mode. Make sure the card looks good. This would likely be the most common use case.
11) Switch back to a system preference page and try playing around with the 'OPACVirtualCardBarcode'. Note that these changes affect the type of barcode that is display in the virtual card page. If you selected a barcode format that is incompatible, an error message should display in the virtual card page.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: Add new system preference 'OPACVirtualCardBarcode'
Sam Lau [Mon, 24 Jun 2024 16:26:36 +0000 (16:26 +0000)]
Bug 26777: Add new system preference 'OPACVirtualCardBarcode'

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: Add bwip-js library to Koha
Sam Lau [Wed, 26 Jun 2024 02:07:12 +0000 (02:07 +0000)]
Bug 26777: Add bwip-js library to Koha

bwip-js is the chosen library for generating and displaying barcodes in the OPAC. It allows for many different barcode types and customizable settings. This patch created a new directory and file for the js library code to live as well as updating the about.tt to give credit.

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: (follow-up) Fix file permssions and tidy
Lucas Gass [Fri, 21 Jun 2024 17:15:57 +0000 (17:15 +0000)]
Bug 26777: (follow-up) Fix file permssions and tidy

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: (follow-up) Adjust script, template, and CSS
Lucas Gass [Fri, 21 Jun 2024 17:13:38 +0000 (17:13 +0000)]
Bug 26777: (follow-up) Adjust script, template, and CSS

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: Add new patron page 'My Virtual Card'
Sam Lau [Tue, 18 Jun 2024 22:47:47 +0000 (22:47 +0000)]
Bug 26777: Add new patron page 'My Virtual Card'

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: Add barcode generator file and initial styling
Sam Lau [Thu, 20 Jun 2024 20:50:04 +0000 (20:50 +0000)]
Bug 26777: Add barcode generator file and initial styling

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 26777: Added new sys pref 'OPACVirtualCard'
Sam Lau [Tue, 18 Jun 2024 19:04:44 +0000 (19:04 +0000)]
Bug 26777: Added new sys pref 'OPACVirtualCard'

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37076: Fix incorrect needsconfirmation code
Matt Blenkinsop [Wed, 12 Jun 2024 13:36:42 +0000 (13:36 +0000)]
Bug 37076: Fix incorrect needsconfirmation code

This patch corrects two instances of RESERVED_WAITING to RESERVE_WAITING

Test plan:
1) Navigate to system preferences and search for AllowItemsOnHoldCheckoutSCO
2) Observe from the description that the correct status code is RESERVE_WAITING
3) Search the repository for RESERVED_WAITING - you should find two instances, one in Checkouts.pm and one in checkout.js
4) Apply patch
5) Repeat step 3 - there should be 0 instances

Signed-off-by: Lucas <lchirlias@ville-roubaix.fr>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 23387: Add caching to C4::ClassSource
Nick Clemens [Mon, 5 Aug 2024 18:21:46 +0000 (18:21 +0000)]
Bug 23387: Add caching to C4::ClassSource

These routines ultimately need to be moved to the Koha namespace, for now though,
we can reduce look ups during import and batch modification by caching the values
here for each request

To test:
1 - prove -v t/db_dependent/ClassSources.t
2 - Import some records with items, confirm cn_sort values correctly built
3 - Edit some items, confirm cn_Sort correclty built

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35931: More preselected items in the renew column on patron checkouts
Katariina Pohto [Fri, 3 May 2024 10:30:02 +0000 (13:30 +0300)]
Bug 35931: More preselected items in the renew column on patron checkouts

When viewing patron checkouts table from details or circulation page, overdue checkouts
are preselected for renewals and the overdue dates are bolded and red. This patch will enable
also preselecting checkouts that are due on the current day. The due dates for these checkouts
will be bolded but not red.

Test plan:
1) See/create a patron with several checkouts: overdue, due today and due later.
2) Note that only the overdue checkouts have a checkmark on Renew column when loading the table.
3) Apply patch.
4) Load the checkouts table again. Note that now also the checkout due today has a preselected renewal
   checkmark and the due date has been bolded.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 24471: Rename handle_commit_maybe method
Pedro Amorim [Wed, 3 Jul 2024 15:59:33 +0000 (15:59 +0000)]
Bug 24471: Rename handle_commit_maybe method

To test (k-t-d):
1) Enable ILLModule and install FreeForm, run:
  bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
2) Checkout 24.05.x branch, run:
  cd /kohadevbox/koha/Koha/Illbackends/FreeForm
  git checkout 24.05.x
3) Create a new ILL request from:
  http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl
4) Confirm the request creation works as before

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35402: (follow-up) Remove form from returns.tt
Owen Leonard [Fri, 23 Aug 2024 15:29:39 +0000 (15:29 +0000)]
Bug 35402: (follow-up) Remove form from returns.tt

If you have AllowReturnToBranch enabled and you check in an item which
is disallowed by the preference (returned at the wrong branch, for
instance) You get a "Cannot check in" modal.

Previously clicking the "OK" button in this form triggered JS which is
supposed to submit a form. However, all the button needs to do is
dismiss the modal. The form and the "approve" class on the button are
removed by this patch.

NOTE: This patch contains indentation changes.

To test, apply the patch and set the AllowReturnToBranch system
preference to "only at the library that the item is from."

- Locate an item belonging to another library and check it out to a
  patron.
- Check in the item.
- You should see a modal confirmation, "Cannot check in".
- Clicking the "OK" button should dismiss the modal window without
  triggering a reload of the page.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: DBIC schema update
Katrin Fischer [Fri, 23 Aug 2024 15:48:30 +0000 (15:48 +0000)]
Bug 35044: DBIC schema update

Includes a checksum update for Deleteditem and Item caused
by a previous manual fix.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: DBRev 24.06.00.024
Katrin Fischer [Fri, 23 Aug 2024 15:46:10 +0000 (15:46 +0000)]
Bug 35044: DBRev 24.06.00.024

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: (QA follow-up): Add color to atomic update
Pedro Amorim [Tue, 20 Aug 2024 14:27:54 +0000 (14:27 +0000)]
Bug 35044: (QA follow-up): Add color to atomic update

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: (QA follow-up): Fix flaky tests
Pedro Amorim [Fri, 26 Jul 2024 13:05:17 +0000 (13:05 +0000)]
Bug 35044: (QA follow-up): Fix flaky tests

To test, run the following test file a couple times until it fails:
prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t

My testing this failed around 50% of the time so it should not take
long to reproduce. I believe this is because the order of the array
elements may differ.

Apply this patch and run the test file again many times. It should
never fail.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: (QA follow-up) Delete empty values with a single query
Julian Maurice [Fri, 26 Jul 2024 07:16:15 +0000 (09:16 +0200)]
Bug 35044: (QA follow-up) Delete empty values with a single query

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: (QA follow-up): Remove empty additional_field_values entries
Pedro Amorim [Thu, 25 Jul 2024 17:15:03 +0000 (17:15 +0000)]
Bug 35044: (QA follow-up): Remove empty additional_field_values entries

To test:
1) Follow any of the above test plans to add some
   additional_field_values entries
2) Run the following SQL:
  update additional_field_values set value = '';
3) Run updatedatabase twice. Notice the first time it tells you how many
   entries were removed. The 2nd time it does nothing.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: (QA follow-up): Fix QA script Error on boolean TINYINT
Pedro Amorim [Thu, 25 Jul 2024 16:58:48 +0000 (16:58 +0000)]
Bug 35044: (QA follow-up): Fix QA script Error on boolean TINYINT

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: (QA follow-up): Avoid polluting global scope with functions
Pedro Amorim [Thu, 25 Jul 2024 16:52:10 +0000 (16:52 +0000)]
Bug 35044: (QA follow-up): Avoid polluting global scope with functions

using immediately invoked function expression

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: (QA follow-up): Remove useless code
Pedro Amorim [Thu, 25 Jul 2024 16:43:12 +0000 (16:43 +0000)]
Bug 35044: (QA follow-up): Remove useless code

Most definitely a copy paste error. I've tested and retested this
particular JS piece of code, works as intended before and after removing
this badly copy pasted code. I'm surprised this wasn't causing a console
error.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: (QA follow-up): Allow for '0' in serials batch edit
Pedro Amorim [Thu, 25 Jul 2024 16:39:00 +0000 (16:39 +0000)]
Bug 35044: (QA follow-up): Allow for '0' in serials batch edit

This commit also ensures any existing '0' value additional fields are
kept if batch editing and submitting the input empty

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: (QA follow-up): Remove FIXME and redundant code
Pedro Amorim [Wed, 24 Jul 2024 18:31:07 +0000 (18:31 +0000)]
Bug 35044: (QA follow-up): Remove FIXME and redundant code

prove t/db_dependent/Koha/Acquisition/Booksellers.t
prove t/db_dependent/Serials.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: (QA follow-up): Allow for value '0' in additional fields
Pedro Amorim [Wed, 24 Jul 2024 18:15:05 +0000 (18:15 +0000)]
Bug 35044: (QA follow-up): Allow for value '0' in additional fields

This now allows for value '0' for an additional field (repeatable or
not).
This still does not allow for an empty '' field in additional fields.
This is consistent with borrower patron attributes, i.e. if you submit
an empty borrower patron attribute entry, it does not store it as empty.
Additionally, if you have a value in a borrower patron attribute but
then submit the form with that field as empty, it gets deleted from the
database.

I agree not being able to save the value '0' is a blocker, but not the
empty.
For consistency sake I'm keeping this as is, I don't see a use-case
where a row with an empty field value is preferred over it not existing.

If we allow for '' values of additional fields, the 'clear' button for
repeatable fields would have to remove the input instead of clearing the
value (or else how would the user remove repeatable fields entries?).
If this is done, it's inconsistent with the repeatable fields from
patron attribute types, as in that instance the 'clear' button only
removes the input contents, not the input element itself.

prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: (QA follow-up): DRY code before set_additional_fields
Pedro Amorim [Wed, 24 Jul 2024 18:14:09 +0000 (18:14 +0000)]
Bug 35044: (QA follow-up): DRY code before set_additional_fields

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: Add tests
Pedro Amorim [Wed, 18 Oct 2023 09:31:11 +0000 (09:31 +0000)]
Bug 35044: Add tests

Test plan:
prove t/db_dependent/Koha/Object/Mixin/AdditionalFields.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: Add repetable to REST API spec
Pedro Amorim [Tue, 31 Oct 2023 12:02:24 +0000 (12:02 +0000)]
Bug 35044: Add repetable to REST API spec

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: Update: Manual invoices, manual credits and accountlines
Pedro Amorim [Tue, 17 Oct 2023 13:02:22 +0000 (13:02 +0000)]
Bug 35044: Update: Manual invoices, manual credits and accountlines

Test plan, k-t-d:

Preparation: Create additional fields for table 'accountlines:credit',
visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Acredit

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable

1) Add a new manual credit for admin borrower:
/cgi-bin/koha/members/mancredit.pl?borrowernumber=51
2) Set the mandatory "Amount" input (e.g. '5'). Click the 'Next' and
   press 'Ok' on the alert box.
3) Fill in all additional fields, click the '+New' and 'Clear' links,
   hit 'Save'
4) On the table, click "Details" for the for account line we just
   created.
5) Notice the additional fields are there, repeated fields are comma
   separated.
6) Repeat the above test plan, but for accountlines:debit instead,
   visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=accountlines%3Adebit
7) To add a manual invoice, visit:
   /cgi-bin/koha/members/maninvoice.pl?borrowernumber=51

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: Update: Serial subscriptions batch edit
Pedro Amorim [Mon, 16 Oct 2023 16:14:53 +0000 (16:14 +0000)]
Bug 35044: Update: Serial subscriptions batch edit

Test plan, k-t-d:

Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field
942$c
Attempt to create a repeatable MARC field (get or set). Notice you're
unable to.

1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and
   press 'Ok' on the alert box.
3) Fill in all required fields and press "Test prediction pattern"
4) At the bottom, fill in all additional fields, click the '+New' and
   'Clear' links,  hit 'Save'
5) Notice the fields are shown, repeated fields are comma separated
6) Repeat steps 1-4 to create a second subscription
7) Visit serials home and hit "Search":
/cgi-bin/koha/serials/serials-home.pl
8) Check the checkboxes next to the 2 subscriptions and click "Edit
   selected serials"
9) Input some values in the additional fields section, click the '+New'
   and 'Clear' links,  hit 'Save'
10) Verify that both subscriptions now have the new values form the
    batch edit.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: Update: Serial subscriptions
Pedro Amorim [Mon, 16 Oct 2023 09:20:01 +0000 (09:20 +0000)]
Bug 35044: Update: Serial subscriptions

Test plan, k-t-d:

Preparation: Create additional fields for table 'subscription', visit:
/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription

2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field
942$c
Attempt to create a repeatable MARC field (get or set). Notice you're
unable to.

1) Add a new serial subscription, visit:
/cgi-bin/koha/serials/subscription-add.pl
2) Set the mandatory "Record" input (e.g. '112'). Click the 'Next' and
   press 'Ok' on the alert box.
3) Fill in all required fields and press "Test prediction pattern"
4) At the bottom, fill in all additional fields, click the '+New' and
   'Clear' links,  hit 'Save'
5) Notice the fields are shown, repeated fields are comma separated
6) Click Edit -> Edit Subscription, repeat steps 4 and 5
7) Go back to subscription additional fields, set all fields as
   searchable
8) Visit serials-home: /cgi-bin/koha/serials/serials-home.pl
9) Click 'Search'
10) Notice the searchable fields now show in their columns, repeated
    fields separated by comma
11) Perform a search using a repeatable field, verify it all works as
    expected.

-- Subscription Claims --

Preparation:
1) Define a new claim notice, visit:
/cgi-bin/koha/tools/letter.pl?op=add_form&module=claimissues
2) Input code, name, click "Email" set a "Message subject" and put
   something in the message body. Hit 'Save'.
3) Set a serial as late, visit our original subscription:
/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1
4) Click "Edit serials" and status -> "Late". Hit "Save".
5) Link the original subscription to the existing vendor, visit:
/cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=1
6) Click "Search for a vendor". Hit "Ok". Hit "Choose". Save the
   subscription.

Claims:
7) Visit claims:
/cgi-bin/koha/serials/claims.pl
8) Click "Ok"
9) Verify that searchable additional fields all have their respective
   column. Repeated fields are shown comma separated.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: Update: Invoices
Pedro Amorim [Mon, 16 Oct 2023 14:34:51 +0000 (14:34 +0000)]
Bug 35044: Update: Invoices

Added fixme comment to invoices.tt, the search works so nothing to do
here, but the code is not DRY

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqinvoices':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable

1) Add a new invoice for an existing vendor, visit:
/cgi-bin/koha/acqui/parcels.pl?booksellerid=1
2) Input something in the mandatory "Vendor invoice" field.
3) Fill in all additional fields, click the '+New' and 'Clear' links,
   hit 'Save'
4) Search for invoices, visit:
http://localhost:8081/cgi-bin/koha/acqui/invoices.pl
5) Click "Search" on the left column of the page
6) Click the invoice we just created. Verify all the fields show
   correctly.
7) Go back to the additional fields configuration, set all additional
   fields as "searchable"
8) Return to http://localhost:8081/cgi-bin/koha/acqui/invoices.pl
9) Perform some searches using the additional fields values.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: Update: Acquisition orders
Pedro Amorim [Mon, 16 Oct 2023 12:36:06 +0000 (12:36 +0000)]
Bug 35044: Update: Acquisition orders

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqorders':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable
2 MARC fields, one 'get' and one 'set', both non-repeatable, MARC field
942$c
Attempt to create a repeatable MARC field (get or set). Notice you're
unable to.

1) Add a new order for an existing basket, with an existing record,
   visit:
/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=1&basketno=1&biblionumber=76
2) Set the mandatory "Koha item type" for the item. Click the 'Add item'
   button below.
3) Notice the accounting details now have quantity:1
4) Set the mandatory "Fund" input in accounting details.
5) At the bottom, fill in all additional fields, click the '+New' and
   'Clear' links,  hit 'Save'
6) In the orders table shown, click "Modify". Notice all the fields are
   presented correctly in the edit form.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: Update: Order baskets
Pedro Amorim [Mon, 16 Oct 2023 09:32:44 +0000 (09:32 +0000)]
Bug 35044: Update: Order baskets

Test plan, k-t-d:

Preparation: Create additional fields for table 'aqbasket':
2 text fields, one repeatable, one not-repeatable
2 AV fields, one repeatable, one not-repeatable

1) Add a new basket, visit:
/cgi-bin/koha/acqui/basketheader.pl?booksellerid=1&op=add_form
2) Fill in name and all additional fields, click the '+New' and 'Clear'
   links,  hit 'Save'
3) Notice the basket screen shows repeated fields separated by comma.
4) Notice that only non-null additional fields labels are shown.
5) Edit the basket. Notice all fields are shown as expected.

Additional testing:

Having a repeatable field with multiple instances, go back to the
additional fields configuration and make the additional field
non-repeatable again. Edit the basket again. Notice the multiple text
instances are still shown, but the '+New' link no longer shows.
You're able to remove existing multiple instances, but unable to add new
ones, this is because the field is no longer repeatable.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: Preparation:
Pedro Amorim [Fri, 13 Oct 2023 09:58:17 +0000 (09:58 +0000)]
Bug 35044: Preparation:

get_additional_field_values_for_template method

New method to be utilized for retrieval of additional fields of any
class that implements it.
This is to be used when additional_fields are needed to be sent to .tt
files for renderering. Both for form entries and read-only 'show' pages.

Template files:

Updated additional-fields-entry.inc:
Now considers entry of repeatable fields.
Repeatable text fields will have a "+New" link to allow for adding of a
new instance of a repeatable field.
Repeatable AV fields will be shown as checkboxes instead of a dropdown

Update additional-fields-display.inc
When displaying non-editable additional-fields, multiple instances for
each field are now considered.
Label now only shows if field has a non-null value in it.
Option to show value_only
Option to set if its to be displayed on a table cell

Update histsearch.tt and filter-orders.inc
Now calls additional-fields-entry.inc with search_form=1 to prevent
repetable "+New" controls from showing on search inputs.

additional-fields-entry.js
New JS asset to be called by template files who require
additional-fields-entry.inc for repeatable fields controls.
This also handles the need for having the marcfield of type
'get' submitted if it is a disabled dropdown (AV marc field)

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: Admin: New additional fields 'repeatable' field
Pedro Amorim [Fri, 13 Oct 2023 10:00:22 +0000 (10:00 +0000)]
Bug 35044: Admin: New additional fields 'repeatable' field

There is now a new 'repeatable' checkbox when configuring
(adding or editing) an additional field for a specific table.
It is also displayed in a column in the additional fields panel
for a given tablename.

MARC fields are not allowed to be repeatable.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35044: DB changes + atomicupdate file
Pedro Amorim [Thu, 12 Oct 2023 11:10:56 +0000 (11:10 +0000)]
Bug 35044: DB changes + atomicupdate file

Add the 'repeatable' column to additional_fields
Remove the unique key from additional_field_values
as we will now be allowing for repeated instances of the same
field_id + record_id

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37642: Generated letter should use https in header
Baptiste Wojtkowski [Wed, 14 Aug 2024 08:55:16 +0000 (10:55 +0200)]
Bug 37642: Generated letter should use https in header

_wrap_html returns a header referring to http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd and http://www.w3.org/1999/xhtml. These should be https links.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37672: Add tests
Tomas Cohen Arazi [Mon, 19 Aug 2024 12:55:06 +0000 (09:55 -0300)]
Bug 37672: Add tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37672: Make V1/RecordSources.pm use more helpers
Tomas Cohen Arazi [Mon, 19 Aug 2024 12:27:38 +0000 (09:27 -0300)]
Bug 37672: Make V1/RecordSources.pm use more helpers

This patch adapts the controller class to match the current guidelines
by makiing use of the provided helpers.

The tests are adapted.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37687: Restore -not_in operator
Matt Blenkinsop [Tue, 20 Aug 2024 13:49:15 +0000 (13:49 +0000)]
Bug 37687: Restore -not_in operator

Test plan:
1) Compare the API documentation on query parameters and note that'-not_in' is listed as a valid operator.
2) Look at the patch diff - you will see that previously '-not_in' was not included in the list and now is

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36716: Do special processing based on input id, not column index
Emily Lamancusa [Fri, 9 Aug 2024 17:04:17 +0000 (13:04 -0400)]
Bug 36716: Do special processing based on input id, not column index

When a user clicks "Edit" ( .editrule ) we use JavaScript to loop
through each of the columns in the table to copy the appropriate values
into the input fields. Fields that need special processing are
identified by the column index, which can lead to problems when the
index varies between Koha versions or columns are shown/hidden based
on syspref settings.

In the current main, there is at least one such bug causing the
value for "no automatic renewal before" not to propagate, but to get
silently saved in the "no automatic renewal before (hard limit)" field
instead.

Identifying fields for special processing based on input id rather than
index should fix the above issue and avoid similar regressions.

To test:
1. Create a circulation rule that has:
    a) a value (such as 30) in the column "No automatic renewal after"
    b) no value in the column "No automatic renewal after (hard limit)"
2. Click the button to edit the circulation rule from step 1
--> The text field for "No automatic renewal after" is blank
3. Save the rule without making any changes
--> "No automatic renewal after" is now blank for this rule, but "No
    automatic renewal after (hard limit)" has a date in it
4. Apply patch
5. Repeat steps 1-3
--> "No automatic renewal after" and "No automatic renewal after (hard
     limit)" now preserve their values correctly
6. Create a circulation rule that has a non-default value in every field
7. Edit the circulation rule from step 6
--> Confirm that all values are copied to the edit fields correctly
8. Save the rule without making any changes
--> Confirm that the rule saved correctly
9. Create a circulation rule, leaving the following columns blank:
    "Current checkouts allowed"
    "Current on-site checkouts allowed"
    "Holds allowed (total)"
    "Holds allowed (daily)"
    "Holds per record (count)"
--> The above columns should display as "Unlimited"
10. Edit the rule from step 9
--> The input fields for the above columns should be blank
11. Save the rule without making any changes
--> The above fields should still display as "Unlimited"

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37396: Add missing cud-checkout op to form
Nick Clemens [Tue, 23 Jul 2024 16:00:10 +0000 (16:00 +0000)]
Bug 37396: Add missing cud-checkout op to form

To test:

1. Set the system preference 'OverduesBlockCirc' to 'Ask for Confirmation'
2. Enable the BatchCheckout system preference
3. Checkout an item to a patron and backdate the due date so that it is overdue.
4. Attempt to checkout an item or a set of items using the Batch Checkout feature. The batch checkout page will ask you to confirm the checkouts because the 'Patron has 1 overdue item'.
5. Confirm the checkout and go to the patron's holdings table. The items you checked out via the batch checkout were not issued to the patron.
6. Apply patch
7. Repeate batch checkout
8. Confirm the checkout
9, Items are successfully issued!

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37413: Ensure itemnumber is sent
Pedro Amorim [Thu, 1 Aug 2024 11:59:58 +0000 (11:59 +0000)]
Bug 37413: Ensure itemnumber is sent

Fix condition to ensure the itemnumber is sent

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 36111: 856 should not appear as a link in detailed record
Hammat Wele [Wed, 21 Aug 2024 19:08:11 +0000 (19:08 +0000)]
Bug 36111: 856 should not appear as a link in detailed record

Test plan:
1. Add 856 to MARC editor
   1.1. Go to Administration > MARC bibliographic frameworks
   1.2. Next to Default framework, click Actions > MARC structure
   1.3. Search for field 856
   1.4. Click Actions > Edit subfields
   1.5. Click h
   1.6. Check the Editor box
   1.7. Click Save changes
2. Catalog a new record with a random URL in 856
   2.1. Go to Cataloging
   2.2. Click New record
   2.3. Fill out the mandatory fields (000, 003, 005, 008, 040,
        245, 942)
   2.4. Go to tab 8 and enter a value in 856
   2.5. Click Save (No need to add an item)
3. Search for the title in the staff interface (a large enough
   search to have more than one result)
   --> Notice it says "Online resources: Click here to access online"
   3.1. Try to click the link
        --> Blank page
4. Access the detailed record in the staff interface
   --> Notice it says "Online resources: Click here to access online"
   4.1. Try to click the link
        --> Blank page
5. Search for the title in the opac (a large enough search to have
   more than one result)
   --> Notice it says "Online resources: Click here to access online"
   5.1. Try to click the link
        --> Blank page
6. Access the detailed record in the opac
   --> Notice it says "Online resources: Click here to access online"
   6.1. Try to click the link
        --> Blank page
7. Edit the item and add a text in field 856
8. Access the detailed record in the staff interface
   --> Notice it says what you put in 856 field
9. Apply the patch
10. Replay steps 3 through 6, but this time, the "Online resources"
   field should not be present.
11. Replay steps 7 through 8, but this time, what you put in 856
   field should not be present.
12. Edit the item and add a url in field 856
13. Replay steps 3 through 6, but this time, clicking on the link
    should take you to the URL specified in the 856 field.
14. Replay steps 7 through 8, but this time, what you put in 856
   field should be present and
   clicking on the link should take you to the URL specified in the 856 field.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Bug 36111: fixed extra space

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Nind <david@davidnind.com>
Bug 36111: online resource link should be based on the presence of 856

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 37542: Fix patron search when dateofbirth is a DefaultPatronSearchField
Brendan Lawlor [Wed, 21 Aug 2024 15:52:24 +0000 (15:52 +0000)]
Bug 37542: Fix patron search when dateofbirth is a DefaultPatronSearchField

This patch updates the call to dayjs to use strict parsing for patron search. See https://day.js.org/docs/en/parse/string-format

To test:
1. Create a patron with dateofbirth 1994-07-27
2. Add dateofbirth to DefaultPatronSearchFields
3. In patron or checkout search, type a cardnumber like '2908800092528'
4. Note the patron with that birth date is found in autocomplete
5. Apply patch and restart_all
6. Repeat step 3 and notice the patron is no longer found
7. In patron or checkout search, try searches using a formatted date
8. Confirm searches for '07/27/1994' and '1994-07-27' find the patron

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoBug 35402: Update the OPAC and staff interface to Bootstrap 5
Owen Leonard [Wed, 3 Jan 2024 19:33:07 +0000 (19:33 +0000)]
Bug 35402: Update the OPAC and staff interface to Bootstrap 5

This patch updates the OPAC and staff interface to use Bootstrap 5.
Bootstrap CSS assets are now pulled from node_modules and compiled into
staff-global.css and opac.css at build time. This update lays the
foundations of some other chnages, especially the addition of a dark
mode in the future.

Hundreds of templates have been updated, mostly with updates to the grid
markup. Most of the responsive behavior is still the same with the
exception of improved flexibility of headers and footers in both the
OPAC and staff interface.

The other most common change is to add a new "namespace" to data
attributes used by Bootstrap, e.g. "data-bs-target" or "data-bs-toggle".
Modal markup has also been updated everywhere. Other common changes:
dropdown button markup, alert markup (we now use Bootstrap's "alert
alert-warning" and "alert alert-info" instead of our old "dialog alert"
and "dialog info").

Bootstrap 5 now uses CSS variables which we can override in our own
'_variables.scss' (in both the OPAC and staff) to accomplish a lot of
the style overrides which we previously put in staff-global.scss.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2 months agoRevert "Bug 36111: 856$h should not appear as a link in detailed record"
Katrin Fischer [Wed, 21 Aug 2024 17:16:27 +0000 (17:16 +0000)]
Revert "Bug 36111: 856$h should not appear as a link in detailed record"

This reverts commit 24e1e2de243c89b0a274a0158dcdc2c8328ef6af.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>