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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (+18 lines)
Lines 3-8 Link Here
3
[% USE Asset %]
3
[% USE Asset %]
4
[% USE JSON.Escape %]
4
[% USE JSON.Escape %]
5
[% USE Koha %]
5
[% USE Koha %]
6
[% USE Biblio %]
6
[% USE KohaDates %]
7
[% USE KohaDates %]
7
[% USE Branches %]
8
[% USE Branches %]
8
[% USE Categories %]
9
[% USE Categories %]
Lines 904-909 Link Here
904
            [% END %]
905
            [% END %]
905
906
906
            [% UNLESS ( patron ) %]
907
            [% UNLESS ( patron ) %]
908
                [% SET hold_count = Biblio.HoldsCount( biblio.biblionumber ) | html %]
909
                [% IF hold_count %]
910
                    <label for ="always_show_holds">Always show holds</label>
911
                    [% IF always_show_holds == 'DONT' %]
912
                        <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
913
                        <a class="btn btn-default" value="Show holds" id="show_holds_now" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblio.biblionumber %]&show_holds_now=1">Show holds ([% hold_count %])</a>
914
                    [% ELSE %]
915
                        <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
916
                    [% END %]
917
                [% END %]
907
                [% IF ( reserveloop ) %]
918
                [% IF ( reserveloop ) %]
908
                    <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
919
                    <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
909
                        [% IF ( multi_hold ) %]
920
                        [% IF ( multi_hold ) %]
Lines 1399-1404 Link Here
1399
        }
1410
        }
