Commit Graph

8009 Commits

Author SHA1 Message Date
Jonathan Druart 0a94b02139
Bug 38010: Embed invoices_count - fix patron deletion from show view
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-05-05 10:33:51 +02:00
Jonathan Druart 25a805e8e4
Bug 39826: UTF8-decode vendor interface's password on display
We store an encrypted version of the passwords for vendor's interfaces, but we don't utf8 decode it after it is decrypted

Test plan:
0. Do not apply this patch
1. Create or edit a vendor and add at least one interface with non ascii
   characters, eg. émyPassword❤
2. Go to the detail view of the vendor and click the "Show password"
   link
=> The password is not correctly utf8-decoded
3. Apply this patch, repeat 2
=> The password is correctly displayed
4. Repeat 1 and 2
=> The password is correctly displayed

Note that maybe we should make sure the encrypt_hex is getting a valid
utf8-encoded variable.
2025-05-05 10:17:22 +02:00
Jonathan Druart ef774abc8c
Bug 23875: Fix tests
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-05-05 09:51:47 +02:00
Jonathan Druart 2f84989a38
Bug 38010: Fix cypress tests - add _count to the mock object
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:19:33 +02:00
Jonathan Druart b2787045f4
Bug 38010: Fix cypress tests - do not intercept /config
We do not want to intercept /acquisitions/vendors/config
Ideally we should mock it separately

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:19:33 +02:00
Jonathan Druart 25ec6e70bd
Bug 38010: Add tests for DELETE vendors/{vendor_id}
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:19:32 +02:00
Matt Blenkinsop fb4f2e42b1
Bug 38010: Migrate to_api logic to GET endpoint
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:19:28 +02:00
Jonathan Druart c5819f40a8
Bug 38010: Embed baskets+count and subscriptions+count
We don't need to whole list of baskets and subscriptions

(cherry picked from commit 391b4d3b32b57c97bfb7e66ab394020ae7eed0e5)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:19:28 +02:00
Jonathan Druart 1e780ea61d
Bug 38010: Add tests for embed contacts,interfaces,aliases
(cherry picked from commit cae75569e6e8f2bfe5a2e6d3acc111485f81cc1e)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:19:25 +02:00
Matt Blenkinsop 8f93413671
Bug 38010: (QA follow-up) Update routes to include 'acquisition'
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:19:09 +02:00
Matt Blenkinsop 964c160f64
Bug 38010: (QA follow-up) Add unit tests
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:19:08 +02:00
Matt Blenkinsop 5dc611d037
Bug 38010: Remove unneccessary test
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:18:53 +02:00
Matt Blenkinsop 12cb5d3d87
Bug 38010: Fix vendors search bar
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:18:37 +02:00
Matt Blenkinsop 069381a815
Bug 38010: Add cypress tests
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:18:35 +02:00
Matt Blenkinsop a8ebbdab10
Bug 38941: Add a cypress test
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 17:18:25 +02:00
Nick Clemens 0fff879e40
Bug 39710: Unit test
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-05-02 08:49:21 +02:00
Jonathan Druart a5f671330e
Bug 39323: Fix selenium/update_child_to_adult.t
This test is not really needed. It the new window opens correctly the
next test will pass.
And should fail if it does not.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-29 17:19:34 +02:00
Nick Clemens 08da4b33b0
Bug 39752: (QA follow-up) Unit test
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-29 17:19:30 +02:00
Tomas Cohen Arazi 72fe5765ec
Bug 38441: (QA follow-up) Minor change
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:44 +02:00
Pedro Amorim d9c6a1de11
Bug 38441: (QA follow-up): Only look for matchin requests if patron
Previous commit 'HistoryCheck now only considers same patron' added the following regression:
HistoryCheck is performed and shown in the OPAC even if no user is authenticated (using ILLOpacUnauthenticatedRequest).
This fixes that. History check is skipped unless a user exists.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:43 +02:00
Pedro Amorim 4da60d1669
Bug 38441: (QA follow-up): Hackfest feedback
This commit addresses all Hackfest QA related feedback:
1) Update of all strings that required update, including UI messages and
   sys pref description
2) Moved the history check information from staffnotes to its own
   pipe-separated illrequestattribute 'historycheck_requests'
3) Fix display of ILL request information on the history check screen
   (Staff), including proper label naming (e.g. branchcode -> library),
show status description instead of code, uppercase labels.
4) Updated OPAC display to match Staff UI's display of matching history
   requests
