Bugzilla – Attachment 68585 Details for
Bug 2093
Add OPAC dashboard for logged-in users
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2093: [FOLLOW-UP] Add OPAC dashboard for logged-in users
Bug-2093-FOLLOW-UP-Add-OPAC-dashboard-for-logged-i.patch (text/plain), 6.21 KB, created by
Nick Clemens (kidclamp)
on 2017-10-26 10:11:59 UTC
(
hide
)
Description:
Bug 2093: [FOLLOW-UP] Add OPAC dashboard for logged-in users
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-10-26 10:11:59 UTC
Size:
6.21 KB
patch
obsolete
>From 48e8b8062759045113ae8fe508c456c7ddc93d68 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 2 Aug 2017 23:25:35 +0000 >Subject: [PATCH] Bug 2093: [FOLLOW-UP] Add OPAC dashboard for logged-in users > >This patch: >- hides the dashboard if there is no dashboard information to display >- changes '5.00 due' to '5.00 due in fines and charges' for translation >- uses Koha::Holds in place of deprecated C4::Reserves methods > >To test, confirm all the right information for holds still shows, and >confirm the dashboard is hidden if there are no checkouts, holds, fines >or overdues. > >Signed-off-by: Hugo Agud <hagud@orex.es> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt | 12 ++++++------ > opac/opac-main.pl | 19 +++++++++---------- > 2 files changed, 15 insertions(+), 16 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >index 817dad6..3399c38 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt >@@ -135,24 +135,24 @@ > </div> <!-- /#login --> > [% END # /casAuthentication %] > [% ELSE %] >- [% IF Koha.Preference('OPACUserSummary') %] >+ [% IF Koha.Preference('OPACUserSummary') && dashboard_info %] > <div id="user_summary"> > <h3>Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</span></a></h3> > <ul id="user_summary_shortcuts"> > [% IF checkouts && checkouts > 0 %] >- <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-checkouts"><span class="user_checkouts_count count_label">[% checkouts %]</span> Checkout(s)</a></li> >+ <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-checkouts"><span class="user_checkouts_count count_label">[% checkouts %]</span> checkout(s)</a></li> > [% END %] > [% IF overdues && overdues > 0 %] >- <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-overdues"><span class="user_overdues_count count_label">[% overdues %]</span> Overdue(s)</a></li> >+ <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-overdues"><span class="user_overdues_count count_label">[% overdues %]</span> overdue(s)</a></li> > [% END %] > [% IF holds_pending && holds_pending > 0 %] >- <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds"><span class="user_holds_pending_count count_label">[% holds_pending %]</span> Hold(s) pending</a></li> >+ <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds"><span class="user_holds_pending_count count_label">[% holds_pending %]</span> hold(s) pending</a></li> > [% END %] > [% IF holds_waiting && holds_waiting > 0 %] >- <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds"><span class="user_holds_waiting_count count_label">[% holds_waiting %]</span> Hold(s) waiting</a></li> >+ <li><a href="/cgi-bin/koha/opac-user.pl#opac-user-holds"><span class="user_holds_waiting_count count_label">[% holds_waiting %]</span> hold(s) waiting</a></li> > [% END %] > [% IF total_owing && total_owing > 0 %] >- <li><a href="/cgi-bin/koha/opac-account.pl"><span class="user_fines_count count_label">[% total_owing | $Price with_symbol => 1 %]</span> Due</a></li> >+ <li><a href="/cgi-bin/koha/opac-account.pl"><span class="user_fines_count count_label">[% total_owing | $Price with_symbol => 1 %]</span> due in fines and charges</a></li> > [% END %] > </ul> > </div> >diff --git a/opac/opac-main.pl b/opac/opac-main.pl >index d63392b..33e100f 100755 >--- a/opac/opac-main.pl >+++ b/opac/opac-main.pl >@@ -27,8 +27,8 @@ use C4::Languages qw(getTranslatedLanguages accept_language); > use C4::Koha qw( GetDailyQuote ); > use C4::Members; > use C4::Overdues; >-use C4::Reserves; > use Koha::Checkouts; >+use Koha::Holds; > > my $input = new CGI; > my $dbh = C4::Context->dbh; >@@ -66,23 +66,22 @@ 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 = GetReservesFromBorrowernumber($borrowernumber); >-my $holds_pending = 0; >-foreach my $hold (@holds) { >- if (not defined($hold->{found})){ >- $holds_pending++; >- } >-} >-my @holds_waiting = GetReservesFromBorrowernumber($borrowernumber, 'W'); >+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 ); >+} >+ > $template->param( > checkouts => $checkouts, > overdues => $overdues_count, > holds_pending => $holds_pending, >- holds_waiting => scalar @holds_waiting, >+ holds_waiting => $holds_waiting, > total_owing => $total, > koha_news => $all_koha_news, > koha_news_count => $koha_news_count, >-- >2.1.4
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 2093
:
501
|
62704
|
62982
|
62983
|
65438
|
66245
|
68583
|
68584
| 68585 |
68586
|
68764
|
68765