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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-20 / +32 lines)
Lines 206-219 Link Here
206
206
207
                        [% IF ( multi_hold ) %]
207
                        [% IF ( multi_hold ) %]
208
                            <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
208
                            <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
209
                            <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
210
                            <input type="hidden" name="request" value="any"/>
209
                            <input type="hidden" name="request" value="any"/>
211
                            [% FOREACH biblioloo IN biblioloop %]
210
                            [% FOREACH biblioloo IN biblioloop %]
212
                                <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
211
                                [% UNLESS biblioloo.none_avail %]
213
                                <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
212
                                    <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
213
                                    <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
214
                                    <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
215
                                [% END %]
214
                            [% END %]
216
                            [% END %]
215
                        [% ELSE %]
217
                        [% ELSE %]
216
                            <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
218
                            <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
219
                            <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
217
                            <input type="hidden" name="title" value="[% biblio.title | html %]" />
220
                            <input type="hidden" name="title" value="[% biblio.title | html %]" />
218
                            <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
221
                            <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
219
                        [% END # /IF multi_hold %]
222
                        [% END # /IF multi_hold %]
Lines 403-408 Link Here
403
                                        <li><strong>Too many holds for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]"> [% biblioloo.title | html %]</a>: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | html %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
406
                                        <li><strong>Too many holds for <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]"> [% biblioloo.title | html %]</a>: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | html %]">[% patron.firstname | html %] [% patron.surname | html %] </a> can only place a maximum of [% max_holds_for_record | html %] hold(s) on this record.</li>
404
                                    [% END %]
407
                                    [% END %]
405
                                [% END %]
408
                                [% END %]
409
                            [% ELSIF ( none_available ) %]
410
                                <li><strong>No items available: </strong>One or more records have no items that can be held</li>
