View | Details | Raw Unified | Return to bug 2093
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_2093_-_add_OPACUserSummary_syspref.sql (+1 lines)
Line 0 Link Here
1
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');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 386-391 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
386
('OPACUserCSS','',NULL,'Add CSS to be included in the OPAC in an embedded <style> tag.','free'),
386
('OPACUserCSS','',NULL,'Add CSS to be included in the OPAC in an embedded <style> tag.','free'),
387
('OPACUserJS','','70|10','Define custom javascript for inclusion in OPAC','Textarea'),
387
('OPACUserJS','','70|10','Define custom javascript for inclusion in OPAC','Textarea'),
388
('opacuserlogin','1',NULL,'Enable or disable display of user login features','YesNo'),
388
('opacuserlogin','1',NULL,'Enable or disable display of user login features','YesNo'),
389
('OPACUserSummary', 1, NULL, "Show the summary of a logged in user's checkouts, overdues, holds and fines on the mainpage", 'YesNo'),
389
('OPACViewOthersSuggestions','0',NULL,'If ON, allows all suggestions to be displayed in the OPAC','YesNo'),
390
('OPACViewOthersSuggestions','0',NULL,'If ON, allows all suggestions to be displayed in the OPAC','YesNo'),
390
('OPACXSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on OPAC','Free'),
391
('OPACXSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on OPAC','Free'),
391
('OPACXSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on OPAC','Free'),
392
('OPACXSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on OPAC','Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 1-6 Link Here
1
OPAC:
1
OPAC:
2
    Appearance:
2
    Appearance:
3
        -
3
        -
4
            - pref: OPACUserSummary
5
              choices:
6
                  yes: Show
7
                  no: "Don't show"
8
            - "a summary of a logged in user's checkouts, overdues, holds and fines on the mainpage"
9
        -
4
            - For search results in the OPAC, show the item's
10
            - For search results in the OPAC, show the item's
5
            - pref: OPACResultsLibrary
11
            - pref: OPACResultsLibrary
6
              choices:
12
              choices:
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-main.tt (-1 / +25 lines)
Lines 1-5 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Branches %]
2
[% USE Branches %]
3
[% USE Price %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog</title>
5
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
Lines 121-127 Link Here
121
                                </form>
122
                                </form>
122
                            </div> <!-- /#login -->
123
                            </div> <!-- /#login -->
123
                        [% END # /casAuthentication %]
124
                        [% END # /casAuthentication %]
124
                    [% END # / loggedinusername %]
125
                    [% ELSE %]
126
                        [% IF Koha.Preference('OPACUserSummary') %]
127
                            <div id="user_summary">
128
                                <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>
129
                                <ul id="user_summary_shortcuts">
130
                                    [% IF checkouts && checkouts > 0 %]
131
                                        <li><a href="/cgi-bin/koha/opac-user.pl">[% checkouts %] checkout(s)</a></li>
132
                                    [% END %]
133
                                    [% IF overdues && overdues > 0 %]
134
                                        <li><a href="/cgi-bin/koha/opac-user.pl">[% overdues %] overdue(s)</a></li>
135
                                    [% END %]
136
                                    [% IF holds_pending && holds_pending > 0 %]
137
                                        <li><a href="/cgi-bin/koha/opac-user.pl">[% holds_pending %] hold(s) pending</a></li>
138
                                    [% END %]
139
                                    [% IF holds_waiting && holds_waiting > 0 %]
140
                                        <li><a href="/cgi-bin/koha/opac-user.pl">[% holds_waiting %] hold(s) waiting</a></li>
141
                                    [% END %]
142
                                    [% IF total_owing && total_owing > 0 %]
143
                                        <li><a href="/cgi-bin/koha/opac-account.pl">[% total_owing | $Price %] due</a></li>
144
                                    [% END %]
145
                                </ul>
146
                            </div>
147
                        [% END %]
148
                    [% END # /loggedinusername %]
125
                [% END # /opacuserlogin %]
149
                [% END # /opacuserlogin %]
126
                [% IF ( OpacNavRight ) %]
150
                [% IF ( OpacNavRight ) %]
127
                    <div id="opacnavright">
151
                    <div id="opacnavright">
(-)a/opac/opac-main.pl (-1 / +21 lines)
Lines 25-30 use C4::Output; Link Here
25
use C4::NewsChannels;    # GetNewsToDisplay
25
use C4::NewsChannels;    # GetNewsToDisplay
26
use C4::Languages qw(getTranslatedLanguages accept_language);
26
use C4::Languages qw(getTranslatedLanguages accept_language);
27
use C4::Koha qw( GetDailyQuote );
27
use C4::Koha qw( GetDailyQuote );
28
use C4::Members;
29
use C4::Overdues;
30
use C4::Reserves;
31
use Koha::Checkouts;
28
32
29
my $input = new CGI;
33
my $input = new CGI;
30
my $dbh   = C4::Context->dbh;
34
my $dbh   = C4::Context->dbh;
Lines 62-68 my $koha_news_count = scalar @$all_koha_news; Link Here
62
66
63
my $quote = GetDailyQuote();   # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha
67
my $quote = GetDailyQuote();   # other options are to pass in an exact quote id or select a random quote each pass... see perldoc C4::Koha
64
68
69
my $checkouts = Koha::Checkouts->search({ borrowernumber => $borrowernumber })->count;
70
my ( $overdues_count, $overdues ) = checkoverdues($borrowernumber);
71
my @holds = GetReservesFromBorrowernumber($borrowernumber);
72
my $holds_pending = 0;
73
foreach my $hold (@holds) {
74
    if (not defined($hold->{found})){
75
        $holds_pending++;
76
    }
77
}
78
my @holds_waiting = GetReservesFromBorrowernumber($borrowernumber, 'W');
79
my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
80
65
$template->param(
81
$template->param(
82
    checkouts           => $checkouts,
83
    overdues            => $overdues_count,
84
    holds_pending       => $holds_pending,
85
    holds_waiting       => scalar @holds_waiting,
86
    total_owing         => $total,
66
    koha_news           => $all_koha_news,
87
    koha_news           => $all_koha_news,
67
    koha_news_count     => $koha_news_count,
88
    koha_news_count     => $koha_news_count,
68
    branchcode          => $homebranch,
89
    branchcode          => $homebranch,
69
- 

Return to bug 2093