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

(-)a/Koha/SimpleMARC.pm (-3 / +3 lines)
Lines 135-143 sub copy_and_replace_field { Link Here
135
135
136
    if ( ! ( $record && $fromFieldName && $toFieldName ) ) { return; }
136
    if ( ! ( $record && $fromFieldName && $toFieldName ) ) { return; }
137
137
138
138
    if (
139
    if ( !defined $fromSubfieldName or $fromSubfieldName eq ''
139
        ( !defined $fromSubfieldName or $fromSubfieldName eq '' )
140
      or !defined $toSubfieldName or $toSubfieldName eq ''
140
        and ( !defined $toSubfieldName or $toSubfieldName eq '' )
141
    ) {
141
    ) {
142
        _copy_move_field(
142
        _copy_move_field(
143
            {   record        => $record,
143
            {   record        => $record,
(-)a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js (-8 / +5 lines)
Lines 14-21 $(document).ready(function() { Link Here
14
        var action = $("#action").val();
14
        var action = $("#action").val();
15
        if ( action == 'move_field' || action == 'copy_field' || action == 'copy_and_replace_field') {
15
        if ( action == 'move_field' || action == 'copy_field' || action == 'copy_and_replace_field') {
16
            if ( $("#from_subfield").val().length != $("#to_subfield").val().length ) {
16
            if ( $("#from_subfield").val().length != $("#to_subfield").val().length ) {
17
                alert( __("Both subfield values should be filled or empty.") );
17
                if ( ( $("#to_field").val()   >= 10 && $("#to_subfield").val().length   > 0 ) &&
18
                return false;
18
                     ( $("#from_field").val() >= 10 && $("#from_subfield").val().length > 0 ) ) {
19
                    alert( __("Both subfield values should be filled or empty.") );
20
                    return false;
21
                }
19
            }
22
            }
20
            if ( $("#to_field").val().length <= 0 ) {
23
            if ( $("#to_field").val().length <= 0 ) {
21
                alert( __("The destination should be filled.") );
24
                alert( __("The destination should be filled.") );
Lines 26-36 $(document).ready(function() { Link Here
26
                alert( __("If the field is a control field, the subfield should be empty") );
29
                alert( __("If the field is a control field, the subfield should be empty") );
27
                return false;
30
                return false;
28
            }
31
            }
29
            if ( ( $("#from_field").val() < 10 && $("#to_field").val()   >= 10 ) ||
30
                 ( $("#to_field").val()   < 10 && $("#from_field").val() >= 10 ) ) {
31
                alert( __("A control field cannot be used with a regular field.") );
32
                return false;
33
            }
34
        }
32
        }
35
        if ( action == 'update_field' ) {
33
        if ( action == 'update_field' ) {
36
            if ( $("#from_subfield").val().length <= 0 ) {
34
            if ( $("#from_subfield").val().length <= 0 ) {
37
- 

Return to bug 36515