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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-3 / +41 lines)
Lines 1-6 Link Here
1
[% USE raw %]
1
[% USE raw %]
2
[% USE To %]
2
[% USE To %]
3
[% USE Asset %]
3
[% USE Asset %]
4
[% USE JSON.Escape %]
4
[% USE Koha %]
5
[% USE Koha %]
5
[% USE KohaDates %]
6
[% USE KohaDates %]
6
[% USE Branches %]
7
[% USE Branches %]
Lines 414-419 Link Here
414
415
415
                        [% IF ( multi_hold ) %]
416
                        [% IF ( multi_hold ) %]
416
                            <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
417
                            <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
418
                            <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
417
                            <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
419
                            <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
418
                            <input type="hidden" name="request" value="any"/>
420
                            <input type="hidden" name="request" value="any"/>
419
                            [% FOREACH biblioloo IN biblioloop %]
421
                            [% FOREACH biblioloo IN biblioloop %]
Lines 454-460 Link Here
454
                                    [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
456
                                    [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
455
                            [% ELSE %]
457
                            [% ELSE %]
456
                                <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
458
                                <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
457
                                    [% PROCESS options_for_libraries libraries => Branches.all({ selected => pickup, search_params => { pickup_location => 1 } }) %]
459
                                    <option value="" selected="selected"></option>
460
                                [% FOREACH pickup_location IN multi_pickup_locations %]
461
                                    <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
462
                                [% END %]
458
                            [% END %]
463
                            [% END %]
459
                                </select>
464
                                </select>
460
                            </li>
465
                            </li>
Lines 759-764 Link Here
759
                                    [% END %]
764
                                    [% END %]
760
                                    <th>Priority</th>
765
                                    <th>Priority</th>
761
                                    <th>Information</th>
766
                                    <th>Information</th>
767
                                    <th>Pickup location</th>
762
                                </tr>
768
                                </tr>
763
                                [% FOREACH biblioloo IN biblioloop %]
769
                                [% FOREACH biblioloo IN biblioloop %]
764
                                    [% IF ( biblioloo.warn ) %]
770
                                    [% IF ( biblioloo.warn ) %]
Lines 822-827 Link Here
822
                                                [% END %]
828
                                                [% END %]
823
                                            [% END %]
829
                                            [% END %]
824
                                        </td>
830
                                        </td>
831
                                        <td>
832
                                            <select name="pickup_[% biblioloo.biblionumber | html %]"
833
                                                    class="multi_pickup_select"
834
                                                    data-biblio-id="[% biblioloo.biblionumber | html %]"
835
                                                    data-patron-id="[% patron.borrowernumber | html %]"
836
                                                    data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
837
                                                <option value=""></option>
838
                                            [% FOREACH pickup_location IN biblioloo.pickup_locations %]
839
                                                <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
840
                                            [% END %]
841
                                            </select>
842
                                        </td>
825
                                    </tr>
843
                                    </tr>
826
                                [% END # /FOREACH biblioloo %]
844
                                [% END # /FOREACH biblioloo %]
827
                            </table> <!-- /#requesttitles -->
845
                            </table> <!-- /#requesttitles -->
Lines 1252-1261 Link Here
1252
                    templateResult: display_pickup_location
1270
                    templateResult: display_pickup_location
1253
                });
1271
                });
1254
            });
1272
            });
1273
1255
            $("#pickup_multi").select2({
1274
            $("#pickup_multi").select2({
1256
                width: 'style',
1275
                width: '30%',
1257
                allowClear: false
1276
                allowClear: true
1277
            });
1278
1279
            $('.multi_pickup_select').select2({
1280
                width: '100%',
1281
                allowClear: true
1258
            });
1282
            });
1283
1284
            $("#pickup_multi").on("change", function() {
1285
                var selection = $(this).val();
1286
                if ( selection != '' ) {
1287
                    $(".multi_pickup_select").each(function() {
1288
                        var valid_pickup_locations = $(this).data('pickup-locations');
1289
                        if ( valid_pickup_locations.includes(selection) ) {
1290
                            $(this).val(selection);
1291
                            $(this).trigger("change");
1292
                        }
1293
                    });
1294
                }
1295
            });
