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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-1 / +15 lines)
Lines 879-890 Link Here
879
            [% END %]
879
            [% END %]
880
880
881
            [% UNLESS ( patron ) %]
881
            [% UNLESS ( patron ) %]
882
883
                        <label for ="always_show_holds">Always show holds</label>
884
                        [% IF always_show_holds == 'DONT' %]
885
                            <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
886
                            <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</a>
887
                        [% ELSE %]
888
                            <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
889
                        [% END %]
882
                [% IF ( reserveloop ) %]
890
                [% IF ( reserveloop ) %]
883
                    <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
891
                    <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
884
                        [% IF ( multi_hold ) %]
892
                        [% IF ( multi_hold ) %]
885
                            <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
893
                            <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
886
                        [% END %]
894
                        [% END %]
887
888
                        <h2>Existing holds</h2>
895
                        <h2>Existing holds</h2>
889
                        <div id="toolbar" class="btn-toolbar">
896
                        <div id="toolbar" class="btn-toolbar">
890
                            <input type="submit" name="submit" value="Update hold(s)" />
897
                            <input type="submit" name="submit" value="Update hold(s)" />
Lines 1478-1483 Link Here
1478
        }
1485
        }
1479
1486
1480
         $(document).ready(function() {
1487
         $(document).ready(function() {
1488
            $("#always_show_holds").change(function(){
1489
                if( $(this).prop('checked') ){
1490
                    document.cookie = 'always_show_holds=DO';
1491
                } else {
1492
                    document.cookie = 'always_show_holds=DONT';
1493
                }
1494
            });
1481
            $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1495
            $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1482
                var itemnumber = this.value;
1496
                var itemnumber = this.value;
1483
                var msg = '';
1497
                var msg = '';
(-)a/reserve/request.pl (-50 / +54 lines)
Lines 635-691 foreach my $biblionumber (@biblionumbers) { Link Here
635
635
636
    # existingreserves building
636
    # existingreserves building
637
    my @reserveloop;
637
    my @reserveloop;
638
    my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } );
638
    my $always_show_holds = $input->cookie('always_show_holds');
639
    foreach my $res (
639
    $template->param( always_show_holds => $always_show_holds );
640
        sort {
640
    my $show_holds_now = $input->param('show_holds_now');
641
            my $a_found = $a->found() || '';
641
    unless( (defined $always_show_holds && $always_show_holds eq 'DONT') && !$show_holds_now ){
642
            my $b_found = $a->found() || '';
642
        my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } );
643
            $a_found cmp $b_found;
643
        foreach my $res (
644
        } @reserves
644
            sort {
645
      )
645
                my $a_found = $a->found() || '';
646
    {
646
                my $b_found = $a->found() || '';
647
        my %reserve;
647
                $a_found cmp $b_found;
648
        if ( $res->is_found() ) {
648
            } @reserves
649
            $reserve{'holdingbranch'} = $res->item()->holdingbranch();
649
          )
650
            $reserve{'biblionumber'}  = $res->item()->biblionumber();
650
        {
651
            $reserve{'barcodenumber'} = $res->item()->barcode();
651
            my %reserve;
652
            $reserve{'wbrcode'}       = $res->branchcode();
652
            if ( $res->is_found() ) {
653
            $reserve{'itemnumber'}    = $res->itemnumber();
653
                $reserve{'holdingbranch'} = $res->item()->holdingbranch();
654
            $reserve{'wbrname'}       = $res->branch()->branchname();
654
                $reserve{'biblionumber'}  = $res->item()->biblionumber();
655
            $reserve{'atdestination'} = $res->is_at_destination();
655
                $reserve{'barcodenumber'} = $res->item()->barcode();
656
            $reserve{'desk_name'}     = ( $res->desk() ) ? $res->desk()->desk_name() : '' ;
656
                $reserve{'wbrcode'}       = $res->branchcode();
657
            $reserve{'found'}     = $res->is_found();
657
                $reserve{'itemnumber'}    = $res->itemnumber();
658
            $reserve{'inprocessing'} = $res->is_in_processing();
658
                $reserve{'wbrname'}       = $res->branch()->branchname();
659
            $reserve{'intransit'} = $res->is_in_transit();
659
                $reserve{'atdestination'} = $res->is_at_destination();
660
        }
660
                $reserve{'desk_name'}     = ( $res->desk() ) ? $res->desk()->desk_name() : '' ;
661
        elsif ( $res->priority() > 0 ) {
661
                $reserve{'found'}     = $res->is_found();
662
            if ( my $item = $res->item() )  {
662
                $reserve{'inprocessing'} = $res->is_in_processing();
663
                $reserve{'itemnumber'}      = $item->id();
663
                $reserve{'intransit'} = $res->is_in_transit();
664
                $reserve{'barcodenumber'}   = $item->barcode();
664
            }
665
                $reserve{'item_level_hold'} = 1;
665
            elsif ( $res->priority() > 0 ) {
666
                if ( my $item = $res->item() )  {
667
                    $reserve{'itemnumber'}      = $item->id();
668
                    $reserve{'barcodenumber'}   = $item->barcode();
669
                    $reserve{'item_level_hold'} = 1;
670
                }
666
            }
671
            }
667
        }
668
672
669
        $reserve{'expirationdate'} = $res->expirationdate;
673
            $reserve{'expirationdate'} = $res->expirationdate;
670
        $reserve{'date'}           = $res->reservedate;
674
            $reserve{'date'}           = $res->reservedate;
671
        $reserve{'borrowernumber'} = $res->borrowernumber();
675
            $reserve{'borrowernumber'} = $res->borrowernumber();
672
        $reserve{'biblionumber'}   = $res->biblionumber();
676
            $reserve{'biblionumber'}   = $res->biblionumber();
673
        $reserve{'patron'}         = $res->borrower;
677
            $reserve{'patron'}         = $res->borrower;
674
        $reserve{'notes'}          = $res->reservenotes();
678
            $reserve{'notes'}          = $res->reservenotes();
675
        $reserve{'waiting_date'}   = $res->waitingdate();
679
            $reserve{'waiting_date'}   = $res->waitingdate();
676
        $reserve{'ccode'}          = $res->item() ? $res->item()->ccode() : undef;
680
            $reserve{'ccode'}          = $res->item() ? $res->item()->ccode() : undef;
677
        $reserve{'barcode'}        = $res->item() ? $res->item()->barcode() : undef;
681
            $reserve{'barcode'}        = $res->item() ? $res->item()->barcode() : undef;
678
        $reserve{'priority'}       = $res->priority();
682
            $reserve{'priority'}       = $res->priority();
679
        $reserve{'lowestPriority'} = $res->lowestPriority();
683
            $reserve{'lowestPriority'} = $res->lowestPriority();
680
        $reserve{'suspend'}        = $res->suspend();
684
            $reserve{'suspend'}        = $res->suspend();
681
        $reserve{'suspend_until'}  = $res->suspend_until();
685
            $reserve{'suspend_until'}  = $res->suspend_until();
682
        $reserve{'reserve_id'}     = $res->reserve_id();
686
            $reserve{'reserve_id'}     = $res->reserve_id();
683
        $reserve{itemtype}         = $res->itemtype();
687
            $reserve{itemtype}         = $res->itemtype();
684
        $reserve{branchcode}       = $res->branchcode();
688
            $reserve{branchcode}       = $res->branchcode();
685
        $reserve{non_priority}     = $res->non_priority();
689
            $reserve{non_priority}     = $res->non_priority();
686
        $reserve{object}           = $res;
690
            $reserve{object}           = $res;
687
691
688
        push( @reserveloop, \%reserve );
692
            push( @reserveloop, \%reserve );
693
        }
689
    }
694
    }
690
695
691
    # get the time for the form name...
696
    # get the time for the form name...
692
- 

Return to bug 29058