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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-202 / +202 lines)
Lines 283-289 Link Here
283
                                <tr>
283
                                <tr>
284
                                    <th>&nbsp;</th>
284
                                    <th>&nbsp;</th>
285
                                    <th>Title</th>
285
                                    <th>Title</th>
286
                                    [% UNLESS ( item_level_itypes ) %]
286
                                    [% UNLESS Koha.Preference('item-level_itypes') %]
287
                                        <th>Item type</th>
287
                                        <th>Item type</th>
288
                                    [% END %]
288
                                    [% END %]
289
                                    <th>Priority</th>
289
                                    <th>Priority</th>
Lines 315-323 Link Here
315
                                                <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
315
                                                <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
316
                                            [% END %]
316
                                            [% END %]
317
                                        </td>
317
                                        </td>
318
                                        [% UNLESS ( item_level_itypes ) %]
318
                                        [% UNLESS Koha.Preference('item-level_itypes') %]
319
                                            <td>
319
                                            <td>
320
                                                <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
320
                                                <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
321
                                            </td>
321
                                            </td>
322
                                        [% END %]
322
                                        [% END %]
323
                                        <td>[% biblioloo.rank | html %]</td>
323
                                        <td>[% biblioloo.rank | html %]</td>
Lines 571-792 Link Here
571
                                [% END %]
571
                                [% END %]
572
                            </fieldset>
572
                            </fieldset>
573
573
574
                            [% FOREACH bibitemloo IN bibitemloop %]
574
                            [% biblio = biblioloop.0 %]
575
                                <ol>
576
                                    [% UNLESS ( item_level_itypes ) %]
577
                                        <li>
578
                                            <span class="label">Item type:</span>
579
                                            [% bibitemloo.description | html %]
580
                                        </li>
581
                                    [% END %]
582
575
583
                                    [% IF ( bibitemloo.publicationyear ) %]
576
                            <ol>
584
                                        <li>
577
                                [% UNLESS Koha.Preference('item-level_itypes') %]
585
                                            <span class="label">Publication year:</span>
578
                                    <li>
586
                                            [% bibitemloo.publicationyear | html %]
579
                                        <span class="label">Item typeX:</span>
587
                                        </li>
580
                                        [% biblio.itemtype.translated_description | html %]
588
                                    [% END %]
581
                                    </li>
589
                                </ol>
582
                                [% END %]
590
583
591
                                <h2 style="padding: 0 1em;">
584
                                [% IF ( biblio.biblioitem.publicationyear ) %]
592
                                    Place a hold on a specific item
585
                                    <li>
593
                                    [% IF bibitemloo.force_hold_level == 'item' %]
586
                                        <span class="label">Publication year:</span>
594
                                         <span class="error"><em>(Required)</em></span>
587
                                        [% biblio.biblioitem.publicationyear | $KohaDates %]
595
                                    [% END %]
588
                                    </li>
596
                                </h2>
589
                                [% END %]
590
                            </ol>
597
591
598
                                <table id="requestspecific">
592
                            <h2 style="padding: 0 1em;">
599
                                    <thead>
593
                                Place a hold on a specific item
600
                                        <tr>
594
                                [% IF force_hold_level == 'item' %]
601
                                            <th>Hold</th>
595
                                     <span class="error"><em>(Required)</em></span>
602
                                            [% IF ( item_level_itypes ) %]
596
                                [% END %]
603
                                                <th>Item type</th>
597
                            </h2>
604
                                            [% END %]
598
605
                                            <th>Barcode</th>
599
                            <table id="requestspecific">
606
                                            <th>Home library</th>
600
                                <thead>
607
                                            <th>Last location</th>
601
                                    <tr>
608
                                            [% IF itemdata_ccode %]
602
                                        <th>Hold</th>
609
                                                <th>Collection</th>
603
                                        [% IF Koha.Preference('item-level_itypes') %]
610
                                            [% END %]
604
                                            <th>Item type</th>
611
                                            <th>Call number</th>
605
                                        [% END %]
612
                                            <th>Copy number</th>
606
                                        <th>Barcode</th>
613
                                            [% IF itemdata_enumchron %]
607
                                        <th>Home library</th>
614
                                                <th>Vol no.</th>
608
                                        <th>Last location</th>
615
                                            [% END %]
609
                                        [% IF itemdata_ccode %]
616
                                            <th>Information</th>
610
                                            <th>Collection</th>
617
                                            <th>Allowed pickup locations</th>
611
                                        [% END %]
618
                                        </tr>
612
                                        <th>Call number</th>
619
                                    </thead>
613
                                        <th>Copy number</th>
620
                                    <tbody>
614
                                        [% IF itemdata_enumchron %]
621
                                        [% SET selected = 0 %]
615
                                            <th>Vol no.</th>
622
                                        [% FOREACH itemloo IN bibitemloo.itemloop %]
616
                                        [% END %]
623
                                            [% UNLESS ( itemloo.hide ) %]
617
                                        <th>Information</th>
624
                                                <tr class="[% itemloo.backgroundcolor | html %]">
618
                                        <th>Allowed pickup locations</th>
625
                                                    <td>
619
                                    </tr>
