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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-11 / +8 lines)
Lines 1070-1086 Link Here
1070
                                    >
1070
                                    >
1071
                                </form>
1071
                                </form>
1072
1072
1073
                                <form method="get" action="/cgi-bin/koha/tools/batch_modify_holds.pl" id="batch_modify_holds">
1073
                                <form method="post" action="/cgi-bin/koha/tools/batch_modify_holds.pl" id="batch_modify_holds" target="_blank">
1074
                                    <input type="hidden" name="op" value="list" />
1074
                                    [% INCLUDE 'csrf-token.inc' %]
1075
                                    [% FOREACH result IN results %]
1075
                                    <input type="hidden" name="op" value="form" />
1076
                                        [% FOREACH cells IN result.cells %]
1076
                                    <textarea style="display:none" name="reserve_ids_list" id="reserve_ids_list">
1077
                                            [% place = loop.index %]
1077
                                    [%# Preserve the whitespace of the following textarea in order to format the values correctly %]
1078
                                            [% IF header_row.$place.cell == 'reserve_id' || header_types.item(header_row.$place.cell) == 'reserve_id' %]
1078
                                        [%- reserve_ids = PROCESS batch_list results=results batch_type='reserve_id' | trim | html %][% IF reserve_ids %][% SET batch_reserve_ids = 1 %][% reserve_ids | html %][% END -%]
1079
                                                [% SET batch_reserve_ids = 1 %]
1079
                                    </textarea
1080
                                                <input type="hidden" name="reserve_ids" value="[% cells.cell | html %]" />
1080
                                    >
1081
                                            [% END %]
1082
                                        [% END %]
1083
                                    [% END %]
1084
                                </form>
1081
                                </form>
1085
1082
1086
                                [% BLOCK batch_list %]
1083
                                [% BLOCK batch_list %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt (+8 lines)
Lines 195-200 Link Here
195
    <script>
195
    <script>
196
        let hide_patron_name = [% IF Koha.Preference('HidePatronName') %]true[% ELSE %]false[% END %];
196
        let hide_patron_name = [% IF Koha.Preference('HidePatronName') %]true[% ELSE %]false[% END %];
197
        let hold_ids = [% IF updated_holds %] [% updated_holds | $raw %] [% ELSE %] [] [% END %];
197
        let hold_ids = [% IF updated_holds %] [% updated_holds | $raw %] [% ELSE %] [] [% END %];
198
        let hold_ids_from_sql = [% IF reserve_ids_list  %] [% reserve_ids_list  | $raw %] [% ELSE %] [] [% END %];
198
199
199
        $(document).ready(function() {
200
        $(document).ready(function() {
200
201
Lines 260-265 Link Here
260
                return false;
261
                return false;
261
            });
262
            });
262
263
264
            if(hold_ids_from_sql.length > 0){
265
                $('#modify_holds_form').trigger('submit');
266
            }
267
263
            $("#edit_search").on("click", function(e){
268
            $("#edit_search").on("click", function(e){
264
                e.preventDefault();
269
                e.preventDefault();
265
                $('#modify_holds_search').show();
270
                $('#modify_holds_search').show();
Lines 359-364 Link Here
359
                        searchpattern += holdnotes ? _("hold notes like ") + holdnotes : "";
364
                        searchpattern += holdnotes ? _("hold notes like ") + holdnotes : "";
360
365
361
                        return holdnotes ? {"-like": "%"+holdnotes+"%"} : "";
366
                        return holdnotes ? {"-like": "%"+holdnotes+"%"} : "";
367
                    },
368
                    "me.hold_id": function(){
369
                        return hold_ids_from_sql.length > 0 ? { "-in": hold_ids_from_sql } : "";
362
                    }
370
                    }
363
                }
371
                }
364
372
(-)a/tools/batch_modify_holds.pl (-2 / +6 lines)
Lines 23-29 use CGI; Link Here
23
23
24
use JSON qw( to_json );
24
use JSON qw( to_json );
25
25
26
use C4::Auth   qw( get_template_and_user );
26
use C4::Auth qw( get_template_and_user );
27
use C4::Output qw( output_html_with_http_headers );
27
use C4::Output qw( output_html_with_http_headers );
28
28
29
use Koha::DateUtils qw( dt_from_string );
29
use Koha::DateUtils qw( dt_from_string );
Lines 44-49 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
44
my @hold_ids;
44
my @hold_ids;
45
45
46
if ( $op eq 'form' ) {
46
if ( $op eq 'form' ) {
47
    my $reserve_ids_list = $input->param('reserve_ids_list') || undef;
48
    if ($reserve_ids_list) {
49
        my @reserve_ids = split /\n/, $reserve_ids_list;
50
        $template->param( reserve_ids_list => to_json( \@reserve_ids ), );
51
    }
47
    $template->param( view => 'form', );
52
    $template->param( view => 'form', );
48
} elsif ( $op eq 'cud-modify' ) {
53
} elsif ( $op eq 'cud-modify' ) {
49
    my $new_expiration_date = $input->param('new_expiration_date');
54
    my $new_expiration_date = $input->param('new_expiration_date');
50
- 

Return to bug 36135