});
$("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;
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");
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');
<div id="yui-main">
<div class="yui-b">
<h2>MARC modification templates</h2>
+
+ [% IF error %]
+ [% IF error == 'no_from_field' %]
+ <div class="dialog message">Error: no field value specified.</div>
+ [% END %]
+ [% END %]
[% IF ( TemplatesLoop ) %]
[% IF ( ActionsLoo.conditional_comparison_equals ) %] matches [% END %]
[% IF ( ActionsLoo.conditional_comparison_not_equals ) %] does not match [% END %]
- [% IF ( ActionsLoo.conditional_regex ) %] RegEx m/[% END %]<strong>[% ActionsLoo.conditional_value %]/</strong>
+ [% IF ( ActionsLoo.conditional_regex ) %] RegEx m/[% END %]
+ <strong>[% ActionsLoo.conditional_value %]</strong>
+ [% IF ( ActionsLoo.conditional_regex ) %]/[% END %]
[% END %]
</td>
<td>[% ActionsLoo.description %]</td>
<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>