626
                                                        [% IF itemloo.force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
620
                                </thead>
627
                                                            <span class="error">
621
                                <tbody>
628
                                                                <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
622
                                    [% SET selected = 0 %]
629
                                                                Hold must be record level
623
                                    [% FOREACH itemloo IN biblio.itemloop %]
630
                                                            </span>
624
                                        [% UNLESS ( itemloo.hide ) %]
631
                                                        [% ELSIF ( itemloo.available ) %]
625
                                            <tr class="[% itemloo.backgroundcolor | html %]">
632
                                                            <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
626
                                                <td>
633
                                                        [% ELSIF ( itemloo.override ) %]
627
                                                    [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
634
                                                            <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
628
                                                        <span class="error">
635
                                                            <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
629
                                                            <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
636
                                                        [% ELSE %]
630
                                                            Hold must be record level
637
                                                            <span class="error">
631
                                                        </span>
638
                                                                <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
632
                                                    [% ELSIF ( itemloo.available ) %]
639
                                                                [% IF itemloo.not_holdable %]
633
                                                        <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
640
                                                                    [% IF itemloo.not_holdable == 'damaged' %]
634
                                                    [% ELSIF ( itemloo.override ) %]
641
                                                                        Item damaged
635
                                                        <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
642
                                                                    [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
636
                                                        <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
643
                                                                        Age restricted
637
                                                    [% ELSE %]
644
                                                                    [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
638
                                                        <span class="error">
645
                                                                        Exceeded max holds per record
639
                                                            <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
646
                                                                    [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
640
                                                            [% IF itemloo.not_holdable %]
647
                                                                        Daily hold limit reached for patron
641
                                                                [% IF itemloo.not_holdable == 'damaged' %]
648
                                                                    [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
642
                                                                    Item damaged
649
                                                                        Too many holds
643
                                                                [% ELSIF itemloo.not_holdable == 'ageRestricted' %]
650
                                                                    [% ELSIF itemloo.not_holdable == 'notReservable' %]
644
                                                                    Age restricted
651
                                                                        Not holdable
645
                                                                [% ELSIF itemloo.not_holdable == 'tooManyHoldsForThisRecord' %]
652
                                                                    [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
646
                                                                    Exceeded max holds per record
653
                                                                        Patron is from different library
647
                                                                [% ELSIF itemloo.not_holdable == 'tooManyReservesToday' %]
654
                                                                    [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
648
                                                                    Daily hold limit reached for patron
655
                                                                        Cannot place hold from patron's library
649
                                                                [% ELSIF itemloo.not_holdable == 'tooManyReserves' %]
656
                                                                    [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
650
                                                                    Too many holds
657
                                                                        Patron already has hold for this item
651
                                                                [% ELSIF itemloo.not_holdable == 'notReservable' %]
658
                                                                    [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
652
                                                                    Not holdable
659
                                                                        Cannot be transferred to pickup library
653
                                                                [% ELSIF itemloo.not_holdable == 'cannotReserveFromOtherBranches' %]
660
                                                                    [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
654
                                                                    Patron is from different library
661
                                                                        Only pickup locations within the same hold group are allowed
655
                                                                [% ELSIF itemloo.not_holdable == 'branchNotInHoldGroup' %]
662
                                                                    [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
656
                                                                    Cannot place hold from patron's library
663
                                                                        No reserves are allowed on this item
657
                                                                [% ELSIF itemloo.not_holdable == 'itemAlreadyOnHold' %]
664
                                                                    [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
658
                                                                    Patron already has hold for this item
665
                                                                        Library is not a pickup location
659
                                                                [% ELSIF itemloo.not_holdable == 'cannotBeTransferred' %]
666
                                                                    [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
660
                                                                    Cannot be transferred to pickup library
667
                                                                        No valid pickup location
661
                                                                [% ELSIF itemloo.not_holdable == 'pickupNotInHoldGroup' %]
668
                                                                    [% ELSE %]
662
                                                                    Only pickup locations within the same hold group are allowed
669
                                                                        [% itemloo.not_holdable | html %]
663
                                                                [% ELSIF itemloo.not_holdable == 'noReservesAllowed' %]
670
                                                                    [% END %]
664
                                                                    No reserves are allowed on this item
665
                                                                [% ELSIF itemloo.not_holdable == 'libraryNotPickupLocation' %]
666
                                                                    Library is not a pickup location
667
                                                                [% ELSIF itemloo.not_holdable == 'no_valid_pickup_location' %]
668
                                                                    No valid pickup location
669
                                                                [% ELSE %]
670
                                                                    [% itemloo.not_holdable | html %]
671
                                                                [% END %]
671
                                                                [% END %]
672
                                                            </span>
673
                                                        [% END # /IF itemloo.force_hold_level %]
674
                                                    </td>
675
                                                    [% IF ( item_level_itypes ) %]
676
                                                        <td>
677
                                                            [% UNLESS ( noItemTypeImages ) %]
678
                                                                [% IF ( itemloo.imageurl ) %]<img src="[% itemloo.imageurl | html %]" alt="" /> <br /> [% END %]
679
                                                            [% END %]
672
                                                            [% END %]
680
                                                            [% itemloo.itypename | html %]
673
                                                        </span>
681
                                                        </td>
674
                                                    [% END # /IF force_hold_level %]
682
                                                    [% END %]
675
                                                </td>
683
                                                    <td>
676
                                                [% IF Koha.Preference('item-level_itypes') %]
684
                                                        [% itemloo.barcode | html %]
685
                                                    </td>
686
                                                    <td>
677
                                                    <td>
687
                                                        [% Branches.GetName( itemloo.homebranch ) | html %]
678
                                                        [% UNLESS ( noItemTypeImages ) %]
679
                                                            [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %]
680
                                                        [% END %]
681
                                                        [% itemloo.itemtype.translated_description | html %]
688
                                                    </td>
682
                                                    </td>
683
                                                [% END %]
684
                                                <td>
685
                                                    [% itemloo.barcode | html %]
686
                                                </td>
687
                                                <td>
688
                                                    [% Branches.GetName( itemloo.homebranch ) | html %]
689
                                                </td>
690
                                                <td>
691
                                                    [% Branches.GetName( itemloo.holdingbranch ) | html %]
692
                                                </td>
693
                                                [% IF itemdata_ccode %]
689
                                                    <td>
694
                                                    <td>
690
                                                        [% Branches.GetName( itemloo.holdingbranch ) | html %]
695
                                                        [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
691
                                                    </td>
696
                                                    </td>
692
                                                    [% IF itemdata_ccode %]
697
                                                [% END %]
693
                                                        <td>
698
                                                <td>
694
                                                            [% IF ( itemloo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemloo.ccode ) | html %][% END %]
699
                                                    [% itemloo.itemcallnumber | html %]
695
                                                        </td>
700
                                                </td>
696
                                                    [% END %]
701
                                                <td>
702
                                                    [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %]&nbsp;[% END %]
703
                                                </td>
704
                                                [% IF itemdata_enumchron %]
697
                                                    <td>
705
                                                    <td>
698
                                                        [% itemloo.itemcallnumber | html %]
706
                                                        [% itemloo.enumchron | html %]
699
                                                    </td>
707
                                                    </td>
708
                                                [% END %]
709
                                                [% IF ( itemloo.onloan ) %]
710
                                                    <td data-order="[% itemloo.date_due | html %]">
711
                                                        <span class="checkedout">Due [% itemloo.date_due | $KohaDates  as_due_date => 1 %]</span>
712
                                                [% ELSE %]
700
                                                    <td>
713
                                                    <td>
701
                                                        [% IF ( itemloo.copynumber ) %][% itemloo.copynumber | html %][% ELSE %]&nbsp;[% END %]
714
                                                        [% IF ( itemloo.transfertwhen ) %]
702
                                                    </td>
715
                                                            In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
703
                                                    [% IF itemdata_enumchron %]
716
                                                            to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
704
                                                        <td>
717
                                                        [% END %]
705
                                                            [% itemloo.enumchron | html %]
718
                                                [% END %]
706
                                                        </td>
707
                                                    [% END %]
708
                                                    [% IF ( itemloo.onloan ) %]
709
                                                        <td data-order="[% itemloo.date_due | html %]">
710
                                                            <span class="checkedout">Due [% itemloo.date_due | $KohaDates  as_due_date => 1 %]</span>
711
                                                    [% ELSE %]
712
                                                        <td>
713
                                                            [% IF ( itemloo.transfertwhen ) %]
714
                                                                In transit from [% Branches.GetName( itemloo.transfertfrom ) | html %],
715
                                                                to [% Branches.GetName( itemloo.transfertto ) | html %], since [% itemloo.transfertwhen | html %]
716
                                                            [% END %]
717
                                                    [% END %]
718
719
719
                                                        [% IF ( itemloo.reservedate ) %]
720
                                                    [% IF ( itemloo.reservedate ) %]
720
                                                            [% IF ( itemloo.nocancel ) %]
721
                                                        [% IF ( itemloo.nocancel ) %]
721
                                                                    Can't be cancelled when item is in transit
722
                                                                Can't be cancelled when item is in transit
723
                                                        [% ELSE %]
724
                                                            [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
725
                                                            [% IF ( itemloo.canreservefromotherbranches ) %]
726
                                                                for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
727
                                                            [% END %]
728
                                                            [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
729
                                                            [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
730
                                                            [% IF ( itemloo.waitingdate ) %]
731
                                                                [% itemloo.waitingdate | $KohaDates %]
722
                                                            [% ELSE %]
732
                                                            [% ELSE %]
723
                                                                [% IF ( itemloo.waitingdate ) %]Waiting[% ELSE %]On hold[% END %]
733
                                                                [% IF ( itemloo.reservedate ) %]
724
                                                                [% IF ( itemloo.canreservefromotherbranches ) %]
734
                                                                    [% itemloo.reservedate | html %]
725
                                                                    for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedFor.borrowernumber | uri %]">[% itemloo.ReservedFor.firstname | html %] [% itemloo.ReservedFor.surname | html %]</a>
726
                                                                [% END %]
735
                                                                [% END %]
727
                                                                [% IF ( itemloo.waitingdate ) %]at[% ELSE %]expected at[% END %]
736
                                                            [% END %].
728
                                                                [% Branches.GetName( itemloo.ExpectedAtLibrary ) | html %] since
737
                                                            <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&amp;CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&amp;CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
729
                                                                [% IF ( itemloo.waitingdate ) %]
738
                                                        [% END # /IF itemloo.nocancel %]
730
                                                                    [% itemloo.waitingdate | $KohaDates %]
739
                                                    [% ELSE %]
731
                                                                [% ELSE %]
740
                                                        Not on hold
732
                                                                    [% IF ( itemloo.reservedate ) %]
741
                                                    [% END # /IF itemloo.reservedate %]
733
                                                                        [% itemloo.reservedate | html %]
734
                                                                    [% END %]
735
                                                                [% END %].
736
                                                                <a class="info cancel-hold" href="modrequest.pl?CancelBiblioNumber=[% itemloo.biblionumber | html %]&amp;CancelBorrowerNumber=[% itemloo.ReservedFor.borrowernumber | html %]&amp;CancelItemnumber=[% itemloo.itemnumber | html %]">Cancel hold</a>
737
                                                            [% END # /IF itemloo.nocancel %]
738
                                                        [% ELSE %]
739
                                                            Not on hold
740
                                                        [% END # /IF itemloo.reservedate %]
741
742
742
                                                        [% IF itemloo.item_level_holds == "N" %]
743
                                                    [% IF itemloo.item_level_holds == "N" %]
743
                                                            <br/>Item level hold not allowed from OPAC
744
                                                        <br/>Item level hold not allowed from OPAC
744
                                                        [% ELSIF itemloo.item_level_holds == "F" %]
745
                                                    [% ELSIF itemloo.item_level_holds == "F" %]
745
                                                            <br/>Item level hold forced from OPAC
746
                                                        <br/>Item level hold forced from OPAC
746
                                                        [% END %]
747
                                                    [% END %]
747
748
748
                                                        [% IF ( itemloo.itemlost ) %]
749
                                                    [% IF ( itemloo.itemlost ) %]
749
                                                           <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
750
                                                       <span class="lost">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => itemloo.itemlost ) | html %]</span>
750
                                                        [% END %]
751
                                                    [% END %]
751
752
752
                                                        [% IF ( itemloo.damaged ) %]
753
                                                    [% IF ( itemloo.damaged ) %]
753
                                                            <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
754
                                                        <span class="dmg">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => itemloo.damaged ) | html %]</span>
754
                                                        [% END %]
755
                                                    [% END %]
755
756
756
                                                        [% IF ( itemloo.withdrawn ) %]
757
                                                    [% IF ( itemloo.withdrawn ) %]
757
                                                           <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
758
                                                       <span class="wdn">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => itemloo.withdrawn ) | html %]</span>
758
                                                        [% END %]
759
                                                    [% END %]
759
760
760
                                                        [% IF ( itemloo.notforloan ) %]
761
                                                    [% IF ( itemloo.notforloan ) %]
761
                                                           <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
762
                                                       <span class="nfl">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemloo.notforloan ) | html %])</span>
762
                                                        [% END %]
763
                                                    </td>
764
                                                    <td>
765
                                                    [% IF (itemloo.pickup_locations_count > 0) %]
766
                                                        <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations"
767
                                                                data-item-id="[% itemloo.itemnumber | html %]"
768
                                                                data-patron-id="[% patron.borrowernumber | html %]"
769
                                                                data-pickup-location-source="item">
770
                                                        [% IF (itemloo.default_pickup_location) %]
771
                                                            <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
772
                                                        [% END %]
773
                                                        </select>
774
                                                    [% END %]
763
                                                    [% END %]
775
                                                    </td>
764
                                                </td>
776
                                                </tr>
765
                                                <td>
777
                                            [% END # / UNLESS itemloo.hide %]
766
                                                [% IF (itemloo.pickup_locations_count > 0) %]
778
                                        [% END # /FOREACH itemloo %]
767
                                                    <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations"
779
                                    </tbody>
768
                                                            data-item-id="[% itemloo.itemnumber | html %]"
780
                                </table> <!-- /#requestspecific -->
769
                                                            data-patron-id="[% patron.borrowernumber | html %]"
781
770
                                                            data-pickup-location-source="item">
782
                                [% IF ( bibitemloo.hiddencount ) %]
771
                                                    [% IF (itemloo.default_pickup_location) %]
783
                                    <form>
772
                                                        <option value="[% itemloo.default_pickup_location.branchcode | html %]" selected="selected">[% itemloo.default_pickup_location.branchname | html %]</option>
784
                                        <p class="hiddencount">
773
                                                    [% END %]
785
                                            <a href="request.pl?biblionumber=[% bibitemloo.biblionumber | uri %]&amp;borrowernumber=[% bibitemloo.borrowernumber | uri %]&amp;showallitems=1">Show all items ([% bibitemloo.hiddencount | html %] hidden)</a>
774
                                                    </select>
786
                                        </p>
775
                                                [% END %]
787
                                    </form>
776
                                                </td>
788
                                [% END # /IF bibitemloo.hiddencount %]
777
                                            </tr>
789
                            [% END # /FOREACH bibitemloo %]
778
                                        [% END # / UNLESS itemloo.hide %]
779
                                    [% END # /FOREACH itemloo %]
780
                                </tbody>
781
                            </table> <!-- /#requestspecific -->
782
783
                            [% IF hiddencount %]
784
                                <form>
785
                                    <p class="hiddencount">
786
                                        <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;borrowernumber=[% borrowernumber | uri %]&amp;showallitems=1">Show all items ([% biblio.hiddencount | html %] hidden)</a>
787
                                    </p>
788
                                </form>
789
                            [% END # /IF hiddencount %]
790
790
791
                        [% ELSE # /UNLESS multi_hold %]
791
                        [% ELSE # /UNLESS multi_hold %]
792
792
Lines 794-800 Link Here
794
                                <tr>
794
                                <tr>
795
                                    <th>&nbsp;</th>
795
                                    <th>&nbsp;</th>
796
                                    <th>Title</th>
796
                                    <th>Title</th>
797
                                    [% UNLESS ( item_level_itypes ) %]
797
                                    [% UNLESS Koha.Preference('item-level_itypes') %]
798
                                        <th>Item type</th>
798
                                        <th>Item type</th>
799
                                    [% END %]
799
                                    [% END %]
800
                                    <th>Priority</th>
800
                                    <th>Priority</th>
Lines 827-835 Link Here
827
                                                <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
827
                                                <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
828
                                            [% END %]
828
                                            [% END %]
829
                                        </td>
829
                                        </td>
830
                                        [% UNLESS ( item_level_itypes ) %]
830
                                        [% UNLESS Koha.Preference('item-level_itypes') %]
831
                                            <td>
831
                                            <td>
832
                                                <img src="[% biblioloo.imageurl | html %]" alt="[% biblioloo.itypename | html %]" title="[% biblioloo.itypename | html %]" />
832
                                                <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
833
                                            </td>
833
                                            </td>
834
                                        [% END %]
834
                                        [% END %]
835
                                        <td>[% biblioloo.rank | html %]</td>
835
                                        <td>[% biblioloo.rank | html %]</td>
Lines 1140-1146 Link Here
1140
        var biblionumber = "[% biblionumber | $raw %]";
1140
        var biblionumber = "[% biblionumber | $raw %]";
1141
        var borrowernumber = "[% patron.borrowernumber | $raw %]";
1141
        var borrowernumber = "[% patron.borrowernumber | $raw %]";
1142
        var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1142
        var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]";
1143
        var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %]
1143
        var override_items = {[% FOREACH biblio IN biblioloop %][% FOREACH itemloo IN biblio.itemloop %][% IF ( itemloo.override ) %]
1144
        [% itemloo.itemnumber | html %]: {
1144
        [% itemloo.itemnumber | html %]: {
1145
            homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1145
            homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]",
1146
            holdallowed: "[% itemloo.holdallowed | html %]"
1146
            holdallowed: "[% itemloo.holdallowed | html %]"
(-)a/reserve/request.pl (-220 / +157 lines)
Lines 68-74 my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( Link Here
68
my $showallitems = $input->param('showallitems');
68
my $showallitems = $input->param('showallitems');
69
my $pickup = $input->param('pickup');
69
my $pickup = $input->param('pickup');
70
70
71
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
71
my $itemtypes = {
72
    map {
73
        $_->itemtype =>
74
          { %{ $_->unblessed }, image_location => $_->image_location }
75
    } Koha::ItemTypes->search_with_localization->as_list
76
};
72
77
73
# Select borrowers infos
78
# Select borrowers infos
74
my $findborrower = $input->param('findborrower');
79
my $findborrower = $input->param('findborrower');
Lines 326-332 foreach my $biblionumber (@biblionumbers) { Link Here
326
        last;
331
        last;
327
    }
332
    }
328
333
329
    my $force_hold_level;
330
    if ( $patron ) {
334
    if ( $patron ) {
331
        { # CanBookBeReserved
335
        { # CanBookBeReserved
332
            my $canReserve = CanBookBeReserved( $patron->borrowernumber, $biblionumber );
336
            my $canReserve = CanBookBeReserved( $patron->borrowernumber, $biblionumber );
Lines 370-378 foreach my $biblionumber (@biblionumbers) { Link Here
370
                found          => undef,
374
                found          => undef,
371
            }
375
            }
372
        );
376
        );
373
        $force_hold_level = $holds->forced_hold_level();
377
        $template->param( force_hold_level => $holds->forced_hold_level() );
374
        $biblioloopiter{force_hold_level} = $force_hold_level;
375
        $template->param( force_hold_level => $force_hold_level );
376
378
377
        # For a librarian to be able to place multiple record holds for a patron for a record,
379
        # For a librarian to be able to place multiple record holds for a patron for a record,
378
        # we must find out what the maximum number of holds they can place for the patron is
380
        # we must find out what the maximum number of holds they can place for the patron is
Lines 383-590 foreach my $biblionumber (@biblionumbers) { Link Here
383
        $template->param( remaining_holds_for_record => $remaining_holds_for_record );
385
        $template->param( remaining_holds_for_record => $remaining_holds_for_record );
384
    }
386
    }
385
387
386
387
    my $count = Koha::Holds->search( { biblionumber => $biblionumber } )->count();
388
    my $totalcount = $count;
389
390
    # adding a fixed value for priority options
388
    # adding a fixed value for priority options
391
    my $fixedRank = $count+1;
389
    my $fixedRank = $biblio->holds->count + 1;
392
390
393
    my %itemnumbers_of_biblioitem;
391
    my @items = $biblio->items->as_list;
394
392
395
    my @hostitems = get_hostitemnumbers_of($biblionumber);
393
    my @host_items = $biblio->host_items->as_list;
396
    my @itemnumbers;
394
    if (@host_items) {
397
    if (@hostitems){
395
        push @items, @host_items;
398
        push(@itemnumbers, @hostitems);
399
    }
396
    }
400
397
401
    my $items = Koha::Items->search({ -or => { biblionumber => $biblionumber, itemnumber => { in => \@itemnumbers } } });
398
    unless ( @items ) {
402
403
    unless ( $items->count ) {
404
        # FIXME Then why do we continue?
399
        # FIXME Then why do we continue?
405
        $template->param('noitems' => 1) unless ( $multi_hold );
400
        $template->param('noitems' => 1) unless ( $multi_hold );
406
        $biblioloopiter{noitems} = 1;
401
        $biblioloopiter{noitems} = 1;
407
    }
402
    }
408
403
409
    ## Here we go backwards again to create hash of biblioitemnumber to itemnumbers
410
    ## this is important when we have analytic items which may be on another record
411
    my ( $iteminfos_of );
412
    while ( my $item = $items->next ) {
413
        $item = $item->unblessed;
414
        my $biblioitemnumber = $item->{biblioitemnumber};
415
        my $itemnumber = $item->{itemnumber};
416
        push( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} }, $itemnumber );
417
        $iteminfos_of->{$itemnumber} = $item;
418
    }
419
420
    my @biblioitemnumbers = keys %itemnumbers_of_biblioitem;
421
422
    my $biblioiteminfos_of = {
423
        map {
424
            my $biblioitem = $_;
425
            ( $biblioitem->{biblioitemnumber} => $biblioitem )
426
          } @{ Koha::Biblioitems->search(
427
                { biblioitemnumber => { -in => \@biblioitemnumbers } },
428
                { select => ['biblionumber', 'biblioitemnumber', 'publicationyear', 'itemtype']}
429
            )->unblessed
430
          }
431
    };
432
433
    my @bibitemloop;
434
435
    my @available_itemtypes;
404
    my @available_itemtypes;
436
    foreach my $biblioitemnumber (@biblioitemnumbers) {
405
    my $num_available = 0;
437
        my $biblioitem = $biblioiteminfos_of->{$biblioitemnumber};
406
    my $num_override  = 0;
438
        my $num_available = 0;
407
    my $hiddencount   = 0;
439
        my $num_override  = 0;
408
    my $num_alreadyheld = 0;
440
        my $hiddencount   = 0;
409
441
        my $num_alreadyheld = 0;
410
    # iterating through all items first to check if any of them available
442
411
    # to pass this value further inside down to IsAvailableForItemLevelRequest to
443
        $biblioitem->{force_hold_level} = $force_hold_level;
412
    # it's complicated logic to analyse.
444
413
    # (before this loop was inside that sub loop so it was O(n^2) )
445
        $biblioloopiter{description} = $biblioitem->{description};
414
    my $items_any_available;
446
        $biblioloopiter{itypename}   = $biblioitem->{description};
415
    $items_any_available = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblio->biblionumber, patron => $patron })
447
        if ( $biblioitem->{itemtype} ) {
416
        if $patron;
448
417
449
            $biblioitem->{description} =
418
    for my $item_object ( @items ) {
450
              $itemtypes->{ $biblioitem->{itemtype} }{description};
419
        my $do_check;
451
420
        my $item = $item_object->unblessed;
452
            $biblioloopiter{imageurl} =
421
        if ( $patron ) {
453
              getitemtypeimagelocation( 'intranet',
422
            $do_check = $patron->do_check_for_previous_checkout($item) if $wants_check;
454
                $itemtypes->{ $biblioitem->{itemtype} }{imageurl} );
423
            if ( $do_check && $wants_check ) {
455
        }
424
                $item->{checked_previously} = $do_check;
456
425
                if ( $multi_hold ) {
457
        # iterating through all items first to check if any of them available
426
                    $biblioloopiter{checked_previously} = $do_check;
458
        # to pass this value further inside down to IsAvailableForItemLevelRequest to
427
                } else {
459
        # it's complicated logic to analyse.
428
                    $template->param( checked_previously => $do_check );
460
        # (before this loop was inside that sub loop so it was O(n^2) )
461
        my $items_any_available;
462
        $items_any_available = ItemsAnyAvailableAndNotRestricted( { biblionumber => $biblioitem->{biblionumber}, patron => $patron })
463
            if $patron;
464
465
        foreach my $itemnumber ( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} } )    {
466
            my $item = $iteminfos_of->{$itemnumber};
467
            my $do_check;
468
            if ( $patron ) {
469
                $do_check = $patron->do_check_for_previous_checkout($item) if $wants_check;
470
                if ( $do_check && $wants_check ) {
471
                    $item->{checked_previously} = $do_check;
472
                    if ( $multi_hold ) {
473
                        $biblioloopiter{checked_previously} = $do_check;
474
                    } else {
475
                        $template->param( checked_previously => $do_check );
476
                    }
477
                }
429
                }
478
            }
430
            }
479
            $item->{force_hold_level} = $force_hold_level;
431
        }
480
481
            unless (C4::Context->preference('item-level_itypes')) {
482
                $item->{itype} = $biblioitem->{itemtype};
483
            }
484
432
485
            $item->{itypename} = $itemtypes->{ $item->{itype} }{description};
433
        $item->{itemtype} = $itemtypes->{ $item_object->effective_itemtype };
486
            $item->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $item->{itype} }{imageurl} );
487
            $item->{homebranch} = $item->{homebranch};
488
434
489
            # if the holdingbranch is different than the homebranch, we show the
435
        if($item->{biblionumber} ne $biblio->biblionumber){
490
            # holdingbranch of the document too
436
            $item->{hosttitle} = Koha::Biblios->find( $item->{biblionumber} )->title;
491
            if ( $item->{homebranch} ne $item->{holdingbranch} ) {
437
        }
492
                $item->{holdingbranch} = $item->{holdingbranch};
493
            }
494
438
495
            if($item->{biblionumber} ne $biblionumber){
439
        # if the item is currently on loan, we display its return date and
496
                $item->{hosttitle} = Koha::Biblios->find( $item->{biblionumber} )->title;
440
        # change the background color
497
            }
441
        my $issue = $item_object->checkout;
442
        if ( $issue ) { # FIXME must be moved to the template
443
            $item->{date_due} = $issue->date_due;
444
            $item->{backgroundcolor} = 'onloan';
445
        }
498
446
499
            # if the item is currently on loan, we display its return date and
447
        # checking reserve
500
            # change the background color
448
        my $holds = $item_object->current_holds;
501
            my $issue = Koha::Checkouts->find( { itemnumber => $itemnumber } );
449
        if ( my $first_hold = $holds->next ) {
502
            if ( $issue ) {
450
            my $p = Koha::Patrons->find( $first_hold->borrowernumber );
503
                $item->{date_due} = $issue->date_due;
504
                $item->{backgroundcolor} = 'onloan';
505
            }
506
451
507
            # checking reserve
452
            $item->{backgroundcolor} = 'reserved';
508
            my $item_object = Koha::Items->find( $itemnumber );
453
            $item->{reservedate}     = output_pref({ dt => dt_from_string( $first_hold->reservedate ), dateonly => 1 }); # FIXME Should be formatted in the template
509
            my $holds = $item_object->current_holds;
454
            $item->{ReservedFor}     = $p;
510
            if ( my $first_hold = $holds->next ) {
455
            $item->{ExpectedAtLibrary}     = $first_hold->branchcode;
511
                my $p = Koha::Patrons->find( $first_hold->borrowernumber );
456
            $item->{waitingdate} = $first_hold->waitingdate;
512
457
        }
513
                $item->{backgroundcolor} = 'reserved';
514
                $item->{reservedate}     = output_pref({ dt => dt_from_string( $first_hold->reservedate ), dateonly => 1 }); # FIXME Should be formatted in the template
515
                $item->{ReservedFor}     = $p;
516
                $item->{ExpectedAtLibrary}     = $first_hold->branchcode;
517
                $item->{waitingdate} = $first_hold->waitingdate;
518
            }
519
458
520
            # Management of the notforloan document
459
        # Management of the notforloan document
521
            if ( $item->{notforloan} ) {
460
        if ( $item->{notforloan} ) {
522
                $item->{backgroundcolor} = 'other';
461
            $item->{backgroundcolor} = 'other';
523
            }
462
        }
524
463
525
            # Management of lost or long overdue items
464
        # Management of lost or long overdue items
526
            if ( $item->{itemlost} ) {
465
        if ( $item->{itemlost} ) {
527
                $item->{backgroundcolor} = 'other';
466
            $item->{backgroundcolor} = 'other';
528
                if ($logged_in_patron->category->hidelostitems && !$showallitems) {
467
            if ($logged_in_patron->category->hidelostitems && !$showallitems) {
529
                    $item->{hide} = 1;
468
                $item->{hide} = 1;
530
                    $hiddencount++;
469
                $hiddencount++;
531
                }
532
            }
470
            }
471
        }
533
472
534
            # Check the transit status
473
        # Check the transit status
535
            my ( $transfertwhen, $transfertfrom, $transfertto ) =
474
        my ( $transfertwhen, $transfertfrom, $transfertto ) =
536
              GetTransfers($itemnumber);
475
          GetTransfers($item_object->itemnumber); # FIXME replace with get_transfer
537
476
538
            if ( defined $transfertwhen && $transfertwhen ne '' ) {
477
        if ( defined $transfertwhen && $transfertwhen ne '' ) {
539
                $item->{transfertwhen} = output_pref({ dt => dt_from_string( $transfertwhen ), dateonly => 1 });
478
            $item->{transfertwhen} = output_pref({ dt => dt_from_string( $transfertwhen ), dateonly => 1 });
540
                $item->{transfertfrom} = $transfertfrom;
479
            $item->{transfertfrom} = $transfertfrom;
541
                $item->{transfertto} = $transfertto;
480
            $item->{transfertto} = $transfertto;
542
                $item->{nocancel} = 1;
481
            $item->{nocancel} = 1;
543
            }
482
        }
544
483
545
            # If there is no loan, return and transfer, we show a checkbox.
484
        # If there is no loan, return and transfer, we show a checkbox.
546
            $item->{notforloan} ||= 0;
485
        $item->{notforloan} ||= 0;
547
486
548
            # if independent branches is on we need to check if the person can reserve
487
        # if independent branches is on we need to check if the person can reserve
549
            # for branches they arent logged in to
488
        # for branches they arent logged in to
550
            if ( C4::Context->preference("IndependentBranches") ) {
489
        if ( C4::Context->preference("IndependentBranches") ) {
551
                if (! C4::Context->preference("canreservefromotherbranches")){
490
            if (! C4::Context->preference("canreservefromotherbranches")){
552
                    # can't reserve items so need to check if item homebranch and userenv branch match if not we can't reserve
491
                # can't reserve items so need to check if item homebranch and userenv branch match if not we can't reserve
553
                    my $userenv = C4::Context->userenv;
492
                my $userenv = C4::Context->userenv;
554
                    unless ( C4::Context->IsSuperLibrarian ) {
493
                unless ( C4::Context->IsSuperLibrarian ) {
555
                        $item->{cantreserve} = 1 if ( $item->{homebranch} ne $userenv->{branch} );
494
                    $item->{cantreserve} = 1 if ( $item->{homebranch} ne $userenv->{branch} );
556
                    }
557
                }
495
                }
558
            }
496
            }
497
        }
559
498
560
            if ( $patron ) {
499
        if ( $patron ) {
561
                my $patron_unblessed = $patron->unblessed;
500
            my $patron_unblessed = $patron->unblessed;
562
                my $branch = C4::Circulation::_GetCircControlBranch($item, $patron_unblessed);
501
            my $branch = C4::Circulation::_GetCircControlBranch($item, $patron_unblessed);
563
502
564
                my $branchitemrule = GetBranchItemRule( $branch, $item->{'itype'} );
503
            my $branchitemrule = GetBranchItemRule( $branch, $item->{'itype'} );
565
504
566
                $item->{'holdallowed'} = $branchitemrule->{'holdallowed'};
505
            $item->{'holdallowed'} = $branchitemrule->{'holdallowed'};
567
506
568
                my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $itemnumber )->{status};
507
            my $can_item_be_reserved = CanItemBeReserved( $patron->borrowernumber, $item_object->itemnumber )->{status};
569
                $item->{not_holdable} = $can_item_be_reserved unless ( $can_item_be_reserved eq 'OK' );
508
            $item->{not_holdable} = $can_item_be_reserved unless ( $can_item_be_reserved eq 'OK' );
570
509
571
                $item->{item_level_holds} = Koha::CirculationRules->get_opacitemholds_policy( { item => $item_object, patron => $patron } );
510
            $item->{item_level_holds} = Koha::CirculationRules->get_opacitemholds_policy( { item => $item_object, patron => $patron } );
572
511
573
                if (
512
            if (
574
                       !$item->{cantreserve}
513
                   !$item->{cantreserve}
575
                    && !$exceeded_maxreserves
514
                && !$exceeded_maxreserves
576
                    && $can_item_be_reserved eq 'OK'
515
                && $can_item_be_reserved eq 'OK'
577
                    # items_any_available defined outside of the current loop,
516
                # items_any_available defined outside of the current loop,
578
                    # so we avoiding loop inside IsAvailableForItemLevelRequest:
517
                # so we avoiding loop inside IsAvailableForItemLevelRequest:
579
                    && IsAvailableForItemLevelRequest($item_object, $patron, undef, $items_any_available)
518
                && IsAvailableForItemLevelRequest($item_object, $patron, undef, $items_any_available)
580
                  )
519
              )
581
                {
520
            {
521
                # Send the pickup locations count to the UI, the pickup locations will be pulled using the API
522
                my $pickup_locations = $item_object->pickup_locations({ patron => $patron });
523
                $item->{pickup_locations_count} = $pickup_locations->count;
524
                if ( $item->{pickup_locations_count} > 0 ) {
525
                    $num_available++;
526
                    $item->{available} = 1;
527
                    # pass the holding branch for use as default
528
                    my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next;
529
                    $item->{default_pickup_location} = $default_pickup_location;
530
                }
531
                else {
532
                    $item->{available} = 0;
533
                    $item->{not_holdable} = "no_valid_pickup_location";
534
                }
535
536
                push( @available_itemtypes, $item->{itype} );
537
            }
538
            elsif ( C4::Context->preference('AllowHoldPolicyOverride') ) {
539
                # If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules
540
                # with the exception of itemAlreadyOnHold because, you know, the item is already on hold
541
                if ( $can_item_be_reserved ne 'itemAlreadyOnHold' ) {
582
                    # Send the pickup locations count to the UI, the pickup locations will be pulled using the API
542
                    # Send the pickup locations count to the UI, the pickup locations will be pulled using the API
583
                    my $pickup_locations = $item_object->pickup_locations({ patron => $patron });
543
                    my $pickup_locations = $item_object->pickup_locations({ patron => $patron });
584
                    $item->{pickup_locations_count} = $pickup_locations->count;
544
                    $item->{pickup_locations_count} = $pickup_locations->count;
585
                    if ( $item->{pickup_locations_count} > 0 ) {
545
                    if ( $item->{pickup_locations_count} > 0 ) {
586
                        $num_available++;
546
                        $item->{override} = 1;
587
                        $item->{available} = 1;
547
                        $num_override++;
588
                        # pass the holding branch for use as default
548
                        # pass the holding branch for use as default
589
                        my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next;
549
                        my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next;
590
                        $item->{default_pickup_location} = $default_pickup_location;
550
                        $item->{default_pickup_location} = $default_pickup_location;
Lines 593-653 foreach my $biblionumber (@biblionumbers) { Link Here
593
                        $item->{available} = 0;
553
                        $item->{available} = 0;
594
                        $item->{not_holdable} = "no_valid_pickup_location";
554
                        $item->{not_holdable} = "no_valid_pickup_location";
595
                    }
555
                    }
556
                } else { $num_alreadyheld++ }
596
557
597
                    push( @available_itemtypes, $item->{itype} );
558
                push( @available_itemtypes, $item->{itype} );
598
                }
559
            }
599
                elsif ( C4::Context->preference('AllowHoldPolicyOverride') ) {
600
                    # If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules
601
                    # with the exception of itemAlreadyOnHold because, you know, the item is already on hold
602
                    if ( $can_item_be_reserved ne 'itemAlreadyOnHold' ) {
603
                        # Send the pickup locations count to the UI, the pickup locations will be pulled using the API
604
                        my $pickup_locations = $item_object->pickup_locations({ patron => $patron });
605
                        $item->{pickup_locations_count} = $pickup_locations->count;
606
                        if ( $item->{pickup_locations_count} > 0 ) {
607
                            $item->{override} = 1;
608
                            $num_override++;
609
                            # pass the holding branch for use as default
610
                            my $default_pickup_location = $pickup_locations->search({ branchcode => $item->{holdingbranch} })->next;
611
                            $item->{default_pickup_location} = $default_pickup_location;
612
                        }
613
                        else {
614
                            $item->{available} = 0;
615
                            $item->{not_holdable} = "no_valid_pickup_location";
616
                        }
617
                    } else { $num_alreadyheld++ }
618
619
                    push( @available_itemtypes, $item->{itype} );
620
                }
621
560
622
                # If none of the conditions hold true, then neither override nor available is set and the item cannot be checked
561
            # If none of the conditions hold true, then neither override nor available is set and the item cannot be checked
623
562
624
                # Show serial enumeration when needed
563
            # Show serial enumeration when needed
625
                if ($item->{enumchron}) {
564
            if ($item->{enumchron}) {
626
                    $itemdata_enumchron = 1;
565
                $itemdata_enumchron = 1;
627
                }
566
            }
628
                # Show collection when needed
567
            # Show collection when needed
629
                if ($item->{ccode}) {
568
            if ($item->{ccode}) {
630
                    $itemdata_ccode = 1;
569
                $itemdata_ccode = 1;
631
                }
632
            }
570
            }
633
634
            push @{ $biblioitem->{itemloop} }, $item;
635
        }
571
        }
636
572
637
        # While we can't override an alreay held item, we should be able to override the others
573
        push @{ $biblioloopiter{itemloop} }, $item;
638
        # Unless all items are already held
574
    }
639
        if ( $num_override > 0 && ($num_override + $num_alreadyheld) == scalar( @{ $biblioitem->{itemloop} } ) ) {
640
        # That is, if all items require an override
641
            $template->param( override_required => 1 );
642
        } elsif ( $num_available == 0 ) {
643
            $template->param( none_available => 1 );
644
            $biblioloopiter{warn} = 1;
645
            $biblioloopiter{none_avail} = 1;
646
        }
647
        $template->param( hiddencount => $hiddencount);
648
575
649
        push @bibitemloop, $biblioitem;
576
    $biblioloopiter{biblioitem} = $biblio->biblioitem;
577
578
    # While we can't override an alreay held item, we should be able to override the others
579
    # Unless all items are already held
580
    if ( $num_override > 0 && ($num_override + $num_alreadyheld) == scalar( @{ $biblioloopiter{itemloop} } ) ) {
581
    # That is, if all items require an override
582
        $template->param( override_required => 1 );
583
    } elsif ( $num_available == 0 ) {
584
        $template->param( none_available => 1 );
585
        $biblioloopiter{warn} = 1;
586
        $biblioloopiter{none_avail} = 1;
650
    }
587
    }
588
    $template->param( hiddencount => $hiddencount);
651
589
652
    @available_itemtypes = uniq( @available_itemtypes );
590
    @available_itemtypes = uniq( @available_itemtypes );
653
    $template->param( available_itemtypes => \@available_itemtypes );
591
    $template->param( available_itemtypes => \@available_itemtypes );
Lines 717-723 foreach my $biblionumber (@biblionumbers) { Link Here
717
655
718
    # display infos
656
    # display infos
719
    $template->param(
657
    $template->param(
720
                     bibitemloop       => \@bibitemloop,
721
                     itemdata_enumchron => $itemdata_enumchron,
658
                     itemdata_enumchron => $itemdata_enumchron,
722
                     itemdata_ccode    => $itemdata_ccode,
659
                     itemdata_ccode    => $itemdata_ccode,
723
                     date              => $date,
660
                     date              => $date,
Lines 764-769 if ( C4::Context->preference( 'AllowHoldDateInFuture' ) ) { Link Here
764
$template->param(
701
$template->param(
765
    SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'),
702
    SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'),
766
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
703
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
704
    borrowernumber => $borrowernumber_hold,
767
);
705
);
768
706
769
# printout the page
707
# printout the page
770
- 

Return to bug 29660