Commit graph

49748 commits

Author SHA1 Message Date
a2093742fe Bug 34447: Do not export "Actions" columns
In the KohaTable Vue component we should add the noExport class to the actions columns to not export them.

Test plan:
Go to the ERM module, create at least one agreement.
Go to the agreement list view and click "export" to export the table
=> Without this patch the "Actions" column was exported
=> With this patch is no longer there

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 585138f13f)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 50dfe2be55)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:50:43 +00:00
emlam
148eec6bb3 Bug 34435: Remove side effect from get_password_expiry_date
If get_password_expiry_date is passed a DateTime object
as a parameter, it modifies and returns the original
object. This can create possible side effects.

This patch modifies get_password_expiry_date to clone the
DateTime object that it receives as a parameter and
return the modified clone, so that object references can
be passed in safely.

To test:
prove t/db_dependent/Koha/Patron/Category.t

Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit dae5607fd1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f067a82e3a)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:50:43 +00:00
Emily Lamancusa
77f55baa51 Bug 34435: Add unit test
To test:
prove t/db_dependent/Koha/Patron/Category.t

Signed-off-by: Sam Lau <samalau@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4203632582)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ef24af8da3)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:50:43 +00:00
fc3fde11d4 Bug 33848: Enabling Coce in the OPAC breaks cover images on bibliographic detail page
Bug 32412 added an additional "context" parameter to KOHA.coce.getURL.
The code which pulls a Coce image for the "main" cover image slider
needs to include the correct context parameter for the images to load.

This patch also makes a minor correction to CSS in order to make the
cover image slider "dots" change color to highlight the current slide.

To test, apply the patch and rebuild the OPAC CSS.

- Enable multiple cover image sources in the OPAC including Coce, e.g.
  Amazon, Google, OpenLibrary, etc.
- Search for a title which will match multiple cover image sources. In
  the sample data a search for "Perl" will return good results.
- Note the number of cover images loading for a title in the search
  results.
- View the detail page for that title. There should be the same number
  of covers in the cover image slider.
- Clicking the slider navigation dots should work to show each image,
  and the dot should change color to highlight the current image.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d313f9b963)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4125aec704)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:50:43 +00:00
be76f596a6 Bug 33848: Don't remove coce container from template
It's removed from coce.js

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aa8dc28e97)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 6cef886164)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:50:43 +00:00
68720e0632 Bug 33755: Set profile_id and add missing import
This patch adds a missed parameter (profile_id) in stage-marc-import.pl and also adds a missing import in the background job for staging marc files. This means that the profile used when importing can now be shown in the import batches table and also in batch details

Test plan:
1) Stage a record for import and make sure to save the import profile you use
2) Import a record using that profile
3) Navigate to Cataloging > Manage staged MARC records
4) In the Profile column, no value will be shown for the staged record
5) Click on the batch, the profile will be missing in this screen as well
6) Apply patch
7) Restart_all
8) Repeat steps 2-5, the profile name should be visible in both places

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 38fc85ade9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a0a03cb08b)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:50:43 +00:00
870c3997e2 Bug 34354: Fix progess typo
Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2234ecb8c9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 57ca63cd00)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:50:43 +00:00
42f0a0c472 Bug 34493: Fix indenting in search_indexes.inc
Bug 32683 broke indenting in koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc
Not on purpose looks like.

Test plan :
1) Look at changes to validate indenting
2) Run prove xt/tt_valid.t

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fc2dc973f0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 14a46944ff)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:50:43 +00:00
2a4d1f8b06 Bug 34469: Block editing for received order lines
When an already received order line is modified/edited,
we experience data loss. Most prominently, we will lose the
linked invoiceid. Therefore we should not allow editing an
order line that was already received. If something needs to be
changed, the receipt should be cancelled first.

To test:
* Create basket as standing order with items added in cataloguing
* Add an order line
* Receive shipment
* Go to the basket summary page, click on 'Modify'
* Change the actual cost
* Save
* Verify that the invoice is now empty
* In the database aqorders.invoiceid will be NULL
* Apply patch
* Receive another shipment for the standing order
* Go back to basket summary page
* Verify the 'Modify' link is no longer present
* Click 'Modify' on the unreceived order line
* Edit the URL parameter odernumber to have the number of an
  already received order line
