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

(-)a/circ/view_holdsqueue.pl (-3 / +7 lines)
Lines 43-50 my $params = $query->Vars; Link Here
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
47
my $locationslimit = $params->{'locationslimit'};
47
my @ccodeslimits = grep { $_ && $_ ne '' } $query->multi_param('ccodeslimit');
48
my $ccodeslimit  = @ccodeslimits ? \@ccodeslimits : undef;
49
50
my @locationslimits = grep { $_ && $_ ne '' } $query->multi_param('locationslimit');
51
my $locationslimit  = @locationslimits ? \@locationslimits : undef;
48
52
49
if ($run_report) {
53
if ($run_report) {
50
    my $items = GetHoldsQueueItems(
54
    my $items = GetHoldsQueueItems(
Lines 52-58 if ($run_report) { Link Here
52
            branchlimit    => $branchlimit,
56
            branchlimit    => $branchlimit,
53
            itemtypeslimit => $itemtypeslimit,
57
            itemtypeslimit => $itemtypeslimit,
54
            ccodeslimit    => $ccodeslimit,
58
            ccodeslimit    => $ccodeslimit,
55
            locationslimit => $locationslimit
59
            locationslimit => $locationslimit,
56
        }
60
        }
57
    );
61
    );
58
62
(-)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 324-339 Link Here
324
                </li>
349
                </li>
325
                <li>
350
                <li>
326
                    <label for="ccodeslimit">Collection: </label>
351
                    <label for="ccodeslimit">Collection: </label>
327
                    <select name="ccodeslimit" id="ccodeslimit">
352
                    <select name="ccodeslimit" id="ccodeslimit" multiple="multiple">
328
                        <option value="">All</option>
353
                        <option value="">All</option>
329
                        [% PROCESS options_for_authorised_values authorised_values => AuthorisedValues.GetAuthValueDropbox( 'CCODE' ), selected_av => ccodeslimit %]
354
                        [% PROCESS options_for_authorised_values_multiselect authorised_values => AuthorisedValues.GetAuthValueDropbox( 'CCODE' ), selected_av => ccodeslimit %]
330
                    </select>
355
                    </select>
331
                </li>
356
                </li>
332
                <li>
357
                <li>
333
                    <label for="locationslimit">Shelving location: </label>
358
                    <label for="locationslimit">Shelving location: </label>
334
                    <select name="locationslimit" id="locationslimit">
359
                    <select name="locationslimit" id="locationslimit" multiple="multiple">
335
                        <option value="">All</option>
360
                        <option value="">All</option>
336
                        [% PROCESS options_for_authorised_values authorised_values => AuthorisedValues.GetAuthValueDropbox( 'LOC' ), selected_av => locationslimit %]
361
                        [% PROCESS options_for_authorised_values_multiselect authorised_values => AuthorisedValues.GetAuthValueDropbox( 'LOC' ), selected_av => locationslimit %]
337
                    </select>
362
                    </select>
338
                </li>
363
                </li>
339
            </ol>
364
            </ol>
Lines 346-354 Link Here
346
[% END %]
371
[% END %]
347
372
348
[% MACRO jsinclude BLOCK %]
373
[% MACRO jsinclude BLOCK %]
374
    [% INCLUDE 'select2.inc' %]
349
    [% INCLUDE 'datatables.inc' %]
375
    [% INCLUDE 'datatables.inc' %]
350
    <script>
376
    <script>
351
        $(document).ready(function() {
377
        $(document).ready(function() {
378
            // Apply select2 to all select fields having a "multiple" attribute
379
            let selectFields = document.querySelectorAll('select[multiple]');
380
            selectFields.forEach((selectField) => {
381
                $(selectField).select2({
382
                    width: "100%",
383
                    allowClear: true,
384
                });
385
            });
352
            var holdst;
386
            var holdst;
353
387
354
            // Setup filters before DataTables initialisation, in case some columns are
388
            // Setup filters before DataTables initialisation, in case some columns are
355
- 

Return to bug 40335