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

(-)a/Koha/Illrequest.pm (-1 / +30 lines)
Lines 2067-2073 sub strings_map { Link Here
2067
    return $strings;
2067
    return $strings;
2068
}
2068
}
2069
2069
2070
2071
=head3 get_op_param_deprecation
2070
=head3 get_op_param_deprecation
2072
2071
2073
    my $op = Koha::Illrequest->check_url_param_deprecation($params);
2072
    my $op = Koha::Illrequest->check_url_param_deprecation($params);
Lines 2124-2129 sub get_op_param_deprecation { Link Here
2124
    return $op;
2123
    return $op;
2125
}
2124
}
2126
2125
2126
=head3 get_staff_table_actions
2127
2128
    my $ill_table_actions = $self->get_staff_table_actions;
2129
2130
Returns the table actions available in the Staff ILL list table
2131
A total join of core static actions with custom actions provided by
2132
installed plugins that implement the ill_table_actions hook
2133
2134
=cut
2135
2136
sub get_staff_table_actions {
2137
    my ( $self, $params ) = @_;
2138
2139
    my $ill_table_actions = [
2140
        {
2141
            button_class                  => 'btn btn-default btn-sm',
2142
            button_link                   => '/cgi-bin/koha/ill/ill-requests.pl?method=illview&illrequest_id=',
2143
            append_column_data_to_link    => 1,
2144
            button_link_translatable_text => 'ill_manage',
2145
        }
2146
    ];
2147
2148
    my @plugin_responses = Koha::Plugins->call('ill_table_actions');
2149
    for my $plugin_variables (@plugin_responses) {
2150
        push( @{$ill_table_actions}, $plugin_variables );
2151
    }
2152
2153
    return $ill_table_actions;
2154
}
2155
2127
=head3 _type
2156
=head3 _type
2128
2157
2129
=cut
2158
=cut
(-)a/ill/ill-requests.pl (+1 lines)
Lines 407-412 if ( $backends_available ) { Link Here
407
            }
407
            }
408
        }
408
        }
409
409
410
        $template->param( table_actions => encode_json( Koha::Illrequest->get_staff_table_actions ) );
410
    } elsif ( $op eq "save_comment" ) {
411
    } elsif ( $op eq "save_comment" ) {
411
        my $comment = Koha::Illcomment->new({
412
        my $comment = Koha::Illcomment->new({
412
            illrequest_id  => scalar $params->{illrequest_id},
413
            illrequest_id  => scalar $params->{illrequest_id},
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (+3 lines)
Lines 56-61 Link Here
56
    <div class="row">
56
    <div class="row">
57
57
58
        [% IF op == 'illlist' %]
58
        [% IF op == 'illlist' %]
59
            <script>
60
                var ill_table_actions = [% table_actions | $raw %];
61
            </script>
59
            <div class="col-sm-2">
62
            <div class="col-sm-2">
60
                <aside>
63
                <aside>
61
                    <form method="get" id="illfilter_form">
64
                    <form method="get" id="illfilter_form">
(-)a/koha-tmpl/intranet-tmpl/prog/js/ill-list-table.js (-6 / +15 lines)
Lines 408-418 $(document).ready(function() { Link Here
408
                "orderable": false,
408
                "orderable": false,
409
                "searchable": false,
409
                "searchable": false,
410
                "render": function( data, type, row, meta ) {
410
                "render": function( data, type, row, meta ) {
411
                    return '<a class="btn btn-default btn-sm" ' +
411
                    return render_table_actions(data);
412
                            'href="/cgi-bin/koha/ill/ill-requests.pl?' +
413
                            'op=illview&amp;illrequest_id=' +
414
                            encodeURIComponent(data) +
415
                            '">' + ill_manage + '</a>';
416
                }
412
                }
417
            }
413
            }
418
        ]
414
        ]
Lines 420-425 $(document).ready(function() { Link Here
420
416
421
    $("#illfilter_form").on('submit', filter);
417
    $("#illfilter_form").on('submit', filter);
422
418
419
    function render_table_actions(data) {
420
        let actions_string = "";
421
        ill_table_actions.forEach((ill_table_action) => {
422
            let link_data = ill_table_action.append_column_data_to_link
423
                ? encodeURIComponent(data)
424
                : "";
425
            let link_text = ill_table_action.button_link_translatable_text
426
                ? eval(ill_table_action.button_link_translatable_text)
427
                : ill_table_action.button_link_text;
428
            actions_string += `<a class="${ill_table_action.button_class}" href="${ill_table_action.button_link}${link_data}">${link_text}</a>`;
429
        });
430
        return actions_string;
431
    }
432
423
    function redrawTable() {
433
    function redrawTable() {
424
        let table_dt = ill_requests_table.DataTable();
434
        let table_dt = ill_requests_table.DataTable();
425
        table_dt.draw();
435
        table_dt.draw();
426
- 

Return to bug 35331