5) Removed ISSN criteria for matching requests check
6) Update tests accordingly

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:42 +02:00
Pedro Amorim 9a90757e25
Bug 38441: (QA follow-up): HistoryCheck now only considers same patron
Initial implementation checked existing ILLs for same patron and other patrons.
User testing reported ILLs for other patrons are not helpful, and makes this stage
screen show up much more frequently than it should.

This patch simplifies the original implementation to only consider the
patron of the request being placed for an ILL history check.

It also changes the ID matching to only 'DOI' or only 'Pubmed ID' if any of
those is set. This is to minimize scenarios where different articles from
the same journal come up as matching results e.g. same ISSN but different DOI.

It is also updating tests accordingly.

Other QA improvements

Improve HistoryCheck request list:
- Make link external and show icon (to prevent staff member from clicking away from the historyCheck screen unintentionally)
- Show requests' status
- Show requests' placed date
- Add id_prefix to request ID if possible

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:41 +02:00
Pedro Amorim d0348b5319
Bug 38441: Add tests
Test plan:
1) Apply patches
2) Run (ignore if using a sandbox):
  $ reset_all
3) Visit ILL system preferences:
  <staff_url>/cgi-bin/koha/admin/preferences.pl?tab=interlibrary_loans
4) Enable ILLModule and ILLHistoryCheck system preferences

-- STAFF testing --

5) Create a new ILL request, visit:
  <staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=Standard
6) Pick type = 'Journal article', enter '123' for DOI, '42' for cardnumber and any library. Click create.
7) Repeat 5) and 6). Notice you're now on the 'Request history check' screen. Verify your previous ILL request is listed. Click 'Submit anyway'.
8) Repeat 5) and 6). But pick a different patron cardnumber this time e.g. '23529000035676'.
9) Verify you're not shown the 'Request history check' screen as its a different patron.

-- OPAC testing --

10) Place a new request through the OPAC, visit:
  <opac_url>/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
11) Pick type = 'Journal article', enter '123' for DOI. Click 'Create'. Notice it shows the 'history check' screen listing the existing requests. Click 'Submit anyway'.
12) Return to the Staff UI:
  <staff_url>/cgi-bin/koha/ill/ill-requests.pl
13) Click on the latest ILL request. Verify 'History check requests' is displayed and contains information relating to the already existing ILL requests.

-- Bonus testing --
16) Play around with ILLModuleDisclaimerByType and
    ILLOpacUnauthenticatedRequest enabled at the same time as
    HistoryCheck (easy)
17) Play around with ILLCheckAvailability and AutoILLBackendPriority
    enabled at the same time as HistoryCheck
    (reach out for help using these preferences)

Run tests:
$ prove t/db_dependent/Koha/ILL/Request/Workflow/HistoryCheck.t

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:38 +02:00
Nick Clemens b805f5ff99
Bug 39325: (QA follow-up) Adjust some issues
connexion is a product, added to ignore file

tablee -> tables

a few other small corrections

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:30 +02:00
Owen Leonard 5fd9743c8a
Bug 39325: (follow-up) A few minor corrections
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:29 +02:00
Jonathan Druart 69b8341a8c
Bug 39325: Manual fixes
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:23 +02:00
Jonathan Druart 1d844a7d2f
Bug 39325: Automatic fix
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-28 18:51:22 +02:00
Tomas Cohen Arazi 814af57e83
Bug 39600: Rewrite API controllers
This patch splits the controller in two:

* A controller for staff users use
* An unprivileged access controller

A new endpoint is added for publi access:

* `/public/patrons/:patron_id/ill/requests`

The public one makes use of the state-of-the-art in Koha for public
endpoints, using the `$c->auth->public` validation helper and leaving
the (newly added) public path spec with no special permissions
requirements.

