Bug 15536

Summary: Additional match check comparison operators
Product: Koha Reporter: David Cook <dcook>
Component: MARC Bibliographic record staging/importAssignee: Galen Charlton <gmcharlt>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: andreas.jonsson, andrew
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 15536: Refactor to remove duplicated code.
Bug 15536: Update database schema
Bug 15536: ui and store/fetch for new columns
Bug 15536: implement match control check

Description David Cook 2016-01-11 01:31:57 UTC
When http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12586 is pushed, the "required match checks" will work for Bibliographic records once again.

At the moment, match checks work on an "equal" comparison, but I'm thinking it might be useful to have additional comparisons like >, <, >=, <=, and !=. (Well, string and numeric comparison operators...) 

Example:

- Record 1b 005 > Record 1a 005
Import only if the record's 005 is newer than the existing record's 005.

Admittedly, that's the only feasible example I can think of off the top of my head at the moment.

I suppose you might require that the 942$c be "not equal" before updating, if you only want to update a subset of records that are missing some information. I suppose you should have figured that out beforehand and only tried importing the records you actually want to change.

You might try a match check where the 250 edition statement is > or < but since it's a free-text field, that would probably be a bad idea.

I suppose most cases of using additional comparison operators might be in regards to arbitrary data. Like maybe you only want to update target records if the match result has a 999$c < 1000 or something like that, but that seems unlikely and unwieldy at best.

Just throwing it out here as an idea. It could be useful for the 005 at least.
Comment 1 Andreas Jonsson 2024-04-25 18:47:38 UTC
Also equal/not equal to constant value would be nice.
Comment 2 Andreas Jonsson 2024-05-21 00:49:13 UTC
Created attachment 166947 [details] [review]
Bug 15536: Refactor to remove duplicated code.
Comment 3 Andreas Jonsson 2024-05-21 00:49:15 UTC
Created attachment 166948 [details] [review]
Bug 15536: Update database schema
Comment 4 Andreas Jonsson 2024-05-21 00:49:18 UTC
Created attachment 166949 [details] [review]
Bug 15536: ui and store/fetch for new columns
Comment 5 Andreas Jonsson 2024-05-21 00:49:20 UTC
Created attachment 166950 [details] [review]
Bug 15536: implement match control check
Comment 6 Andreas Jonsson 2024-05-21 00:53:27 UTC
I've added not equals as an operator in addition to being able to specify constant values as operands.  Feel free to add additional operators.