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

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

Return to bug 30579