Bugzilla – Attachment 42284 Details for
Bug 14098
Regression in Marc Modification Templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14098: Add copy_and_replace action to MMT
Bug-14098-Add-copyandreplace-action-to-MMT.patch (text/plain), 4.32 KB, created by
Marcel de Rooy
on 2015-09-03 09:35:13 UTC
(
hide
)
Description:
Bug 14098: Add copy_and_replace action to MMT
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2015-09-03 09:35:13 UTC
Size:
4.32 KB
patch
obsolete
>From 0f5cd75e7e6ea3f9db7fd221914267e7de9e7e4e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@koha-community.org> >Date: Wed, 27 May 2015 13:38:38 +0200 >Subject: [PATCH] Bug 14098: Add copy_and_replace action to MMT >Content-Type: text/plain; charset=utf-8 > >This patch add the new value for the MTT action. >It updates the marc_modification_template_actions.action DB field to >allow 'copy_and_replace_field'. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > .../atomicupdate/Bug-14098-Add_copy_and_replace_action.sql | 1 + > .../prog/en/modules/tools/marc_modification_templates.tt | 10 +++++++++- > tools/marc_modification_templates.pl | 1 + > 3 files changed, 11 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/Bug-14098-Add_copy_and_replace_action.sql > >diff --git a/installer/data/mysql/atomicupdate/Bug-14098-Add_copy_and_replace_action.sql b/installer/data/mysql/atomicupdate/Bug-14098-Add_copy_and_replace_action.sql >new file mode 100644 >index 0000000..bfee4e1 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/Bug-14098-Add_copy_and_replace_action.sql >@@ -0,0 +1 @@ >+alter table marc_modification_template_actions modify column action enum('delete_field','update_field','move_field','copy_field','copy_and_replace_field'); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt >index 6c26d83..5cbc88d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt >@@ -14,7 +14,7 @@ $(document).ready(function() { > > $("#add_action").submit(function(){ > var action = $("#action").val(); >- if ( action == 'move_field' || action == 'copy_field' ) { >+ 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; >@@ -96,6 +96,12 @@ function onActionChange(selectObj) { > show('to_field_block'); > break; > >+ case 'copy_and_replace_field': >+ show('field_number_block'); >+ hide('with_value_block'); >+ show('to_field_block'); >+ break; >+ > } > } > >@@ -375,6 +381,7 @@ function setSelectByValue( selectId, value ) { > [% IF ( ActionsLoo.action_update_field ) %] Update [% END %] > [% IF ( ActionsLoo.action_move_field ) %] Move [% END %] > [% IF ( ActionsLoo.action_copy_field ) %] Copy [% END %] >+ [% IF ( ActionsLoo.action_copy_and_replace_field ) %] Copy and replace [% END %] > > [% UNLESS ( ActionsLoo.action_update_field ) %] > [% IF ( ActionsLoo.field_number ) %] >@@ -455,6 +462,7 @@ function setSelectByValue( selectId, value ) { > <option value="update_field">Add/Update</option> > <option value="move_field">Move</option> > <option value="copy_field">Copy</option> >+ <option value="copy_and_replace_field">Copy and replace</option> > </select> > > <span id="field_number_block"> >diff --git a/tools/marc_modification_templates.pl b/tools/marc_modification_templates.pl >index 31c663b..10589e4 100755 >--- a/tools/marc_modification_templates.pl >+++ b/tools/marc_modification_templates.pl >@@ -124,6 +124,7 @@ foreach my $action ( @actions ) { > $action->{'action_update_field'} = ( $action->{'action'} eq 'update_field' ); > $action->{'action_move_field'} = ( $action->{'action'} eq 'move_field' ); > $action->{'action_copy_field'} = ( $action->{'action'} eq 'copy_field' ); >+ $action->{'action_copy_and_replace_field'} = ( $action->{'action'} eq 'copy_and_replace_field' ); > > $action->{'conditional_if'} = ( $action->{'conditional'} eq 'if' ); > $action->{'conditional_unless'} = ( $action->{'conditional'} eq 'unless' ); >-- >1.7.10.4
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 14098
:
39582
|
39583
|
39584
|
39585
|
39610
|
39611
|
39612
|
39613
|
42282
|
42283
| 42284 |
42285