use C4::Auth;
use C4::Koha;
use C4::Circulation::Circ2;
-use C4::Circulation::Renewals2;
use C4::Reserves2;
-use C4::Search;
+use C4::Members;
use C4::Interface::CGI::Output;
use HTML::Template;
use C4::Date;
+use C4::Letters;
my $query = new CGI;
my ($template, $borrowernumber, $cookie)
$borr->{'dateofbirth'} = format_date($borr->{'dateofbirth'});
$borr->{'ethnicity'} = fixEthnicity($borr->{'ethnicity'});
+if($borr->{'debarred'} || $borr->{'gonenoaddress'} || $borr->{'lost'}){
+ $borr->{'flagged'} =1;
+}
+
if ($borr->{'amountoutstanding'} > 5) {
$borr->{'amountoverfive'} = 1;
}
$template->param(OVERDUES => \@overdues);
$template->param(overdues_count => $overdues_count);
-my $branches = getbranches();
+my $branches = GetBranches();
# now the reserved items....
my ($rcount, $reserves) = FindReserves(undef, $borrowernumber);
my $wcount = 0;
foreach my $res (@$reserves) {
if ($res->{'itemnumber'}) {
+ my $item = getiteminformation('',$res->{'itemnumber'},'');
+ $res->{'holdingbranch'} = $branches->{$item->{'holdingbranch'}}->{'branchname'};
$res->{'branch'} = $branches->{$res->{'branchcode'}}->{'branchname'};
+ if($res->{'holdingbranch'} eq $res->{'branch'}){
+ $res->{'atdestination'} = 1;
+ }
push @waiting, $res;
$wcount++;
}
}
+$template->param(WAITING => \@waiting);
+
+# current alert subscriptions
+warn " B : $borrowernumber";
+my $alerts = getalert($borrowernumber);
+foreach (@$alerts) {
+ $_->{$_->{type}}=1;
+ $_->{relatedto} = findrelatedto($_->{type},$_->{externalid});
+}
-# $template->param(WAITING => \@waiting);
-$template->param(waiting_count => $wcount);
+$template->param(waiting_count => $wcount,
+ textmessaging => $borr->{textmessaging},
+ OpacPasswordChange => C4::Context->preference("OpacPasswordChange"),
+);
output_html_with_http_headers $query, $cookie, $template->output;