Bugzilla – Attachment 166026 Details for
Bug 36515
Amend MARC modification templates so control fields can be copied to subfields
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36515: Amend MARC modification templates so control fields can be copied to subfields
Bug-36515-Amend-MARC-modification-templates-so-con.patch (text/plain), 3.24 KB, created by
David Nind
on 2024-05-02 00:19:41 UTC
(
hide
)
Description:
Bug 36515: Amend MARC modification templates so control fields can be copied to subfields
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-05-02 00:19:41 UTC
Size:
3.24 KB
patch
obsolete
>From b07f9498c04cc53436d4c8fd787a17d16f6227ef Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Wed, 1 May 2024 06:41:00 +1200 >Subject: [PATCH] Bug 36515: Amend MARC modification templates so control > fields can be copied to subfields > >Test plan: >1. Apply patch and restart services >2. Create a MARC modification template with the action: > Copy and replace field 001 to 099$a unless 099$a exists >3. Perform a Batch record modification using your MARC modification template from #2 >4. Confirm that the template has successfully moved the 001 control field value to the 099$a subfield > >Sponsored-by: Education Services Australia SCIS >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/SimpleMARC.pm | 6 +++--- > .../prog/js/marc_modification_templates.js | 12 +++++------- > 2 files changed, 8 insertions(+), 10 deletions(-) > >diff --git a/Koha/SimpleMARC.pm b/Koha/SimpleMARC.pm >index be7f025ea2..6b15b8d939 100644 >--- a/Koha/SimpleMARC.pm >+++ b/Koha/SimpleMARC.pm >@@ -135,9 +135,9 @@ sub copy_and_replace_field { > > if ( ! ( $record && $fromFieldName && $toFieldName ) ) { return; } > >- >- if ( !defined $fromSubfieldName or $fromSubfieldName eq '' >- or !defined $toSubfieldName or $toSubfieldName eq '' >+ if ( >+ ( !defined $fromSubfieldName or $fromSubfieldName eq '' ) >+ and ( !defined $toSubfieldName or $toSubfieldName eq '' ) > ) { > _copy_move_field( > { record => $record, >diff --git a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js >index 39dfd7226d..594985403a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js >@@ -14,8 +14,11 @@ $(document).ready(function() { > var action = $("#action").val(); > if ( action == 'move_field' || action == 'copy_field' || action == 'copy_and_replace_field') { > if ( $("#from_subfield").val().length != $("#to_subfield").val().length ) { >- alert( __("Both subfield values should be filled or empty.") ); >- return false; >+ if ( ( $("#to_field").val() >= 10 && $("#to_subfield").val().length > 0 ) && >+ ( $("#from_field").val() >= 10 && $("#from_subfield").val().length > 0 ) ) { >+ alert( __("Both subfield values should be filled or empty.") ); >+ return false; >+ } > } > if ( $("#to_field").val().length <= 0 ) { > alert( __("The destination should be filled.") ); >@@ -26,11 +29,6 @@ $(document).ready(function() { > alert( __("If the field is a control field, the subfield should be empty") ); > return false; > } >- if ( ( $("#from_field").val() < 10 && $("#to_field").val() >= 10 ) || >- ( $("#to_field").val() < 10 && $("#from_field").val() >= 10 ) ) { >- alert( __("A control field cannot be used with a regular field.") ); >- return false; >- } > } > if ( action == 'update_field' ) { > if ( $("#from_subfield").val().length <= 0 ) { >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36515
:
164575
|
165924
|
165928
|
165929
| 166026 |
166027
|
169215
|
169216