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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-287 / +333 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>
622
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
                                                    <th>Holdable items</th>
671
                                                </tr>
672
                                            </thead>
673
                                            <tbody>
674
                                                [% FOREACH g IN biblio.object.item_groups.search({}, { order_by => ['display_order'] }) %]
675
                                                    [% IF g.items.count %]
676
                                                        <tr>
677
                                                            <td>
678
                                                                <input id="item_group_id_[% g.id | html %]" class="requestgrp" type="radio" name="item_group_id" value="[% g.id | html %]" />
679
                                                            </td>
680
                                                            <td>
681
                                                                <label for="item_group_id_[% g.id | html %]">[% g.description | html %]</label>
682
                                                            </td>
683
                                                            <td>
684
                                                                [% FOREACH i IN g.items %]
685
                                                                    <div><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% i.biblionumber | uri %]#item[% i.itemnumber | uri %]">[% i.barcode | html %]</a></div>
686
                                                                [% END %]
687
                                                            </td>
688
                                                        </tr>
689
                                                    [% ELSE %]
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 %]" disabled="disabled" />
693
                                                            </td>
694
                                                            <td>
695
                                                                <label for="item_group_id_[% g.id | html %]">[% g.description | html %]</label>
696
                                                            </td>
697
                                                            <td>
698
                                                                <div class="error">No holdable items in this item group.</div>
699
                                                            </td>
700
                                                        </tr>
701
                                                    [% END %]
702
                                                [% END %]
703
                                            </tbody>
704
                                        </table>
705
                                    </li>
706
                                </ul>
707
                            [% END %]
708
                            <button type="submit" id="hold_grp_btn" class="btn btn-primary warning">Place hold</button>
709
                        </fieldset>
710
                        [% END %]
711
                        <!-- /ItemGroup level holds -->
625
712
626
                            [% biblio_info = biblioloop.0 %]
713
714
                        <fieldset class="rows">
715
                            <legend>
716
                                <label class="inline">
717
                                    Place a hold on a specific item
718
                                </label>
719
                                [% IF force_hold_level == 'item' %]
720
                                     <input type="radio" name="request" class="requestspecific" checked="checked" disabled='disabled'/>
721
                                     <span class="error"><em>(Required)</em></span>
722
                                [% ELSIF force_hold_level == 'record' || force_hold_level == 'item_group' %]
723
                                     <input type="radio" name="request" class="requestspecific" disabled='disabled'/>
724
                                [% ELSE %]
725
                                     <input type="radio" name="request" class="requestspecific"/>
726
                                [% END %]
727
                            </legend>
627
728
628
                            <ol>
729
                            <ol>
629
                                [% UNLESS Koha.Preference('item-level_itypes') %]
730
                                [% UNLESS Koha.Preference('item-level_itypes') %]
Lines 641-717 Link Here
641
                                [% END %]
742
                                [% END %]
642
                            </ol>
743
                            </ol>
643
744
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
                                                <th>Holdable items</th>
670
                                            </tr>
671
                                        </thead>
672
                                        <tbody>
673
                                            [% FOREACH g IN biblio_info.object.item_groups.search({}, { order_by => ['display_order'] }) %]
674
                                                [% IF g.items.count %]
675
                                                    <tr>
676
                                                        <td>
677
                                                            <input id="item_group_id_[% g.id | html %]" 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
                                                        <td>
683
                                                            [% FOREACH i IN g.items %]
684
                                                                <div><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% i.biblionumber | uri %]#item[% i.itemnumber | uri %]">[% i.barcode | html %]</a></div>
685
                                                            [% END %]
686
                                                        </td>
687
                                                    </tr>
688
                                                [% ELSE %]
689
                                                    <tr>
690
                                                        <td>
691
                                                            <input id="item_group_id_[% g.id | html %]" type="radio" name="item_group_id" value="[% g.id | html %]" disabled="disabled" />
692
                                                        </td>
693
                                                        <td>
694
                                                            <label for="item_group_id_[% g.id | html %]">[% g.description | html %]</label>
695
                                                        </td>
696
                                                        <td>
697
                                                            <div class="error">No holdable items in this item group.</div>
698
                                                        </td>
699
                                                    </tr>
700
                                                [% END %]
701
                                            [% END %]
