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 / +23 lines)
Lines 1-4 Link Here
1
[% USE Branches %]
1
[% USE Branches %]
2
[% USE EncodeUTF8 %]
2
[% USE KohaDates %]
3
[% USE KohaDates %]
3
[% IF ( export_remove_fields OR export_with_csv_profile ) %]
4
[% IF ( export_remove_fields OR export_with_csv_profile ) %]
4
   [% SET exports_enabled = 1 %]
5
   [% SET exports_enabled = 1 %]
Lines 596-615 No patron matched <span class="ex">[% message %]</span> Link Here
596
			</ul>
597
			</ul>
597
        </div>
598
        </div>
598
599
599
			[% IF ( WaitingReserveLoop ) %]
600
            [% IF ( WaitingHolds ) %]
600
			<div id="holdswaiting" class="circmessage">
601
                <div id="holdswaiting" class="circmessage">
601
		    <h4>Holds waiting:</h4>
602
                    <h4>Holds waiting:</h4>
602
			        [% FOREACH WaitingReserveLoo IN WaitingReserveLoop %]
603
                    [% FOREACH w IN WaitingHolds %]
603
			            <ul>
604
                        <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 %].
605
                            <li>
605
			            [% IF ( WaitingReserveLoo.waitingat ) %]
606
                                <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>
607
                                ([% w.item.effective_itemtype %]),
607
			            [% END %]
608
                                [% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %]
608
			                </li>
609
                                [% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber %]] [% END %]
609
			            </ul>
610
                                Hold placed on [% w.reservedate | $KohaDates %].
610
			    [% END %]
611
611
			</div>
612
                                <br/>
612
			<!-- /If WaitingReserveLoop -->[% END %]
613
                                [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode()  ) %]<strong class="waitinghere">[% ELSE %]<strong>[% END %]
614
                                    Waiting at [% w.branch.branchname  | $EncodeUTF8 %]
615
                                </strong>
616
                            </li>
617
                        </ul>
618
                    [% END %]
619
                </div>
620
            [% END %]
621
613
	[% IF ( notes ) %]
622
	[% IF ( notes ) %]
614
			<div id="circnotes" class="circmessage">
623
			<div id="circnotes" class="circmessage">
615
			<h4>Notes:</h4>
624
			<h4>Notes:</h4>
616
- 

Return to bug 12892