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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-274 / +313 lines)
Lines 509-578 Link Here
509
                <div class="dialog alert hide holdalert">
509
                <div class="dialog alert hide holdalert">
510
                </div>
510
                </div>
511
511
512
                <fieldset class="rows">
512
                [% UNLESS ( multi_hold ) %]
513
                    <legend>Hold details</legend>
514
                    <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
513
                    <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
514
                        <fieldset class="rows">
515
                            <legend>Hold details</legend>
515
516
516
                        <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
517
                            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
517
                        [% FOREACH biblionumber IN biblionumbers %]
518
                            [% FOREACH biblionumber IN biblionumbers %]
518
                            <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
519
                                <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
519
                        [% END %]
520
                        [% IF ( multi_hold ) %]
521
                            <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
522
                            <input type="hidden" name="request" value="any"/>
523
                            [% FOREACH biblioloo IN biblioloop %]
524
                                [% UNLESS biblioloo.none_avail %]
525
                                    <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
526
                                    <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
527
                                    <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
528
                                [% END %]
529
                            [% END %]
520
                            [% END %]
530
                        [% ELSE %]
521
                                <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
531
                            <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
522
                                <input type="hidden" name="title" value="[% biblio.title | html %]" />
532
                            <input type="hidden" name="title" value="[% biblio.title | html %]" />
523
                                <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
533
                            <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