* Verify you see a nice error message:
  This order cannot be edited, the basket is closed or the order was already received.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a4b7490633)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 93e9184327)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:38:16 +00:00
fafd11057c Bug 34056: Add -api-client suffit to authorised-values API client
In koha-tmpl/intranet-tmpl/prog/js/vue/fetch all files have the -api-client suffix but authorised-values. For consistency we should add it.

Test plan:
Go to the ERM module and confirm that dropdown lists are correctly
filled in with authorised values.
You can also inspect the console and confirm that a GET query to /authorised_value_categories is done

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 813cfe1eec)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bc3ddc5603)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:33:24 +00:00
d7b6d7b448 Bug 34365: Add cancellation request flow to DELETE /holds
This patch adds a new `x-koha-override` header to allow enforcing the
cancellation request flow for waiting holds.

If the hold is not waiting, the header has no effect.

To test:
1. Apply the tests patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/api/v1/holds.t
=> FAIL: The endpoint doesn't implement the required logic
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests pass! The endpoint behavior is changed!
5. Sign off :-D

Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb224540e2)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit e4e145eb4a)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:32:20 +00:00
f940a14331 Bug 34365: Unit tests
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2a8c43f975)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ffe0f84568)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:32:13 +00:00
Emily Lamancusa
6c83ba326f Bug 34470: Initialize random seed after spawning a child worker process
When background_jobs_worker.pl spawns a new child process, it needs to
explicitly reinitialize the random seed - otherwise each child process
will inherit the same random seed from the parent process, and any
randomization will produce identical results each time.

This patch adds a call to srand immediately after the fork to
reinitialize the seed. Note that child processes should not call
srand with no parameter anywhere else, as the Perl documentation
indicates that srand should not be called with no parameter more than
once per process.

To test:
1. Apply the logging patch only
2. Set system preferences:
    a. RealTimeHoldsQueue -> Enable
    b. RandomizeHoldsQueueWeight -> in random order
3. Watch the logs for the staff interface
   in ktd:
   ktd --shell
   koha-intra-err
4. Place a hold. Note that the logs display the branch list before and
   after it is randomized.
5. Place some more holds. Note that the branch order after randomization
   is identical each time.
6. Apply both patches and restart_all
7. Repeat steps 3-5.
   -> Note that the branch order before randomization hasn't changed
   -> Note that the branch order after randomization is now different
      each time.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a3c64f62c0)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1155af8e80)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:31:45 +00:00
Emily Lamancusa
04e8a6e8de Bug 34117: Add unit tests
To test:
prove t/db_dependent/Koha/Patron/Categories.t

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3ff1430bb4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 33e046f41c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:30:46 +00:00
Emily Lamancusa
c9f1d03982 Bug 34117: Remove side effect from get_expiry_date
If get_expiry_date is passed a DateTime object as a parameter,
it modifies and returns the original object. When memberentry.pl
prefills the input fields for duplicating a patron, it passes the
enrollment date object to get_expiry_date. This causes the enrollment
date object to be modified with the expiry date value.

This patch modifies get_expiry_date to clone the DateTime object that it
receives as a parameter and return the clone, so that references to an
enrollment date object can be passed in safely.

To test:
1. Have or make a patron
2. Duplicate that patron
3. Before saving the new patron, scroll down to Registration Date and
   see that it's defaulting to a date in the future.
4. Apply patch and restart_all
5. Try duplicating a patron again
6. Registration Date should correctly set to today

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bba9feff5c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 1628791ca2)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:30:39 +00:00
Julian Maurice
fc59fecd83 Bug 34155: Hide 'Next available' at OPAC when item-level hold is forced
This was a regression caused by bug 24860

Test plan:
1. Set up circulation rules so that OPAC users can place holds only on
   specific items ("OPAC item level holds" = "force")
2. Try to place a hold at OPAC. The "Next available item" option should
   not appear.
3. Set "OPAC item level holds" to "allow"
4. Try to place a hold at OPAC. The "Next available item" option should
   appear

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b1bd01a42)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9916e18534)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:29:38 +00:00
790c828bfb Bug 34269: (QA follow-up) Add missing TT filters
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e211d8b34b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 741f331e7d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:29:13 +00:00
77a30b1b7d Bug 34269: Convert to using codes in select compares
This patch updates the logic in smart rules to compare option values to
codes as apposed to option texts to value descriptions.

