- The staff member who creates a new ILL request is automatically assigned as its manager.
- No manager is assigned to ILL requests made by users without 'ill' permission e.g. patrons using the OPAC.
- When an ILL request without a manager has its status changed, the staff member making the change is automatically assigned as its manager e.g. by clicking 'confirm' or 'revert request'.
- It is possible to manually update a request's manager by clicking the 'Edit request' toolbar button when viewing a request. The patron search modal, 'select manager' button and all its functionality is shared with the 'select manager' present in the suggestions module. This means that when editing an ILL request, the 'managedby' defaults to the staff member editing the request, unless 'Keep existing manager' is clicked, like it happens in suggestions.
- This is fully core built, all backends will automatically hook into this functionality, because:
-- Automatic 'managedby' happen on status change, regardless of backend
-- All requests have access to 'edit request' page, regardless of backend
- Only if a logged in staff member exists does the auto set manager. If no staff member is found, nothing happens e.g. an ILL request status
was changed by a CLI command / cronjob
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This turns the 'Select manager' and 'Restore manager' actions to proper buttons, well aligned in where they are displayed. The 'Select manager' functionality in the suggestions table page is also updated to make use of the same reusable button block
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This also includes a 'manager' accessor which returns the Koha::Patron
object
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Required to get users filtered by 'ill' permission for patron search modal
prove t/db_dependent/api/v1/ill_users.t
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This is required, or clicking 'Clear' on the ILL patron search modal will trigger this event listener and cause a JS error, as the 'regular' ILL table is not shown/initialized when editing an ILL request
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This is required for ILL 'select manager' functionality, as table_settings are already defined there and the user modal table will pick that up unless explicitly stated to not use it, thus empty_table_settings
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Move 'managed by' and 'restore previous manager' form and show
functionality to reusable .inc files
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
- Move TT interface/theme variables into a separate <script> tag to avoid
mixing template variables with external JavaScript file scope
- Replace local escapeHtml() functions in edifact_interchange.js and
edifact_errors.js with String.prototype.escapeHtml already defined
in staff-global.js
Sponsored-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Remove before()/after() DB hooks — all assertions already use cy.intercept
mocks so no real database messages are needed. Extract repeated button
injection into an openEDIModal() helper. Replace all cy.wait(N) fixed-time
waits with assertion-based waits and cy.wait('@alias') for network sync.
Fix a Bootstrap 5 race condition in the modal-close cleanup test where
hidden.bs.modal fired after the backdrop animation, causing the re-opened
modal's focus class to be removed mid-test.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch adds end-to-end testing for the EDIFACT modal interface,
providing coverage of all user interactions and functionality.
**Test Coverage:**
- Modal display and initialization with proper Bootstrap navbar structure
- View toggle functionality between tree and raw display modes
- Search functionality including navigation, result counting, and highlighting
- Focus functionality for basket and invoice contexts
- Error handling for invalid message IDs and network failures
- Accessibility features including keyboard navigation
- Responsive behavior and modal interaction patterns
**Test Plan:**
1. Apply patch
2. Ensure KTD environment is running with test data
3. Run tests: `npx cypress run --spec "t/cypress/integration/Acquisitions/Edifact*"`
4. **Verify Test Results:**
5. **Manual Verification:**
- All test scenarios reflect real user workflows
- Test data requirements are clearly documented in spec file
- Test data is cleaned up after the tests are run
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch completely rebuilds the EDIFACT message modal interface, featuring:
**Core Features:**
- Modern Bootstrap 5 navbar with integrated search functionality
- Tree view and raw view display modes for message structure
- Real-time search with regex support and result navigation
- Smart focus functionality that highlights relevant segments based on
context (basket, invoice)
**User Interface:**
- Bootstrap navbar between modal header and body
- Search form with previous/next navigation and live result counts
- Clean separation between always-visible controls and view-specific toolbars
- Accessibility conscious with proper ARIA labels and semantic markup
- Streamlined DOM structure with direct modal-body scrolling
**Test Plan:**
1. Apply patch and run: yarn css:build to compile SCSS
2. Navigate to Acquisitions > EDIFACT messages
3. Click "View message" on any EDIFACT message
4. **Modal Display Testing:**
- Verify modal opens with Bootstrap navbar between header and body
- Confirm tree view is active by default with segment structure visible
- Click raw view button to verify plain text display
- Test modal responsiveness by resizing window
5. **Search Functionality Testing:**
- Enter "UNH" in search field, verify navbar shows result count
- Use previous/next buttons to navigate between results
- Test search with terms like "ORDER", "NAD", "LIN" - all results should be found
- Verify native browser clear button appears and works
- Test case-insensitive search behavior
6. **Focus Functionality Testing:**
- From basket page, click enhanced view link - should highlight relevant segments
- From invoice page, click enhanced view - should focus on invoice-related segments
- Verify focus highlighting persists during search operations
7. **Error Handling Testing:**
- Test with invalid message ID, verify error display
- Test network errors, confirm loading states work properly
8. **Accessibility Testing:**
- Verify keyboard navigation works with search controls
- Test screen reader compatibility with ARIA labels
- Confirm modal can be closed with Escape key
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch implements a JSON representation of EDIFACT interchanges for enhanced
programmatic access and debugging capabilities.
Backend Changes:
- Add to_json() method to Koha::Edifact module
- Structured JSON output with header, messages array, and trailer
- Segment parsing with raw data, elements arrays, and line_id tracking
- Line item grouping using LIN segment identifiers
Frontend Changes:
- Add JSON download button to edimsg.pl page
- Support for ?format=json parameter and Accept: application/json header
- Proper HTTP content-type handling for JSON responses
- Error handling for missing messages in JSON format
JSON Structure:
{
"header": "UNB+UNOC:3+...",
"messages": [
{
"header": "UNH+1+QUOTES:D:93A:UN:EAN008'",
"segments": [
{
"tag": "LIN",
"raw": "LIN+1+1+9780552150040:EN'",
"elements": ["1", "1", "9780552150040:EN"],
"line_id": "1"
}
],
"trailer": "UNT+25+1'"
}
],
"trailer": "UNZ+1+1'"
}
Test plan:
1. Apply this patch
2. Ensure you have EDIFACT messages in your system
3. Go to Acquisitions > EDIFACT messages
4. Click "View message" for any message
5. Click the new "JSON" button
6. Verify JSON downloads with proper structure
7. Verify direct URL access with ?format=json parameter works
8. Test with Accept: application/json header
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch adds unit tests for the new to_json method being introduced
in Koha::Edifact module in the next patch.
The tests verify:
- JSON output generation and validity
- Proper structure with header, messages, and trailer fields
- Message array structure with correct number of messages
- Individual message structure (header, segments, trailer)
- Segment data integrity including raw data and elements arrays
- Line ID functionality for related segments (LIN, QTY, PRI, PIA)
Test plan:
1. Apply this patch and the next one
2. Run: prove t/Edifact.t
3. Verify all 63 tests pass
4. Confirm the new JSON-related tests (22 tests) execute successfully
Sponsored-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Hannah Dunne-Howrie <hdunne-howrie@westminster.gov.uk>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch clarifies which records will be deleted in
the batch item deletion (when no items remain).
Test plan:
0. Apply the patch
1. Go to "Reports" and click "Create from SQL"
2. Create a report with the following SQL:
select itemnumber from items limit 5
3. Run the report and then click "Batch operations with 5 visible records"
on the output page
4. Near the bottom of the screen note that there is a checkbox that
has a label reading "Delete bibliographic records if no items remain."
5. C'est tout!
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Test plan
=========
1. Make field 026 active for Editor in MARC framework section (e.g. in default
framework).
2. Edit any bibliographic record (with modified framework) adding 026 field data,
e.g. 026 ## $a urdu esrt $b eses jecl $c 1790
3. Verify in Normal view (intranet) and in OPAC that you are unable to
see the inserted data.
4. Apply the patch ; restart_all.
5. Verify in Normal view (intranet) and in OPAC that you are now able to
see the fingerprint information from 026 field.
Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Libraries cataloguing older monographic resources request fingerprint indexing.
In MARC 21, it would be the content of field 026, in UNIMARC - 012.
Test plan
=========
1. Start up KTD with Elasticsearch: ktd --search-engine es8 up -d
2. Make field 026 active for Editor in MARC framework section (e.g. in default
framework).
3. Edit any bibliographic record (with modified framework) adding 026 field data,
e.g. 026 ## $a urdu esrt $b eses jecl $c 1790
4. Verify that you are unable to find the record searching with fingerprint data.
5. Apply the patch ; restart_all.
6. Reindex with: koha-elasticsearch --rebuild -r -d kohadev
7. Now you should be able to find the record searching with fingerprint data
(performing a general search or prefixed with 'fingerprint-identifier:').
Sponsored-by: Ignatianum University in Cracow
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch changes the way the notices template checks for the existence
of the TranslateNotices system preference in order to avoid a missing
space in the corresponding label.
To test you should have at least two languages enabled under the
StaffInterfaceLanguages system preference.
- Apply the patch and go to Administration -> System preferences..
- Locate the TranslateNotices preference and set it to "Allow"
- Go to Tools -> Notices and edit a notice.
- The "Modify notice" page should have tabs each of your enabled
languages as well as "Default."
- Each tab should have a "Format" section. Expand it and check that the
label for the checkbox at the bottom is correct, e.g. "Apply format
settings to all notices for this language."
- Return to system preferences and set TranslateNotices to "Don't
allow."
- Reload the notice edit screen and check the "Format" section. The
label should now read "Apply format settings to all notices."
Sponsored-by: Athens County Public Libraries
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Test plan:
==========
1. Have a ktd instance with Elasticsearch enabled.
2. In standard ktd installation there is a record with a title
"Typical girls? : the story of the Slits." (with question mark
attached to a word) - biblio # 229. We will try to find it.
3. Go to advanced search (OPAC or intranet) and try a *title* search
with:
Typical girls? the story of the Slits
You should get no results.
From the main page try a ccl-style search:
ti:Typical girls? the story of the Slits
You should get no results too.
4. Apply the patch ; updatedatabase ; restart_all.
5. Put ? in OpacElasticsearchEscapeCharacters and/or
ElasticsearchEscapeCharacters system preference.
4. Repeat the searches from p. 3. You should get the record if a
system preference was set for the given interface.
Sponsored-by: Pontificia Università di San Tommaso d'Aquino (Angelicum)
Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
To test: prove t/db_dependent/Reserves.t
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
When logging a hold create action, include all hold fields that may be
defined at hold creation.
Fields that are not defined until later (such as found status, waiting
date, etc) are not included to avoid clutter.
To test:
1. System preference setup
i. Enable HoldsLog system preference
ii. Set AllowHoldPolicyOverride to Allow
2. Place a hold in the staff interface
3. View the action logs entry for that hold creation
i. Go to Tools > Log viewer
ii. Select Modules: Holds and Action: Create
iii. Click Submit
--> Note that the "info" column only shows the hold id
4. Apply patch and restart_all
5. Repeat steps 2-3
--> The "info" column should now show hold details
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Fix spelling on the SIP2 account form to spell 'Syspref'
section heading in full ('System preference overrides').
Test plan:
1. Go to Administration > Patrons and circulation > Self-service
circulation (SIP2) > Accounts > New account
2. Note the label for the section is "Syspref overrides".
3. Apply the patch.
4. Rebuild everything: yarn build
5. Hard refresh the page.
6. Note that "Syspref..." is now spelt in full as
"System preference overrides".
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Anneli Österman <anneli.osterman@koha-suomi.fi>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
- Add aria-label="Quick shortcuts" to the shortcut nav element
in both the TT include and the Vue Help component
- Ensures all nav landmarks on the staff interface are
uniquely labeled for screen readers (WCAG 2.4.1)
To test:
- Apply the patch
- Rebuild vue components with `yarn js:build`
- Open the staff interface home page
- View the page source and confirm the shortcut nav has
aria-label="Quick shortcuts"
- Confirm that all three nav elements (Main, Breadcrumb,
Quick shortcuts) have unique aria-labels
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
The main <nav> should have a unique aria-label to differentiate it from the Breadcrumb nav
To test:
1. View page source and confirm there are two <nav> elements
2. Notice the main <nav> does not have a unique aria-label
3. Apply patch and check again
4. Confirm the main <nav> is labeled
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch imporves accessibility for screen readers by removing a duplicate empty link
that is rendered in the breadcrumbs on patron pages.
patron-title.inc already includes the links and doesn't need to be wrapped in <a> element.
To test:
1. Go to a patron record and tab through the breadcrumbs
2. Notice there is an empty link that is invisible but gets focus
between the Patrons and <patron title> breadcrumbs.
3. Check the other tabs to confirm the issue is present
Accounting, Routing list, Circulation history, Holds history, Notices,
Statistics and Purchase suggestions
4. Click edit and check the breadcrumbs on that page
5. Enable TwoFactorAuthentication and check the manage two-factor auth page
6. Apply patch
7. Revist the pages from steps 1-5 and tab through the breadcrumbs again
8. Confirm there is no duplicate empty link
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
- Add order_by => ['name'] to record_sources fetch in marc-overlay-rules.pl
so filter dropdown options are consistently sorted
- Add COMMENT to record_sources.is_system column in kohastructure.sql
to match convention of other columns in that table
- Remove commented-out Data::Dumper debug lines from biblios.t
- Remove redundant explicit object deletes inside subtests that are
already wrapped in txn_rollback; the rollback undoes them anyway
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
INSERT IGNORE silently skips rows whose name already exists, leaving
their is_system column at 0. Systems that already had 'intranet',
'z3950' etc. as record sources would not have them protected from
deletion. Added an explicit UPDATE after the INSERT to ensure all
known system record source names have is_system=1 regardless of
whether the row was just inserted or already existed.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
The CASE checks for 'bulkmarkimport' but the record source inserted by
the atomicupdate is named 'bulkmarcimport'. The mismatch caused the
display label and the JS filter option to fall through to the default
(untranslated) case. Fixed in both the rule filter display block and the
module_filter_options JS object.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Make atomicupdate script executable, add html filters to tt, annotate is_system as boolean (SQL12 coding guidelines)
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
updateBiblio API:
- tests for locked records (records with a given record_source which is set to can_be_edited = 0)
- tests for MARCOverlayRules bound to a record_source or fallback source (*)
As record_sources now has an is_system property which prevents it from getting deleted, all tests creating and deleting a record_source were changed so that is_system is set to 0 on creation.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch moves hardcoded source filter from 'MARC overlay rules' (batchmod, intranet, z3950, staged import, bulk import, import_lexile) to 'Record Sources' and makes them untouchable. They cannot be renamed or modified.
New record sources can be added and modified though.
All default and newly created record sources are available as filter for the module "Source" in 'MARC overlay rules'.
The API route for PUT /biblios/:biblio_id now checks for a given header x-record-source-id.
If an id is given the name of the rule is retrieved and forwarded as an overlay_context to ModBiblio.
If no id is given the fallback '*' is added as overlay_context.
Also the record source id is getting saved.
Test plan:
pre) run perl installer/data/mysql/updatedatabase.pl to add new is_system column
pre) run dbic to build Koha::Schema::Result::RecordSource as it gets a new columns is_system
pre) run 'redocly bundle --ext json api/v1/swagger/swagger.yaml --output api/v1/swagger/swagger_bundle.json' or 'yarn build'
a) enable system preference MARCOverlayRules and RESTBasicAuth
b) create new record source in /cgi-bin/koha/admin/record_sources and recognize its <NAME> and <ID>
c) create overlay rules in /cgi-bin/koha/admin/marc-overlay-rules.pl
f.e.
+----+-----+--------+----------+-----------+
| id | tag | module | filter | preset |
+----+-----+--------+----------+-----------+
| 1 | 245 | source | * | protect |
+----+-----+--------+----------+-----------+
This will make the 245 field protected from change, unless the record source matches
d) go to /cgi-bin/koha/catalogue/detail.pl?biblionumber=262 and change 245 (title) via edit -> edit record
e) save and take a look the title is still the same
f) run the updateBiblio-Request from below with a API-testing client like REST Client
g) check that title gets overwritten even though it is protected. This is due the fact the updateBiblio is not setting an overlay context.
h) apply patch
redo d) and e)
i) add another overlay rule allowing your record source to change 245:
+----+-----+--------+----------+-----------+
| id | tag | module | filter | preset |
+----+-----+--------+----------+-----------+
| 1 | 245 | source | * | protect |
| 2 | 245 | source | <NAME> | overwrite |
+----+-----+--------+----------+-----------+
j) run the updateBiblio-Request from below, be sure to fill out x-record-source-id:with your ID from step b)
k) check that title gets overwritten
l) run the updateBiblio-Request from below, but omit x-record-source-id or set it to another value than <ID>
m) check that title is not overwritten
PUT http://main-intra.localhost/api/v1/biblios/262
Authorization: Basic koha:koha
Authorization: Basic koha:koha
Content-Type: application/marcxml+xml
x-record-source-id: <ID>
<?xml version="1.0" encoding="UTF-8"?>
<record
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.loc.gov/MARC21/slimhttp://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"
xmlns="http://www.loc.gov/MARC21/slim">
<leader>01075cam a2200313 a 4500</leader>
<controlfield tag="001">foo</controlfield>
<controlfield tag="005">20200421093825.0</controlfield>
<controlfield tag="008">120417s2012 ch a b 001 0 eng </controlfield>
<datafield tag="040" ind1=" " ind2=" ">
<subfield code="c">482</subfield>
</datafield>
<datafield tag="100" ind1="1" ind2=" ">
<subfield code="a">Christiansen, Tom.</subfield>
<subfield code="9">482</subfield>
</datafield>
<datafield tag="245" ind1="1" ind2="0">
<subfield code="a">New Title</subfield>
<subfield code="c">Tom Christiansen, Brian D. Foy & Larry Wall.</subfield>
</datafield>
<datafield tag="260" ind1=" " ind2=" ">
<subfield code="a">City</subfield>
</datafield>
<datafield tag="300" ind1=" " ind2=" ">
<subfield code="a">Pages and more</subfield>
</datafield>
<datafield tag="942" ind1=" " ind2=" ">
<subfield code="c">BKS</subfield>
</datafield>
</record>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This patch enhances the filters in record overlay rules when using the "Source" module. The available filter values are now system defined in Administration -> Record sources and can be extended by own record souces. The former hard coded values (f.e. batchmod, intranet) are added to the database and cannot be deleted.
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
This changes the structure of record source with an is_system column which controls whether this value can be deleted.
Also predefined values are inserted to reflect the default hard coded values from 'Record overlay rules' sources
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
mock_userenv expects 'branchcode' but the test was passing 'branch',
causing the branchcode to fall through to the 'Branch4T' default and
the branch-specific notice lookup to never match.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Koha::Object::AUTOLOAD calls set_column directly, bypassing DBIC's
inflate/deflate mechanism. This means date/datetime column values set
via Koha object accessors (without store()) can end up as raw DateTime
objects in _column_data. When _unblessed_for_log then calls get_column,
it retrieves the DateTime object, which encode_json in C4::Log cannot
serialise, causing the patron delete (and test) to die with an
"encountered object" error.
Fix by stringifying any DateTime objects found in the column data before
returning from _unblessed_for_log.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
mock_userenv was called before the test patron was created and
used the default borrowernumber (51), which doesn't necessarily
exist in the test database. This caused safe_to_delete to crash
on the not_same_branch check when Koha::Patrons->find returned
undef.
Move mock_userenv after patron creation and pass the actual
borrowernumber.
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Switch from unblessed() to get_column() so that date/datetime column
values are returned as raw ISO strings directly from DBIC's internal
storage, without constructing DateTime objects that would only be
immediately stringified. This makes _unblessed_for_log cheaper on every
call, which is particularly noticeable in the test suite where
BorrowersLog defaults to enabled and patron stores are frequent.
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>