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

(-)a/admin/restrictions.pl (-2 / +2 lines)
Lines 99-109 if ( $op eq 'add_form') { Link Here
99
        }
99
        }
100
    }
100
    }
101
    $op = 'list';
101
    $op = 'list';
102
} elsif ( $op eq 'make_default' ) {
102
} elsif ( $op eq 'cud-make_default' ) {
103
    my $restriction = Koha::Patron::Restriction::Types->find($code);
103
    my $restriction = Koha::Patron::Restriction::Types->find($code);
104
    $restriction->make_default;
104
    $restriction->make_default;
105
    $op = 'list';
105
    $op = 'list';
106
} elsif ( $op eq 'cud-delete_confirm' ) {
106
} elsif ( $op eq 'delete_confirm' ) {
107
    $template->param(
107
    $template->param(
108
        restriction => scalar Koha::Patron::Restriction::Types->find($code)
108
        restriction => scalar Koha::Patron::Restriction::Types->find($code)
109
    );
109
    );
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/restrictions.tt (-2 / +13 lines)
Lines 225-231 Link Here
225
                                    <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/restrictions.pl?op=delete_confirm&amp;code=[% restriction.code | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
225
                                    <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/restrictions.pl?op=delete_confirm&amp;code=[% restriction.code | uri %]"><i class="fa fa-trash-can"></i> Delete</a>
226
                                [% END %]
226
                                [% END %]
227
                                [% IF !restriction.is_system && !restriction.is_default %]
227
                                [% IF !restriction.is_system && !restriction.is_default %]
228
                                    <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/restrictions.pl?op=make_default&amp;code=[% restriction.code | uri %]"><i class="fa fa-archive"></i> Make default</a>
228
                                    <form id="make_default_[% restriction.code | html %]" method="post" action="/cgi-bin/koha/admin/restrictions.pl">
229
                                        [% INCLUDE 'csrf-token.inc' %]
230
                                        <input type="hidden" name="op" value="cud-make_default" />
231
                                        <input type="hidden" name="code" value="[% restriction.code | html %]" />
232
                                    </form>
233
                                    <a class="btn btn-default btn-xs make_default_button" href="#" data-code="[% restriction.code | html %]"><i class="fa fa-archive"></i> Make default</a>
229
                                [% END %]
234
                                [% END %]
230
                            </td>
235
                            </td>
231
                        </tr>
236
                        </tr>
Lines 270-275 Link Here
270
                $("#fee_limit").prop("required",false).nextAll().remove();
275
                $("#fee_limit").prop("required",false).nextAll().remove();
271
            }
276
            }
272
        });
277
        });
278
279
        $(".make_default_button").on("click", function(e){
280
            e.preventDefault();
281
            var code = $(this).data('code');
282
            $('#make_default_'+code).submit();
283
        });
284
273
    </script>
285
    </script>
274
    [% Asset.js("js/restrictiontypes.js") | $raw %]
286
    [% Asset.js("js/restrictiontypes.js") | $raw %]
275
[% END %]
287
[% END %]
276
- 

Return to bug 36193