Commit Graph

6600 Commits

Author SHA1 Message Date
Jake Deery 2688dfd668
Bug 35761: Database updates
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-19 13:23:03 -06:00
Lucas Gass d7c21c722e
Bug 39526: DBRev 25.06.00.017
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-19 08:42:53 -06:00
Jonathan Druart 8dbf22f996
Bug 39526: Prevent other prefs to be renamed
There is only one pref. It feel safer to rename this specific pref than
other pref that might not be ES related.

Other prefs starting with "ES" could be added, then this patch
backported, etc.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-19 08:42:52 -06:00
Thomas Klausner c4a6c7584d
Bug 39526: Unify syspref variable names to Elasticsearch
We currently have a sysprefs named "Elasticsearch*" and some name only "ES*". This patch unifies the names to always start with "Elasticsearch".

Test plan:

* Start koha-testing-docker, open the staff interface and go to Administration.
* Enter "Elasticsearch" into the System Preference search box and click "search"
* You will find a bunch of sysprefs
* Now search for "ESPreventAutoTruncate", which should find one match

* Apply the patch
* run (in ktd) the script `updatedatabase`

* You should see output like
DEV atomic update /kohadevbox/koha/installer/data/mysql/atomicupdate/bug_39526_unify_syspref_variable_names_for_elasticsearch.pl  [09:35:03]: Bug 39526 - Unify system preference variable names for Elasticsearch
	Renamed system preference 'ES..' to 'Elasticsearch..'

* Go again to to sysprefs and search again for "Elasticsearch"
* you should now find "ElasticsearchPreventAutoTruncate"
* Search for "ESPreventAutoTruncate", which should show "No system preferences matched your search for .." (and the list of ALL sysprefs)

Please note that the qa script explains about installer/data/mysql/mandatory/sysprefs.sql, but the last line is not touched by this patch, so not sure why this happens.

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-19 08:42:52 -06:00
Lucas Gass 95863d9de5
Bug 31698: DBRev 25.06.00.016
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-05 15:10:46 -06:00
Lucas Gass ceb5ec8b15
Bug 31698: Add alter_hold_targets permission
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-05 15:10:38 -06:00
Lucas Gass 2e84dfa24f
Bug 40665: DBRev 25.06.00.015
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-05 15:10:37 -06:00
Paul Derscheid 1460ddc222
Bug 40665: Database update
This patch updates the database schema to add booking_id foreign key
columns to both issues and old_issues tables, enabling the linkage
between checkouts and the bookings that generated them.

Schema changes:
- Add booking_id column to issues and old_issues tables
- Add foreign key constraints referencing bookings table
- Preserve referential integrity with appropriate CASCADE actions

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-05 15:10:35 -06:00
Lucas Gass 3a12111b40
Bug 37661: DBRev 25.06.00.014
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-05 15:10:32 -06:00
Baptiste 46c818be4e
Bug 37661: Add a new syspref EnableBooking
This patch makes the Booking module dependant of a new YesNo syspref: EnableBooking

To do this, I tried and get all changes using the graph of Bug 29002 and
got interrested in every tt change to make changes on this depend on the
new syspref. File inside the booking module should not be amended.

Here are the files I found relevant for each patch
Bug 37737:
- koha-tmpl/intranet-tmpl/prog/en/includes/patron-detail-tabs.inc
- koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
Bug 37736:
- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt
Bug 29002:
- koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/ISBDdetail.tt
- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt
- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/imageviewer.tt
- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/labeledMARCdetail.tt
- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt

TEST PLAN:
1 -  Set "Bookable = 1" on a given item
2 - Make sure you know where are located
    - The field bookable on exemplaries
    - The button "Place booking" in item toolbae
    - The link "Bookings (0)" in item menu
3 - Apply patch and update database
4 - Check that every field listed in 2 - is still present
5 - Set the syspref "EnableBooking" to "Disable"
6 - Check that every field listed in 2 - is still present
7 - Browse Norme, ISBD, Marc, Items tabs + pages imageviewer.pl, labeledMARCdetail.pl and check that nothing is broken

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-05 15:10:32 -06:00
Lucas Gass db4c21022b
Bug 36135: DBRev 25.06.00.013
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 14:00:53 -06:00
Lucas Gass 54638fba03
Bug 36135: Add batch_modify_holds permissions
Sponsored-by: Koha-Suomi Oy
Signed-off-by: Jason Robb <jrobb@sekls.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 14:00:47 -06:00
Lucas Gass 3597befb4c
Bug 15516: DBRev 25.06.00.012
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:42:06 -06:00
Lucas Gass f7a9683458
Bug 15516: Add new system preference to atomicupdate
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:42:05 -06:00
David Cook 8e11019993
Bug 15516: (follow-up) explicitly define indexes for foreign keys
This patch explicitly defines indexes for foreign keys.