0. Apply patch
1. Install another language in the staff interface
   1. ./translate install xx-XX
   2. Check the box of the language in the 'language' system preference
   3. Refresh
2. Create an item type with a parent
   1. Go to Administration > Item types
   2. Create a new item type or modify an existing one, assigning a parent type
      Example: Create a 'Children's books' itemtypetype
      and assig 'Books' as its parent
   3. Create a third item type with the same description but something added in ():
      Example: 'Children's books (3-5)'
3. Create a circulation rule for the parent type
   Example: All/Books, with 2 checkouts allowed
4. Create a circulation rule for:
   All/All with 3 checkouts allowed
5. In English, click on "Edit" next to the parent type rule (All/Books)
   --> Note that the item type in the bottom row (the modifiable row) is changed to 'Books (All)'
6. Modify the number of checkouts allowed (e.g. 99)
   --> The All/Books rule is modified
7. Switch the interface to the other language
8. Click on "Edit" next to the parent type rule (All/Books)
   --> The All/Books rule is modified
9. Add rules for Children's books and Children's books (3-5)
10. Click on "Edit" next to each rule and change a value
   --> Verify that the changed values are always saved for the correct rule

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e0fdb2db51)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 864f4ecba5)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:29:06 +00:00
1a99d96ff7 Bug 34452: Restore fund label and 'Update adjustments' button
This patch fixed 2 small and recent regressions:

* The "Update adjustments" button used to always display. It's
  required to save a new first adjustment, but also to save
  changes to existing adjustments edited inline. It now would
  only display after "Add adjustments" was clicked. We retore
  to display it always. (bug 32746)

* We have several "Fund" pull downs on this page, but they are
  for different things and require different labelling.
  "Fund" was changed to "Shipping fund" which matches at the top,
  but doesn't work for the adjustments table and single adjustment
  form. Now we use "Shipping fund" "Fund" and no label in the table
  as the table header covers it there. (bug 33721)

To test.
  * Add a vendor
  * Receive shipment
  * Add invoice and save
  * Click on "Finish receiving"
  * Verify the button "Update adjustments" appears after clicking
    "Add new adjustment"
  * Verify the button is gone after you clicked it and the table shows
  * Change something in the table - no button to save change :(
  * Apply patch
  * Repeat steps, button "Update adjustments" should not always be
    visible.

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 72ef65edbe)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 4ababc2dc8)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:28:08 +00:00
5fdc778da1 Bug 34059: Add only issues from the branch that is creating the notice
Test plan, on k-t-d
1) Go to 'my account' on top right user menu
2) On 'Patron messaging preferences', click 'Edit'
3) On the 'Item due' row, check the 'Email' and 'Digests only' checkboxes and save
4) On the top search bar, press 'Check out' and enter '42' (koha user cardnumber)
5) On the checkout input bar, enter 39999000001372 and press checkout
7) Go to 'Set library' on top right user menu and pick a different library
8) Repeat step 4), then, on the checkout input, enter 39999000004571 and press checkout
9) Verify that this user now has 2 items checked out, from 2 different libraries at /cgi-bin/koha/circ/circulation.pl?borrowernumber=51
9) Run the following 2 queries to force the due_date to be equal to 'today's' date for both issues:
NOTE: change the YYYY-MM-DD below to whatever day it is you're running this test plan

UPDATE issues SET date_due = '2023-06-19 23:59:00' where issue_id = 1;
UPDATE issues SET date_due = '2023-06-19 23:59:00' where issue_id = 2;

10) Run the cronjob:
./koha/misc/cronjobs/advance_notices.pl -c --digest-per-branch

11) Verify that two DUEDGEST notices were created, one per each library, but both notices contain both issues:
SELECT letter_code, time_queued, content FROM message_queue ORDER BY message_id DESC LIMIT 2;

12) Apply patch, then do 10) and 11) again
13) Verify that each notice only contains the issue for its respective library

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Stephen Graham <s.graham4@herts.ac.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 39e6b100cb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit bdfe5b3cde)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:14:29 +00:00
Katrin Fischer
3063b166a8 Bug 34387: (QA follow-up) Fix display of 'Import batches'
Fixes the heading and sidebar display of the 'Import batches'
section.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:14:11 +00:00
c93a6b77a1 Bug 34387: (follow-up) Minor spelling and quoting fixes
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:14:11 +00:00
e573b1347f Bug 34387: Improve API docs naming consistency
This patch aims to make our API docs be more consistent.
It addresses two particular things:

* There's no consistency on the `tags` used across the spec, and not all
  of them are correctly described and have an `x-displayName` entry.
  More on this later.
* This are not sorted either by some for of grouping, or at least
  alphabetically.

For the former, I did my best trying to harmonize (specially on the ERM
front) with what we do in the rest of the use cases.

For the latter, I opted for sorting everything alphabetically, as a
first step. Hoping someone else could work on grouping things.

To test (ON YOUR HOST MACHINE):
1. On current master run:
   $ cd api/v1/swagger
   $ docker run --rm -v $(pwd):/api --workdir /api redocly/cli \
           build-docs swagger.yaml --output index.html
=> SUCCESS: It doesn't break or anything
2. Open your browser, open the generated api/v1/swagger/index.html file
=> FAIL: The left column has
         * several lower case entries
         * not everything is correctly grouped (ERM? packages?)
         * Things are not sorted. There's an attempt but looks messy
3. Apply this patch
4. Repeat 1 and 2
=> SUCCESS: Things look much better!
5. Sign off :-D

CAVEAT1: I'm not sure why, but import_batches doesn't work. Ideas are
welcome, I'll keep looking for fixes.
CAVEAT2: I don't have enough eHoldings background to weight in, but I
feel like 'ERM eHoldings packages' could just be 'ERM packages'.
Follw-up patches with better ideas are welcome.
CAVEAT3: Patron credits, debits, balance... They could all go in to
'Patrons accounts' or similar. Open to ideas.
CAVEAT4: Old redocly didn't support mapping an endpoint to more than one
target section. Something to explore if we want (for example) to reach
'credits' through the 'Patrons' section but also from 'Accounting'.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 13:14:11 +00:00
Hammat Wele
e9cba48c76 Bug 33978: Adding authority from automatic linker closes imported record
If you import a record, then create an authority record using the automatic linker, it closes the biblio record. The problem occures when a record is edited in a new tab.

To recreate:

1. Import the example records
   1.1. Download the example records
   1.2. Go to Cataloging > Stage records for import
   1.3. Choose the downloaded file
   1.4. Click Upload file
   1.5. Click Stage for import
   1.6. Click View batch
   1.7. Click Import this batch into the catalog
   1.8. Click View detail of the enqueued job
   1.9. Click Manage imported batch

Correct behaviour:

2. In another tab, search for one of the records (for example, Fafounet)
3. Click Edit > Edit record
4. Go to field 100
5. Click Link authorities automatically
   --> It should say 100 - No matching authority found.
6. Click the plus sign next to 100
7. Fill out the mandatory fields by clinking in the text fields (000, 003, 005, 008, 040), field 100 should already be filled
8. Click 'Save'
   --> Authority number is added in 100 and you get to stay in the record for more edits if needed

Incorrect behaviour:

9. Go back to the imported batch tab
10. Click Edit next to the second title (the one by Paventi, Eza)
11. Redo steps 4 to 8
    --> Record is closedclear :(
    The behaviour should be the same, stay in the bibliographic record until it is saved.

12. Apply the patch
13. Redo step 9, 10, 4
14. Edit field 100, Type 'Paventi Test 2'
15. Redo step 5 to 8
    --> Authority number is added in 100 and you get to stay in the record for more edits if needed

Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit ad124fe536)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 03c5a75dfd)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 11:46:43 +00:00
54b530e351 Bug 34213: import_patrons.pl - Fix short version of matchpoint option in POD
44     'c|confirm'                      => \$confirm,

 46     'm|matchpoint=s'                 => \$matchpoint,

The POD is wrong.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 2442a4537d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 5fcaf0aa09)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 11:42:59 +00:00
Laura Escamilla
1f8c6c3de9 Bug 34332: Removed extra parenthesis that was causing an error
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eb84c45da4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 46496e74a0)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 11:42:29 +00:00
4d9ef1db9f Bug 34334: Item(s) in MARCdetail untranslatable
This patch adds a <span> around the text "Item(s)" in the template for
the MARC detail page in the staff interface. Without the span the
translation tool can't detect the string.

To test, apply the patch and update a translation, e.g. fr-FR:

  > cd misc/translator
  > perl translate update fr-FR

