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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/marc_modification_templates.tt (-3 / +5 lines)
Lines 157-165 Link Here
157
                                                [% IF ( ActionsLoo.conditional_comparison_equals ) %] matches [% END %]
157
                                                [% IF ( ActionsLoo.conditional_comparison_equals ) %] matches [% END %]
158
                                                [% IF ( ActionsLoo.conditional_comparison_not_equals ) %] does not match [% END %]
158
                                                [% IF ( ActionsLoo.conditional_comparison_not_equals ) %] does not match [% END %]
159
159
160
                                                [% IF ( ActionsLoo.conditional_regex ) %] RegEx m/[% END %]
160
                                                [% IF ( ActionsLoo.conditional_regex ) %] RegEx m/[% END %]<strong>[% ActionsLoo.conditional_value | html %]</strong>[% IF ( ActionsLoo.conditional_regex ) %]/[% END %]
161
                                                <strong>[% ActionsLoo.conditional_value | html %]</strong>
162
                                                [% IF ( ActionsLoo.conditional_regex ) %]/[% END %]
163
                                            [% END %]
161
                                            [% END %]
164
                                        </td>
162
                                        </td>
165
                                        <td>[% ActionsLoo.description | html %]</td>
163
                                        <td>[% ActionsLoo.description | html %]</td>
Lines 356-361 Link Here
356
        var MSG_MMT_CONFIRM_DEL_TEMPLATE_ACTION = _("Are you sure you wish to delete this template action?");
354
        var MSG_MMT_CONFIRM_DEL_TEMPLATE_ACTION = _("Are you sure you wish to delete this template action?");
357
        var MSG_MMT_EDIT_ACTION = _("Edit action %s");
355
        var MSG_MMT_EDIT_ACTION = _("Edit action %s");
358
        var MSG_MMT_UPDATE_ACTION = _("Update action");
356
        var MSG_MMT_UPDATE_ACTION = _("Update action");
357
        var MSG_MMT_CONDITIONAL_FIELD_REQUIRED = _("The conditional field should be filled.");
358
        var MSG_MMT_CONDITIONAL_COMPARISON_REQUIRED = _("The conditional comparison operator should be filled.");
359
        var MSG_MMT_CONDITIONAL_VALUE_REQUIRED = _("The conditional value should be filled.");
360
        var MSG_MMT_CONDITIONAL_VALUE_REGEX_REQUIRED = _("The conditional regular expression should be filled.");
359
    </script>
361
    </script>
360
    [% Asset.js("js/marc_modification_templates.js") | $raw %]
362
    [% Asset.js("js/marc_modification_templates.js") | $raw %]
361
[% END %]
363
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/js/marc_modification_templates.js (-1 / +21 lines)
Lines 41-46 $(document).ready(function() { Link Here
41
            alert( MSG_MMT_SOURCE_FIELD );
41
            alert( MSG_MMT_SOURCE_FIELD );
42
            return false;
42
            return false;
43
        }
43
        }
44
        if ( $("#conditional").val() == 'if' || $("#conditional").val() == 'unless' ) {
45
            if ( $("#conditional_field").val() == '' ) {
46
                alert( MSG_MMT_CONDITIONAL_FIELD_REQUIRED );
47
                return false;
48
            }
49
            if ( $("#conditional_comparison").val() == '' ) {
50
                alert( MSG_MMT_CONDITIONAL_COMPARISON_REQUIRED );
51
                return false
52
            }
53
            if ( $("#conditional_value").val() == '' &&
54
                 ( $("#conditional_comparison").val() == 'equals' || $("#conditional_comparison").val() == 'not_equals' ) ) {
55
                if ( document.getElementById('conditional_regex').checked == true ) {
56
                    alert( MSG_MMT_CONDITIONAL_VALUE_REGEX_REQUIRED );
57
                    return false;
58
                } else {
59
                    alert( MSG_MMT_CONDITIONAL_VALUE_REQUIRED );
60
                    return false;
61
                }
62
            }
63
        }
44
    });
64
    });
45
65
46
    $("#conditional_field,#from_field").change(function(){
66
    $("#conditional_field,#from_field").change(function(){
Lines 274-279 function editAction( mmta_id, ordering, action, field_number, from_field, from_s Link Here
274
    document.getElementById('conditional_value').value = conditional_value;
294
    document.getElementById('conditional_value').value = conditional_value;
275
295
276
    document.getElementById('conditional_regex').checked = parseInt( conditional_regex );
296
    document.getElementById('conditional_regex').checked = parseInt( conditional_regex );
297
    document.getElementById('conditional_regex').onchange();
277
298
278
    document.getElementById('description').value = description;
299
    document.getElementById('description').value = description;
279
300
280
- 

Return to bug 21861