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

(-)a/admin/debit_types.pl (-2 / +2 lines)
Lines 99-105 elsif ( $op eq 'cud-add_validate' ) { Link Here
99
    };
99
    };
100
    $op = 'list';
100
    $op = 'list';
101
}
101
}
102
elsif ( $op eq 'archive' ) {
102
elsif ( $op eq 'cud-archive' ) {
103
    try {
103
    try {
104
        $debit_type->archived(1)->store();
104
        $debit_type->archived(1)->store();
105
        push @messages, { code => 'success_on_archive', type => 'message' };
105
        push @messages, { code => 'success_on_archive', type => 'message' };
Lines 110-116 elsif ( $op eq 'archive' ) { Link Here
110
    };
110
    };
111
    $op = 'list';
111
    $op = 'list';
112
}
112
}
113
elsif ( $op eq 'unarchive' ) {
113
elsif ( $op eq 'cud-unarchive' ) {
114
    try {
114
    try {
115
        $debit_type->archived(0)->store();
115
        $debit_type->archived(0)->store();
116
        push @messages, { code => 'success_on_restore', type => 'message' };
116
        push @messages, { code => 'success_on_restore', type => 'message' };
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/debit_types.tt (-3 / +24 lines)
Lines 223-232 Link Here
223
                                            [% IF !debit_type.archived %]
223
                                            [% IF !debit_type.archived %]
224
                                                <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=add_form&amp;code=[% debit_type.code | uri %]&type=debit"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
224
                                                <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=add_form&amp;code=[% debit_type.code | uri %]&type=debit"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
225
                                                [% IF !debit_type.is_system %]
225
                                                [% IF !debit_type.is_system %]
226
                                                    <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=archive&amp;code=[% debit_type.code | uri %]"><i class="fa fa-archive"></i> Archive</a>
226
                                                    <form id="archive_[% debit_type.code | html %]" method="post" action="/cgi-bin/koha/admin/debit_types.pl">
227
                                                        [% INCLUDE 'csrf-token.inc' %]
228
                                                        <input type="hidden" name="op" value="cud-archive" />
229
                                                        <input type="hidden" name="code" value="[% debit_type.code | html %]" />
230
                                                    </form>
231
                                                    <a class="btn btn-default btn-xs archive_button" href="#" data-code="[% debit_type.code | html %]"><i class="fa fa-archive"></i> Archive</a>
227
                                                [% END %]
232
                                                [% END %]
228
                                            [% ELSIF debit_type.archived %]
233
                                            [% ELSIF debit_type.archived %]
229
                                                <a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/debit_types.pl?op=unarchive&amp;code=[% debit_type.code | uri %]"><i class="fa fa-undo"></i> Restore</a>
234
                                                <form id="unarchive_[% debit_type.code | html %]" method="post" action="/cgi-bin/koha/admin/debit_types.pl">
235
                                                    [% INCLUDE 'csrf-token.inc' %]
236
                                                    <input type="hidden" name="op" value="cud-unarchive" />
237
                                                    <input type="hidden" name="code" value="[% debit_type.code | html %]" />
238
                                                </form>
239
                                                <a class="btn btn-default btn-xs unarchive_button" href="#" data-code="[% debit_type.code | html %]"><i class="fa fa-undo"></i> Restore</a>
230
                                            [% END %]
240
                                            [% END %]
231
                                        </td>
241
                                        </td>
232
                                    </tr>
242
                                    </tr>
Lines 284-289 Link Here
284
294
285
            //Start filtered
295
            //Start filtered
286
            $('#filter_system').click();
296
            $('#filter_system').click();
297
298
            $(".archive_button").on("click", function(e){
299
                e.preventDefault();
300
                var code = $(this).data('code');
301
                $('#archive_'+code).submit();
302
            });
303
304
            $(".unarchive_button").on("click", function(e){
305
                e.preventDefault();
306
                var code = $(this).data('code');
307
                $('#unarchive_'+code).submit();
308
            });
287
        });
309
        });
288
    </script>
310
    </script>
289
[% END %]
311
[% END %]
290
- 

Return to bug 36193