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 881-892 Link Here
881
            [% END %]
881
            [% END %]
882
882
883
            [% UNLESS ( patron ) %]
883
            [% UNLESS ( patron ) %]
884
885
                        <label for ="always_show_holds">Always show holds</label>
886
                        [% IF always_show_holds == 'DONT' %]
887
                            <input type="checkbox" name="always_show_holds" id="always_show_holds" value="DO">
888
                            <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>
889
                        [% ELSE %]
890
                            <input type="checkbox" name="always_show_holds" value="DO" id="always_show_holds" checked="checked">
891
                        [% END %]
884
                [% IF ( reserveloop ) %]
892
                [% IF ( reserveloop ) %]
885
                    <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
893
                    <form id="existing_holds" name="T[% time | html %]" action="modrequest.pl" method="post" style="display:block">
886
                        [% IF ( multi_hold ) %]
894
                        [% IF ( multi_hold ) %]
887
                            <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
895
                            <input type = "hidden" name="biblionumbers" value="[% biblionumbers | html %]"/>
888
                        [% END %]
896
                        [% END %]
889
890
                        <h2>Existing holds</h2>
897
                        <h2>Existing holds</h2>
891
                        <div id="toolbar" class="btn-toolbar">
898
                        <div id="toolbar" class="btn-toolbar">
892
                            <input type="submit" name="submit" value="Update hold(s)" />
899
                            <input type="submit" name="submit" value="Update hold(s)" />
Lines 1460-1465 Link Here
1460
        }
1467
        }
