Bugzilla – Attachment 70489 Details for
Bug 19938
C4::Overdues::checkoverdues has inconsistent return type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19938: Do not fetch dashboard's info if no logged in
Bug-19938-Do-not-fetch-dashboards-info-if-no-logge.patch (text/plain), 2.55 KB, created by
Jonathan Druart
on 2018-01-15 15:02:32 UTC
(
hide
)
Description:
Bug 19938: Do not fetch dashboard's info if no logged in
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-01-15 15:02:32 UTC
Size:
2.55 KB
patch
obsolete
>From 3410cdb795d6adc7cfe40d6b2597856b8252267c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 15 Jan 2018 12:02:16 -0300 >Subject: [PATCH] Bug 19938: Do not fetch dashboard's info if no logged in > >--- > opac/opac-main.pl | 28 ++++++++++++++++------------ > 1 file changed, 16 insertions(+), 12 deletions(-) > >diff --git a/opac/opac-main.pl b/opac/opac-main.pl >index 33e100f361..2637ffa7a0 100755 >--- a/opac/opac-main.pl >+++ b/opac/opac-main.pl >@@ -67,22 +67,26 @@ my $koha_news_count = scalar @$all_koha_news; > my $quote = GetDailyQuote(); # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha > > # For dashboard >-my $checkouts = Koha::Checkouts->search({ borrowernumber => $borrowernumber })->count; >-my ( $overdues_count, $overdues ) = checkoverdues($borrowernumber); >-my $holds_pending = Koha::Holds->search({ borrowernumber => $borrowernumber, found => undef })->count; >-my $holds_waiting = Koha::Holds->search({ borrowernumber => $borrowernumber })->waiting->count; >-my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); >+if ( $borrowernumber ) { >+ my $checkouts = Koha::Checkouts->search({ borrowernumber => $borrowernumber })->count; >+ my ( $overdues_count, $overdues ) = checkoverdues($borrowernumber); >+ my $holds_pending = Koha::Holds->search({ borrowernumber => $borrowernumber, found => undef })->count; >+ my $holds_waiting = Koha::Holds->search({ borrowernumber => $borrowernumber })->waiting->count; >+ my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); > >-if ( $checkouts > 0 || $overdues_count > 0 || $holds_pending > 0 || $holds_waiting > 0 || $total > 0 ) { >- $template->param( dashboard_info => 1 ); >+ if ( $checkouts > 0 || $overdues_count > 0 || $holds_pending > 0 || $holds_waiting > 0 || $total > 0 ) { >+ $template->param( >+ dashboard_info => 1, >+ checkouts => $checkouts, >+ overdues => $overdues_count, >+ holds_pending => $holds_pending, >+ holds_waiting => $holds_waiting, >+ total_owing => $total, >+ ); >+ } > } > > $template->param( >- checkouts => $checkouts, >- overdues => $overdues_count, >- holds_pending => $holds_pending, >- holds_waiting => $holds_waiting, >- total_owing => $total, > koha_news => $all_koha_news, > koha_news_count => $koha_news_count, > branchcode => $homebranch, >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19938
:
70375
|
70382
|
70383
|
70396
|
70397
|
70472
|
70473
|
70485
|
70486
|
70489
|
70567