Bug 13560: Add an 'Add' option for marc modification templates
authorNick Clemens <nick@bywatersolutions.com>
Tue, 16 Jan 2018 16:16:40 +0000 (16:16 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 19 Jul 2018 17:22:18 +0000 (17:22 +0000)
commit284226a4966520eb0f1e784310bbc87ed3e59334
tree41636a0cdcae46f51dc871abe670e4e46351a2f8
parentc20fbda4611e68d3935d078be0be5254563ee077
Bug 13560: Add an 'Add' option for marc modification templates

Add/Update would update a field or create new if it existed, but didn't
allow for creating new if the field existed.

This patchset splits the options to 'Add & Update' so that 'Add' will always
add a field and 'Update' will operate as it always has

To test:
1 - Have a record with a known existing field (make a copy)
2 - Define a marc modification template that 'Add/update' on that field
3 - Define an 'Add/Update' on a field that doesn't exist
4 - Batch modify the copy of record using the above template
5 - Verify the existing field was updated
6 - Verify the non-existing field was updated
7 - Apply patch and update database
8 - Make another copy
9 - Modify the copy with the same template as above
10 - Should match initial modification
11 - Add a new rule to add a new field
12 - Modify using the updated template
13 - Ensure your new field is created
14 - Test various options in the modification tool
15 - prove t/db_dependent/MarcModificationTemplates.t

Signed-off-by: Victor Grousset <victor.grousset@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/MarcModificationTemplates.pm
Koha/SimpleMARC.pm
koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt
koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js
tools/marc_modification_templates.pl