|
Lines 154-211
my @issuedat;
Link Here
|
| 154 |
my $itemtypes = GetItemTypes(); |
154 |
my $itemtypes = GetItemTypes(); |
| 155 |
my $issues = GetPendingIssues($borrowernumber); |
155 |
my $issues = GetPendingIssues($borrowernumber); |
| 156 |
if ($issues){ |
156 |
if ($issues){ |
| 157 |
foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) { |
157 |
foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) { |
| 158 |
# check for reserves |
158 |
# check for reserves |
| 159 |
my ( $restype, $res, undef ) = CheckReserves( $issue->{'itemnumber'} ); |
159 |
my ( $restype, $res, undef ) = CheckReserves( $issue->{'itemnumber'} ); |
| 160 |
if ( $restype ) { |
160 |
if ( $restype ) { |
| 161 |
$issue->{'reserved'} = 1; |
161 |
$issue->{'reserved'} = 1; |
| 162 |
} |
162 |
} |
| 163 |
|
163 |
|
| 164 |
my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); |
164 |
my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); |
| 165 |
my $charges = 0; |
165 |
my $charges = 0; |
| 166 |
foreach my $ac (@$accts) { |
166 |
foreach my $ac (@$accts) { |
| 167 |
if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) { |
167 |
if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) { |
| 168 |
$charges += $ac->{'amountoutstanding'} |
168 |
$charges += $ac->{'amountoutstanding'} |
| 169 |
if $ac->{'accounttype'} eq 'F'; |
169 |
if $ac->{'accounttype'} eq 'F'; |
| 170 |
$charges += $ac->{'amountoutstanding'} |
170 |
$charges += $ac->{'amountoutstanding'} |
| 171 |
if $ac->{'accounttype'} eq 'L'; |
171 |
if $ac->{'accounttype'} eq 'L'; |
| 172 |
} |
172 |
} |
| 173 |
} |
173 |
} |
| 174 |
$issue->{'charges'} = $charges; |
174 |
$issue->{'charges'} = $charges; |
| 175 |
|
175 |
|
| 176 |
# get publictype for icon |
176 |
# get publictype for icon |
| 177 |
|
177 |
|
| 178 |
my $publictype = $issue->{'publictype'}; |
178 |
my $publictype = $issue->{'publictype'}; |
| 179 |
$issue->{$publictype} = 1; |
179 |
$issue->{$publictype} = 1; |
| 180 |
|
180 |
|
| 181 |
# check if item is renewable |
181 |
# check if item is renewable |
| 182 |
my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} ); |
182 |
my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} ); |
| 183 |
($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'}); |
183 |
($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'}); |
| 184 |
if($status && C4::Context->preference("OpacRenewalAllowed")){ |
184 |
if($status && C4::Context->preference("OpacRenewalAllowed")){ |
| 185 |
$issue->{'status'} = $status; |
185 |
$issue->{'status'} = $status; |
| 186 |
} |
186 |
} |
| 187 |
$issue->{'too_many'} = 1 if $renewerror and $renewerror eq 'too_many'; |
187 |
$issue->{'too_many'} = 1 if $renewerror and $renewerror eq 'too_many'; |
| 188 |
$issue->{'on_reserve'} = 1 if $renewerror and $renewerror eq 'on_reserve'; |
188 |
$issue->{'on_reserve'} = 1 if $renewerror and $renewerror eq 'on_reserve'; |
| 189 |
|
189 |
|
| 190 |
if ( $issue->{'overdue'} ) { |
190 |
if ( $issue->{'overdue'} ) { |
| 191 |
push @overdues, $issue; |
191 |
push @overdues, $issue; |
| 192 |
$overdues_count++; |
192 |
$overdues_count++; |
| 193 |
$issue->{'overdue'} = 1; |
193 |
$issue->{'overdue'} = 1; |
| 194 |
} |
194 |
} |
| 195 |
else { |
195 |
else { |
| 196 |
$issue->{'issued'} = 1; |
196 |
$issue->{'issued'} = 1; |
| 197 |
} |
197 |
} |
| 198 |
# imageurl: |
198 |
# imageurl: |
| 199 |
my $itemtype = $issue->{'itemtype'}; |
199 |
my $itemtype = $issue->{'itemtype'}; |
| 200 |
if ( $itemtype ) { |
200 |
if ( $itemtype ) { |
| 201 |
$issue->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} ); |
201 |
$issue->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} ); |
| 202 |
$issue->{'description'} = $itemtypes->{$itemtype}->{'description'}; |
202 |
$issue->{'description'} = $itemtypes->{$itemtype}->{'description'}; |
| 203 |
} |
203 |
} |
| 204 |
push @issuedat, $issue; |
204 |
push @issuedat, $issue; |
| 205 |
$count++; |
205 |
$count++; |
| 206 |
|
206 |
|
| 207 |
my $isbn = GetNormalizedISBN($issue->{'isbn'}); |
207 |
my $isbn = GetNormalizedISBN($issue->{'isbn'}); |
| 208 |
$issue->{normalized_isbn} = $isbn; |
208 |
$issue->{normalized_isbn} = $isbn; |
| 209 |
|
209 |
|
| 210 |
# My Summary HTML |
210 |
# My Summary HTML |
| 211 |
if (my $my_summary_html = C4::Context->preference('OPACMySummaryHTML')){ |
211 |
if (my $my_summary_html = C4::Context->preference('OPACMySummaryHTML')){ |
|
Lines 217-223
if ($issues){
Link Here
|
| 217 |
$issue->{biblionumber} ? $my_summary_html =~ s/{BIBLIONUMBER}/$issue->{biblionumber}/g : $my_summary_html =~ s/{BIBLIONUMBER}//g; |
217 |
$issue->{biblionumber} ? $my_summary_html =~ s/{BIBLIONUMBER}/$issue->{biblionumber}/g : $my_summary_html =~ s/{BIBLIONUMBER}//g; |
| 218 |
$issue->{MySummaryHTML} = $my_summary_html; |
218 |
$issue->{MySummaryHTML} = $my_summary_html; |
| 219 |
} |
219 |
} |
| 220 |
} |
220 |
} |
| 221 |
} |
221 |
} |
| 222 |
$template->param( ISSUES => \@issuedat ); |
222 |
$template->param( ISSUES => \@issuedat ); |
| 223 |
$template->param( issues_count => $count ); |
223 |
$template->param( issues_count => $count ); |
|
Lines 341-352
if (C4::Context->preference('BakerTaylorEnabled')) {
Link Here
|
| 341 |
if (C4::Context->preference("OPACAmazonCoverImages") or |
341 |
if (C4::Context->preference("OPACAmazonCoverImages") or |
| 342 |
C4::Context->preference("GoogleJackets") or |
342 |
C4::Context->preference("GoogleJackets") or |
| 343 |
C4::Context->preference("BakerTaylorEnabled") or |
343 |
C4::Context->preference("BakerTaylorEnabled") or |
| 344 |
C4::Context->preference("SyndeticsCoverImages")) { |
344 |
C4::Context->preference("SyndeticsCoverImages")) { |
| 345 |
$template->param(JacketImages=>1); |
345 |
$template->param(JacketImages=>1); |
| 346 |
} |
346 |
} |
| 347 |
|
347 |
|
| 348 |
if ( GetMessagesCount( $borrowernumber, 'B' ) ) { |
348 |
if ( GetMessagesCount( $borrowernumber, 'B' ) ) { |
| 349 |
$template->param( bor_messages => 1 ); |
349 |
$template->param( bor_messages => 1 ); |
| 350 |
} |
350 |
} |
| 351 |
|
351 |
|
| 352 |
if ( $borr->{'opacnote'} ) { |
352 |
if ( $borr->{'opacnote'} ) { |
|
Lines 357-363
if ( $borr->{'opacnote'} ) {
Link Here
|
| 357 |
} |
357 |
} |
| 358 |
|
358 |
|
| 359 |
$template->param( |
359 |
$template->param( |
| 360 |
bor_messages_loop => GetMessages( $borrowernumber, 'B', 'NONE' ), |
360 |
bor_messages_loop => GetMessages( $borrowernumber, 'B', 'NONE' ), |
| 361 |
waiting_count => $wcount, |
361 |
waiting_count => $wcount, |
| 362 |
patronupdate => $patronupdate, |
362 |
patronupdate => $patronupdate, |
| 363 |
OpacRenewalAllowed => C4::Context->preference("OpacRenewalAllowed"), |
363 |
OpacRenewalAllowed => C4::Context->preference("OpacRenewalAllowed"), |
| 364 |
- |
|
|