This isn't really needed for the atomic update, but we've included
it for consistency.

It is needed in kohastructure.sql, because MySQL/MariaDB silently/implicitly
adds these indexes for foreign keys, which means that the database
audit tool will show a discrepancy between kohastructure.sql and
the installed DB schema.

Also fix a discrepancy between atomic update and kohastructure.sql

Test plan:
0. Apply the patch
1. Use both methods to update the DB schema
2. Go to http://localhost:8081/cgi-bin/koha/about.pl?tab=database
3. Note that about.pl isn't telling you to drop the indexes
for reserves_ibfk_hg and old_reserves_ibfk_hg now

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:42:04 -06:00
David Cook 71c4086435
Bug 15516: (follow-up) Have DisplayAddHoldGroups disabled by default
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:42:02 -06:00
David Cook c1e7da6eed
Bug 15516: (follow-up) Tweaks to new feature
Bug 15516: Add ability to create and view hold groups from OPAC

This patch adds a "Treat as hold group" to opac-reserve.pl,
which lets OPAC users create a hold group which can include
1+ bibs and either bib-level holds, or item-level holds, or both.

This patch shows the item-level and bib-level holds in a hold group
for the user's holds in the OPAC. This includes both the opac-user.pl
page and the self-checkout hold display.

Bug 15516: (follow-up) Only show hold groups for multi hold in OPAC
Bug 15516: (follow-up) Only show hold groups for multi hold in staff interface
Bug 15516: Add 'DisplayAddHoldGroups' system preference to toggle ability to add titles to hold groups

These patches add the ability to create hold groups across multiple bibs in the staff interface or OPAC.
These hold groups are fulfilled by the first item checked in across the hold group.

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:42:01 -06:00
Aleisha Amohia 8ce7541997
Bug 15516: Database and installer updates
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:41:59 -06:00
Nick Clemens c1f4e2712b
Bug 38906: Use SUBSTRING and LOCATE over REGEXP_REPLACE
To test:
1 - Check out an old version of Koha and set some columns settings for holdings tables, or:
    UPDATE columns_settings
    SET columnname = CONCAT("holdings_",columnname)
    WHERE module = 'catalogue' AND page='detail' AND tablename = "holdings_table";
    UPDATE columns_settings
    SET columnname = CONCAT("otherholdings_",columnname)
    WHERE module = 'catalogue' AND page = 'detail' AND tablename = "otherholdings_table";
2 - perl -e 'use C4::Installer; my $result = C4::Installer::run_db_rev("/kohadevbox/koha/installer/data/mysql/db_revs/240600064.pl"); warn Data::Dumper::Dumper($result)'
3 - SELECT columnname FROM columns_settings WHERE module="catalogue" AND page="detail" AND ( tablename="holdings_table" OR tablename="otherholdings_table");
4 - Confirm column names are correct
5 - repeat 2
6 - Confirm column names are not affected on subsequent runs (items_group does not become group)

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-03 11:41:58 -06:00
Lucas Gass 69001a7a56
Bug 20644: Fix order of insert into the itemtypes table
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-29 13:46:55 -06:00
Caroline Cyr La Rose 17acb0c157
Bug 40071: MARC21 Addition to relator terms in technical notice 2025-06-04
This patch adds a relator term that was added to the MARC code list for
relators in the June 4, 2025 technical notice. The new term is waw -
Writer of afterword.

To test:
1. Apply patch and reset_all
2. Go to Administration > Authorized values
3. Search for the RELTERMS list and click on it
4. Search for waw
   --> There should be an entry for waw - Writer of afterword

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-29 10:43:38 -06:00
Caroline Cyr La Rose 38a5b8190d
Bug 40072: MARC21 Addition to relator terms in technical notice 2025-04-03
This patch adds a relator term that was added to the MARC code list for
relators in the April 3, 2025 technical notice. The new term is wfw -
Writer of foreword. This technical notice also deprecates an existing
term, aui (author of introduction), in favour of the new term.

To test:
1. Apply patch and reset_all
2. Go to Administration > Authorized values
3. Search for the RELTERMS list and click on it
4. Search for wfw
   --> There should be an entry for wfw - Writer of foreword
5. Search for aui
   --> Term should not exist

