@@ -, +, @@ used - If a control field is used with a regular field - The subfield should be empty --- .../modules/tools/marc_modification_templates.tt | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt @@ -23,6 +23,16 @@ $(document).ready(function() { alert(_("The destination should be filled.")); return false; } + if ( ( $("#to_field").val() <= 10 && $("#to_subfield").val().length > 0 ) || + ( $("#from_field").val() <= 10 && $("#from_subfield").val().length > 0 ) ) { + alert(_("If the field is a control field, the subfield should be empty")); + return false; + } + if ( ( $("#from_field").val() <= 10 && $("#to_subfield").val().length == 0 ) || + ( $("#to_field").val() <= 10 && $("#from_subfield").val().length == 0 ) ) { + alert(_("A control field cannot be used with a regular field.")); + return false; + } } if ( action == 'update_field' ) { if ( $("#from_subfield").val().length <= 0 ) { --