- Open the corresponding .po file, in this case
  misc/translator/po/fr-FR-staff-prog.po
- Confirm that the string is now in the .po file for translation. You
  should find these lines:

koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt:146
c-format
msgid "Item(s)"
msgstr "Exemplaire(s)"

I found that the translation was already populated. Install the updated
po file:

 > perl translate install fr-FR

Test the MARC detail page in your translated language to confirm that
the string is correct.

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 92692a2ee9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9bffe4aec1)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 11:41:39 +00:00
b431cd1d14 Bug 34316: Add_credit should rethrow an exception correctly
Found while running Items.t on top of 33608.
Another exception was thrown but not rethrown.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit fa9750e24d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 2b1b8884cc)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:38:59 +00:00
3ab7309e67 Bug 28493: Make koha-passwd display the username
to test...

1/ run command
 $ sudo koha-passwd dev1
 Password for dev1: CraZyPa$$WoRD!!
 Press enter to clear the screen...
 ^C

2/ apply patch

3/ run command again, note 'username' section
 $ sudo koha-passwd dev1
 Username for dev1: koha_dev1  <<<<<<<<<<<<
 Password for dev1: CraZyPa$$WoRD!!
 Press enter to clear the screen...
 ^C

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 4ce7f8c493)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit ba51185fbd)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:38:41 +00:00
7cb0a706cc Bug 34279: Don't enforce overduefinescap unless it is greater than 0
When creating a circ rule, we can set overduefinescap to blank or 0 and no cap is enforced. If we edit that rule, the blank/0 is converted to "0.00" which perl considers true, thus zero-ing out any calculated fine.

Considering we've always ignored an overdue fines cap of 0, we should also ignore 0.00. However, perl is evaluating it as a string which makes it true instead of false as 0 is.

Test Plan:
1) Apply the first patch ( unit tests )
2) prove t/db_dependent/Circulation/CalcFine.t
3) Note the test fails
4) Apply the second patch as well
5) prove t/db_dependent/Circulation/CalcFine.t
6) Note the test passes

Test Plan 2:
1) Create an all/all/all rule with an overduefinescap of 0.00, with a
   daily fine. Enable CalculateFinesOnReturn
2) Backdate a checkout so it is overdue
3) Return this item, note the lack of a fine
4) Apply this patch set
5) Backdate a checkout and return it again
6) Note the fine is generated!

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1763b136d1)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 662da18be2)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:37:11 +00:00
0860515897 Bug 34279: Unit tests
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 8096ec9fff)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3e360c5637)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:37:04 +00:00
e93ff79c85 Bug 32271: (QA follow-up) Restore $Price filtering for valid values
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 093d1959af)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit cf41331ba1)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:36:18 +00:00
67aa3dbba3 Bug 32271: (QA follow-up) Correction to 'can_be_blank' logic
The logic introducing the can_be_blank check into the monetary decimal
format check was flawed and meant we were no longer checking decimal
formatting in the majority of cases. This patch updates that so we pass
the unit tests and correctly check any value passed that's not an empty
string.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit c42725bab4)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7ccbda031c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:36:12 +00:00
b3b62a5e1e Bug 32271: Unit test
Add a unit test for the allow blank option added to the monetary check
in CirculationRules.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 41274ef751)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 8d02637bec)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:36:06 +00:00
16cf05f74d Bug 32271: (QA follow-up) Convert all positive numbers to monetary float and convert all 0 equivilents to blank value
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit daedce4f6e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 093a97c67b)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:36:00 +00:00
Géraud Frappier
2afb79a7c3 Bug 32271: Fix overdue fines cap (amount) set to 0.00 when editing rule.
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit adeb4d5453)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit b8a9eefc4c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:35:54 +00:00
692fd632ac Bug 34133: Set default sort on first column (ID) desc
Test plan:

Before applying patch:
* Open incognito at /cgi-bin/koha/ill/ill-requests.pl,
* Verify order is by ASC (lowest ID first)
* Close incognito