Note : This update includes a term deprecation. I decided to go ahead
and remove it from the authorized values list because, unlike for MARC
frameworks, a nonexistent value will not delete data from the records.
It will simply say "aui (Not an authorized value)". Furthermore, this
only affects new installations. Nothing will be deleted from existing
installations, unless the libraries themselves remove the authorized
value. They can make a batch modification before deleting it if
necessary.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-29 10:43:37 -06:00
Caroline Cyr La Rose add898d8a9
Bug 40073: MARC21 Addition to relator terms in technical notice 2025-02-06
This patch adds new relator terms that were added to the MARC code list
for relators in the Februrary 2, 2025 technical notice. The new terms
are ink - Inker, and pnc - Penciller.

To test:
1. Apply patch and reset_all
2. Go to Administration > Authorized values
3. Search for the RELTERMS list and click on it
4. Search for ink
   --> There should be an entry for ink - Inker
5. Search for pnc
   --> There should be an entry for pnc - Penciller

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-29 10:43:36 -06:00
Lucas Gass 4066d2a4fc
Bug 40725: Add TableExists check to db_revs/231200053.pl
This patch makes the DB revision idempotent.

To test:
1. Fix the Koha version right before the broken upgrade:
   $ ktd --shell
  k$ koha-mysql kohadev
   > UPDATE systempreferences SET value="23.1200052" WHERE
variable="version"; \q
2. Restart everything (memcached should be enough)
  k$ restart_all
3. Run:
  k$ updatedatabase
=> FAIL: You get:

```shell
Upgrade to 23.12.00.053  [19:34:35]: Bug 36755 - Increase length of 'code' column in borrower_attribute_types
	ERROR: C4::Installer::foreign_key_exists(): DBI Exception: DBD::mysql::db selectrow_array failed: Table 'koha_kohadev.pseudonymized_borrower_attributes' doesn't exist at /kohadevbox/koha/installer/data/mysql/db_revs/231200053.pl line 11
```

4. Apply this patch
5. Repeat 3
=> SUCCESS: Update runs smoothly!
6. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-28 13:54:34 -06:00
Lucas Gass fe55aa02ef
Bug 20644: (follow-up) Fix atomicupdate
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-22 07:44:58 -06:00
Lucas Gass 0b4b59680b
Bug 37901: DBRev 25.06.00.011
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:26 -06:00
Pedro Amorim de25abcb4d
Bug 37901: Add updatedatabase information
This warning will display if there are existing reports that contain 'pseudonymized_borrower_attributes', informing that these reports need to be updated

Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:25 -06:00
Pedro Amorim 1b505dfa34
Bug 37901: atomicupdate: Add 'illrequest_id' column to statistics
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:22 -06:00
Pedro Amorim c59514c02e
Bug 37901: Add 'illrequest_id' column to statistics
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:21 -06:00
Pedro Amorim ab1d428927
Bug 37901: Preparation: atomic update
Rename the table pseudonymized_borrower_attributes to pseudonymized_metadata_values
This is so that pseudonymizing other 'extended_attributes' type of data,
such as illrequestsattributes, becomes possible.

Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:18 -06:00
Pedro Amorim 8948896344
Bug 37901: Preparation: db changes
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:18 -06:00
Lucas Gass d425202684
Bug 20644: DBRev 25.06.00.010
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:07 -06:00
Shi Yao Wang 9b70f6db00
Bug 20644: Change checkprevcheckout as ENUM at DB level
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:06 -06:00
Lisette Scheer 8819f2d41c
Bug 20644: (QA follow-up) Remove duplicate variable
I removed a duplicate variable and tidied.

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:43:06 -06:00
Hammat Wele 99322896b9
Bug 20644: Add checkprevcheckout on item types
I have added the "Check for previous checkouts" option to item types. This option is visible only when the system preference "CheckPrevCheckout" is set to either :
- "Unless overridden by patron category or by item type, do"
or
- "Unless overridden by patron category or by item type, do not."

This option takes precedence over patron and patron category preferences.

TEST PLAN
1) Apply the patch.
2) Perform an atomic update (installer/data/mysql/updatedatabase.pl)
3) Set the "CheckPrevCheckout" system preference to "Unless overridden by patron category or by item type, do".
4) Go to "Koha administration > Item types > + New item type".
5) Fill in the necessary fields; the "Check for previous checkouts" field should be set to "Inherit from system preferences".
6) Click the "Save changes" button.
7) Create an item with the type you have created.
8) Check out this item for a patron, then check it in.
9) Check out the same item for the same patron again.
10) The message "Patron has previously checked out this title: <Title>. Check out anyway?" should appear.
11) Go to "Koha administration > Item types".
12) Edit the created item type.
13) Change the value of the "Check for previous checkouts" field to "No and try to override system preferences".
14) Click the "Save changes" button.
15) Check out the same item for the same patron.
16) The message should not appear.
17) Run the tests "Borrower_PrevCheckout.t" (prove t/db_dependent/Patron/Borrower_PrevCheckout.t) and "ItemTypes.t" (prove t/db_dependent/Koha/ItemTypes.t).
18) Verify that all tests pass successfully.