702
                                        </tbody>
703
                                    </table>
704
                                [% END %]
705
                            [% END %]
706
                            <!-- /ItemGroup level holds -->
707
708
                            <h2 style="padding: 0 1em;">
709
                                Place a hold on a specific item
710
                                [% IF force_hold_level == 'item' %]
711
                                     <span class="error"><em>(Required)</em></span>
712
                                [% END %]
713
                            </h2>
714
715
                            <table id="requestspecific">
745
                            <table id="requestspecific">
716
                                <thead>
746
                                <thead>
717
                                    <tr>
747
                                    <tr>
Lines 754-762 Link Here
754
                                                            Hold must be item group level
784
                                                            Hold must be item group level
755
                                                        </span>
785
                                                        </span>
756
                                                    [% ELSIF ( itemloo.available ) %]
786
                                                    [% ELSIF ( itemloo.available ) %]
757
                                                        <input type="radio" name="checkitem" value="[% itemloo.itemnumber | html %]" />
787
                                                        <input type="radio" name="checkitem" class="requestspecific" value="[% itemloo.itemnumber | html %]" />
758
                                                    [% ELSIF ( itemloo.override ) %]
788
                                                    [% ELSIF ( itemloo.override ) %]
759
                                                        <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
789
                                                        <input type="radio" name="checkitem" class="needsoverride requestspecific" value="[% itemloo.itemnumber | html %]" />
760
                                                        <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
790
                                                        <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" title="Requires override of hold policy"/></i>
761
                                                    [% ELSE %]
791
                                                    [% ELSE %]
762
                                                        <span class="error">
792
                                                        <span class="error">
