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

(-)a/circ/view_holdsqueue.pl (-10 / +13 lines)
Lines 39-66 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( Link Here
39
    }
39
    }
40
);
40
);
41
41
42
my $params         = $query->Vars;
42
my $params          = $query->Vars;
43
my $run_report     = $params->{'run_report'};
43
my $run_report      = $params->{'run_report'};
44
my $branchlimit    = $params->{'branchlimit'};
44
my $branchlimit     = $params->{'branchlimit'};
45
my $itemtypeslimit = $params->{'itemtypeslimit'};
45
my $itemtypeslimit  = $params->{'itemtypeslimit'};
46
my $ccodeslimit    = $params->{'ccodeslimit'};
46
my @locationslimits = $query->multi_param('locationslimit');
47
my $locationslimit = $params->{'locationslimit'};
47
my @ccodeslimits    = $query->multi_param('ccodeslimit');
48
49
my $locationslimit = @locationslimits ? \@locationslimits : undef;
50
my $ccodeslimit    = @ccodeslimits    ? \@ccodeslimits    : undef;
48
51
49
if ($run_report) {
52
if ($run_report) {
50
    my $items = GetHoldsQueueItems(
53
    my $items = GetHoldsQueueItems(
51
        {
54
        {
52
            branchlimit    => $branchlimit,
55
            branchlimit    => $branchlimit,
53
            itemtypeslimit => $itemtypeslimit,
56
            itemtypeslimit => $itemtypeslimit,
54
            ccodeslimit    => $ccodeslimit,
57
            ccodeslimit    => $locationslimit,
55
            locationslimit => $locationslimit
58
            locationslimit => $ccodeslimit,
56
        }
59
        }
57
    );
60
    );
58
61
59
    $template->param(
62
    $template->param(
60
        branchlimit    => $branchlimit,
63
        branchlimit    => $branchlimit,
61
        itemtypeslimit => $itemtypeslimit,
64
        itemtypeslimit => $itemtypeslimit,
62
        ccodeslimit    => $ccodeslimit,
65
        ccodeslimit    => $locationslimit,
63
        locationslimit => $locationslimit,
66
        locationslimit => $ccodeslimit,
64
        total          => $items->count,
67
        total          => $items->count,
65
        itemsloop      => $items,
68
        itemsloop      => $items,
66
        run_report     => $run_report,
69
        run_report     => $run_report,
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc (-2 / +17 lines)
Lines 47-55 Link Here
47
    [% END %]
47
    [% END %]
48
[% END %]
48
[% END %]
49
49
50
[% BLOCK options_for_authorised_values %]
50
[% BLOCK options_for_authorised_values_multiselect %]
51
    [% FOREACH av IN authorised_values %]
51
    [% FOREACH av IN authorised_values %]
52
        [% IF av.authorised_value == selected_av %]
52
        [% is_selected = 0 %]
53
        [% IF selected_av %]
54
            [% IF selected_av.defined && selected_av.size.defined %]
55
                [% FOREACH sel IN selected_av %]
56
                    [% IF sel == av.authorised_value %]
57
                        [% is_selected = 1 %]
58
                        [% LAST %]
59
                    [% END %]
60
                [% END %]
61
            [% ELSE %]
62
                [% IF av.authorised_value == selected_av %]
63
                    [% is_selected = 1 %]
64
                [% END %]
65
            [% END %]
66
        [% END %]
67
        [% IF is_selected %]
53
            <option value="[% av.authorised_value | html %]" selected="selected">[% av.lib | html %]</option>
68
            <option value="[% av.authorised_value | html %]" selected="selected">[% av.lib | html %]</option>
54
        [% ELSE %]
69
        [% ELSE %]
55
            <option value="[% av.authorised_value | html %]">[% av.lib | html %]</option>
70
            <option value="[% av.authorised_value | html %]">[% av.lib | html %]</option>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt (-7 / +40 lines)
Lines 20-25 Link Here
20
    p {
20
    p {
21
        margin-top: 0;
21
        margin-top: 0;
22
    }
22
    }
23
    #locationslimit + .select2-container,
24
    #itemtypeslimit + .select2-container {
25
        max-width: 300px !important;
26
    }
27
    .main .col-md-10 #branchlimit,
28
    .main .col-md-10 #itemtypeslimit {
29
        width: 300px;
30
    }
23
</style>
31
</style>
24
</head>
32
</head>
25
33
Lines 69-76 Link Here
69
                                    >[% total | html %] <span>items found for</span>
77
                                    >[% total | html %] <span>items found for</span>
70
                                    [% IF ( branchlimit ) %][% Branches.GetName( branchlimit ) | html %][% ELSE %]<span>All libraries</span>[% END %]
78
                                    [% IF ( branchlimit ) %][% Branches.GetName( branchlimit ) | html %][% ELSE %]<span>All libraries</span>[% END %]
71
                                    [% IF ( itemtypeslimit ) %]<span>and item type: [% ItemTypes.GetDescription( itemtypeslimit ) | html %]</span>[% END %]
79
                                    [% IF ( itemtypeslimit ) %]<span>and item type: [% ItemTypes.GetDescription( itemtypeslimit ) | html %]</span>[% END %]
72
                                    [% IF ( ccodeslimit ) %]<span>and collection: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode' authorised_value = ccodeslimit ) | html %]</span>[% END %]
80
                                    [% IF ( ccodeslimit ) %]
73
                                    [% IF ( locationslimit ) %]<span>and shelving location: [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location' authorised_value = locationslimit ) | html %]</span>[% END %]
81
                                        <span
82
                                            >and collection:
83
                                            [% FOREACH ccode IN ccodeslimit %]
84
                                                [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode' authorised_value = ccode ) | html %]
85
                                                [% UNLESS loop.last %],[% END %]
86
                                            [% END %]
87
                                        </span>
88
                                    [% END %]
89
90
                                    [% IF ( locationslimit ) %]
91
                                        <span
92
                                            >and shelving location:
93
                                            [% FOREACH loc IN locationslimit %]
94
                                                [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location' authorised_value = loc ) | html %]
95
                                                [% UNLESS loop.last %],[% END %]
96
                                            [% END %]
97
                                        </span>
98
                                    [% END %]
74
                                </div>
99
                                </div>
75
                            [% ELSE %]
100
                            [% ELSE %]
76
                                <div class="alert alert-info">No items found.</div>
101
                                <div class="alert alert-info">No items found.</div>
Lines 328-343 Link Here
328
                </li>
353
                </li>
329
                <li>
354
                <li>
330
                    <label for="ccodeslimit">Collection: </label>
355
                    <label for="ccodeslimit">Collection: </label>
331
                    <select name="ccodeslimit" id="ccodeslimit">
356
                    <select name="ccodeslimit" id="ccodeslimit" multiple="multiple">
332
                        <option value="">All</option>
357
                        <option value="">All</option>
333
                        [% PROCESS options_for_authorised_values authorised_values => AuthorisedValues.GetAuthValueDropbox( 'CCODE' ), selected_av => ccodeslimit %]
358
                        [% PROCESS options_for_authorised_values_multiselect authorised_values => AuthorisedValues.GetAuthValueDropbox( 'CCODE' ), selected_av => ccodeslimit %]
334
                    </select>
359
                    </select>
335
                </li>
360
                </li>
336
                <li>
361
                <li>
337
                    <label for="locationslimit">Shelving location: </label>
362
                    <label for="locationslimit">Shelving location: </label>
338
                    <select name="locationslimit" id="locationslimit">
363
                    <select name="locationslimit" id="locationslimit" multiple="multiple">
339
                        <option value="">All</option>
364
                        <option value="">All</option>
340
                        [% PROCESS options_for_authorised_values authorised_values => AuthorisedValues.GetAuthValueDropbox( 'LOC' ), selected_av => locationslimit %]
365
                        [% PROCESS options_for_authorised_values_multiselect authorised_values => AuthorisedValues.GetAuthValueDropbox( 'LOC' ), selected_av => locationslimit %]
341
                    </select>
366
                    </select>
342
                </li>
367
                </li>
343
            </ol>
368
            </ol>
Lines 352-361 Link Here
352
[% INCLUDE 'hold-group-modal.inc' %]
377
[% INCLUDE 'hold-group-modal.inc' %]
353
378
354
[% MACRO jsinclude BLOCK %]
379
[% MACRO jsinclude BLOCK %]
380
    [% INCLUDE 'select2.inc' %]
355
    [% INCLUDE 'datatables.inc' %]
381
    [% INCLUDE 'datatables.inc' %]
356
    [% Asset.js("js/hold-group.js") | $raw %]
382
    [% Asset.js("js/hold-group.js") | $raw %]
357
    <script>
383
    <script>
358
        $(document).ready(function() {
384
        $(document).ready(function() {
385
            // Apply select2 to all select fields having a "multiple" attribute
386
            let selectFields = document.querySelectorAll('select[multiple]');
387
            selectFields.forEach((selectField) => {
388
                $(selectField).select2({
389
                    width: "100%",
390
                    allowClear: true,
391
                });
392
            });
359
            var holdst;
393
            var holdst;
360
394
361
            // Setup filters before DataTables initialisation, in case some columns are
395
            // Setup filters before DataTables initialisation, in case some columns are
362
- 

Return to bug 40335