Signed-off-by: Laurence <laurence.rault@biblibre.com>
Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-20 13:42:58 -06:00
Emily Lamancusa dcdb8b058c
Bug 36114: Adjust TRANSFERSLIP to use Template Toolkit
To test:
1. Apply patch
2. reset_all (or start your testing environment in the first place)
3. Find or create an item that belongs to a library other than the logged-in library
4. Make sure the item has a callnumber (edit it to add one if needed)
4. Check the item in to generate a transfer slip
--> Confirm the information is all filled in correctly on the slip

Signed-off-by: Marion Durand <marion.durand@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-14 16:05:48 -06:00
Lucas Gass 462d811d4e
Bug 35467: DBRev 25.06.00.009
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-13 13:39:40 -06:00
Andrew Fuerste Henry 665753634b
Bug 35467: atomicupdate to rename NewsLog to AdditionalContentLog
Now executable!

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-13 13:39:39 -06:00
Andrew Fuerste Henry 420add2908
Bug 35467: atomicupdate to change NewsLog to AdditionalContentLog
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-13 13:39:38 -06:00
Andrew Fuerste Henry 9805b4cb3e
Bug 35467: Rename NewsLog system preference to AdditionalContent
To test:
1 - confirm whether or not NewsLog is enabled on your system
2 - apply patch, updatedatabase, restart_all
3 - search system preferences, confirm you now have
    AdditionalContentLog rather than NewsLog and that the new
    description is accurate
4 - confitm AdditionalContentLog shows the value you previously had for
    NewsLog
5 - go to Tools > Log Viewer
6 - confirm the checkbox here is labeled "Additional Content", that it
    correctly reflects the syspref value, and that it links to the
    syspref
7 - with AdditionalContentLog enabled, created/edit/delete news, HTML
    customizations, and pages. confirm they log
8 - with AdditionalContentLog disabled, created/edit/delete news, HTML
    customizations, and pages. confirm they don't log

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-13 13:39:29 -06:00
Jonathan Druart 3ea3c2a27a
Bug 40337: Remove test of datatype
Keep the UPDATE to adjust bad data however.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-01 14:57:00 -06:00
Martin Renvoize 827b3b41a8
Bug 40337: (QA follow-up) Make database update idempotent
Running this update twice fails before this patch with:

ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Data truncated for column 'checkprevcheckout' at row 3 at /kohadevbox/koha/C4/Installer.pm line 825

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-01 14:56:53 -06:00
Emily Lamancusa f869d42807
Bug 36127: Adjust default HOLDPLACED and HOLD_CHANGED notices to use TT
To test:
1. Apply patch
2. reset_all (or start your testing environment in the first place)
3. Edit system preferences:
     emailLibrarianWhenHoldIsPlaced - Enable
     ReplyToDefault - enter a fake/test email address
     ExpireReservesMaxPickupDelay - Allow
     ExpireReservesAutoFill - Do
     ExpireReservesAutoFillEmail - same email address as ReplyToDefault
4. Place two holds on the same bib for two different patrons, Patron A
   and Patron B
5. Edit an item on that bib to set a call number (if it doesn't have one
   already)
6. Check in that item to set Patron A's hold to waiting
7. Edit the expiration date on Patron A's hold to yesterday's date
   To do this in KTD:
     ktd --shell
     koha-mysql kohadev
     UPDATE reserves SET expirationdate = <yesterday's date>
     WHERE borrowernumber = <Patron A's borrowernumber>;
8. Run misc/cronjobs/holds/cancel_expired_holds.pl to automatically
   cancel the expired hold and fill the next one
9. Open koha-mysql again and run the following query to view the
   generated notices:
   SELECT subject, content FROM message_queue
   WHERE to_address = '<the email address you set in step 3>';
--> Confirm that HOLDPLACED and HOLD_CHANGED notices were both generated
--> Confirm that all information has been filled in correctly for those
    notices

