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

(-)a/Koha/Schema/Result/Reserve.pm (+12 lines)
Lines 313-316 __PACKAGE__->belongs_to( Link Here
313
  },
313
  },
314
);
314
);
315
315
316
__PACKAGE__->belongs_to(
317
  "branch",
318
  "Koha::Schema::Result::Branch",
319
  { branchcode => "branchcode" },
320
  {
321
    is_deferrable => 1,
322
    join_type     => "LEFT",
323
    on_delete     => "CASCADE",
324
    on_update     => "CASCADE",
325
  },
326
);
327
316
1;
328
1;
(-)a/Koha/Schema/ResultSet/Reserve.pm (+23 lines)
Line 0 Link Here
1
package Koha::Schema::ResultSet::Reserve;
2
3
use Modern::Perl;
4
5
use Carp;
6
7
use base 'DBIx::Class::ResultSet';
8
9
sub GetWaiting {
10
    my ( $self, $params ) = @_;
11
12
    my $borrowernumber = $params->{borrowernumber};
13
    croak("No borrowernumber passed in to Koha::Schema::ResultSet::Reserve::GetWaiting") unless $borrowernumber;
14
15
    return $self->search(
16
        {
17
            borrowernumber => $borrowernumber,
18
            found          => 'W',
19
        }
20
    );
21
}
22
23
1;
(-)a/circ/circulation.pl (-2 / +4 lines)
Lines 362-370 if ($borrowernumber) { Link Here
362
# BUILD HTML
362
# BUILD HTML
363
# show all reserves of this borrower, and the position of the reservation ....
363
# show all reserves of this borrower, and the position of the reservation ....
364
if ($borrowernumber) {
364
if ($borrowernumber) {
365
    my $holds_rs = Koha::Database->new()->schema()->resultset('Reserve');
365
    $template->param(
366
    $template->param(
366
        holds_count => Koha::Database->new()->schema()->resultset('Reserve')
367
        holds_count => $holds_rs->count( { borrowernumber => $borrowernumber } ),
367
          ->count( { borrowernumber => $borrowernumber } ) );
368
        WaitingHolds => $holds_rs->GetWaiting( { borrowernumber => $borrowernumber } )
369
    );
368
370
369
    $template->param( adultborrower => 1 ) if ( $borrower->{'category_type'} eq 'A' );
371
    $template->param( adultborrower => 1 ) if ( $borrower->{'category_type'} eq 'A' );
370
}
372
}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt (-15 / +22 lines)
Lines 596-615 No patron matched <span class="ex">[% message %]</span> Link Here
596
			</ul>
596
			</ul>
597
        </div>
597
        </div>
598
598
599
			[% IF ( WaitingReserveLoop ) %]
599
            [% IF ( WaitingHolds ) %]
600
			<div id="holdswaiting" class="circmessage">
600
                <div id="holdswaiting" class="circmessage">
601
		    <h4>Holds waiting:</h4>
601
                    <h4>Holds waiting:</h4>
602
			        [% FOREACH WaitingReserveLoo IN WaitingReserveLoop %]
602
                    [% FOREACH w IN WaitingHolds %]
603
			            <ul>
603
                        <ul>
604
			                <li> <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% WaitingReserveLoo.biblionumber %]">[% WaitingReserveLoo.title |html %]</a> ([% WaitingReserveLoo.itemtype %]), [% IF ( WaitingReserveLoo.author ) %]by [% WaitingReserveLoo.author %][% END %] [% IF ( WaitingReserveLoo.itemcallnumber ) %][[% WaitingReserveLoo.itemcallnumber %]] [% END %]Hold placed on [% WaitingReserveLoo.reservedate %].
604
                            <li>
605
			            [% IF ( WaitingReserveLoo.waitingat ) %]
605
                                <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% w.biblio.biblionumber %]">[% w.biblio.title | html %]</a>
606
			                <br />[% IF ( WaitingReserveLoo.waitinghere ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]Waiting at [% WaitingReserveLoo.waitingat %]</strong>
606
                                ([% w.item.effective_itemtype %]),
607
			            [% END %]
607
                                [% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %]
608
			                </li>
608
                                [% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber %]] [% END %]
609
			            </ul>
609
                                Hold placed on [% w.reservedate | $KohaDates %].
610
			    [% END %]
610
611
			</div>
611
                                <br/>
612
			<!-- /If WaitingReserveLoop -->[% END %]
612
                                [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode()  ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]
613
                                    Waiting at [% w.branch.branchname  %]
614
                                </strong>
615
                            </li>
616
                        </ul>
617
                    [% END %]
618
                </div>
619
            [% END %]
620
613
	[% IF ( notes ) %]
621
	[% IF ( notes ) %]
614
			<div id="circnotes" class="circmessage">
622
			<div id="circnotes" class="circmessage">
615
			<h4>Notes:</h4>
623
			<h4>Notes:</h4>
616
- 

Return to bug 12892