Bug 39438

Summary: Add additional fields to agreements periods
Product: Koha Reporter: Mathieu Saby <mathsabypro>
Component: ERMAssignee: Matt Blenkinsop <matt.blenkinsop>
Status: Passed QA --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: andrew.auld, jonathan.druart, jonathan.field, martin.renvoize, matt.blenkinsop, michaela.sieber, pedro.amorim
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 40192    
Bug Blocks:    
Attachments: Bug 39438: Add additional fields to agreement periods
Bug 39438: Add additional fields support to ERM agreement periods
Bug 39438: Add DBIC schema relationships for agreement period additional fields
Bug 39438: Add additional fields support to ERM agreement periods
Bug 39438: Add DBIC schema relationships for agreement period additional fields
Bug 39438: (bug 38446 follow-up) Add agreement_period to /erm/extended_attribute_types

Description Mathieu Saby 2025-03-24 17:45:51 UTC
It could be discussed... But it would probably be useful to give this possiblity to libraries
Comment 1 Matt Blenkinsop 2025-10-23 08:15:01 UTC
Created attachment 188307 [details] [review]
Bug 39438: Add additional fields to agreement periods
Comment 2 Martin Renvoize (ashimema) 2025-10-31 09:20:10 UTC
Created attachment 188778 [details] [review]
Bug 39438: Add additional fields support to ERM agreement periods

This patch enables additional fields functionality for agreement periods
in the ERM (Electronic Resource Management) module, allowing libraries
to define custom metadata fields for agreement period records.

Changes include:
- Update Koha::AdditionalField to support erm_agreement_periods table
- Modify API definitions to include extended_attributes in responses
- Add erm_agreement_periods option to additional fields admin interface
- Enhance Vue components to display and manage additional field values
- Update ShowElement component to handle period-specific attributes

Test plan:
1. Navigate to Administration > Additional fields
2. Create new fields for "Agreement periods"
3. Edit an ERM agreement and add/edit period information
4. Verify additional fields appear and can be populated
5. Confirm values are saved and displayed correctly

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 3 Martin Renvoize (ashimema) 2025-10-31 09:20:12 UTC
Created attachment 188779 [details] [review]
Bug 39438: Add DBIC schema relationships for agreement period additional fields

This patch adds the required DBIx::Class relationship definitions to
Koha::Schema::Result::ErmAgreementPeriod to support additional fields
and extended attributes on agreement periods.

Two has_many relationships are added:
- additional_field_values: links to all additional field values
- extended_attributes: alias for additional_field_values

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 4 Martin Renvoize (ashimema) 2025-10-31 09:20:54 UTC
Takes the same well-trodden road as the rest of these, works as expected.. Passing QA
Comment 5 Jonathan Druart 2025-11-04 15:21:44 UTC
Created attachment 189021 [details] [review]
Bug 39438: Add additional fields support to ERM agreement periods

This patch enables additional fields functionality for agreement periods
in the ERM (Electronic Resource Management) module, allowing libraries
to define custom metadata fields for agreement period records.

Changes include:
- Update Koha::AdditionalField to support erm_agreement_periods table
- Modify API definitions to include extended_attributes in responses
- Add erm_agreement_periods option to additional fields admin interface
- Enhance Vue components to display and manage additional field values
- Update ShowElement component to handle period-specific attributes

Test plan:
1. Navigate to Administration > Additional fields
2. Create new fields for "Agreement periods"
3. Edit an ERM agreement and add/edit period information
4. Verify additional fields appear and can be populated
5. Confirm values are saved and displayed correctly

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 6 Jonathan Druart 2025-11-04 15:21:46 UTC
Created attachment 189022 [details] [review]
Bug 39438: Add DBIC schema relationships for agreement period additional fields

This patch adds the required DBIx::Class relationship definitions to
Koha::Schema::Result::ErmAgreementPeriod to support additional fields
and extended attributes on agreement periods.

Two has_many relationships are added:
- additional_field_values: links to all additional field values
- extended_attributes: alias for additional_field_values

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 7 Jonathan Druart 2025-11-04 15:21:49 UTC
Created attachment 189023 [details] [review]
Bug 39438: (bug 38446 follow-up) Add agreement_period to /erm/extended_attribute_types

Sponsored-by: Karlsruhe Institute of Technology (KIT)