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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-245 / +290 lines)
Lines 507-576 Link Here
507
                <div class="dialog alert hide holdalert">
507
                <div class="dialog alert hide holdalert">
508
                </div>
508
                </div>
509
509
510
                <fieldset class="rows">
510
                [% UNLESS ( multi_hold ) %]
511
                    <legend>Hold details</legend>
512
                    <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
511
                    <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
512
                        <fieldset class="rows">
513
                            <legend>Hold details</legend>
513
514
514
                        <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
515
                            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
515
                        [% FOREACH biblionumber IN biblionumbers %]
516
                            [% FOREACH biblionumber IN biblionumbers %]
516
                            <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
517
                                <input type="hidden" name="biblionumber" value="[% biblionumber | html %]"/>
517
                        [% END %]
518
                        [% IF ( multi_hold ) %]
519
                            <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
520
                            <input type="hidden" name="request" value="any"/>
521
                            [% FOREACH biblioloo IN biblioloop %]
522
                                [% UNLESS biblioloo.none_avail %]
523
                                    <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
524
                                    <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
525
                                    <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
526
                                [% END %]
527
                            [% END %]
518
                            [% END %]
528
                        [% ELSE %]
519
                                <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
529
                            <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblio.biblionumber | html %]"/>
520
                                <input type="hidden" name="title" value="[% biblio.title | html %]" />
530
                            <input type="hidden" name="title" value="[% biblio.title | html %]" />
521
                                <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
531
                            <input type="hidden" name="rank-request" value="[% fixedRank | html %]" />