The staff-oriented endpoint gets the right permissions added (at least
those used in the main `/ill/requests` endpoint.

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

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 19:23:41 +02:00
Tomas Cohen Arazi 87b0773d5f
Bug 39600: Add Koha::Patron->ill_requests() accessor
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Tadeusz „tadzik” Sośnierz <tadeusz@sosnierz.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 19:23:40 +02:00
Tadeusz „tadzik” Sośnierz a715c695f7
Bug 39600: Cleanup the changes -- tidy, document, add a missing TT filter
Sponsored-by: Wiko <https://www.wiko-berlin.de/>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 19:23:40 +02:00
Tadeusz „tadzik” Sośnierz 88dbb07620
Bug 39600: Add tests for patron_list
Sponsored-by: Wiko <https://www.wiko-berlin.de/>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 19:23:39 +02:00
Tomas Cohen Arazi c3fd9b02fd
Bug 32034: Add more tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 18:35:03 +02:00
Kyle Hall 9806508b24
Bug 32034: Add item transfers to action logs
Having branch transfers in the action logs would help to more fully show the cycle of holds that require transfers.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Restart all the things!
4) Enable the new syspref LogTransfers
5) Create and finish some transfers, note the new logs in the log
   viewer!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 18:35:02 +02:00
Tomas Cohen Arazi b914ace0b7
Bug 39092: Unit tests
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 18:34:50 +02:00
Katrin Fischer 04dafe5e48
Bug 34739: (QA follow-up) Fix number of tests
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 18:34:49 +02:00
Pedro Amorim 7d4be5bc06
Bug 36197: (QA follow-up): Fix PluginRoutes.t
prove t/db_dependent/Koha/REST/Plugin/PluginRoutes.t

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:07 +02:00
Pedro Amorim d3173a8d7b
Bug 36197: Add tests
0) If k-t-d, run updatedatabase (ignore this if testing on a sandbox)
1) Enable ILLModule syspref:
  {staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLModule
2) No need to install a backend as 35570 is in the tree
3) On a different browser session, without being lgoged in, access the create ILL request OPAC page directly:
  {opac_url}/cgi-bin/koha/opac-illrequests.pl?method=create&backend=Standard
4) Notice you're presented with the login page, as expected
5) Enable ILLOpacUnauthenticatedRequest:
  {staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLOpacUnauthenticatedRequest
6) Repeat step 3) Notice you now get the create ILL request form, with some additional inputs at the top specific to an unauthenticated request (first name, last name, e-mail address)
6.5) (optional) Confirm the 'Make an Interlibrary loan request' link exists at the bottom of the search results page, while unauthenticated on OPAC:
  {opac_url}/cgi-bin/koha/opac-search.pl?idx=&q=music&weight_search=1
  This should only show for authenticated OPAC users if ILLOpacUnauthenticatedRequest is off.
7) Test the form, try submitting with some blank fields, change type and library after and before inputing data in the input fields, etc.
8) Submit the form successfully. Notice you're presented with the unauthenticated request submission confirmation screen with a message and request details.
9) Go back to Staff UI, logged in, access ILL requests and confirm the unauthenticated request submitted through the OPAC is there:
  {staff_url}/cgi-bin/koha/ill/ill-requests.pl
10) Test that you can add a patron afterwards, if needed, by clicking 'Edit request' on the toolbar of the manage request page, and entering a patron ID
11) Test that you're able to 'confirm' the request by clicking 'Confirm request', as if it was a regular 'NEW' request.

Additional testing:
 Make sure existing ILL functionality interacts with this new optional workflow behavior.
 For this, we're using ILLModuleDisclaimerByType. ILLCheckAvailability or AutoILLBackendPriority can also be used but require more setup (plugins, credentials, etc)
1) Configure ILLModuleDisclaimerByType, visit
  {staff_url}/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLModuleDisclaimerByType
2) Click the 'edit' link at the bottom of the syspref and copy the example code from the description into the text box. Save.
3) Repeat the original test plan from above, but make sure the request type is not 'article' (as that type is bypassed). Use 'journal', for example. Submit the request making sure you fill in all mandatory fields.
4) Notice you're now presented with the ILL request disclaimer screen, hit Submit. Notice the request is created as before.
5) Return to Staff UI, logged in, confirm this 2nd unauthenticated request has been created and the type disclaimer info is stored and presented when viewing the request.

Run tests (k-t-d only):
  prove t/db_dependent/Koha/ILL/Request/Config.t
  prove t/db_dependent/selenium/opac_ill_requests.t

Sponsored-by: NHS England (National Health Service England)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:47:06 +02:00
Matt Blenkinsop b88857395a
Bug 37930: Extend new AV logic to the Preservation module
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:46:57 +02:00
Raphael Straub caa4e523e2
Bug 37418: (follow-up) Add unit tests for GetBorrowersToExpunge()
Add unit tests for testing the new parameter without_restriction_types
of C4::Members::GetBorrowersToExpunge().

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:46:52 +02:00
Matt Blenkinsop e9ef1a0c85
Bug 39518: Update object methods and unit tests
Test plan:
Test plan:

This test plan involves running a cronjob, not sure how easy this is in the sandboxes

1) In system preferences, click Search and then select the Acquisitions option from the left hand menu
2) Enable MarcOrderingAutomation
3) Paste the following into MarcFieldsToOrder
price: 975$p
quantity: 975$q
budget_code: 975$h
4) Paste the following into MarcItemFieldsToOrder
homebranch: 949$a
holdingbranch: 949$b
itype: 949$y
nonpublic_note: 949$x
public_note: 949$z
loc: 949$c
ccode: 949$8
notforloan: 949$7
uri: 949$u
copyno: 949$t
price: 949$g
replacementprice: 949$v
itemcallnumber: 949$o
quantity: 949$k
budget_code: 949$l
Now save the sysprefs
5) In the administration homepage, under Acquisition parameters there should now be a link called "MARC order accounts"
6) Click on this and click the New account button
7) Choose a vendor and a budget
8) Enter a description and make sure you don't set a value in the 'Basket name field' input
9) Enter the following in download directory - "/var/lib/koha/kohadev/tmp/koha_kohadev_upload"
10) Select any record matching settings you want (not important for the test plan, this uses the same code as the marc file staging that already exists in Koha)
11) Check Yes under Check for embedded item record data
12) Click submit
13) We now need to upload a MARC file into the directory that we put in the account. The easiest way to do this is through the marc staging tool
14) Navigate to Cataloging > Stage MARC records for import
15) Upload the file attached to this bug using the Choose file button
16) Click Upload file.
17) Leave the page without completing the new form that appears, we don't want to stage this file. The file we uploaded is now in the directory ready for the cronjob to process as if it had been transferred via SFTP.
18) In the CLI run, perl misc/cronjobs/marc_ordering_process.pl -v -c
19) The logging should show that the file has been processed for that account
20) Navigate to Acquisitions
21) Search for the Vendor that you put in the MARC ordering account
22) There should now be a basket titled: '{random_hash}_orderstest.marcxml'
23) In the ordering account, set the 'Basket name field' to be 975$a
24) Repeat steps 14 -22, the basket should now be called "This is the basket name" which has been pulled from the file

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:46:50 +02:00
Raphael Straub 936b5650c5
Bug 39405: (follow-up) Add the parameter borrowernumber to the overwrite_calc_fine plugin hook
This patch adds the borrowernumber as a parameter to the overwrite_calc_fine
plugin hook. E.g., the borrower is needed for calculating graduated fines.

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:46:49 +02:00
Tomas Cohen Arazi 9b972d9b3e
Bug 39405: Add more plugin examples to build tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:46:48 +02:00
Raphael Straub fa329e4a09
Bug 39405: Add hook overwrite_calc_fine to override CalcFine in Overdues.pm
This new hook allows to overwrite the koha standard calculation of fines.
This can be useful if your library has a fine policy with graduated fines
per overdue letter.

To test:
1) Apply patch.
2) Run prove -v t/db_dependent/Circulation/CalcFine.t
3) Run prove -v t/db_dependent/Koha/Plugins/Overdues.t
4) Sign off.

Sponsored-by: Karlsruhe Institute of Technology (KIT)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:46:47 +02:00
PerplexedTheta 1fb771c2a1
Bug 33473: Rename UseEmailReceipts to AutomaticEmailReceipts
This bug will rename the UseEmailReceipts to AutomaticEmailReceipts, to
make it clearer the purpose of this syspref. This is because the receipts
dropdown is no longer conditional, and will always show, even if
AutomaticEmailReceipts is switched off.

To test (steps a-e before applying patch):
a)  search sysprefs for 'EmailReceipts'
    1)  note the name is currently 'UseEmailReceipts'
    2)  enable this syspref
b)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
c)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is visible
d)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was automatically sent
e)  apply the patch, upgrade the db schema
f)  search sysprefs for 'EmailReceipts'
    1)  note the name is now 'AutomaticEmailReceipts'
g)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
h)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is no longer visible
i)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was automatically sent again
j)  disable the 'AutomaticEmailReceipts' syspref
k)  go to members/memberentry.pl?op=edit_form&destination=circ&borrowernumber=19
    1)  add a valid email address
k)  go to members/maninvoice.pl?borrowernumber=51
    1)  enter an amount (e.g. 100)
    2)  save & pay, confirm