1461
1468
1462
         $(document).ready(function() {
1469
         $(document).ready(function() {
1470
            $("#always_show_holds").change(function(){
1471
                if( $(this).prop('checked') ){
1472
                    document.cookie = 'always_show_holds=DO';
1473
                } else {
1474
                    document.cookie = 'always_show_holds=DONT';
1475
                }
1476
            });
1463
            $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1477
            $("input.needsoverride").click(function() { // This must be before the radio button/checkbox switch logic
1464
                var itemnumber = this.value;
1478
                var itemnumber = this.value;
1465
                var msg = '';
1479
                var msg = '';
(-)a/reserve/request.pl (-62 / +66 lines)
Lines 648-717 foreach my $biblionumber (@biblionumbers) { Link Here
648
648
649
    # existingreserves building
649
    # existingreserves building
650
    my @reserveloop;
650
    my @reserveloop;
651
    my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } );
651
    my $always_show_holds = $input->cookie('always_show_holds');
652
    foreach my $res (
652
    $template->param( always_show_holds => $always_show_holds );
653
        sort {
653
    my $show_holds_now = $input->param('show_holds_now');
654
            my $a_found = $a->found() || '';
654
    unless( (defined $always_show_holds && $always_show_holds eq 'DONT') && !$show_holds_now ){
655
            my $b_found = $a->found() || '';
655
        my @reserves = Koha::Holds->search( { biblionumber => $biblionumber }, { order_by => 'priority' } );
656
            $a_found cmp $b_found;
656
        foreach my $res (
657
        } @reserves
657
            sort {
658
      )
658
                my $a_found = $a->found() || '';
659
    {
659
                my $b_found = $a->found() || '';
660
        my $priority = $res->priority();
660
                $a_found cmp $b_found;
661
        my %reserve;
661
            } @reserves
662
        my @optionloop;
662
          )
663
        for ( my $i = 1 ; $i <= $totalcount ; $i++ ) {
663
        {
664
            push(
664
            my $priority = $res->priority();
665
                @optionloop,
665
            my %reserve;
666
                {
666
            my @optionloop;
667
                    num      => $i,
667
            for ( my $i = 1 ; $i <= $totalcount ; $i++ ) {
668
                    selected => ( $i == $priority ),
668
                push(
669
                }
669
                    @optionloop,
670
            );
670
                    {
671
        }
671
                        num      => $i,
672
                        selected => ( $i == $priority ),
673
                    }
674
                );
675
            }
672
676
673
        if ( $res->is_found() ) {
677
            if ( $res->is_found() ) {
674
            $reserve{'holdingbranch'} = $res->item()->holdingbranch();
678
                $reserve{'holdingbranch'} = $res->item()->holdingbranch();
675
            $reserve{'biblionumber'}  = $res->item()->biblionumber();
679
                $reserve{'biblionumber'}  = $res->item()->biblionumber();
676
            $reserve{'barcodenumber'} = $res->item()->barcode();
680
                $reserve{'barcodenumber'} = $res->item()->barcode();
677
            $reserve{'wbrcode'}       = $res->branchcode();
681
                $reserve{'wbrcode'}       = $res->branchcode();
678
            $reserve{'itemnumber'}    = $res->itemnumber();
682
                $reserve{'itemnumber'}    = $res->itemnumber();
679
            $reserve{'wbrname'}       = $res->branch()->branchname();
683
                $reserve{'wbrname'}       = $res->branch()->branchname();
680
            $reserve{'atdestination'} = $res->is_at_destination();
684
                $reserve{'atdestination'} = $res->is_at_destination();
681
            $reserve{'desk_name'}     = ( $res->desk() ) ? $res->desk()->desk_name() : '' ;
685
                $reserve{'desk_name'}     = ( $res->desk() ) ? $res->desk()->desk_name() : '' ;
682
            $reserve{'found'}     = $res->is_found();
686
                $reserve{'found'}     = $res->is_found();
683
            $reserve{'inprocessing'} = $res->is_in_processing();
687
                $reserve{'inprocessing'} = $res->is_in_processing();
684
            $reserve{'intransit'} = $res->is_in_transit();
688
                $reserve{'intransit'} = $res->is_in_transit();
685
        }
689
            }
686
        elsif ( $res->priority() > 0 ) {
690
            elsif ( $res->priority() > 0 ) {
687
            if ( my $item = $res->item() )  {
691
                if ( my $item = $res->item() )  {
688
                $reserve{'itemnumber'}      = $item->id();
692
                    $reserve{'itemnumber'}      = $item->id();
689
                $reserve{'barcodenumber'}   = $item->barcode();
693
                    $reserve{'barcodenumber'}   = $item->barcode();
690
                $reserve{'item_level_hold'} = 1;
694
                    $reserve{'item_level_hold'} = 1;
695
                }
691
            }
696
            }
692
        }
693
697
694
        $reserve{'expirationdate'} = $res->expirationdate;
698
            $reserve{'expirationdate'} = $res->expirationdate;
695
        $reserve{'date'}           = $res->reservedate;
699
            $reserve{'date'}           = $res->reservedate;
696
        $reserve{'borrowernumber'} = $res->borrowernumber();
700
            $reserve{'borrowernumber'} = $res->borrowernumber();
697
        $reserve{'biblionumber'}   = $res->biblionumber();
701
            $reserve{'biblionumber'}   = $res->biblionumber();
698
        $reserve{'patron'}         = $res->borrower;
702
            $reserve{'patron'}         = $res->borrower;
699
        $reserve{'notes'}          = $res->reservenotes();
703
            $reserve{'notes'}          = $res->reservenotes();
700
        $reserve{'waiting_date'}   = $res->waitingdate();
704
            $reserve{'waiting_date'}   = $res->waitingdate();
701
        $reserve{'ccode'}          = $res->item() ? $res->item()->ccode() : undef;
705
            $reserve{'ccode'}          = $res->item() ? $res->item()->ccode() : undef;
702
        $reserve{'barcode'}        = $res->item() ? $res->item()->barcode() : undef;
706
            $reserve{'barcode'}        = $res->item() ? $res->item()->barcode() : undef;
703
        $reserve{'priority'}       = $res->priority();
707
            $reserve{'priority'}       = $res->priority();
704
        $reserve{'lowestPriority'} = $res->lowestPriority();
708
            $reserve{'lowestPriority'} = $res->lowestPriority();
705
        $reserve{'optionloop'}     = \@optionloop;
709
            $reserve{'optionloop'}     = \@optionloop;
706
        $reserve{'suspend'}        = $res->suspend();
710
            $reserve{'suspend'}        = $res->suspend();
707
        $reserve{'suspend_until'}  = $res->suspend_until();
711
            $reserve{'suspend_until'}  = $res->suspend_until();
708
        $reserve{'reserve_id'}     = $res->reserve_id();
712
            $reserve{'reserve_id'}     = $res->reserve_id();
709
        $reserve{itemtype}         = $res->itemtype();
713
            $reserve{itemtype}         = $res->itemtype();
710
        $reserve{branchcode}       = $res->branchcode();
714
            $reserve{branchcode}       = $res->branchcode();
711
        $reserve{non_priority}     = $res->non_priority();
715
            $reserve{non_priority}     = $res->non_priority();
712
        $reserve{object}           = $res;
716
            $reserve{object}           = $res;
713
717
714
        push( @reserveloop, \%reserve );
718
            push( @reserveloop, \%reserve );
719
        }
715
    }
720
    }
716
721
717
    # get the time for the form name...
722
    # get the time for the form name...
718
- 

Return to bug 29058