532
                        [% END # /IF multi_hold %]
533
522
534
                        <ol>
523
                            <ol>
535
                            <li>
524
                                <li>
536
                                <span class="label">Patron:</span>
525
                                    <span class="label">Patron:</span>
537
                                [% IF ( patron.borrowernumber ) %]
526
                                    [% IF ( patron.borrowernumber ) %]
538
                                    [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]
527
                                        [% INCLUDE 'patron-title.inc' patron => patron no_title => 1 no_cardnumber => 1 hide_patron_infos_if_needed => 1 %]
539
                                [% ELSE %]
528
                                    [% ELSE %]
540
                                    Not defined yet
529
                                        Not defined yet
541
                                [% END %]
530
                                    [% END %]
542
                            </li>
531
                                </li>
543
532
544
                            [% UNLESS ( multi_hold ) %]
545
                                <li>
533
                                <li>
546
                                    <span class="label">Estimated priority:</span>
534
                                    <span class="label">Estimated priority:</span>
547
                                    <strong>[% fixedRank | html %]</strong>
535
                                    <strong>[% fixedRank | html %]</strong>
548
                                </li>
536
                                </li>
549
                            [% END %]
550
537
551
                            <li>
538
                                <li>
552
                                <label for="holdnotes">Notes:</label>
539
                                    <label for="holdnotes">Notes:</label>
553
                                <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
540
                                    <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
554
                            </li>
541
                                </li>
555
                            <li>
542
                                <li>
556
                                <label for="pickup">Pickup at:</label>
543
                                    <label for="pickup">Pickup at:</label>
557
                            [% UNLESS ( multi_hold ) %]
544
                                    <select name="pickup" id="pickup"
558
                                <select name="pickup" id="pickup"
545
                                            data-biblio-id="[% biblio.biblionumber | html %]"
559
                                        data-biblio-id="[% biblio.biblionumber | html %]"
546
                                            data-patron-id="[% patron.borrowernumber | html %]"
560
                                        data-patron-id="[% patron.borrowernumber | html %]"
547
                                            data-pickup-location-source="biblio">
561
                                        data-pickup-location-source="biblio">
548
                                        [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
562
                                    [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
549
                                    </select>
563
                            [% ELSE %]
550
                                </li>
564
                                <select name="pickup" id="pickup_multi" data-patron-id="[% patron.borrowernumber | html %]">
565
                                    <option value="" selected="selected"></option>
566
                                [% FOREACH pickup_location IN multi_pickup_locations %]
567
                                    <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
568
                                [% END %]
569
                            [% END %]
570
                                </select>
571
                            </li>
572
551
573
                            [% UNLESS ( multi_hold ) %]
574
                                [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
552
                                [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
575
                                    <li>
553
                                    <li>
576
                                        <label for="itemtype">Request specific item type:</label>
554
                                        <label for="itemtype">Request specific item type:</label>
Lines 582-588 Link Here
582
                                        </select>
560
                                        </select>
583
                                    </li>
561
                                    </li>
584
                                [% END %]
562
                                [% END %]
585
                            [% END # /UNLESS multi_hold %]
586
563
587
                            [% IF ( Koha.Preference('AllowHoldDateInFuture') ) %]
564
                            [% IF ( Koha.Preference('AllowHoldDateInFuture') ) %]
588
                                <li>
565
                                <li>
Lines 596-646 Link Here
596
                                <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
573
                                <input id="expiration_date" name="expiration_date" id="to" size="10" type="text" class="flatpickr" data-flatpickr-futuredate="true" />
597
                            </li>
574
                            </li>
598
575
599
                            [% UNLESS ( multi_hold ) %]
576
                                <li id="non_priority_list_item">
577
                                    <label for="non_priority">Non priority hold:</label>
578
                                    <input name="non_priority" id="non_priority" type="checkbox" />
579
                                    <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
580
                                </li>
600
                                <li>
581
                                <li>
601
                                    <label for="requestany">Hold next available item </label>
582
                                    <label for="holdnotes">Notes:</label>
602
                                    [% IF force_hold_level == 'item' || force_hold_level == 'item_group'  %]
583
                                    <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
603
                                        <input type="checkbox" id="requestany" name="request" disabled="true" />
584
                                </li>
585
                            </ol>
586
                            </fieldset>
587
                            <fieldset class="rows">
588
                                <legend>
589
                                    <label for="requestany" class="inline">
590
                                        Hold next available item
591
                                    </label>
592
                                    [% IF force_hold_level == 'item' || force_hold_level == 'item_group' %]
593
                                        <input type="radio" id="requestany" name="request" disabled="true" />
604
                                    [% ELSIF force_hold_level == 'record' %]
594
                                    [% ELSIF force_hold_level == 'record' %]
605
                                        <input type="checkbox" id="requestany" checked="checked" value="Any" disabled="true"/>
595
                                        <input type="radio" id="requestany" checked="checked" value="Any" disabled="true"/>
606
                                        <input type="hidden" name="request" value="Any"/>
596
                                        <input type="hidden" name="request" value="Any"/>
607
                                    [% ELSE %]
597
                                    [% ELSE %]
608
                                        <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
598
                                        <input type="radio" id="requestany" name="request" checked="checked" value="Any" />
609
                                    [% END %]
599
                                    [% END %]
610
                                    <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
600
                                </legend>
611
                                </li>
601
                                <input type="hidden" name="alreadyreserved" value="[% alreadyreserved | html %]" />
602
                                <ol>
612
603
613
                                [% IF remaining_holds_for_record > 1 %]
614
                                    <li>
604
                                    <li>
615
                                        <label for="holds_to_place_count">Holds to place (count)</label>
605
                                        <label for="pickup">Pickup at:</label>
616
                                        <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" />
606
                                        <select name="pickup" id="pickup"
607
                                                data-biblio-id="[% biblio.biblionumber | html %]"
608
                                                data-patron-id="[% patron.borrowernumber | html %]"
609
                                                data-pickup-location-source="biblio">
610
                                            [% PROCESS options_for_libraries libraries => Branches.pickup_locations({ search_params => { biblio => biblionumber, patron => patron }, selected => pickup }) %]
611
                                        </select>
617
                                    </li>
612
                                    </li>
618
                                [% ELSE %]
619
                                    <input type="hidden" name="holds_to_place_count" value="1" />
620
                                [% END %]
621
                            [% END # /UNLESS multi_hold %]
622
613
623
                            <li id="non_priority_list_item">
614
                                    [% IF Koha.Preference('AllowHoldItemTypeSelection') %]
624
                                <label for="non_priority">Non priority hold:</label>
615
                                        <li>
625
                                <input name="non_priority" id="non_priority" type="checkbox" />
616
                                            <label for="itemtype">Request specific item type:</label>
626
                                <span class="hint">A non priority hold doesn't prevent a current checkout from renewing</span>
617
                                            <select name="itemtype" id="itemtype">
627
                            </li>
618
                                                <option value="">Any item type</option>
628
                        </ol>
619
                                                [%- FOREACH itemtype IN available_itemtypes %]
620
                                                    <option value="[% itemtype | html %]">[% ItemTypes.GetDescription( itemtype ) | html %]</option>
621
                                                [%- END %]
622
                                            </select>
623
                                        </li>
624
                                    [% END %]
625
                                    [% IF remaining_holds_for_record > 1 %]
626
                                        <li>
627
                                            <label for="holds_to_place_count">Holds to place (count)</label>
628
                                            <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" />
629
                                        </li>
630
                                    [% ELSE %]
631
                                        <input type="hidden" name="holds_to_place_count" value="1" />
632
                                    [% END %]
633
                                </ol>
634
629
635
630
                        [% UNLESS ( multi_hold ) %]
631
                            <fieldset class="action">
636
                            <fieldset class="action">
632
                                [% IF ( patron.borrowernumber ) %]
637
                                [% IF ( patron.borrowernumber ) %]
633
                                    [% IF ( override_required ) %]
638
                                    [% IF ( override_required ) %]
634
                                        <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
639
                                        <button type="submit" id="hold_any_btn" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
635
                                    [% ELSIF ( none_available ) %]
640
                                    [% ELSIF ( none_available ) %]
636
                                        <button type="submit" disabled="disabled" class="btn btn-primary btn-disabled">Place hold</button>
641
                                        <button type="submit" id="hold_any_btn" disabled="disabled" class="btn btn-primary btn-disabled">Place hold</button>
637
                                    [% ELSE %]
642
                                    [% ELSE %]
638
                                        <button type="submit" class="btn btn-primary">Place hold</button>
643
                                        <button type="submit" id="hold_any_btn" class="btn btn-primary">Place hold</button>
639
                                    [% END %]
644
                                    [% END %]
640
                                [% END %]
645
                                [% END %]
641
                            </fieldset>
646
                            </fieldset>
647
                        </fieldset>
648
649
                        <hr/>
650
651
                        [% biblio = biblioloop.0 %]
652
                        <!-- ItemGroup level holds -->
653
                        [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
654
                        <fieldset class="rows">
655
                            <legend>
656
                                <label for="requestgrp" class="inline">
657
                                    Hold next available item from an item group
658
                                </label>
659
                                [% IF force_hold_level == 'item_group' %]
660
                                    <input type="radio" class="requestgrp" id="requestgrp" name="request" checked="checked" disabled="true" />
661
                                    <span class="error"><i>(Required)</i></span>
662
                                [% ELSIF force_hold_level == 'item' || force_hold_level == 'record' %]
663
                                    <input type="radio" class="requestgrp" id="requestgrp" name="request" disabled="true" />
664
                                [% ELSE %]
665
                                    <input type="radio" class="requestgrp" id="requestgrp" name="request" />
666
                                [% END %]
667
                            </legend>
668
669
                            [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
670
                                <span class="error">
671
                                    <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
672
                                    Hold must be record level
673
                                </span>
674
                            [% ELSIF force_hold_level == 'item' # Patron has placed an item level hold previously for this record %]
675
                                <span class="error">
676
                                    <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
677
                                    Hold must be item level
678
                                </span>
679
                            [% ELSE %]
680
                                <table>
681
                                    <thead>
682
                                        <tr>
683
                                            <th>Hold</th>
684
                                            <th>Item group</th>
685
                                        </tr>
686
                                    </thead>
687
                                    <tbody>
688
                                        [% FOREACH g IN biblio.object.item_groups.search({}, { order_by => ['display_order'] }) %]
689
                                            [% IF g.items %]
690
                                                <tr>
691
                                                    <td>
692
                                                        <input id="item_group_id_[% g.id | html %]" class="requestgrp" type="radio" name="item_group_id" value="[% g.id | html %]" />
693
                                                    </td>
694
                                                    <td>
695
                                                        <label for="item_group_id_[% g.id | html %]">[% g.description | html %]</label>
696
                                                    </td>
697
                                                </tr>
698
                                            [% END %]
699
                                        [% END %]
700
                                    </tbody>
701
                                </table>
702
                            [% END %]
703
                            <button type="submit" id="hold_grp_btn" class="btn btn-primary warning">Place hold</button>
704
                        </fieldset>
705
                        [% END %]
706
                        <!-- /ItemGroup level holds -->
707
642
708
643
                            [% biblio = biblioloop.0 %]
709
                        <fieldset class="rows">
710
                            <legend>
711
                                <label class="inline">
712
                                    Place a hold on a specific item
713
                                </label>
714
                                [% IF force_hold_level == 'item' %]
715
                                     <input type="radio" name="request" class="requestspecific" checked="checked" disabled='disabled'/>
716
                                     <span class="error"><em>(Required)</em></span>
717
                                [% ELSIF force_hold_level == 'record' || force_hold_level == 'item_group' %]
718
                                     <input type="radio" name="request" class="requestspecific" disabled='disabled'/>
719
                                [% ELSE %]
720
                                     <input type="radio" name="request" class="requestspecific"/>
721
                                [% END %]
722
                            </legend>
644
723
645
                            <ol>
724
                            <ol>
646
                                [% UNLESS Koha.Preference('item-level_itypes') %]
725
                                [% UNLESS Koha.Preference('item-level_itypes') %]
Lines 658-716 Link Here
658
                                [% END %]
737
                                [% END %]
659
                            </ol>
738
                            </ol>
660
739
661
                            <!-- ItemGroup level holds -->
662
                            [% IF Koha.Preference('EnableItemGroupHolds') && biblio.object.item_groups.count %]
663
                                <h2 style="padding: 0 1em;">
664
                                    Hold next available item from an item group
665
                                    [% IF force_hold_level == 'item_group' %]
666
                                        <span class="error"><i>(Required)</i></span>
667
                                    [% END %]
668
                                </h2>
669
670
                                [% IF force_hold_level == 'record' # Patron has placed a record level hold previously for this record %]
671
                                    <span class="error">
672
                                        <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
673
                                        Hold must be record level
674
                                    </span>
675
                                [% ELSIF force_hold_level == 'item' # Patron has placed an item level hold previously for this record %]
676
                                    <span class="error">
677
                                        <i class="fa fa-times fa-lg" title="Cannot be put on hold"></i>
678
                                        Hold must be item level
679
                                    </span>
680
                                [% ELSE %]
681
                                    <table>
682
                                        <thead>
683
                                            <tr>
684
                                                <th>Hold</th>
685
                                                <th>Item group</th>
686
                                            </tr>
687
                                        </thead>
688
                                        <tbody>
689
                                            [% FOREACH g IN biblio.object.item_groups.search({}, { order_by => ['display_order'] }) %]
690
                                                [% IF g.items %]
691
                                                    <tr>
692
                                                        <td>
693
                                                            <input id="item_group_id_[% g.id | html %]" type="radio" name="item_group_id" value="[% g.id | html %]" />
694
                                                        </td>
695
                                                        <td>
696
                                                            <label for="item_group_id_[% g.id | html %]">[% g.description | html %]</label>
697
                                                        </td>
698
                                                    </tr>
699
                                                [% END %]
700
                                            [% END %]
701
                                        </tbody>
702
                                    </table>
703
                                [% END %]
704
                            [% END %]
705
                            <!-- /ItemGroup level holds -->
706
707
                            <h2 style="padding: 0 1em;">
708
                                Place a hold on a specific item
709
                                [% IF force_hold_level == 'item' %]
710
                                     <span class="error"><em>(Required)</em></span>
711
                                [% END %]
712
                            </h2>
713
714
                            <table id="requestspecific">
740
                            <table id="requestspecific">
715
                                <thead>
741
                                <thead>
716
                                    <tr>
742
                                    <tr>
Lines 753-761 Link Here
753
                                                            Hold must be item group level
779
                                                            Hold must be item group level
754
                                                        </span>
780
                                                        </span>
755
                                                    [% ELSIF ( itemloo.available ) %]
781
                                                    [% ELSIF ( itemloo.available ) %]
756
                                                        <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
782
                                                        <input type="radio" name="checkitem" class="requestspecific" value="[% itemloo.itemnumber | html %]" />
757
                                                    [% ELSIF ( itemloo.override ) %]
783
                                                    [% ELSIF ( itemloo.override ) %]
758
                                                        <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
784
                                                        <input type="radio" name="checkitem" class="needsoverride requestspecific" value="[% itemloo.itemnumber | html %]" />
759
                                                        <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
785
                                                        <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
760
                                                    [% ELSE %]
786
                                                    [% ELSE %]
761
                                                        <span class="error">
787
                                                        <span class="error">
Lines 800-806 Link Here
800
                                                </td>
826
                                                </td>
801
                                                <td>
827
                                                <td>
802
                                                [% IF (itemloo.pickup_locations_count > 0) %]
828
                                                [% IF (itemloo.pickup_locations_count > 0) %]
803
                                                    <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
829
                                                    <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations requestspecific" style="width:100%;"
804
                                                            data-item-id="[% itemloo.itemnumber | html %]"
830
                                                            data-item-id="[% itemloo.itemnumber | html %]"
805
                                                            data-patron-id="[% patron.borrowernumber | html %]"
831
                                                            data-patron-id="[% patron.borrowernumber | html %]"
806
                                                            data-pickup-location-source="item">
832
                                                            data-pickup-location-source="item">
Lines 919-1023 Link Here
919
                            </table> <!-- /#requestspecific -->
945
                            </table> <!-- /#requestspecific -->
920
946
921
                            [% IF hiddencount %]
947
                            [% IF hiddencount %]
922
                                <form>
948
                                <p class="hiddencount">
923
                                    <p class="hiddencount">
949
                                    <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;borrowernumber=[% borrowernumber | uri %]&amp;showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
924
                                        <a href="request.pl?biblionumber=[% biblio.biblionumber | uri %]&amp;borrowernumber=[% borrowernumber | uri %]&amp;showallitems=1">Show all items ([% hiddencount | html %] hidden)</a>
950
                                </p>
925
                                    </p>
926
                                </form>
927
                            [% END # /IF hiddencount %]
951
                            [% END # /IF hiddencount %]
928
952
929
                        [% ELSE # /UNLESS multi_hold %]
953
                        [% ELSE # /UNLESS multi_hold %]
930
954
                            <fieldset class="rows">
931
                            <table id="requesttitles">
955
                                <legend>Hold details</legend>
932
                                <tr>
956
                                <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
933
                                    <th>&nbsp;</th>
957
                                        <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
934
                                    <th>Pickup location</th>
958
                                        <input type="hidden" name="request" value="any"/>
935
                                    <th>Title</th>
959
                                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
936
                                    [% UNLESS Koha.Preference('item-level_itypes') %]
960
                                        [% FOREACH biblioloo IN biblioloop %]
937
                                        <th>Item type</th>
961
                                            <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblioloo.biblionumber | html %]"/>
938
                                    [% END %]
962
                                            [% UNLESS biblioloo.none_avail %]
939
                                    <th>Priority</th>
963
                                                <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
940
                                    <th>Information</th>
964
                                                <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
941
                                </tr>
965
                                                <input type="hidden" name="rank_[% biblioloo.biblionumber | html %]" value="[% biblioloo.rank | html %]"/>
942
                                [% FOREACH biblioloo IN biblioloop %]
943
                                    [% IF ( biblioloo.warn ) %]
944
                                        <tr class="onissue">
945
                                    [% ELSE %]
946
                                        <tr>
947
                                    [% END %]
948
                                        <td>
949
                                            [% UNLESS ( biblioloo.warn ) %]
950
                                                <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
951
                                            [% END %]
952
                                        </td>
953
                                        <td>
954
                                            [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
955
                                                <select name="pickup_[% biblioloo.biblionumber | html %]"
956
                                                        class="multi_pickup_select"
957
                                                        data-biblio-id="[% biblioloo.biblionumber | html %]"
958
                                                        data-patron-id="[% patron.borrowernumber | html %]"
959
                                                        data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
960
                                                    <option value=""></option>
961
                                                    [% FOREACH pickup_location IN biblioloo.pickup_locations %]
962
                                                        <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
963
                                                    [% END %]
964
                                                </select>
965
                                            [% END %]
966
                                            [% END %]
966
                                        </td>
967
                                        [% END %]
967
                                        <td>
968
968
                                            <ul>
969
                                <table id="requesttitles">
969
                                                <li>
970
                                    <tr>
970
                                                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
971
                                        <th>&nbsp;</th>
971
                                                    [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
972
                                        <th>Pickup location</th>
972
                                                </li>
973
                                        <th>Title</th>
973
                                                [% IF ( biblioloo.publicationyear ) %]
974
                                        [% UNLESS Koha.Preference('item-level_itypes') %]
975
                                            <th>Item type</th>
976
                                        [% END %]
977
                                        <th>Priority</th>
978
                                        <th>Information</th>
979
                                    </tr>
980
                                    [% FOREACH biblioloo IN biblioloop %]
981
                                        [% IF ( biblioloo.warn ) %]
982
                                            <tr class="onissue">
983
                                        [% ELSE %]
984
                                            <tr>
985
                                        [% END %]
986
                                            <td>
987
                                                [% UNLESS ( biblioloo.warn ) %]
988
                                                    <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
989
                                                [% END %]
990
                                            </td>
991
                                            <td>
992
                                                [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
993
                                                    <select name="pickup_[% biblioloo.biblionumber | html %]"
994
                                                            class="multi_pickup_select"
995
                                                            data-biblio-id="[% biblioloo.biblionumber | html %]"
996
                                                            data-patron-id="[% patron.borrowernumber | html %]"
997
                                                            data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
998
                                                        <option value=""></option>
999
                                                        [% FOREACH pickup_location IN biblioloo.pickup_locations %]
1000
                                                            <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
1001
                                                        [% END %]
1002
                                                    </select>
1003
                                                [% END %]
1004
                                            </td>
1005
                                            <td>
1006
                                                <ul>
974
                                                    <li>
1007
                                                    <li>
975
                                                        <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
1008
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
1009
                                                        [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
976
                                                    </li>
1010
                                                    </li>
1011
                                                    [% IF ( biblioloo.publicationyear ) %]
1012
                                                        <li>
1013
                                                            <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
1014
                                                        </li>
1015
                                                    [% END %]
1016
                                                </ul>
1017
                                                [% IF ( biblioloo.warn ) %]
1018
                                                    <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
977
                                                [% END %]
1019
                                                [% END %]
978
                                            </ul>
979
                                            [% IF ( biblioloo.warn ) %]
980
                                                <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
981
                                            [% END %]
982
                                        </td>
983
                                        [% UNLESS Koha.Preference('item-level_itypes') %]
984
                                            <td>
985
                                                <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
986
                                            </td>
1020
                                            </td>
987
                                        [% END %]
1021
                                            [% UNLESS Koha.Preference('item-level_itypes') %]
988
                                        <td>[% biblioloo.rank | html %]</td>
1022
                                                <td>
989
                                        <td>
1023
                                                    <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
990
                                            [% IF ( biblioloo.checked_previously ) %]
1024
                                                </td>
991
                                                <span>Patron has previously checked out this title</span><br/>
992
                                            [% END %]
1025
                                            [% END %]
993
                                            [% IF ( biblioloo.alreadyres ) %]
1026
                                            <td>[% biblioloo.rank | html %]</td>
994
                                                <ul>
1027
                                            <td>
995
                                            [% ELSE %]
1028
                                                [% IF ( biblioloo.checked_previously ) %]
996
                                                [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1029
                                                    <span>Patron has previously checked out this title</span><br/>
1030
                                                [% END %]
1031
                                                [% IF ( biblioloo.alreadyres ) %]
997
                                                    <ul>
1032
                                                    <ul>
1033
                                                [% ELSE %]
1034
                                                    [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1035
                                                        <ul>
1036
                                                    [% END %]
998
                                                [% END %]
1037
                                                [% END %]
999
                                            [% END %]
1000
1038
1001
                                            [% IF ( biblioloo.alreadyres ) %]
1039
                                                [% IF ( biblioloo.alreadyres ) %]
1002
                                            <li>
1040
                                                <li>
1003
                                                [% 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
1041
                                                    [% 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
1004
                                            </li>
1042
                                                </li>
1005
                                            [% END %]
1043
                                                [% END %]
1006
                                            [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1007
                                                <li> <strong>No items are available</strong> to be placed on hold</li>
1008
                                            [% END %]
1009
1010
                                            [% IF ( biblioloo.alreadyres ) %]
1011
                                                </ul>
1012
                                            [% ELSE %]
1013
                                                [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1044
                                                [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1045
                                                    <li> <strong>No items are available</strong> to be placed on hold</li>
1046
                                                [% END %]
1047
1048
                                                [% IF ( biblioloo.alreadyres ) %]
1014
                                                    </ul>
1049
                                                    </ul>
1050
                                                [% ELSE %]
1051
                                                    [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1052
                                                        </ul>
1053
                                                    [% END %]
1015
                                                [% END %]
1054
                                                [% END %]
1016
                                            [% END %]
1055
                                            </td>
1017
                                        </td>
1056
                                        </tr>
1018
                                    </tr>
1057
                                    [% END # /FOREACH biblioloo %]
1019
                                [% END # /FOREACH biblioloo %]
1058
                                </table> <!-- /#requesttitles -->
1020
                            </table> <!-- /#requesttitles -->
1059
                            </fieldset>
1021
1060
1022
                        [% END # /UNLESS multi_hold %]
1061
                        [% END # /UNLESS multi_hold %]
1023
1062
Lines 1025-1051 Link Here
1025
                            [% IF ( patron AND patron.borrowernumber ) %]
1064
                            [% IF ( patron AND patron.borrowernumber ) %]
1026
                                [% IF ( multi_hold ) %]
1065
                                [% IF ( multi_hold ) %]
1027
                                    [% IF ( override_required ) %]
1066
                                    [% IF ( override_required ) %]
1028
                                        <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
1067
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
1029
                                    [% ELSIF ( no_bibs_available ) %]
1068
                                    [% ELSIF ( no_bibs_available ) %]
1030
                                        <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place holds</button>
1069
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary btn-disabled" disabled="disabled">Place holds</button>
1031
                                    [% ELSIF ( none_available ) %]
1070
                                    [% ELSIF ( none_available ) %]
1032
                                        <button type="submit" class="btn btn-primary">Place holds</button>
1071
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary">Place holds</button>
1033
                                    [% ELSE %]
1072
                                    [% ELSE %]
1034
                                        <button type="submit" class="btn btn-primary" id="multi_hold_submit">Place holds</button>
1073
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary" id="multi_hold_submit">Place holds</button>
1035
                                    [% END %]
1074
                                    [% END %]
1036
                                [% ELSE %]
1075
                                [% ELSE %]
1037
                                    [% IF ( override_required ) %]
1076
                                    [% IF ( override_required ) %]
1038
                                        <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
1077
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
1039
                                    [% ELSIF ( none_available ) %]
1078
                                    [% ELSIF ( none_available ) %]
1040
                                        <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place hold</button>
1079
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary btn-disabled" disabled="disabled">Place hold</button>
1041
                                    [% ELSE %]
1080
                                    [% ELSE %]
1042
                                        <button type="submit" class="btn btn-primary">Place hold</button>
1081
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary">Place hold</button>
1043
                                    [% END %]
1082
                                    [% END %]
1044
                                [% END %]
1083
                                [% END %]
1045
                            [% END # /IF patron %]
1084
                            [% END # /IF patron %]
1046
                        </fieldset> <!-- /.action -->
1085
                        </fieldset> <!-- /.action -->
1047
                    </form> <!-- /#hold-request-form -->
1086
                    </fieldset> <!-- /.rows -->
1048
                </fieldset> <!-- /.rows -->
1087
                </form> <!-- /#hold-request-form -->
1049
            [% END %]
1088
            [% END %]
1050
1089
1051
            [% UNLESS ( patron ) %]
1090
            [% UNLESS ( patron ) %]
Lines 1363-1377 Link Here
1363
            }
1402
            }
1364
1403
1365
1404
1366
            function ToggleHoldsToPlace() {
1367
                if ( $("#requestany").prop('checked') ) {
1368
                    $("#holds_to_place_count").prop('disabled', false);
1369
                } else {
1370
                    $("#holds_to_place_count").prop('disabled', true);
1371
                }
1372
            }
1373
            ToggleHoldsToPlace();
1405
            ToggleHoldsToPlace();
1374
            $("#requestany").on('change', function(){
1406
            $("#requestany,.requestspecific[name='request'],.requestgrp").on('change', function(){
1375
                ToggleHoldsToPlace();
1407
                ToggleHoldsToPlace();
1376
            });
1408
            });
1377
1409
Lines 1390-1401 Link Here
1390
                "sDom": '<"top pager"ilf>t',
1422
                "sDom": '<"top pager"ilf>t',
1391
            }));
1423
            }));
1392
1424
1393
            //Override fieldset styling for dataTables search box
1394
            $("div.top.pager").css("margin-left","1em");
1395
            $(".dataTables_filter label").css({
1396
                "width":"auto",
1397
                "margin-right":"0em"
1398
            });
1399
1425
1400
            $("#club-request-form").on("submit", function() {
1426
            $("#club-request-form").on("submit", function() {
1401
                let $t = $(this);
1427
                let $t = $(this);
Lines 1497-1502 Link Here
1497
            });
1523
            });
1498
        });
1524
        });
1499
1525
1526
        function ToggleHoldsToPlace() {
1527
            if ( $("#requestany").prop('checked') ) {
1528
                $("#holds_to_place_count, #pickup, #itemtype, #hold_any_btn").prop('disabled', false);
1529
                $(".requestspecific,.requestgrp").prop('checked', false);
1530
                $("#hold_item_btn, #hold_grp_btn").prop("disabled", true );
1531
                $("#hold_any_btn").prop("disabled", false );
1532
            } else if( $(".requestspecific").prop('checked') ) {
1533
                $("#holds_to_place_count, #pickup, #itemtype, #hold_any_btn").prop('disabled', true);
1534
                $("#hold_item_btn").prop("disabled", false );
1535
                $("#hold_any_btn,#hold_grp_btn").prop("disabled", true );
1536
                $("#requestany,.requestgrp").prop('checked', false);
1537
            } else {
1538
                $("#holds_to_place_count, #pickup, #itemtype, #hold_any_btn").prop('disabled', true);
1539
                $("#hold_grp_btn").prop("disabled", false );
1540
                $("#hold_any_btn,#hold_item_btn").prop("disabled", true );
1541
                $("#requestany,.requestspecific").prop('checked', false);
1542
            }
1543
        }
1544
1500
        function check( e, table ) {
1545
        function check( e, table ) {
1501
1546
1502
            var msg = "";
1547
            var msg = "";
Lines 1606-1615 Link Here
1606
                });
1651
                });
1607
                if(onechecked == 1){
1652
                if(onechecked == 1){
1608
                    $("#requestany").prop("checked", false);
1653
                    $("#requestany").prop("checked", false);
1609
                    $("#holds_to_place_count").prop('disabled', true);
1654
                    $("#holds_to_place_count,#pickup,#itemtype").prop('disabled', true);
1610
                } else {
1655
                } else {
1611
                    $("#requestany").prop("checked",true);
1656
                    $("#requestany").prop("checked",true);
1612
                    $("#holds_to_place_count").prop('disabled', false);
1657
                    $("#holds_to_place_count,#pickup,#itemtype").prop('disabled', false);
1613
                }
1658
                }
1614
            });
1659
            });
1615
            var prev_rank_request;
1660
            var prev_rank_request;
(-)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