View | Details | Raw Unified | Return to bug 14098
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/Bug-14098-Add_copy_and_replace_action.sql (+1 lines)
Line 0 Link Here
1
alter table marc_modification_template_actions modify column action enum('delete_field','update_field','move_field','copy_field','copy_and_replace_field');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt (-1 / +9 lines)
Lines 14-20 $(document).ready(function() { Link Here
14
14
15
    $("#add_action").submit(function(){
15
    $("#add_action").submit(function(){
16
        var action = $("#action").val();
16
        var action = $("#action").val();
17
        if ( action == 'move_field' || action == 'copy_field' ) {
17
        if ( action == 'move_field' || action == 'copy_field' || action == 'copy_and_replace_field') {
18
            if ( $("#from_subfield").val().length != $("#to_subfield").val().length ) {
18
            if ( $("#from_subfield").val().length != $("#to_subfield").val().length ) {
19
                alert(_("Both subfield values should be filled or empty."));
19
                alert(_("Both subfield values should be filled or empty."));
20
                return false;
20
                return false;
Lines 96-101 function onActionChange(selectObj) { Link Here
96
            show('to_field_block');
96
            show('to_field_block');
97
            break;
97
            break;
98
98
99
        case 'copy_and_replace_field':
100
            show('field_number_block');
101
            hide('with_value_block');
102
            show('to_field_block');
103
            break;
104
99
    }
105
    }
100
}
106
}
101
107
Lines 375-380 function setSelectByValue( selectId, value ) { Link Here
375
                                    [% IF ( ActionsLoo.action_update_field ) %] Update [% END %]
381
                                    [% IF ( ActionsLoo.action_update_field ) %] Update [% END %]
376
                                    [% IF ( ActionsLoo.action_move_field ) %] Move [% END %]
382
                                    [% IF ( ActionsLoo.action_move_field ) %] Move [% END %]
377
                                    [% IF ( ActionsLoo.action_copy_field ) %] Copy [% END %]
383
                                    [% IF ( ActionsLoo.action_copy_field ) %] Copy [% END %]
384
                                    [% IF ( ActionsLoo.action_copy_and_replace_field ) %] Copy and replace [% END %]
378
385
379
                                    [% UNLESS ( ActionsLoo.action_update_field ) %]
386
                                    [% UNLESS ( ActionsLoo.action_update_field ) %]
380
                                        [% IF ( ActionsLoo.field_number ) %]
387
                                        [% IF ( ActionsLoo.field_number ) %]
Lines 455-460 function setSelectByValue( selectId, value ) { Link Here
455
                            <option value="update_field">Add/Update</option>
462
                            <option value="update_field">Add/Update</option>
456
                            <option value="move_field">Move</option>
463
                            <option value="move_field">Move</option>
457
                            <option value="copy_field">Copy</option>
464
                            <option value="copy_field">Copy</option>
465
                            <option value="copy_and_replace_field">Copy and replace</option>
458
                        </select>
466
                        </select>
459
467
460
                        <span id="field_number_block">
468
                        <span id="field_number_block">
(-)a/tools/marc_modification_templates.pl (-1 / +1 lines)
Lines 124-129 foreach my $action ( @actions ) { Link Here
124
  $action->{'action_update_field'} = ( $action->{'action'} eq 'update_field' );
124
  $action->{'action_update_field'} = ( $action->{'action'} eq 'update_field' );
125
  $action->{'action_move_field'} = ( $action->{'action'} eq 'move_field' );
125
  $action->{'action_move_field'} = ( $action->{'action'} eq 'move_field' );
126
  $action->{'action_copy_field'} = ( $action->{'action'} eq 'copy_field' );
126
  $action->{'action_copy_field'} = ( $action->{'action'} eq 'copy_field' );
127
  $action->{'action_copy_and_replace_field'} = ( $action->{'action'} eq 'copy_and_replace_field' );
127
128
128
  $action->{'conditional_if'} = ( $action->{'conditional'} eq 'if' );
129
  $action->{'conditional_if'} = ( $action->{'conditional'} eq 'if' );
129
  $action->{'conditional_unless'} = ( $action->{'conditional'} eq 'unless' );
130
  $action->{'conditional_unless'} = ( $action->{'conditional'} eq 'unless' );
130
- 

Return to bug 14098