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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt (-14 / +6 lines)
Lines 262-271 Link Here
262
                                    </td>
262
                                    </td>
263
                                    <td>[% rule.tag | html %]</td>
263
                                    <td>[% rule.tag | html %]</td>
264
                                    <td class="rule-preset"></td>
264
                                    <td class="rule-preset"></td>
265
                                    <td class="rule-operation-action" data-operation="add">[% IF rule.add %]Add[% ELSE %]Skip[% END %]</td>
265
                                    <td class="rule-operation-action" data-operation="add" data-value="[% rule.add %]">[% IF rule.add %]Add[% ELSE %]Skip[% END %]</td>
266
                                    <td class="rule-operation-action" data-operation="append">[% IF rule.append %]Append[% ELSE %]Skip[% END %]</td>
266
                                    <td class="rule-operation-action" data-operation="append" data-value="[% rule.append %]">[% IF rule.append %]Append[% ELSE %]Skip[% END %]</td>
267
                                    <td class="rule-operation-action" data-operation="remove">[% IF rule.remove %]Remove[% ELSE %]Skip[% END %]</td>
267
                                    <td class="rule-operation-action" data-operation="remove" data-value="[% rule.remove %]">[% IF rule.remove %]Remove[% ELSE %]Skip[% END %]</td>
268
                                    <td class="rule-operation-action" data-operation="delete">[% IF rule.delete %]Delete[% ELSE %]Skip[% END %]</td>
268
                                    <td class="rule-operation-action" data-operation="delete" data-value="[% rule.delete %]">[% IF rule.delete %]Delete[% ELSE %]Skip[% END %]</td>
269
                                    <td class="actions">
269
                                    <td class="actions">
270
                                        <a href="?op=remove&id=[% rule.id | uri %]" title="Delete" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
270
                                        <a href="?op=remove&id=[% rule.id | uri %]" title="Delete" class="btn btn-default btn-xs"><i class="fa fa-trash"></i> Delete</a>
271
                                        <a href="?op=edit&id=[% rule.id | uri %]" title="Edit" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
271
                                        <a href="?op=edit&id=[% rule.id | uri %]" title="Edit" class="btn btn-default btn-xs"><i class="fa fa-pencil"></i> Edit</a>
Lines 429-441 Link Here
429
          'delete': 0
429
          'delete': 0
430
        };
430
        };
431
431
432
        var overlay_rules_label_to_value = {};
433
        overlay_rules_label_to_value[_("Add")] = 1;
434
        overlay_rules_label_to_value[_("Append")] = 1;
435
        overlay_rules_label_to_value[_("Remove")] = 1;
436
        overlay_rules_label_to_value[_("Delete")] = 1;
437
        overlay_rules_label_to_value[_("Skip")] = 0;
438
439
        function hash_config(config) {
432
        function hash_config(config) {
440
          return JSON.stringify(config, Object.keys(config).sort());
433
          return JSON.stringify(config, Object.keys(config).sort());
441
        }
434
        }
Lines 455-464 Link Here
455
          var operations_config = {};
448
          var operations_config = {};
456
          $('.rule-operation-action', $this).each(function() {
449
          $('.rule-operation-action', $this).each(function() {
457
            var $operation = $(this);
450
            var $operation = $(this);
458
            operations_config[$operation.data('operation')] = overlay_rules_label_to_value[$operation.text()];
451
            operations_config[$operation.data('operation')] = $operation.data('value');
459
          });
452
          });
460
          $('.rule-preset', $this).text(
453
          $('.rule-preset', $this).text(
461
            $('option[value="' + operations_config_overlay_rule_preset(operations_config) + '"]').text() || _("Custom")
454
            $('select[name="preset"] option[value="' + operations_config_overlay_rule_preset(operations_config) + '"]').text()
462
          );
455
          );
463
        });
456
        });
464
457
465
- 

Return to bug 31694