--- /dev/null
+INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`) VALUES ('OPACUserSummary', 1, NULL, "Show the summary of a logged in user's checkouts, overdues, holds and fines on the mainpage", 'YesNo');
('OPACUserCSS','',NULL,'Add CSS to be included in the OPAC in an embedded <style> tag.','free'),
('OPACUserJS','','70|10','Define custom javascript for inclusion in OPAC','Textarea'),
('opacuserlogin','1',NULL,'Enable or disable display of user login features','YesNo'),
+('OPACUserSummary', 1, NULL, "Show the summary of a logged in user's checkouts, overdues, holds and fines on the mainpage", 'YesNo'),
('OPACViewOthersSuggestions','0',NULL,'If ON, allows all suggestions to be displayed in the OPAC','YesNo'),
('OPACXSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on OPAC','Free'),
('OPACXSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on OPAC','Free'),
OPAC:
Appearance:
-
+ - pref: OPACUserSummary
+ choices:
+ yes: Show
+ no: "Don't show"
+ - "a summary of a logged in user's checkouts, overdues, holds and fines on the mainpage"
+ -
- For search results in the OPAC, show the item's
- pref: OPACResultsLibrary
choices:
[% USE Koha %]
[% USE Branches %]
+[% USE Price %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog</title>
[% INCLUDE 'doc-head-close.inc' %]
</form>
</div> <!-- /#login -->
[% END # /casAuthentication %]
- [% END # / loggedinusername %]
+ [% ELSE %]
+ [% IF Koha.Preference('OPACUserSummary') %]
+ <div id="user_summary">
+ <h1>Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% USER_INFO.title %] [% USER_INFO.firstname %] [% USER_INFO.surname %]</span></a></h1>
+ <ul id="user_summary_shortcuts">
+ [% IF checkouts && checkouts > 0 %]
+ <li><a href="/cgi-bin/koha/opac-user.pl">[% checkouts %] checkout(s)</a></li>
+ [% END %]
+ [% IF overdues && overdues > 0 %]
+ <li><a href="/cgi-bin/koha/opac-user.pl">[% overdues %] overdue(s)</a></li>
+ [% END %]
+ [% IF holds_pending && holds_pending > 0 %]
+ <li><a href="/cgi-bin/koha/opac-user.pl">[% holds_pending %] hold(s) pending</a></li>
+ [% END %]
+ [% IF holds_waiting && holds_waiting > 0 %]
+ <li><a href="/cgi-bin/koha/opac-user.pl">[% holds_waiting %] hold(s) waiting</a></li>
+ [% END %]
+ [% IF total_owing && total_owing > 0 %]
+ <li><a href="/cgi-bin/koha/opac-account.pl">[% total_owing | $Price %] due</a></li>
+ [% END %]
+ </ul>
+ </div>
+ [% END %]
+ [% END # /loggedinusername %]
[% END # /opacuserlogin %]
[% IF ( OpacNavRight ) %]
<div id="opacnavright">
use C4::NewsChannels; # GetNewsToDisplay
use C4::Languages qw(getTranslatedLanguages accept_language);
use C4::Koha qw( GetDailyQuote );
+use C4::Members;
+use C4::Overdues;
+use C4::Reserves;
+use Koha::Checkouts;
my $input = new CGI;
my $dbh = C4::Context->dbh;
my $quote = GetDailyQuote(); # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha
+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 ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
+
$template->param(
+ checkouts => $checkouts,
+ overdues => $overdues_count,
+ holds_pending => $holds_pending,
+ holds_waiting => scalar @holds_waiting,
+ total_owing => $total,
koha_news => $all_koha_news,
koha_news_count => $koha_news_count,
branchcode => $homebranch,