1296
1259
            $("#pickup").each( function () {
1297
            $("#pickup").each( function () {
1260
                var this_dropdown = $(this);
1298
                var this_dropdown = $(this);
1261
                var patron_id = $(this).data('patron-id');
1299
                var patron_id = $(this).data('patron-id');
(-)a/reserve/placerequest.pl (-3 / +4 lines)
Lines 67-74 my %bibinfos = (); Link Here
67
my @biblionumbers = split '/', $biblionumbers;
67
my @biblionumbers = split '/', $biblionumbers;
68
foreach my $bibnum (@biblionumbers) {
68
foreach my $bibnum (@biblionumbers) {
69
    my %bibinfo = ();
69
    my %bibinfo = ();
70
    $bibinfo{title} = $input->param("title_$bibnum");
70
    $bibinfo{title}  = $input->param("title_$bibnum");
71
    $bibinfo{rank} = $input->param("rank_$bibnum");
71
    $bibinfo{rank}   = $input->param("rank_$bibnum");
72
    $bibinfo{pickup} = $input->param("pickup_$bibnum");
72
    $bibinfos{$bibnum} = \%bibinfo;
73
    $bibinfos{$bibnum} = \%bibinfo;
73
}
74
}
74
75
Lines 128-134 if ( $type eq 'str8' && $borrower ) { Link Here
128
            if ( $can_override || CanBookBeReserved($borrower->{'borrowernumber'}, $biblionumber)->{status} eq 'OK' ) {
129
            if ( $can_override || CanBookBeReserved($borrower->{'borrowernumber'}, $biblionumber)->{status} eq 'OK' ) {
129
                AddReserve(
130
                AddReserve(
130
                    {
131
                    {
131
                        branchcode       => $branch,
132
                        branchcode       => $bibinfo->{pickup},
132
                        borrowernumber   => $borrower->{'borrowernumber'},
133
                        borrowernumber   => $borrower->{'borrowernumber'},
133
                        biblionumber     => $biblionumber,
134
                        biblionumber     => $biblionumber,
134
                        priority         => $bibinfo->{rank},
135
                        priority         => $bibinfo->{rank},
(-)a/reserve/request.pl (-1 / +14 lines)
Lines 286-291 $template->param( Link Here
286
# FIXME launch another time GetMember perhaps until (Joubu: Why?)
286
# FIXME launch another time GetMember perhaps until (Joubu: Why?)
287
my $patron = Koha::Patrons->find( $borrowernumber_hold );
287
my $patron = Koha::Patrons->find( $borrowernumber_hold );
288
288
289
if ( $patron && $multi_hold ) {
290
    my @multi_pickup_locations =
291
      Koha::Biblios->search( { biblionumber => \@biblionumbers } )
292
      ->pickup_locations( { patron => $patron } );
293
    $template->param( multi_pickup_locations => \@multi_pickup_locations );
294
}
295
289
my $logged_in_patron = Koha::Patrons->find( $borrowernumber );
296
my $logged_in_patron = Koha::Patrons->find( $borrowernumber );
290
297
291
my $wants_check;
298
my $wants_check;
Lines 737-742 foreach my $biblionumber (@biblionumbers) { Link Here
737
        $template->param( reserveloop => \@reserveloop );
744
        $template->param( reserveloop => \@reserveloop );
738
    }
745
    }
739
746
747
    if ( $patron ) {
748
        # Add the valid pickup locations
749
        my @pickup_locations = $biblio->pickup_locations({ patron => $patron });
750
        $biblioloopiter{pickup_locations} = \@pickup_locations;
751
        $biblioloopiter{pickup_locations_codes} = [ map { $_->branchcode } @pickup_locations ];
752
    }
753
740
    push @biblioloop, \%biblioloopiter;
754
    push @biblioloop, \%biblioloopiter;
741
}
755
}
742
756
743
- 

Return to bug 28273