@@ -, +, @@
- the source field is always mandatory
- on move and copy, the source and destination subfield should be both
filled or blank.
- on move and copy, the destination subfield should be filled.
- on update, the subfield value should be filled.
---
.../modules/tools/marc_modification_templates.tt | 28 ++++++++++++++++++--
1 file changed, 26 insertions(+), 2 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
@@ -11,6 +11,30 @@ $(document).ready(function() {
});
$("span.match_regex_prefix" ).hide();
$("span.match_regex_suffix" ).hide();
+
+ $("#add_action").submit(function(){
+ var action = $("#action").val();
+ if ( action == 'move_field' || action == 'copy_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().length <= 0 ) {
+ alert(_("The destination should be filled."));
+ return false;
+ }
+ }
+ if ( action == 'update_field' ) {
+ if ( $("#from_subfield").val().length <= 0 ) {
+ alert(_("The source subfield should be filled for update."));
+ return false;
+ }
+ }
+ if ( $("#from_field").val().length <= 0 ) {
+ alert(_("The source field should be filled."));
+ return false;
+ }
+ });
});
//]]>
@@ -415,14 +439,14 @@ function setSelectByValue( selectId, value ) {
- field(s)
+ field(s)
with value
- to field
+ to field
--