Bug 12495 - Include streetnumber in hold alert address
[koha_fer] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / marc_modification_templates.tt
index 569b7f8..a9b9d3d 100644 (file)
@@ -11,11 +11,26 @@ $(document).ready(function() {
     });
     $("span.match_regex_prefix" ).hide();
     $("span.match_regex_suffix" ).hide();
+
+    $("#conditional_field,#from_field").change(function(){
+        updateWarnings(); // For 3.14.x branches only, if bug 11319 is not pushed into
+    });
 });
 //]]>
 </script>
 
 <script>
+
+function updateWarnings(){
+    if ( $("#conditional_field").is(":visible") ) {
+        if ( $("#conditional_field").val() == $("#from_field").val() && $("#from_field").val().length > 0 ) {
+            $("#warning_multivalued").show();
+        } else {
+            $("#warning_multivalued").hide();
+        }
+    }
+}
+
 function onActionChange(selectObj) {
     // get the index of the selected option
     var idx = selectObj.selectedIndex;
@@ -186,8 +201,8 @@ function editAction( mmta_id, ordering, action, field_number, from_field, from_s
 
     document.getElementById('description').value = description;
 
-    window.modaction_legend_innerhtml = document.getElementById('modaction_legend').innerhtml;
-    document.getElementById('modaction_legend').innerhtml = _("Edit action") + ordering;
+    window.modaction_legend_innerhtml = document.getElementById('modaction_legend').innerHTML;
+    document.getElementById('modaction_legend').innerHTML = _("Edit action %s").format(ordering);
 
     window.action_submit_value = document.getElementById('action_submit').value;
     document.getElementById('action_submit').value = _("Update action");
@@ -226,7 +241,7 @@ function cancelEditAction() {
 
     document.getElementById('conditional_regex').checked = false;
 
-    document.getElementById('modaction_legend').innerhtml = window.modaction_legend_innerhtml;
+    document.getElementById('modaction_legend').innerHTML = window.modaction_legend_innerhtml;
     document.getElementById('action_submit').value = window.action_submit_value;
 
     hide('cancel_edit');
@@ -400,6 +415,7 @@ function setSelectByValue( selectId, value ) {
                     <a name="modaction"></a>
                     <fieldset>
                         <legend id="modaction_legend">Add a new action</legend>
+                        <div id="warning_multivalued" style="color:red; display:none;">You have chosen a condition on the same field as the original field. If your records contain multivalued fields it is highly recommended not to do that.</div>
 
                         <select name="action" id="action" onchange="onActionChange(this);">
                             <option value="delete_field">Delete</option>