1400
1411
1401
         $(document).ready(function() {
1412
         $(document).ready(function() {
1413
            $("#always_show_holds").change(function(){
1414
                if( $(this).prop('checked') ){
1415
                    document.cookie = 'always_show_holds=DO';
1416
                } else {
1417
                    document.cookie = 'always_show_holds=DONT';
1418
                }
1419
            });
1402
            $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1420
            $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1403
                var itemnumber = this.value;
1421
                var itemnumber = this.value;
1404
                var msg = '';
1422
                var msg = '';
(-)a/reserve/request.pl (-50 / +54 lines)
Lines 678-734 if ( ( $findborrower && $borrowernumber_hold || $findclub && $club_hold ) Link Here
678
678
679
        # existingreserves building
679
        # existingreserves building
680
        my @reserveloop;
680
        my @reserveloop;
681
        my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } );
681
        my $always_show_holds = $input->cookie('always_show_holds');
682
        foreach my $res (
682
        $template->param( always_show_holds => $always_show_holds );
683
            sort {
683
        my $show_holds_now = $input->param('show_holds_now');
684
                my $a_found = $a->found() || '';
684
        unless( (defined $always_show_holds && $always_show_holds eq 'DONT') && !$show_holds_now ){
685
                my $b_found = $a->found() || '';
685
            my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } );
686
                $a_found cmp $b_found;
686
            foreach my $res (
687
            } @reserves
687
                sort {
688
          )
688
                    my $a_found = $a->found() || '';
689
        {
689
                    my $b_found = $a->found() || '';
690
            my %reserve;
690
                    $a_found cmp $b_found;
691
            if ( $res->is_found() ) {
691
                } @reserves
692
                $reserve{'holdingbranch'} = $res->item()->holdingbranch();
692
              )
693
                $reserve{'biblionumber'}  = $res->item()->biblionumber();
693
            {
694
                $reserve{'barcodenumber'} = $res->item()->barcode();
694
                my %reserve;
695
                $reserve{'wbrcode'}       = $res->branchcode();
695
                if ( $res->is_found() ) {
696
                $reserve{'itemnumber'}    = $res->itemnumber();
696
                    $reserve{'holdingbranch'} = $res->item()->holdingbranch();
697
                $reserve{'wbrname'}       = $res->branch()->branchname();
697
                    $reserve{'biblionumber'}  = $res->item()->biblionumber();
698
                $reserve{'atdestination'} = $res->is_at_destination();
698
                    $reserve{'barcodenumber'} = $res->item()->barcode();
699
                $reserve{'desk_name'}     = ( $res->desk() ) ? $res->desk()->desk_name() : '' ;
699
                    $reserve{'wbrcode'}       = $res->branchcode();
700
                $reserve{'found'}     = $res->is_found();
700
                    $reserve{'itemnumber'}    = $res->itemnumber();
701
                $reserve{'inprocessing'} = $res->is_in_processing();
701
                    $reserve{'wbrname'}       = $res->branch()->branchname();
702
                $reserve{'intransit'} = $res->is_in_transit();
702
                    $reserve{'atdestination'} = $res->is_at_destination();
703
            }
703
                    $reserve{'desk_name'}     = ( $res->desk() ) ? $res->desk()->desk_name() : '' ;
704
            elsif ( $res->priority() > 0 ) {
704
                    $reserve{'found'}     = $res->is_found();
705
                if ( my $item = $res->item() )  {
705
                    $reserve{'inprocessing'} = $res->is_in_processing();
706
                    $reserve{'itemnumber'}      = $item->id();
706
                    $reserve{'intransit'} = $res->is_in_transit();
707
                    $reserve{'barcodenumber'}   = $item->barcode();
707
                }
708
                    $reserve{'item_level_hold'} = 1;
708
                elsif ( $res->priority() > 0 ) {
709
                    if ( my $item = $res->item() )  {
710
                        $reserve{'itemnumber'}      = $item->id();
711
                        $reserve{'barcodenumber'}   = $item->barcode();
712
                        $reserve{'item_level_hold'} = 1;
713
                    }
709
                }
714
                }
710
            }
711
715
712
            $reserve{'expirationdate'} = $res->expirationdate;
716
                $reserve{'expirationdate'} = $res->expirationdate;
713
            $reserve{'date'}           = $res->reservedate;
717
                $reserve{'date'}           = $res->reservedate;
714
            $reserve{'borrowernumber'} = $res->borrowernumber();
718
                $reserve{'borrowernumber'} = $res->borrowernumber();
715
            $reserve{'biblionumber'}   = $res->biblionumber();
719
                $reserve{'biblionumber'}   = $res->biblionumber();
716
            $reserve{'patron'}         = $res->borrower;
720
                $reserve{'patron'}         = $res->borrower;
717
            $reserve{'notes'}          = $res->reservenotes();
721
                $reserve{'notes'}          = $res->reservenotes();
718
            $reserve{'waiting_date'}   = $res->waitingdate();
722
                $reserve{'waiting_date'}   = $res->waitingdate();
719
            $reserve{'ccode'}          = $res->item() ? $res->item()->ccode() : undef;
723
                $reserve{'ccode'}          = $res->item() ? $res->item()->ccode() : undef;
720
            $reserve{'barcode'}        = $res->item() ? $res->item()->barcode() : undef;
724
                $reserve{'barcode'}        = $res->item() ? $res->item()->barcode() : undef;
721
            $reserve{'priority'}       = $res->priority();
725
                $reserve{'priority'}       = $res->priority();
722
            $reserve{'lowestPriority'} = $res->lowestPriority();
726
                $reserve{'lowestPriority'} = $res->lowestPriority();
723
            $reserve{'suspend'}        = $res->suspend();
727
                $reserve{'suspend'}        = $res->suspend();
724
            $reserve{'suspend_until'}  = $res->suspend_until();
728
                $reserve{'suspend_until'}  = $res->suspend_until();
725
            $reserve{'reserve_id'}     = $res->reserve_id();
729
                $reserve{'reserve_id'}     = $res->reserve_id();
726
            $reserve{itemtype}         = $res->itemtype();
730
                $reserve{itemtype}         = $res->itemtype();
727
            $reserve{branchcode}       = $res->branchcode();
731
                $reserve{branchcode}       = $res->branchcode();
728
            $reserve{non_priority}     = $res->non_priority();
732
                $reserve{non_priority}     = $res->non_priority();
729
            $reserve{object}           = $res;
733
                $reserve{object}           = $res;
730
734
731
            push( @reserveloop, \%reserve );
735
                push( @reserveloop, \%reserve );
736
            }
732
        }
737
        }
733
738
734
        # get the time for the form name...
739
        # get the time for the form name...
735
- 

Return to bug 29058