406
                            [% END # /IF exceeded_maxreserves %]
411
                            [% END # /IF exceeded_maxreserves %]
407
                        [% END # /UNLESS multi_hold %]
412
                        [% END # /UNLESS multi_hold %]
408
                    </div>
413
                    </div>
Lines 450-463 Link Here
450
                        [% IF ( multi_hold ) %]
455
                        [% IF ( multi_hold ) %]
451
                            <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
456
                            <input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers | html %]"/>
452
                            <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
457
                            <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
453
                            <input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
454
                            <input type="hidden" name="request" value="any"/>
458
                            <input type="hidden" name="request" value="any"/>
455
                            [% FOREACH biblioloo IN biblioloop %]
459
                            [% FOREACH biblioloo IN biblioloop %]
456
                                <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
460
                                [% UNLESS biblioloo.none_avail %]
457
                                <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
461
                                    <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
462
                                    <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
463
                                    <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
464
                                [% END %]
458
                            [% END %]
465
                            [% END %]
459
                        [% ELSE %]
466
                        [% ELSE %]
460
                            <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
467
                            <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
468
                            <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
461
                            <input type="hidden" name="title" value="[% biblio.title | html %]" />
469
                            <input type="hidden" name="title" value="[% biblio.title | html %]" />
462
                            <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
470
                            <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
463
                        [% END # /IF multi_hold %]
471
                        [% END # /IF multi_hold %]
Lines 666-671 Link Here
666
                                                                        Library is not a pickup location
674
                                                                        Library is not a pickup location
667
                                                                    [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
675
                                                                    [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
668
                                                                        No valid pickup location
676
                                                                        No valid pickup location
677
                                                                    [% ELSIF itemloo.not_holdable == 'notforloan' %]
678
                                                                        Not for loan
669
                                                                    [% ELSE %]
679
                                                                    [% ELSE %]
670
                                                                        [% itemloo.not_holdable | html %]
680
                                                                        [% itemloo.not_holdable | html %]
671
                                                                    [% END %]
681
                                                                    [% END %]
Lines 760-765 Link Here
760
770
761
                                                        [% IF ( itemloo.notforloan ) %]
771
                                                        [% IF ( itemloo.notforloan ) %]
762
                                                           <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
772
                                                           <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
773
                                                        [% ELSIF ( itemloo.notforloanitype ) %]
774
                                                           <span class="nfl">Not for loan (Itemtype not for loan)</span>
763
                                                        [% END %]
775
                                                        [% END %]
764
                                                    </td>
776
                                                    </td>
765
                                                    <td>
777
                                                    <td>
Lines 886-898 Link Here
886
898
887
                        <fieldset class="action">
899
                        <fieldset class="action">
888
                            [% IF ( patron AND patron.borrowernumber ) %]
900
                            [% IF ( patron AND patron.borrowernumber ) %]
889
                                [% IF ( override_required ) %]
901
                                [% IF ( multi_hold ) %]
890
                                    <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
902
                                    [% IF ( override_required ) %]
891
                                [% ELSIF ( none_available ) %]
903
                                        <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
892
                                    <button class="btn btn-default" type="submit">Place holds</button>
904
                                    [% ELSIF ( no_bibs_available ) %]
893
                                [% ELSE %]
905
                                        <button type="submit" class="btn btn-default btn-disabled" disabled="disabled">Place holds</button>
894
                                    [% IF ( multi_hold ) %]
906
                                    [% ELSIF ( none_available ) %]
907
                                        <button type="submit" class="btn btn-default">Place holds</button>
908
                                    [% ELSE %]
895
                                        <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
909
                                        <button type="submit" class="btn btn-default" id="multi_hold_submit">Place holds</button>
910
                                    [% END %]
911
                                [% ELSE %]
912
                                    [% IF ( override_required ) %]
913
                                        <button type="submit" class="btn btn-default warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
914
                                    [% ELSIF ( none_available ) %]
915
                                        <button type="submit" class="btn btn-default btn-disabled" disabled="disabled">Place hold</button>
896
                                    [% ELSE %]
916
                                    [% ELSE %]
897
                                        <button type="submit" class="btn btn-default">Place hold</button>
917
                                        <button type="submit" class="btn btn-default">Place hold</button>
898
                                    [% END %]
918
                                    [% END %]
Lines 1383-1397 Link Here
1383
                return false;
1403
                return false;
1384
            }
1404
            }
1385
1405
1386
            var badSpans = $(".not_holdable");
1387
            var badBibs = "";
1388
            $(badSpans).each(function() {
1389
                var bibnum = $(this).attr("title");
1390
                badBibs += bibnum + "/";
1391
            });
1392
1393
            $("#multi_hold_bibs").val(biblionumbers);
1406
            $("#multi_hold_bibs").val(biblionumbers);
1394
            $("#bad_bibs").val(badBibs);
1395
1407
1396
            $('#hold-request-form').preventDoubleFormSubmit();
1408
            $('#hold-request-form').preventDoubleFormSubmit();
1397
1409
(-)a/reserve/placerequest.pl (-4 / +1 lines)
Lines 36-41 checkauth($input, 0, { reserveforothers => 'place_holds' }, 'intranet'); Link Here
36
36
37
my @bibitems       = $input->multi_param('biblioitem');
37
my @bibitems       = $input->multi_param('biblioitem');
38
my @reqbib         = $input->multi_param('reqbib');
38
my @reqbib         = $input->multi_param('reqbib');
39
my @holdable_bibs  = $input->multi_param('holdable_bibs');
39
my $biblionumber   = $input->param('biblionumber');
40
my $biblionumber   = $input->param('biblionumber');
40
my $borrowernumber = $input->param('borrowernumber');
41
my $borrowernumber = $input->param('borrowernumber');
41
my $notes          = $input->param('notes');
42
my $notes          = $input->param('notes');
Lines 55-61 $borrower = $borrower->unblessed if $borrower; Link Here
55
my $biblionumbers = $input->param('biblionumbers');
56
my $biblionumbers = $input->param('biblionumbers');
56
$biblionumbers ||= $biblionumber . '/';
57
$biblionumbers ||= $biblionumber . '/';
57
58
58
my $bad_bibs = $input->param('bad_bibs');
59
my $holds_to_place_count = $input->param('holds_to_place_count') || 1;
59
my $holds_to_place_count = $input->param('holds_to_place_count') || 1;
60
60
61
my %bibinfos = ();
61
my %bibinfos = ();
Lines 164-172 if ( $type eq 'str8' && $borrower ) { Link Here
164
        }
164
        }
165
    }
165
    }
166
166
167
    if ($bad_bibs) {
168
        $biblionumbers .= $bad_bibs;
169
    }
170
    print $input->redirect("request.pl?biblionumbers=$biblionumbers");
167
    print $input->redirect("request.pl?biblionumbers=$biblionumbers");
171
}
168
}
172
elsif ( $borrowernumber eq '' ) {
169
elsif ( $borrowernumber eq '' ) {
(-)a/reserve/request.pl (-4 / +8 lines)
Lines 320-325 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
320
    my $itemdata_ccode = 0;
320
    my $itemdata_ccode = 0;
321
    my @biblioloop = ();
321
    my @biblioloop = ();
322
    my $no_reserves_allowed = 0;
322
    my $no_reserves_allowed = 0;
323
    my $num_bibs_available = 0;
323
    foreach my $biblionumber (@biblionumbers) {
324
    foreach my $biblionumber (@biblionumbers) {
324
        next unless $biblionumber =~ m|^\d+$|;
325
        next unless $biblionumber =~ m|^\d+$|;
325
326
Lines 443-449 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
443
            my @available_itemtypes;
444
            my @available_itemtypes;
444
            foreach my $biblioitemnumber (@biblioitemnumbers) {
445
            foreach my $biblioitemnumber (@biblioitemnumbers) {
445
                my $biblioitem = $biblioiteminfos_of->{$biblioitemnumber};
446
                my $biblioitem = $biblioiteminfos_of->{$biblioitemnumber};
446
                my $num_available = 0;
447
                my $num_items_available = 0;
447
                my $num_override  = 0;
448
                my $num_override  = 0;
448
                my $hiddencount   = 0;
449
                my $hiddencount   = 0;
449
                my $num_alreadyheld = 0;
450
                my $num_alreadyheld = 0;
Lines 556-561 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
556
                    }
557
                    }
557
558
558
                    # If there is no loan, return and transfer, we show a checkbox.
559
                    # If there is no loan, return and transfer, we show a checkbox.
560
                    $item->{notforloanitype} = $itemtypes->{$item->{itype}}{notforloan};
559
                    $item->{notforloan} ||= 0;
561
                    $item->{notforloan} ||= 0;
560
562
561
                    # if independent branches is on we need to check if the person can reserve
563
                    # if independent branches is on we need to check if the person can reserve
Lines 580-585 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
580
582
581
                        my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $itemnumber )->{status};
583
                        my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $itemnumber )->{status};
582
                        $item->{not_holdable} = $can_item_be_reserved unless ( $can_item_be_reserved eq 'OK' );
584
                        $item->{not_holdable} = $can_item_be_reserved unless ( $can_item_be_reserved eq 'OK' );
585
                        $item->{not_holdable} ||= 'notforloan' if ( $item->{notforloanitype} || $item->{notforloan} > 0 );
583
586
584
                        $item->{item_level_holds} = Koha::CirculationRules->get_opacitemholds_policy( { item => $item_object, patron => $patron } );
587
                        $item->{item_level_holds} = Koha::CirculationRules->get_opacitemholds_policy( { item => $item_object, patron => $patron } );
585
588
Lines 597-603 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
597
                            $item->{pickup_locations_count} = scalar @pickup_locations;
600
                            $item->{pickup_locations_count} = scalar @pickup_locations;
598
601
599
                            if ( @pickup_locations ) {
602
                            if ( @pickup_locations ) {
600
                                $num_available++;
603
                                $num_items_available++;
601
                                $item->{available} = 1;
604
                                $item->{available} = 1;
602
605
603
                                my $default_pickup_location;
606
                                my $default_pickup_location;
Lines 659-665 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
659
                if ( $num_override > 0 && ($num_override + $num_alreadyheld) == scalar( @{ $biblioitem->{itemloop} } ) ) {
662
                if ( $num_override > 0 && ($num_override + $num_alreadyheld) == scalar( @{ $biblioitem->{itemloop} } ) ) {
660
                # That is, if all items require an override
663
                # That is, if all items require an override
661
                    $template->param( override_required => 1 );
664
                    $template->param( override_required => 1 );
662
                } elsif ( $num_available == 0 ) {
665
                } elsif ( $num_items_available == 0 ) {
663
                    $template->param( none_available => 1 );
666
                    $template->param( none_available => 1 );
664
                    $biblioloopiter{warn} = 1;
667
                    $biblioloopiter{warn} = 1;
665
                    $biblioloopiter{none_avail} = 1;
668
                    $biblioloopiter{none_avail} = 1;
Lines 767-775 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
767
            $biblioloopiter{pickup_locations_codes} = [ map { $_->branchcode } @pickup_locations ];
770
            $biblioloopiter{pickup_locations_codes} = [ map { $_->branchcode } @pickup_locations ];
768
        }
771
        }
769
772
773
        $num_bibs_available++ unless $biblioloopiter{none_avail};
770
        push @biblioloop, \%biblioloopiter;
774
        push @biblioloop, \%biblioloopiter;
771
    }
775
    }
772
776
777
    $template->param( no_bibs_available => 1 ) unless $num_bibs_available > 0;
773
    $template->param( biblioloop => \@biblioloop );
778
    $template->param( biblioloop => \@biblioloop );
774
    $template->param( no_reserves_allowed => $no_reserves_allowed );
779
    $template->param( no_reserves_allowed => $no_reserves_allowed );
775
    $template->param( exceeded_maxreserves => $exceeded_maxreserves );
780
    $template->param( exceeded_maxreserves => $exceeded_maxreserves );
776
- 

Return to bug 30742