Signed-off-by: Marion Durand <marion.durand@biblibre.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-01 13:22:54 -06:00
Jonathan Druart e9eb20249e
Bug 40541: Add missing new line at the end of files when missing
We have insert_final_newline = true to ensure files will contain a new
line at the end. However we have seen commits with "No new line" added
in the git log.

We should have a xt test to prevent more occurrences.

We should also have a test at the QA script level:
https://gitlab.com/koha-community/qa-test-tools/-/issues/96

Test plan:
  prove xt/find-missing-new-lines-at-the-end-of-file.t
should return green.

Remove the new line at the end of a file, eg.
vim -b mainpage.pl
:set noeol
:wq

Now
  prove xt/find-missing-new-lines-at-the-end-of-file.t
is failing on mainpage.pl.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-31 12:42:09 -06:00
Jonathan Druart ffd7a4ec10
Bug 40548: (bug 40337 follow-up): Fix DB comparison
00:40:25 koha-1       | <   `checkprevcheckout` enum('yes', 'no', 'inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.',
00:40:25 koha-1       | ---
00:40:25 koha-1       | >   `checkprevcheckout` enum('yes','no','inherit') NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to category setting if ''inherit''.',
00:40:25 koha-1       | ERROR - DB structures are not identical
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-07-30 09:51:25 +02:00
Caroline Cyr La Rose 3e95c21d85
Bug 40414: Update patron card layout with expiry date
This patch updates the default patron card layout to replace "Expires:
August 31, 2010" with the patron's account expiry date.

To test:
1. Apply patch and reset_all
2. Go to Tools > Patron card creator
3. Click New > Card batch
4. In Add by borrowernumber(s), enter borrowernumbers 1 to 6, one per line
5. Click Add patron(s)
6. Click Export card batch
7. Click Export
8. Open the PDF
   --> Note that the patron's account expiry date is printed on the card

Optional : Change the expiry date of one or more patrons and redo steps 6-8.
--> The updated expiry dates should be printed on the cards.

Signed-off-by: Eric Garcia <cubingguy714@gmail.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-28 16:26:45 -06:00
Courtney Brown 4bd1bc0a6f
Bug 39279: Update the wording for the overdue notice - branch to library
This patch updates the terminology used in the overdue notice (ODUE)
to change 'branch' to 'library'.

Test plan:
1. Check the wording of the ODUE notice under Tools > Patrons and
   circulation > Notices and slips.
2. Note that it includes this wording that uses 'branch':
   "Please return or renew them at the branch below as soon as possible."
3. Apply the patch.
4. Check that the updated ODUE notice has changed 'branch' to 'library'
   by either:
   4.1 Resetting everything: reset_all
   4.2 Viewing the default notice - click "View default" when viewing
       the email notice
   The updated text is now: "Please return or renew your overdue items
   at the library as soon as possible."
5. Sign off.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-28 16:26:40 -06:00
Lucas Gass 3216152520
Bug 40305: DBRev 25.06.00.008
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-25 15:52:19 -06:00
Martin Renvoize 4b300b1c1d
Bug 40305: Add database update to fix existing notice templates
This database update fixes existing RECEIPT and ACCOUNT_CREDIT notice
templates that may still use the old 'collected' variable instead of
'tendered'. It handles various formatting patterns and provides
verification that the conversion was successful.

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-25 14:27:17 -06:00
Martin Renvoize f91310306c
Bug 40305: Fix 'tendered' vs 'collected' variable name inconsistency
"One Ring to rule them all, one Ring to find them, One Ring to bring
them all and in the darkness bind them"

We've been battling against this for years, with a mixed use of
terminology and thus confusion in templates vs controllers and notice
templates.  I've decided to just try and make sure all the terminology
matches throughout, and use the more popular 'tendered' term over the
'collected' term.

This patch standardizes the terminology used throughout the payment
  system to consistently use 'tendered' instead of the mixed usage of
  'collected' and 'tendered' that has caused confusion over the years.

Changes include:
  - Update all payment form templates to use 'tendered' input names
  - Update JavaScript validation and change calculation logic
  - Update controller parameter handling in pos/pay.pl, pos/printreceipt.pl,
    and members/paycollect.pl
  - Update sample notice templates (RECEIPT) to use 'tendered' variable
  - Add null check for $total_tendered to prevent perl warnings

Test plan:
  1. Test Point of Sale payments with tendered amounts and change calculation
  2. Test member account payments with tendered amounts
  3. Test receipt generation (both print and email)
  4. Verify JavaScript validation works correctly
  5. Confirm no perl warnings when tendered amount is undefined

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

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-25 14:27:16 -06:00