Apply patch, then:
* Open incognito at /cgi-bin/koha/ill/ill-requests.pl,
* Verify order is by DESC (highest ID first)

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Followed the test plan from Bugzilla, and added it above.
Works as advertised.
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 67916fc23a)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f1c1cfdb0c)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:34:57 +00:00
Aleisha Amohia
4afe2a2b0a Bug 33992: Only consider the date when auto-expiring problematic recalls
This patch carries this fix into the misc/cronjobs/recalls/expire_recalls.pl cronjob so that recalls are automatically expired when they have been waiting a problematic number of days, not considering hours, as expected.

To test, follow the test plan from the first patch. This will set you up with a waiting problematic recall.

Run the cronjob manually

perl misc/cronjobs/recalls/expire_recalls.pl

Refresh your 'Recalls awaiting pickup' page. Your problematic recall should be gone/expired.

Expiration dates will apply when expiring any 'unfulfilled' recall i.e. newly requested, overdue to be returned, and awaiting pickup.

Sponsored-by: Auckland University of Technology
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0d2052088e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 3a5f4d1701)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:34:28 +00:00
25cc9be36d Bug 34028: Show the secret when registering from the auth screen
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 3cb77a590b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 7651c42b6d)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:33:11 +00:00
fec6a596c3 Bug 34028: Fix manual entry for two factor authentication
This patch changes the "Account" and "Key" display so that
you can manually enter two factor authentication details into
an authenticator app.

The details are the same as those provided by scanning the QR code.

Test plan:
0. Apply patch
1. Go to
http://localhost:8081/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=TwoFactorAuthentication
2. Change setting to "Enable"
3. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51
4. Click "More" on record toolbar and choose "Manage two-factor authentication"
5. Click "Enable two-factor authentication"
6. Scan the QR code into an authenticator app and note it creates an entry called
"Centerville: Centerville_koha"
7. Manually enter an entry into an authenticator app (like Google Authenticator)
7a. Add the "Account" as shown on the Koha screen
7b. Add the "Key" as shown on the Koha screen
8. Note that the entries added by QR code and manual entry have the same
label and both were accepted by the authenticator app

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 7c05333914)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit a51d570a6e)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-18 10:32:58 +00:00
ebd4a6cfa7 Bug 33028: (follow-up) Lower the two digits requirement
This patch makes the code not require two decimal digits, as the main
intention here is to forbid (locale) formatted strings to reach the DB.

The number of digits we support needs to be discussed on its own bug,
and a centralized check implemented.

This patch fixes tests:

prove t/db_dependent/Circulation.t
t/db_dependent/Circulation.t .. 1/67 Exception 'Koha::Exceptions::CirculationRule::NotDecimal' thrown 'The circulation rule expected a decimal value' with name => fine, value => 0.1
t/db_dependent/Circulation.t .. Dubious, test returned 11 (wstat 2816, 0xb00)
Failed 53/67 subtests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 45b050871e)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 343221462e)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 16:02:18 +00:00
0b9a2b8b55 Bug 33028: (follow-up) Add POD to new Exception
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit b82f1bd807)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 187e58aa49)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 16:02:11 +00:00
a72448805e Bug 33028: Unit tests
Add unit tests for is_monetary functionality introduced in the
CirculationRules module.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 88ccaaf3ac)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f0d56eb1dc)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 16:02:03 +00:00
d99dfc6b95 Bug 33028: Make exception less generic
While testing this bug I found Circulation.t was failing, but the
exception doesn't actually display anything useful in terms of helping
debug what's going on.

This patch makes it add the rule_name and rule_value to the message.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 9b7c077c9d)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit f44e411edb)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 16:01:54 +00:00
51eb255b81 Bug 33028: (QA follow-up) Tidy introduced code
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 82bdaa8fbc)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 16:01:19 +00:00
2ce7b2e312 Bug 33028: DBRev 22.11.08.001
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 86c2d9d1e9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 834b3ca5d9)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:59:23 +00:00
6deab87d2d Bug 33028: Perltidy database update script
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit f0a3b98cdb)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 495a4a7477)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:57:40 +00:00
d7ab10b465 Bug 33028: Throw exception if not passed a decimal number
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d5b1041f43)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 0bd5fb0bb6)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:57:32 +00:00
592732dc17 Bug 33028: (follow-up) Apply unformat_price to decimal fields
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 461c1931b9)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 18ce1916fa)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:56:53 +00:00
3fac0d78aa Bug 33028: (follow-up) Add unformat_price js function
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 31cbd5ce94)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 9741e94376)
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
2023-08-17 15:56:46 +00:00