Lines 800-807 Link Here
800
                                                    [% END # /IF force_hold_level %]
830
                                                    [% END # /IF force_hold_level %]
801
                                                </td>
831
                                                </td>
802
                                                <td>
832
                                                <td>
833
<<<<<<< HEAD
803
                                                [% IF (itemloo.pickup_locations_count > 0) || Koha.Preference('AllowHoldPolicyOverride') %]
834
                                                [% IF (itemloo.pickup_locations_count > 0) || Koha.Preference('AllowHoldPolicyOverride') %]
804
                                                    <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
835
                                                    <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations" style="width:100%;"
836
=======
837
                                                [% IF (itemloo.pickup_locations_count > 0) || itemloo.override %]
838
                                                    <select name="item_pickup_[% itemloo.itemnumber | html %]" class="pickup_locations requestspecific" style="width:100%;"
839
>>>>>>> Bug 30579: Disentangle multi-hold and single bib forms
805
                                                            data-item-id="[% itemloo.itemnumber | html %]"
840
                                                            data-item-id="[% itemloo.itemnumber | html %]"
806
                                                            data-patron-id="[% patron.borrowernumber | html %]"
841
                                                            data-patron-id="[% patron.borrowernumber | html %]"
807
                                                            data-pickup-location-source="item">
842
                                                            data-pickup-location-source="item">
Lines 927-1023 Link Here
927
                            [% END # /IF hiddencount %]
962
                            [% END # /IF hiddencount %]
928
963
929
                        [% ELSE # /UNLESS multi_hold %]
964
                        [% ELSE # /UNLESS multi_hold %]
930
965
                            <fieldset class="rows">
931
                            <table id="requesttitles">
966
                                <legend>Hold details</legend>
932
                                <tr>
967
                                <form action="placerequest.pl" method="post" name="form" id="hold-request-form">
933
                                    <th>&nbsp;</th>
968
                                        <input type="hidden" name="multi_holds" id="multi_holds" value="1" />
934
                                    <th>Pickup location</th>
969
                                        <input type="hidden" name="request" value="any"/>
935
                                    <th>Title</th>
970
                                    <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
936
                                    [% UNLESS Koha.Preference('item-level_itypes') %]
971
                                        [% FOREACH biblioloo IN biblioloop %]
937
                                        <th>Item type</th>
972
                                            <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblioloo.biblionumber | html %]"/>
938
                                    [% END %]
973
                                            [% UNLESS biblioloo.none_avail %]
939
                                    <th>Priority</th>
974
                                                <input type="hidden" name="holdable_bibs" id="holdable_bibs" value="[% biblioloo.biblionumber | html %]"/>
940
                                    <th>Information</th>
975
                                                <input type="hidden" name="title_[% biblioloo.biblionumber | html %]" value="[% biblioloo.title | html %]"/>
941
                                </tr>
976
                                                <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 %]
977
                                            [% END %]
966
                                        </td>
978
                                        [% END %]
967
                                        <td>
979
968
                                            <ul>
980
                                <table id="requesttitles">
969
                                                <li>
981
                                    <tr>
970
                                                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
982
                                        <th>&nbsp;</th>
971
                                                    [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
983
                                        <th>Pickup location</th>
972
                                                </li>
984
                                        <th>Title</th>
973
                                                [% IF ( biblioloo.publicationyear ) %]
985
                                        [% UNLESS Koha.Preference('item-level_itypes') %]
986
                                            <th>Item type</th>
987
                                        [% END %]
988
                                        <th>Priority</th>
989
                                        <th>Information</th>
990
                                    </tr>
991
                                    [% FOREACH biblioloo IN biblioloop %]
992
                                        [% IF ( biblioloo.warn ) %]
993
                                            <tr class="onissue">
994
                                        [% ELSE %]
995
                                            <tr>
996
                                        [% END %]
997
                                            <td>
998
                                                [% UNLESS ( biblioloo.warn ) %]
999
                                                    <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/>
1000
                                                [% END %]
1001
                                            </td>
1002
                                            <td>
1003
                                                [% UNLESS ( biblioloo.none_avail || biblioloo.noitems ) %]
1004
                                                    <select name="pickup_[% biblioloo.biblionumber | html %]"
1005
                                                            class="multi_pickup_select"
1006
                                                            data-biblio-id="[% biblioloo.biblionumber | html %]"
1007
                                                            data-patron-id="[% patron.borrowernumber | html %]"
1008
                                                            data-pickup-locations='[% biblioloo.pickup_locations_codes.json | $raw %]'>
1009
                                                        <option value=""></option>
1010
                                                        [% FOREACH pickup_location IN biblioloo.pickup_locations %]
1011
                                                            <option value="[% pickup_location.branchcode | html %]">[% pickup_location.branchname | html %]</option>
1012
                                                        [% END %]
1013
                                                    </select>
1014
                                                [% END %]
1015
                                            </td>
1016
                                            <td>
1017
                                                <ul>
974
                                                    <li>
1018
                                                    <li>
975
                                                        <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
1019
                                                        <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a>
1020
                                                        [% IF biblioloo.author %] by [% biblioloo.author | html %][% END %]
976
                                                    </li>
1021
                                                    </li>
1022
                                                    [% IF ( biblioloo.publicationyear ) %]
1023
                                                        <li>
1024
                                                            <span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]
1025
                                                        </li>
1026
                                                    [% END %]
1027
                                                </ul>
1028
                                                [% IF ( biblioloo.warn ) %]
1029
                                                    <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span>
977
                                                [% END %]
1030
                                                [% 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>
1031
                                            </td>
987
                                        [% END %]
1032
                                            [% UNLESS Koha.Preference('item-level_itypes') %]
988
                                        <td>[% biblioloo.rank | html %]</td>
1033
                                                <td>
989
                                        <td>
1034
                                                    <img src="[% biblioloo.itemtype.image_location | html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" />
990
                                            [% IF ( biblioloo.checked_previously ) %]
1035
                                                </td>
991
                                                <span>Patron has previously checked out this title</span><br/>
992
                                            [% END %]
1036
                                            [% END %]
993
                                            [% IF ( biblioloo.alreadyres ) %]
1037
                                            <td>[% biblioloo.rank | html %]</td>
994
                                                <ul>
1038
                                            <td>
995
                                            [% ELSE %]
1039
                                                [% IF ( biblioloo.checked_previously ) %]
996
                                                [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1040
                                                    <span>Patron has previously checked out this title</span><br/>
1041
                                                [% END %]
1042
                                                [% IF ( biblioloo.alreadyres ) %]
997
                                                    <ul>
1043
                                                    <ul>
1044
                                                [% ELSE %]
1045
                                                    [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1046
                                                        <ul>
1047
                                                    [% END %]
998
                                                [% END %]
1048
                                                [% END %]
999
                                            [% END %]
1000
1001
                                            [% IF ( biblioloo.alreadyres ) %]
1002
                                            <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
1004
                                            </li>
1005
                                            [% 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
1049
1010
                                            [% IF ( biblioloo.alreadyres ) %]
1050
                                                [% IF ( biblioloo.alreadyres ) %]
1011
                                                </ul>
1051
                                                <li>
1012
                                            [% ELSE %]
1052
                                                    [% 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
1053
                                                </li>
1054
                                                [% END %]
1013
                                                [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1055
                                                [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1056
                                                    <li> <strong>No items are available</strong> to be placed on hold</li>
1057
                                                [% END %]
1058
1059
                                                [% IF ( biblioloo.alreadyres ) %]
1014
                                                    </ul>
1060
                                                    </ul>
1061
                                                [% ELSE %]
1062
                                                    [% IF ( biblioloo.none_avail || biblioloo.noitems ) %]
1063
                                                        </ul>
1064
                                                    [% END %]
1015
                                                [% END %]
1065
                                                [% END %]
1016
                                            [% END %]
1066
                                            </td>
1017
                                        </td>
1067
                                        </tr>
1018
                                    </tr>
1068
                                    [% END # /FOREACH biblioloo %]
1019
                                [% END # /FOREACH biblioloo %]
1069
                                </table> <!-- /#requesttitles -->
1020
                            </table> <!-- /#requesttitles -->
1070
                            </fieldset>
1021
1071
1022
                        [% END # /UNLESS multi_hold %]
1072
                        [% END # /UNLESS multi_hold %]
1023
1073
Lines 1025-1051 Link Here
1025
                            [% IF ( patron AND patron.borrowernumber ) %]
1075
                            [% IF ( patron AND patron.borrowernumber ) %]
1026
                                [% IF ( multi_hold ) %]
1076
                                [% IF ( multi_hold ) %]
1027
                                    [% IF ( override_required ) %]
1077
                                    [% IF ( override_required ) %]
1028
                                        <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
1078
                                        <button type="submit" id="hold_multi_btn" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place holds</button>
1029
                                    [% ELSIF ( no_bibs_available ) %]
1079
                                    [% ELSIF ( no_bibs_available ) %]
1030
                                        <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place holds</button>
1080
                                        <button type="submit" id="hold_multi_btn" class="btn btn-primary btn-disabled" disabled="disabled">Place holds</button>
1031
                                    [% ELSIF ( none_available ) %]
1081
                                    [% ELSIF ( none_available ) %]
1032
                                        <button type="submit" class="btn btn-primary">Place holds</button>
1082
                                        <button type="submit" id="hold_multi_btn" class="btn btn-primary">Place holds</button>
1033
                                    [% ELSE %]
1083
                                    [% ELSE %]
1034
                                        <button type="submit" class="btn btn-primary" id="multi_hold_submit">Place holds</button>
1084
                                        <button type="submit" id="hold_multi_btn" class="btn btn-primary" id="multi_hold_submit">Place holds</button>
1035
                                    [% END %]
1085
                                    [% END %]
1036
                                [% ELSE %]
1086
                                [% ELSE %]
1037
                                    [% IF ( override_required ) %]
1087
                                    [% IF ( override_required ) %]
1038
                                        <button type="submit" class="btn btn-primary warning"><i class="fa fa-exclamation-triangle "></i> Place hold</button>
1088
                                        <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 ) %]
1089
                                    [% ELSIF ( none_available ) %]
1040
                                        <button type="submit" class="btn btn-primary btn-disabled" disabled="disabled">Place hold</button>
1090
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary btn-disabled" disabled="disabled">Place hold</button>
1041
                                    [% ELSE %]
1091
                                    [% ELSE %]
1042
                                        <button type="submit" class="btn btn-primary">Place hold</button>
1092
                                        <button type="submit" id="hold_item_btn" class="btn btn-primary">Place hold</button>
1043
                                    [% END %]
1093
                                    [% END %]
1044
                                [% END %]
1094
                                [% END %]
1045
                            [% END # /IF patron %]
1095
                            [% END # /IF patron %]
1046
                        </fieldset> <!-- /.action -->
1096
                        </fieldset> <!-- /.action -->
1047
                    </form> <!-- /#hold-request-form -->
1097
                    </fieldset> <!-- /.rows -->
1048
                </fieldset> <!-- /.rows -->
1098
                </form> <!-- /#hold-request-form -->
1049
            [% END %]
1099
            [% END %]
1050
1100
1051
            [% UNLESS ( patron ) %]
1101
            [% UNLESS ( patron ) %]
Lines 1386-1406 Link Here
1386
            }
1436
            }
1387
1437
1388
1438
1389
            function ToggleHoldsToPlace() {
1390
                if ( $("#requestany").prop('checked') ) {
1391
                    $("#holds_to_place_count").prop('disabled', false);
1392
                } else {
1393
                    $("#holds_to_place_count").prop('disabled', true);
1394
                }
1395
            }
1396
            ToggleHoldsToPlace();
1439
            ToggleHoldsToPlace();
1397
            $("#requestany").on('change', function(){
1440
            $("#requestany,.requestspecific[name='request'],.requestgrp").on('change', function(){
1398
                ToggleHoldsToPlace();
1441
                ToggleHoldsToPlace();
1399
            });
1442
            });
1400
1443
1401
            [% IF Koha.Preference('UseBranchTransferLimits') %]
1444
            [% IF Koha.Preference('UseBranchTransferLimits') %]
1402
                $("#pickup").on('change', function(){
1445
                $("#pickup,#pickup-next-avail,#pickup-item-group").on('change', function(){
1403
                    var pickup = $("#pickup").val();
1446
                    var pickup = $(this).val();
1404
                    var url = "?pickup=" + pickup;
1447
                    var url = "?pickup=" + pickup;
1405
                    url += "&borrowernumber=" + borrowernumber;
1448
                    url += "&borrowernumber=" + borrowernumber;
1406
                    url += "&biblionumber=" + biblionumbers[0];
1449
                    url += "&biblionumber=" + biblionumbers[0];
Lines 1413-1424 Link Here
1413
                "dom": '<"top pager"ilf>t',
1456
                "dom": '<"top pager"ilf>t',
1414
            }));
1457
            }));
1415
1458
1416
            //Override fieldset styling for dataTables search box
1417
            $("div.top.pager").css("margin-left","1em");
1418
            $(".dataTables_filter label").css({
1419
                "width":"auto",
1420
                "margin-right":"0em"
1421
            });
1422
1459
1423
            $("#club-request-form").on("submit", function() {
1460
            $("#club-request-form").on("submit", function() {
1424
                let $t = $(this);
1461
                let $t = $(this);
Lines 1511-1517 Link Here
1511
                }
1548
                }
1512
            });
1549
            });
1513
1550
1514
            $("#pickup").each( function () {
1551
            $("#pickup,#pickup-item-group,#pickup-next-avail").each( function () {
1515
                $(this).pickup_locations_dropdown();
1552
                $(this).pickup_locations_dropdown();
1516
            });
1553
            });
1517
1554
Lines 1520-1538 Link Here
1520
            });
1557
            });
1521
        });
1558
        });
1522
1559
1560
        function ToggleHoldsToPlace() {
1561
            if ( $("#requestany").prop('checked') ) {
1562
                $("#holds_to_place_count, #pickup-next-avail, #itemtype, #hold_any_btn").prop('disabled', false);
1563
                $(".requestspecific,.requestgrp").prop('checked', false);
1564
                $(".requestspecific","#requestspecific").prop('disabled',true);
1565
                $("#hold_item_btn, #hold_grp_btn, #pickup-item-group").prop("disabled", true );
1566
                $("#hold_any_btn").prop("disabled", false );
1567
            } else if( $(".requestspecific").prop('checked') ) {
1568
                $(".requestspecific","#requestspecific").prop('disabled',false);
1569
                $("#holds_to_place_count, #pickup-item-group, #pickup-next-avail #itemtype, #hold_any_btn").prop('disabled', true);
1570
                $("#hold_item_btn").prop("disabled", false );
1571
                $("#hold_any_btn,#hold_grp_btn").prop("disabled", true );
1572
                $("#requestany,.requestgrp").prop('checked', false);
1573
            } else {
1574
                $("#holds_to_place_count, #pickup-next-avail, #itemtype, #hold_any_btn").prop('disabled', true);
1575
                $("#hold_grp_btn, #pickup-item-group").prop("disabled", false );
1576
                $(".requestspecific","#requestspecific").prop('disabled',true);
1577
                $("#hold_any_btn,#hold_item_btn").prop("disabled", true );
1578
                $("#requestany,.requestspecific").prop('checked', false);
1579
            }
1580
        }
1581
1523
        function check( e, table ) {
1582
        function check( e, table ) {
1524
1583
1525
            var msg = "";
1584
            var msg = "";
1526
1585
1527
            if ( ! $("#requestany").is(":checked") ) {
1586
            if ( $(".requestspecific").is(":checked") ) {
1528
                // requestany not selected, go through the item-specific cases
1587
                // requestany not selected, go through the item-specific cases
1529
                if ( $('input[type="radio"]:checked').length > 0 ) {
1588
                var selected_item = $('#requestspecific input[type="radio"]:checked');
1589
                if ( selected_item.length > 0 ) {
1530
                    // got item-specific hold requests in the form!
1590
                    // got item-specific hold requests in the form!
1531
                    // verify they have a pickup location selected
1591
                    // verify they have a pickup location selected
1532
1592
1533
                    if (table.find('input[type="radio"]:checked')
1593
                    if ( selected_item.closest('tr').find(".pickup_locations").val() == '' ) {
1534
                                .closest('tr')
1535
                                .find(".pickup_locations").val() === null) {
1536
1594
1537
                        msg = _("- Please select a pickup location for the item" + "\n")
1595
                        msg = _("- Please select a pickup location for the item" + "\n")
1538
                    }
1596
                    }
Lines 1540-1547 Link Here
1540
                else {
1598
                else {
1541
                    msg = (_("- Please select an item to place a hold") + "\n");
1599
                    msg = (_("- Please select an item to place a hold") + "\n");
1542
                }
1600
                }
1601
            } else if ( $("#requestgrp").is(":checked") ) {
1602
                var selected_group = $('#requestgroup input[type="radio"]:checked');
1603
                if( selected_group.length > 0 ){
1604
                    if( $("#pickup-item-group").length < 1 || $("#pickup-item-grp").val() == "" ){
1605
                        msg = _("- Please select a pickup location for this hold" + "\n");
1606
                    }
1607
                } else {
1608
                    msg = (_("- Please select an item group to place a hold") + "\n");
1609
                }
1543
            } else {
1610
            } else {
1544
                if( $("#pickup").length < 1 || $("#pickup").val() == "" || $('#pickup').val() === null ){
1611
                // Requesting next available
1612
                if( $("#pickup-next-avail").length < 1 || $("#pickup-next-avail").val() == "" || $('#pickup-next-avail').val() === null ){
1545
                    msg = _("- Please select a pickup location for this hold" + "\n");
1613
                    msg = _("- Please select a pickup location for this hold" + "\n");
1546
                }
1614
                }
1547
            }
1615
            }
Lines 1613-1640 Link Here
1613
            $("button.warning").click(function() {
1681
            $("button.warning").click(function() {
1614
                return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1682
                return confirm( _("None of these items can normally be put on hold for this patron.") + "\n\n" + _("Place hold?") );
1615
            });
1683
            });
1616
            $("#requestany").click(function() {
1617
                if(this.checked){
1618
                    $("input[name=checkitem]").each(function() {
1619
                        $(this).prop("checked", false);
1620
                    });
1621
                }
1622
            });
1623
            $("input[name=checkitem]").click(function() {
1624
                onechecked = 0;
1625
                $("input[name=checkitem]").each(function() {
1626
                    if(this.checked){
1627
                        onechecked = 1;
1628
                    }
1629
                });
1630
                if(onechecked == 1){
1631
                    $("#requestany").prop("checked", false);
1632
                    $("#holds_to_place_count").prop('disabled', true);
1633
                } else {
1634
                    $("#requestany").prop("checked",true);
1635
                    $("#holds_to_place_count").prop('disabled', false);
1636
                }
1637
            });
1638
            var prev_rank_request;
1684
            var prev_rank_request;
1639
            $("select[name=rank-request]").on("focus", function() {
1685
            $("select[name=rank-request]").on("focus", function() {
1640
                prev_rank_request = $(this).val();
1686
                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