534
                        [% END # /IF multi_hold %]
535
524
536
                        <ol>
525
                            <ol>
537
                            <li>
526
                                <li>
538
                                <span class="label">Patron:</span>
527
                                    <span class="label">Patron:</span>
539
                                [% IF ( patron.borrowernumber ) %]
528
                                    [% IF ( patron.borrowernumber ) %]
540
                                    [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]
529
                                        [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]
541
                                [% ELSE %]
530
                                    [% ELSE %]
542
                                    Not defined yet
531
                                        Not defined yet
543
                                [% END %]
532
                                    [% END %]
544
                            </li>
533
                                </li>
545
534
546
                            [% UNLESS ( multi_hold ) %]
547
                                <li>
535
                                <li>
548
                                    <span class="label">Estimated priority:</span>
536
                                    <span class="label">Estimated priority:</span>
549
                                    <strong>[% fixedRank | html %]</strong>
537
                                    <strong>[% fixedRank | html %]</strong>
550
                                </li>
538
                                </li>
551
                            [% END %]
552
539
553
                            <li>
540
                                <li>
554
                                <label for="holdnotes">Notes:</label>
541
                                    <label for="holdnotes">Notes:</label>
555
                                <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
542
                                    <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
556
                            </li>
543
                                </li>
557
                            <li>
558
                                <label for="pickup">Pickup at:</label>
559
                            [% UNLESS ( multi_hold ) %]
560
                                <select name="pickup" id="pickup"
561
                                        data-biblio-id="[% biblio.biblionumber | html %]"
562
                                        data-patron-id="[% patron.borrowernumber | html %]"
563
                                        data-pickup-location-source="biblio">
564
                                    [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
565
                            [% ELSE %]
566
                                <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
567
                                    <option value="" selected="selected"></option>
568
                                [% FOREACH pickup_location IN multi_pickup_locations %]
569
                                    <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
570
                                [% END %]
571
                            [% END %]
572
                                </select>
573
                            </li>
574
544
575
                            [% UNLESS ( multi_hold ) %]
576
                                [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
545
                                [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
577
                                    <li>
546
                                    <li>
578
                                        <label for="itemtype">Request specific item type:</label>
547
                                        <label for="itemtype">Request specific item type:</label>
Lines 584-590 Link Here
584
                                        </select>
553
                                        </select>
585
                                    </li>
554
                                    </li>
586
                                [% END %]
555
                                [% END %]
587
                            [% END # /UNLESS multi_hold %]
588
556
589
                            [% IF ( Koha.Preference('AllowHoldDateInFuture') ) %]
557
                            [% IF ( Koha.Preference('AllowHoldDateInFuture') ) %]
590
                                <li>
558
                                <li>
Lines 598-648 Link Here
598
                                <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
566
                                <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
599
                            </li>
567
                            </li>
600
568
601
                            [% UNLESS ( multi_hold ) %]
569
                                <li id="non_priority_list_item">
570
                                    <label for="non_priority">Non priority hold:</label>
571
                                    <input name="non_priority" id="non_priority" type="checkbox" />
572
                                    <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
573
                                </li>
602
                                <li>
574
                                <li>
603
                                    <label for="requestany">Hold next available item </label>
575
                                    <label for="holdnotes">Notes:</label>
604
                                    [% IF force_hold_level == 'item' || force_hold_level == 'item_group'  %]
576
                                    <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
605
                                        <input type="checkbox" id="requestany" name="request" disabled="true" />
577
                                </li>
578
                            </ol>
579
                            </fieldset>
580
                            <fieldset class="rows">
581
                                <legend>
582
                                    <label for="requestany" class="inline">
583
                                        Hold next available item
584
                                    </label>
585
                                    [% IF force_hold_level == 'item' || force_hold_level == 'item_group' %]
586
                                        <input type="radio" id="requestany" name="request" disabled="true" />
606
                                    [% ELSIF force_hold_level == 'record' %]
587
                                    [% ELSIF force_hold_level == 'record' %]
607
                                        <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
588
                                        <input type="radio" id="requestany" checked="checked" value="Any" disabled="true"/>
608
                                        <input type="hidden" name="request" value="Any"/>
589
                                        <input type="hidden" name="request" value="Any"/>
609
                                    [% ELSE %]
590
                                    [% ELSE %]
610
                                        <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
591
                                        <input type="radio" id="requestany" name="request" checked="checked" value="Any" />
611
                                    [% END %]
592
                                    [% END %]
612
                                    <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
593
                                </legend>
613
                                </li>
594
                                <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
595
                                <ol>
614
596
615
                                [% IF remaining_holds_for_record > 1 %]
616
                                    <li>
597
                                    <li>
617
                                        <label for="holds_to_place_count">Holds to place (count)</label>
598
                                        <label for="pickup">Pickup at:</label>
618
                                        <input type="text" inputmode="numeric" pattern="[0-9]*" id="holds_to_place_count" name="holds_to_place_count" maxlength="[% remaining_holds_for_record | html %]" value="1" />
599
                                        <select name="pickup" id="pickup-next-avail"
600
                                                data-biblio-id="[% biblio.biblionumber | html %]"
601
                                                data-patron-id="[% patron.borrowernumber | html %]"
602
                                                data-pickup-location-source="biblio">
603
                                            [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
604
                                        </select>
619
                                    </li>
605
                                    </li>
620
                                [% ELSE %]
621
                                    <input type="hidden" name="holds_to_place_count" value="1" />
622
                                [% END %]
623
                            [% END # /UNLESS multi_hold %]
624
606
625
                            <li id="non_priority_list_item">
607
                                    [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
626
                                <label for="non_priority">Non priority hold:</label>
608
                                        <li>
627
                                <input name="non_priority" id="non_priority" type="checkbox" />
609
                                            <label for="itemtype">Request specific item type:</label>
628
                                <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
610
                                            <select name="itemtype" id="itemtype">
629
                            </li>
611
                                                <option value="">Any item type</option>
630
                        </ol>
612
                                                [%- FOREACH itemtype IN available_itemtypes %]
613
                                                    <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
614
                                                [%- END %]
615
                                            </select>
616
                                        </li>
617
                                    [% END %]
618
                                    [% IF remaining_holds_for_record > 1 %]
619
                                        <li>
620
                                            <label for="holds_to_place_count">Holds to place (count)</label>
621
                                            <input type="text" inputmode="numeric" pattern="[0-9]*" id="holds_to_place_count" name="holds_to_place_count" maxlength="[% remaining_holds_for_record | html %]" value="1" />
622
                                        </li>
623
                                    [% ELSE %]
624
                                        <input type="hidden" name="holds_to_place_count" value="1" />
625
                                    [% END %]
626
                                </ol>
627
631
628
632
                        [% UNLESS ( multi_hold ) %]
633
                            <fieldset class="action">
629
                            <fieldset class="action">
634
                                [% IF ( patron.borrowernumber ) %]
630
                                [% IF ( patron.borrowernumber ) %]
635
                                    [% IF ( override_required ) %]
631
                                    [% IF ( override_required ) %]
636
                                        <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
632
                                        <button type="submit" id="hold_any_btn" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
637
                                    [% ELSIF ( none_available ) %]
633
                                    [% ELSIF ( none_available ) %]
638
                                        <button type="submit" disabled="disabled" class="btn btn-primary btn-disabled">Place hold</button>
634
                                        <button type="submit" id="hold_any_btn" disabled="disabled" class="btn btn-primary btn-disabled">Place hold</button>
639
                                    [% ELSE %]
635
                                    [% ELSE %]
640
                                        <button type="submit" class="btn btn-primary">Place hold</button>
636
                                        <button type="submit" id="hold_any_btn" class="btn btn-primary">Place hold</button>
641
                                    [% END %]
637
                                    [% END %]
642
                                [% END %]
638
                                [% END %]
643
                            </fieldset>
639
                            </fieldset>
640
                        </fieldset>
644
641
645
                            [% biblio = biblioloop.0 %]
642
                        <hr/>
643
644
                        [% biblio = biblioloop.0 %]
645
                        <!-- ItemGroup level holds -->
646
                        [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
647
                        <fieldset class="rows">
648
                            <legend>
649
                                <label for="requestgrp" class="inline">
650
                                    Hold next available item from an item group
651
                                </label>
652
                                [% IF force_hold_level == 'item_group' %]
653
                                    <input type="radio" class="requestgrp" id="requestgrp" name="request" checked="checked" disabled="true" />
654
                                    <span class="error"><i>(Required)</i></span>
655
                                [% ELSIF force_hold_level == 'item' || force_hold_level == 'record' %]
656
                                    <input type="radio" class="requestgrp" id="requestgrp" name="request" disabled="true" />
657
                                [% ELSE %]
658
                                    <input type="radio" class="requestgrp" id="requestgrp" name="request" />
659
                                [% END %]
660
                            </legend>
661
662
                            [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
663
                                <span class="error">
664
                                    <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
665
                                    Hold must be record level
666
                                </span>
667
                            [% ELSIF force_hold_level == 'item' # Patron has placed an item level hold previously for this record %]
668
                                <span class="error">
669
                                    <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
670
                                    Hold must be item level
671
                                </span>
672
                            [% ELSE %]
673
                                <ul>
674
                                    <li>
675
                                        <label for="pickup">Pickup at:</label>
676
                                        <select name="pickup" id="pickup-item-group"
677
                                                data-biblio-id="[% biblio.biblionumber | html %]"
678
                                                data-patron-id="[% patron.borrowernumber | html %]"
679
                                                data-pickup-location-source="biblio">
680
                                            [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
681
                                        </select>
682
                                    </li>
683
                                    <li>
684
                                        <table id="requestgroup">
685
                                            <thead>
686
                                                <tr>
687
                                                    <th>Hold</th>
688
                                                    <th>Item group</th>
689
                                                </tr>
690
                                            </thead>
691
                                            <tbody>
692
                                                [% FOREACH g IN biblio.object.item_groups.search({}, { order_by => ['display_order'] }) %]
693
                                                    [% IF g.items %]
694
                                                        <tr>
695
                                                            <td>
696
                                                                <input id="item_group_id_[% g.id | html %]" class="requestgrp" type="radio" name="item_group_id" value="[% g.id | html %]" />
697
                                                            </td>
698
                                                            <td>
699
                                                                <label for="item_group_id_[% g.id | html %]">[% g.description | html %]</label>
700
                                                            </td>
701
                                                        </tr>
702
                                                    [% END %]
703
                                                [% END %]
704
                                            </tbody>
705
                                        </table>
706
                                    </li>
707
                                </ul>
708
                            [% END %]
709
                            <button type="submit" id="hold_grp_btn" class="btn btn-primary warning">Place hold</button>
710
                        </fieldset>
711
                        [% END %]
712
                        <!-- /ItemGroup level holds -->
713
714
715
                        <fieldset class="rows">
716
                            <legend>
717
                                <label class="inline">
718
                                    Place a hold on a specific item
719
                                </label>
720
                                [% IF force_hold_level == 'item' %]
721
                                     <input type="radio" name="request" class="requestspecific" checked="checked" disabled='disabled'/>
722
                                     <span class="error"><em>(Required)</em></span>
723
                                [% ELSIF force_hold_level == 'record' || force_hold_level == 'item_group' %]
724
                                     <input type="radio" name="request" class="requestspecific" disabled='disabled'/>
725
                                [% ELSE %]
726
                                     <input type="radio" name="request" class="requestspecific"/>
727
                                [% END %]
728
                            </legend>
646
729
647
                            <ol>
730
                            <ol>
648
                                [% UNLESS Koha.Preference('item-level_itypes') %]
731
                                [% UNLESS Koha.Preference('item-level_itypes') %]
Lines 660-718 Link Here
660
                                [% END %]
743
                                [% END %]
661
                            </ol>
744
                            </ol>
662
745
663
                            <!-- ItemGroup level holds -->
664
                            [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
665
                                <h2 style="padding: 0 1em;">
666
                                    Hold next available item from an item group
667
                                    [% IF force_hold_level == 'item_group' %]
668
                                        <span class="error"><i>(Required)</i></span>
669
                                    [% END %]
670
                                </h2>
671
672
                                [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
673
                                    <span class="error">
674
                                        <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
675
                                        Hold must be record level
676
                                    </span>
677
                                [% ELSIF force_hold_level == 'item' # Patron has placed an item level hold previously for this record %]
678
                                    <span class="error">
679
                                        <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
680
                                        Hold must be item level
681
                                    </span>
682
                                [% ELSE %]
683
                                    <table>
684
                                        <thead>
685
                                            <tr>
686
                                                <th>Hold</th>
687
                                                <th>Item group</th>
688
                                            </tr>
689
                                        </thead>
690
                                        <tbody>
691
                                            [% FOREACH g IN biblio.object.item_groups.search({}, { order_by => ['display_order'] }) %]
692
                                                [% IF g.items %]
693
                                                    <tr>
694
                                                        <td>
695
                                                            <input id="item_group_id_[% g.id | html %]" type="radio" name="item_group_id" value="[% g.id | html %]" />
696
                                                        </td>
697
                                                        <td>
698
                                                            <label for="item_group_id_[% g.id | html %]">[% g.description | html %]</label>
699
                                                        </td>
700
                                                    </tr>
701
                                                [% END %]
702
                                            [% END %]
703
                                        </tbody>
704
                                    </table>
705
                                [% END %]
706
                            [% END %]
707
                            <!-- /ItemGroup level holds -->
708
709
                            <h2 style="padding: 0 1em;">
710
                                Place a hold on a specific item
711
                                [% IF force_hold_level == 'item' %]
712
                                     <span class="error"><em>(Required)</em></span>
713
                                [% END %]
714
                            </h2>
715
716
                            <table id="requestspecific">
746
                            <table id="requestspecific">
717
                                <thead>
747
                                <thead>
718
                                    <tr>
748
                                    <tr>
Lines 755-763 Link Here
755
                                                            Hold must be item group level
785
                                                            Hold must be item group level
756
                                                        </span>
786
                                                        </span>
757
                                                    [% ELSIF ( itemloo.available ) %]
787
                                                    [% ELSIF ( itemloo.available ) %]
758
                                                        <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
788
                                                        <input type="radio" name="checkitem" class="requestspecific" value="[% itemloo.itemnumber | html %]" />
759
                                                    [% ELSIF ( itemloo.override ) %]
789
                                                    [% ELSIF ( itemloo.override ) %]
760
                                                        <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
790
                                                        <input type="radio" name="checkitem" class="needsoverride requestspecific" value="[% itemloo.itemnumber | html %]" />
761
                                                        <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
791
                                                        <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
762
                                                    [% ELSE %]
792
                                                    [% ELSE %]
763
                                                        <span class="error">
793
                                                        <span class="error">
Lines 802-808 Link Here
802
                                                </td>
832
                                                </td>
803
                                                <td>
833
                                                <td>
804
                                                [% IF (itemloo.pickup_locations_count > 0) || itemloo.override %]
834
                                                [% IF (itemloo.pickup_locations_count > 0) || itemloo.override %]
805
                                                    <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
835
                                                    <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations requestspecific" style="width:100%;"
806
                                                            data-item-id="[% itemloo.itemnumber | html %]"
836
                                                            data-item-id="[% itemloo.itemnumber | html %]"
807
                                                            data-patron-id="[% patron.borrowernumber | html %]"
837
                                                            data-patron-id="[% patron.borrowernumber | html %]"
808
                                                            data-pickup-location-source="item">
838
                                                            data-pickup-location-source="item">
Lines 921-1025 Link Here
921
                            </table> <!-- /#requestspecific -->
951
                            </table> <!-- /#requestspecific -->
922
952
923
                            [% IF hiddencount %]
953
                            [% IF hiddencount %]
924
                                <form>
954
                                <p class="hiddencount">
925
                                    <p class="hiddencount">
955
                                    <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;borrowernumber=[% borrowernumber | uri %]&amp;showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
926
                                        <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;borrowernumber=[% borrowernumber | uri %]&amp;showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
956
                                </p>
927
                                    </p>
928
                                </form>
929
                            [% END # /IF hiddencount %]
957
                            [% END # /IF hiddencount %]
930
958
931
                        [% ELSE # /UNLESS multi_hold %]
959
                        [% ELSE # /UNLESS multi_hold %]
932
960
                            <fieldset class="rows">
933
                            <table id="requesttitles">
961
                                <legend>Hold details</legend>
934
                                <tr>
962
                                <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
935
                                    <th>&nbsp;</th>
963
                                        <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
936
                                    <th>Pickup location</th>
964
                                        <input type="hidden" name="request" value="any"/>
937
                                    <th>Title</th>
965
                                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
938
                                    [% UNLESS Koha.Preference('item-level_itypes') %]
966
                                        [% FOREACH biblioloo IN biblioloop %]
939
                                        <th>Item type</th>
967
                                            <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblioloo.biblionumber | html %]"/>
940
                                    [% END %]
968
                                            [% UNLESS biblioloo.none_avail %]
941
                                    <th>Priority</th>
969
                                                <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
942
                                    <th>Information</th>
970
                                                <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
943
                                </tr>
971
                                                <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
944
                                [% FOREACH biblioloo IN biblioloop %]
945
                                    [% IF ( biblioloo.warn ) %]
946
                                        <tr class="onissue">
947
                                    [% ELSE %]
948
                                        <tr>
949
                                    [% END %]
950
                                        <td>
951
                                            [% UNLESS ( biblioloo.warn ) %]
952
                                                <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
953
                                            [% END %]
954
                                        </td>
955
                                        <td>
956
                                            [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
957
                                                <select name="pickup_[% biblioloo.biblionumber | html %]"
958
                                                        class="multi_pickup_select"
959
                                                        data-biblio-id="[% biblioloo.biblionumber | html %]"
960
                                                        data-patron-id="[% patron.borrowernumber | html %]"
961
                                                        data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
962
                                                    <option value=""></option>
963
                                                    [% FOREACH pickup_location IN biblioloo.pickup_locations %]
964
                                                        <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
965
                                                    [% END %]
966
                                                </select>
967
                                            [% END %]
972
                                            [% END %]
968
                                        </td>
973
                                        [% END %]
969
                                        <td>
974
970
                                            <ul>
975
                                <table id="requesttitles">
971
                                                <li>
976
                                    <tr>
972
                                                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
977
                                        <th>&nbsp;</th>
973
                                                    [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
978
                                        <th>Pickup location</th>
974
                                                </li>
979
                                        <th>Title</th>
975
                                                [% IF ( biblioloo.publicationyear ) %]
980
                                        [% UNLESS Koha.Preference('item-level_itypes') %]
981
                                            <th>Item type</th>
982
                                        [% END %]
983
                                        <th>Priority</th>
984
                                        <th>Information</th>
985
                                    </tr>
986
                                    [% FOREACH biblioloo IN biblioloop %]
987
                                        [% IF ( biblioloo.warn ) %]
988
                                            <tr class="onissue">
989
                                        [% ELSE %]
990
                                            <tr>
991
                                        [% END %]
992
                                            <td>
993
                                                [% UNLESS ( biblioloo.warn ) %]
994
                                                    <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
995
                                                [% END %]
996
                                            </td>
997
                                            <td>
998
                                                [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
999
                                                    <select name="pickup_[% biblioloo.biblionumber | html %]"
1000
                                                            class="multi_pickup_select"
1001
                                                            data-biblio-id="[% biblioloo.biblionumber | html %]"
1002
                                                            data-patron-id="[% patron.borrowernumber | html %]"
1003
                                                            data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
1004
                                                        <option value=""></option>
1005
                                                        [% FOREACH pickup_location IN biblioloo.pickup_locations %]
1006
                                                            <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
1007
                                                        [% END %]
1008
                                                    </select>
1009
                                                [% END %]
1010
                                            </td>
1011
                                            <td>
1012
                                                <ul>
976
                                                    <li>
1013
                                                    <li>
977
                                                        <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
1014
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
1015
                                                        [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
978
                                                    </li>
1016
                                                    </li>
1017
                                                    [% IF ( biblioloo.publicationyear ) %]
1018
                                                        <li>
1019
                                                            <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
1020
                                                        </li>
1021
                                                    [% END %]
1022
                                                </ul>
1023
                                                [% IF ( biblioloo.warn ) %]
1024
                                                    <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
979
                                                [% END %]
1025
                                                [% END %]
980
                                            </ul>
981
                                            [% IF ( biblioloo.warn ) %]
982
                                                <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
983
                                            [% END %]
984
                                        </td>
985
                                        [% UNLESS Koha.Preference('item-level_itypes') %]
986
                                            <td>
987
                                                <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
988
                                            </td>
1026
                                            </td>
989
                                        [% END %]
1027
                                            [% UNLESS Koha.Preference('item-level_itypes') %]
990
                                        <td>[% biblioloo.rank | html %]</td>
1028
                                                <td>
991
                                        <td>
1029
                                                    <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
992
                                            [% IF ( biblioloo.checked_previously ) %]
1030
                                                </td>
993
                                                <span>Patron has previously checked out this title</span><br/>
994
                                            [% END %]
1031
                                            [% END %]
995
                                            [% IF ( biblioloo.alreadyres ) %]
1032
                                            <td>[% biblioloo.rank | html %]</td>
996
                                                <ul>
1033
                                            <td>
997
                                            [% ELSE %]
1034
                                                [% IF ( biblioloo.checked_previously ) %]
998
                                                [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1035
                                                    <span>Patron has previously checked out this title</span><br/>
1036
                                                [% END %]
1037
                                                [% IF ( biblioloo.alreadyres ) %]
999
                                                    <ul>
1038
                                                    <ul>
1039
                                                [% ELSE %]
1040
                                                    [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1041
                                                        <ul>
1042
                                                    [% END %]
1000
                                                [% END %]
1043
                                                [% END %]
1001
                                            [% END %]
1002
1044
1003
                                            [% IF ( biblioloo.alreadyres ) %]
1045
                                                [% IF ( biblioloo.alreadyres ) %]
1004
                                            <li>
1046
                                                <li>
1005
                                                [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] <strong>already has a hold</strong> on this item
1047
                                                    [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %] <strong>already has a hold</strong> on this item
1006
                                            </li>
1048
                                                </li>
1007
                                            [% END %]
1049
                                                [% END %]
1008
                                            [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1009
                                                <li> <strong>No items are available</strong> to be placed on hold</li>
1010
                                            [% END %]
1011
1012
                                            [% IF ( biblioloo.alreadyres ) %]
1013
                                                </ul>
1014
                                            [% ELSE %]
1015
                                                [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1050
                                                [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1051
                                                    <li> <strong>No items are available</strong> to be placed on hold</li>
1052
                                                [% END %]
1053
1054
                                                [% IF ( biblioloo.alreadyres ) %]
1016
                                                    </ul>
1055
                                                    </ul>
1056
                                                [% ELSE %]
1057
                                                    [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1058
                                                        </ul>
1059
                                                    [% END %]
1017
                                                [% END %]
1060
                                                [% END %]
1018
                                            [% END %]
1061
                                            </td>
1019
                                        </td>
1062
                                        </tr>
1020
                                    </tr>
1063
                                    [% END # /FOREACH biblioloo %]
1021
                                [% END # /FOREACH biblioloo %]
1064
                                </table> <!-- /#requesttitles -->
1022
                            </table> <!-- /#requesttitles -->
1065
                            </fieldset>
1023
1066
1024
                        [% END # /UNLESS multi_hold %]
1067
                        [% END # /UNLESS multi_hold %]
1025
1068
Lines 1027-1053 Link Here
1027
                            [% IF ( patron AND patron.borrowernumber ) %]
1070
                            [% IF ( patron AND patron.borrowernumber ) %]
1028
                                [% IF ( multi_hold ) %]
1071
                                [% IF ( multi_hold ) %]
1029
                                    [% IF ( override_required ) %]
1072
                                    [% IF ( override_required ) %]
1030
                                        <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
1073
                                        <button type="submit" id="hold_multi_btn" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
1031
                                    [% ELSIF ( no_bibs_available ) %]
1074
                                    [% ELSIF ( no_bibs_available ) %]
1032
                                        <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place holds</button>
1075
                                        <button type="submit" id="hold_multi_btn" class="btn btn-primary btn-disabled" disabled="disabled">Place holds</button>
1033
                                    [% ELSIF ( none_available ) %]
1076
                                    [% ELSIF ( none_available ) %]
1034
                                        <button type="submit" class="btn btn-primary">Place holds</button>
1077
                                        <button type="submit" id="hold_multi_btn" class="btn btn-primary">Place holds</button>
1035
                                    [% ELSE %]
1078
                                    [% ELSE %]
1036
                                        <button type="submit" class="btn btn-primary" id="multi_hold_submit">Place holds</button>
1079
                                        <button type="submit" id="hold_multi_btn" class="btn btn-primary" id="multi_hold_submit">Place holds</button>
1037
                                    [% END %]
1080
                                    [% END %]
1038
                                [% ELSE %]
1081
                                [% ELSE %]
1039
                                    [% IF ( override_required ) %]
1082
                                    [% IF ( override_required ) %]
1040
                                        <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
1083
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
1041
                                    [% ELSIF ( none_available ) %]
1084
                                    [% ELSIF ( none_available ) %]
1042
                                        <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place hold</button>
1085
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary btn-disabled" disabled="disabled">Place hold</button>
1043
                                    [% ELSE %]
1086
                                    [% ELSE %]
1044
                                        <button type="submit" class="btn btn-primary">Place hold</button>
1087
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary">Place hold</button>
1045
                                    [% END %]
1088
                                    [% END %]
1046
                                [% END %]
1089
                                [% END %]
1047
                            [% END # /IF patron %]
1090
                            [% END # /IF patron %]
1048
                        </fieldset> <!-- /.action -->
1091
                        </fieldset> <!-- /.action -->
1049
                    </form> <!-- /#hold-request-form -->
1092
                    </fieldset> <!-- /.rows -->
1050
                </fieldset> <!-- /.rows -->
1093
                </form> <!-- /#hold-request-form -->
1051
            [% END %]
1094
            [% END %]
1052
1095
1053
            [% UNLESS ( patron ) %]
1096
            [% UNLESS ( patron ) %]
Lines 1365-1385 Link Here
1365
            }
1408
            }
1366
1409
1367
1410
1368
            function ToggleHoldsToPlace() {
1369
                if ( $("#requestany").prop('checked') ) {
1370
                    $("#holds_to_place_count").prop('disabled', false);
1371
                } else {
1372
                    $("#holds_to_place_count").prop('disabled', true);
1373
                }
1374
            }
1375
            ToggleHoldsToPlace();
1411
            ToggleHoldsToPlace();
1376
            $("#requestany").on('change', function(){
1412
            $("#requestany,.requestspecific[name='request'],.requestgrp").on('change', function(){
1377
                ToggleHoldsToPlace();
1413
                ToggleHoldsToPlace();
1378
            });
1414
            });
1379
1415
1380
            [% IF Koha.Preference('UseBranchTransferLimits') %]
1416
            [% IF Koha.Preference('UseBranchTransferLimits') %]
1381
                $("#pickup").on('change', function(){
1417
                $("#pickup,#pickup-next-avail,#pickup-item-group").on('change', function(){
1382
                    var pickup = $("#pickup").val();
1418
                    var pickup = $(this).val();
1383
                    var url = "?pickup=" + pickup;
1419
                    var url = "?pickup=" + pickup;
1384
                    url += "&borrowernumber=" + borrowernumber;
1420
                    url += "&borrowernumber=" + borrowernumber;
1385
                    url += "&biblionumber=" + biblionumbers[0];
1421
                    url += "&biblionumber=" + biblionumbers[0];
Lines 1392-1403 Link Here
1392
                "sDom": '<"top pager"ilf>t',
1428
                "sDom": '<"top pager"ilf>t',
1393
            }));
1429
            }));
1394
1430
1395
            //Override fieldset styling for dataTables search box
1396
            $("div.top.pager").css("margin-left","1em");
1397
            $(".dataTables_filter label").css({
1398
                "width":"auto",
1399
                "margin-right":"0em"
1400
            });
1401
1431
1402
            $("#club-request-form").on("submit", function() {
1432
            $("#club-request-form").on("submit", function() {
1403
                let $t = $(this);
1433
                let $t = $(this);
Lines 1490-1496 Link Here
1490
                }
1520
                }
1491
            });
1521
            });
1492
1522
1493
            $("#pickup").each( function () {
1523
            $("#pickup,#pickup-item-group,#pickup-next-avail").each( function () {
1494
                $(this).pickup_locations_dropdown();
1524
                $(this).pickup_locations_dropdown();
1495
            });
1525
            });
1496
1526
Lines 1499-1517 Link Here
1499
            });
1529
            });
1500
        });
1530
        });
1501
1531
1532
        function ToggleHoldsToPlace() {
1533
            if ( $("#requestany").prop('checked') ) {
1534
                $("#holds_to_place_count, #pickup-next-avail, #itemtype, #hold_any_btn").prop('disabled', false);
1535
                $(".requestspecific,.requestgrp").prop('checked', false);
1536
                $(".requestspecific","#requestspecific").prop('disabled',true);
1537
                $("#hold_item_btn, #hold_grp_btn, #pickup-item-group").prop("disabled", true );
1538
                $("#hold_any_btn").prop("disabled", false );
1539
            } else if( $(".requestspecific").prop('checked') ) {
1540
                $(".requestspecific","#requestspecific").prop('disabled',false);
1541
                $("#holds_to_place_count, #pickup-item-group, #pickup-next-avail #itemtype, #hold_any_btn").prop('disabled', true);
1542
                $("#hold_item_btn").prop("disabled", false );
1543
                $("#hold_any_btn,#hold_grp_btn").prop("disabled", true );
1544
                $("#requestany,.requestgrp").prop('checked', false);
1545
            } else {
1546
                $("#holds_to_place_count, #pickup-next-avail, #itemtype, #hold_any_btn").prop('disabled', true);
1547
                $("#hold_grp_btn, #pickup-item-group").prop("disabled", false );
1548
                $(".requestspecific","#requestspecific").prop('disabled',true);
1549
                $("#hold_any_btn,#hold_item_btn").prop("disabled", true );
1550
                $("#requestany,.requestspecific").prop('checked', false);
1551
            }
1552
        }
1553
1502
        function check( e, table ) {
1554
        function check( e, table ) {
1503
1555
1504
            var msg = "";
1556
            var msg = "";
1505
1557
1506
            if ( ! $("#requestany").is(":checked") ) {
1558
            if ( $(".requestspecific").is(":checked") ) {
1507
                // requestany not selected, go through the item-specific cases
1559
                // requestany not selected, go through the item-specific cases
1508
                if ( $('input[type="radio"]:checked').length > 0 ) {
1560
                var selected_item = $('#requestspecific input[type="radio"]:checked');
1561
                if ( selected_item.length > 0 ) {
1509
                    // got item-specific hold requests in the form!
1562
                    // got item-specific hold requests in the form!
1510
                    // verify they have a pickup location selected
1563
                    // verify they have a pickup location selected
1511
1564
1512
                    if (table.find('input[type="radio"]:checked')
1565
                    if ( selected_item.closest('tr').find(".pickup_locations").val() == '' ) {
1513
                                .closest('tr')
1514
                                .find(".pickup_locations").val() === null) {
1515
1566
1516
                        msg = _("- Please select a pickup location for the item" + "\n")
1567
                        msg = _("- Please select a pickup location for the item" + "\n")
1517
                    }
1568
                    }
Lines 1519-1526 Link Here
1519
                else {
1570
                else {
1520
                    msg = (_("- Please select an item to place a hold") + "\n");
1571
                    msg = (_("- Please select an item to place a hold") + "\n");
1521
                }
1572
                }
1573
            } else if ( $("#requestgrp").is(":checked") ) {
1574
                var selected_group = $('#requestgroup input[type="radio"]:checked');
1575
                if( selected_group.length > 0 ){
1576
                    if( $("#pickup-item-group").length < 1 || $("#pickup-item-grp").val() == "" ){
1577
                        msg = _("- Please select a pickup location for this hold" + "\n");
1578
                    }
1579
                } else {
1580
                    msg = (_("- Please select an item group to place a hold") + "\n");
1581
                }
1522
            } else {
1582
            } else {
1523
                if( $("#pickup").length < 1 || $("#pickup").val() == "" || $('#pickup').val() === null ){
1583
                // Requesting next available
1584
                if( $("#pickup-next-avail").length < 1 || $("#pickup-next-avail").val() == "" || $('#pickup-next-avail').val() === null ){
1524
                    msg = _("- Please select a pickup location for this hold" + "\n");
1585
                    msg = _("- Please select a pickup location for this hold" + "\n");
1525
                }
1586
                }
1526
            }
1587
            }
Lines 1592-1619 Link Here
1592
            $("button.warning").click(function() {
1653
            $("button.warning").click(function() {
1593
                return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1654
                return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1594
            });
1655
            });
1595
            $("#requestany").click(function() {
1596
                if(this.checked){
1597
                    $("input[name=checkitem]").each(function() {
1598
                        $(this).prop("checked", false);
1599
                    });
1600
                }
1601
            });
1602
            $("input[name=checkitem]").click(function() {
1603
                onechecked = 0;
1604
                $("input[name=checkitem]").each(function() {
1605
                    if(this.checked){
1606
                        onechecked = 1;
1607
                    }
1608
                });
1609
                if(onechecked == 1){
1610
                    $("#requestany").prop("checked", false);
1611
                    $("#holds_to_place_count").prop('disabled', true);
1612
                } else {
1613
                    $("#requestany").prop("checked",true);
1614
                    $("#holds_to_place_count").prop('disabled', false);
1615
                }
1616
            });
1617
            var prev_rank_request;
1656
            var prev_rank_request;
1618
            $("select[name=rank-request]").on("focus", function() {
1657
            $("select[name=rank-request]").on("focus", function() {
1619
                prev_rank_request = $(this).val();
1658
                prev_rank_request = $(this).val();
(-)a/reserve/placerequest.pl (-2 / +2 lines)
Lines 49-54 my $item_group_id = $input->param('item_group_id'); Link Here
49
my $expirationdate = $input->param('expiration_date');
49
my $expirationdate = $input->param('expiration_date');
50
my $itemtype       = $input->param('itemtype') || undef;
50
my $itemtype       = $input->param('itemtype') || undef;
51
my $non_priority   = $input->param('non_priority');
51
my $non_priority   = $input->param('non_priority');
52
my $multi_holds    = $input->param('multi_holds');
52
53
53
my $patron = Koha::Patrons->find( $borrowernumber );
54
my $patron = Koha::Patrons->find( $borrowernumber );
54
55
Lines 103-109 if ( $patron ) { Link Here
103
                }
104
                }
104
            }
105
            }
105
106
106
        } elsif (@biblionumbers > 1) {
107
        } elsif (@biblionumbers > 1 || $multi_holds) {
107
            my $bibinfo = $bibinfos{$biblionumber};
108
            my $bibinfo = $bibinfos{$biblionumber};
108
            if ( $can_override || CanBookBeReserved($patron->borrowernumber, $biblionumber)->{status} eq 'OK' ) {
109
            if ( $can_override || CanBookBeReserved($patron->borrowernumber, $biblionumber)->{status} eq 'OK' ) {
109
                AddReserve(
110
                AddReserve(
110
- 

Return to bug 30579