l)  go to members/boraccount.pl?borrowernumber=51
    1)  note that the receipt dropdown is now visible
m)  go to members/notices.pl?borrowernumber=51
    1)  note that a receipt was NOT automatically sent
n)  go to members/boraccount.pl?borrowernumber=51
    1)  on any account line where a payment is made, click receipts > email
o)  go to members/notices.pl?borrowernumber=51
    1)  confirm a manual notice has been generated
p)  make coffee & have a mini disco

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:46:43 +02:00
Thomas Klausner 6ac7938293
Bug 38694: (follow-up) Rename syspref from ESBoostFieldMatch to ElasticsearchBoostFieldMatch
to keep the syspref names consistent with the existings values. Also "ES" is not as self-documenting as "Elasticsearch".

No code change, so the test plan stays the same.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:46:42 +02:00
Nick Clemens 77e0399811
Bug 38694: Unit tests
Adjust existing and add new

Signed-off-by: Matthias Meusburger <matthias.meusburger@biblibre.com>
Signed-off-by: Thomas Klausner <domm@plix.at>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:46:42 +02:00
Matthias Meusburger 4dd5b2a891
Bug 38142: Choose language to report from authority to bibliographic record.
Currently, when reporting authority field to the bibliographic records,
the merge function uses the first matching authority field.

However, authorities can provide multiple versions of the same field, with
different languages, identified by a code in the $7 field.

French reference for languages codes for example, but any code system could be
used:
https://documentation.abes.fr/sudoc/formats/unmb/DonneesCodees/CodesZone104.htm#$d

This patch introduces the LanguageToReportOnMerge system preference, which
allows to specify a language code.

When set, if there is an authority field with the given language code, it will
be used to report to the bibliographic record.

If the system preference is not set, or there is no matching field, the default
behavior will apply: the first field will be used.

The $7 in the authority field can be in a short or long form:

 - the short form is 2 characters long. Example: ba
 - the long form is 8 characters long, with the short form in position 5 and 6
   (starting from 1). Example: ba0yba0y

Test plan:
----------

1) Edit the 'Personal Name' authority type framework to make the 100 field
repeatable

2) Add an authority with several languages, like this (the order is important):

100    _7ba0yda0y
       _a伊東豊雄
100    _7ba0yba0y
       _aItō

3) Add a bibliographic record linked to that authority.
(Click on the "tag editor" icon next to the 100$a field in the bibliographic record to
 search for the authority, then Search main heading ($a only): contains Itō)

Note that you can choose which version you want when searching for the
authority, under the "Get it!" column

For this example, choose the latin version: Itō

You should now have this in your bibliographic record:
100    _aItō
       _92646

4) Edit the authority, you don't have to change anything, just edit and save.
Note that your bibliographic record now looks like this:

100    _7ba0yda0y
       _a伊東豊雄
       _92646

The first 100 field of the authority has been reported back to the bibliographic
record, regardless of what you chose when selecting the authority.

5) Apply the patch, set the LanguageToReportOnMerge system preference to: 'ba'

6) Edit the authority again, and check that your bibliographic record now looks
like this, according to the system preference:

100    _7ba0yba0y
       _aItō
       _92646

7) Edit the authority again, but set the $7 of the latin field to its short
form:

100    _7ba0yda0y
       _a伊東豊雄
100    _7ba
       _aItō

8) Check that the bibliographic record still has the latin field reported:

100    _7ba
       _aItō
       _92646

9) prove koha/t/db_dependent/Authority/Merge.t

10) Sign-off :)

Sponsored-by: ENSA

Works smoothly, both with UNIMARC/MARC21
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-25 08:46:38 +02:00
Pedro Amorim 54205bd6ba
Bug 39652: Rename new_from_statistic
This new method name better reflects the fact that it now creates - and stores - the PseudonymizedTransaction object

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>
2025-04-24 19:53:17 +02:00
Pedro Amorim f23632a352
Bug 39652: store PseudonymizedTransaction before adding related entries
Test plan:
Run the tests before and after applying this patch:
perl t/db_dependent/Koha/Pseudonymization.t

They should fail before this patch and pass after applying patch.

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>
2025-04-24 19:53:16 +02:00
Pedro Amorim bdb428978f
Bug 39652: Add tests
These tests prove the bug:
perl t/db_dependent/Koha/Pseudonymization.t

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>
2025-04-24 19:53:16 +02:00