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

(-)a/installer/data/mysql/atomicupdate/bug_24221_move-opacmysummarynote-to-addtional-contents.pl (+23 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "24221",
5
    description => "Move OpacMySummaryNote to additional contents",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        # Get any existing value from the OpacMySummaryNote system preference
10
        my ( $opacmysummarynote ) = $dbh->selectrow_array( q|
11
            SELECT value FROM systempreferences WHERE variable='OPACMySummaryNote';
12
        |);
13
        if( $opacmysummarynote ){
14
            # Insert any values found from system preference into additional_contents
15
            foreach my $lang ( 'default' ) {
16
                $dbh->do( "INSERT INTO additional_contents ( category, code, location, branchcode, title, content, lang, published_on ) VALUES ('html_customizations', 'OpacMySummaryNote', 'OpacMySummaryNote', NULL, ?, ?, ?, CAST(NOW() AS date) )", undef, "OpacMySummaryNote $lang", $opacmysummarynote, $lang );
17
            }
18
            # Remove old system preference
19
            $dbh->do("DELETE FROM systempreferences WHERE variable='OPACMySummaryNote'");
20
            say $out "Bug 24221 update done";
21
        }
22
    }
23
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 lines)
Lines 439-445 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
439
('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'),
439
('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'),
440
('OpacMetaDescription','','','This description will show in search engine results (160 characters).','Textarea'),
440
('OpacMetaDescription','','','This description will show in search engine results (160 characters).','Textarea'),
441
('OPACMySummaryHTML','','70|10','Enter the HTML that will appear in a column on the \'my summary\' and \'my checkout history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','Textarea'),
441
('OPACMySummaryHTML','','70|10','Enter the HTML that will appear in a column on the \'my summary\' and \'my checkout history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','Textarea'),
442
('OPACMySummaryNote','','','Note to display on the patron summary page. This note only appears if the patron is connected.','Free'),
443
('OpacNewsLibrarySelect','0','','Show selector for branches on OPAC news page','YesNo'),
442
('OpacNewsLibrarySelect','0','','Show selector for branches on OPAC news page','YesNo'),
444
('OpacNoItemTypeImages','0',NULL,'If ON, disables itemtype images in the OPAC','YesNo'),
443
('OpacNoItemTypeImages','0',NULL,'If ON, disables itemtype images in the OPAC','YesNo'),
445
('OPACNoResultsFound','','70|10','Display this HTML when no results are found for a search in the OPAC','Textarea'),
444
('OPACNoResultsFound','','70|10','Display this HTML when no results are found for a search in the OPAC','Textarea'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-5 lines)
Lines 239-249 OPAC: Link Here
239
              type: textarea
239
              type: textarea
240
              syntax: text/html
240
              syntax: text/html
241
              class: code
241
              class: code
242
        -
243
            - "Note to display on the patron summary page. This note only appears if the patron is logged in:"
244
            - pref: OPACMySummaryNote
245
              type: textarea
246
              syntax: text/html
247
        -
242
        -
248
            - "Include the following HTML under the facets in OPAC search results:"
243
            - "Include the following HTML under the facets in OPAC search results:"
249
            - pref: OPACResultsSidebar
244
            - pref: OPACResultsSidebar
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt (-1 / +1 lines)
Lines 429-435 Link Here
429
            <option value="slip">Slip</option>
429
            <option value="slip">Slip</option>
430
        [% END %]
430
        [% END %]
431
    [% ELSE %]
431
    [% ELSE %]
432
        [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches' ] %]
432
        [% FOREACH l IN [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote' ] %]
433
            [% IF l == location %]
433
            [% IF l == location %]
434
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
434
                <option value="[% l | html %]" selected="selected">[% l | html %]</option>
435
            [% ELSE %]
435
            [% ELSE %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-4 / +3 lines)
Lines 9-14 Link Here
9
[% USE AdditionalContents %]
9
[% USE AdditionalContents %]
10
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
10
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
11
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
11
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
12
[% SET OpacMySummaryNote = AdditionalContents.get( location => "OpacMySummaryNote", lang => lang, library => branchcode ) %]
12
13
13
[% SET borrower_club_enrollments = logged_in_user.get_club_enrollments %]
14
[% SET borrower_club_enrollments = logged_in_user.get_club_enrollments %]
14
[% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1) %] <!-- 1 => OPAC -->
15
[% SET borrower_enrollable_clubs = logged_in_user.get_enrollable_clubs(1) %] <!-- 1 => OPAC -->
Lines 162-170 Link Here
162
                    [% END # / IF patron_flagged %]
163
                    [% END # / IF patron_flagged %]
163
164
164
                    <div class="alert alert-info" id="notesaved" style="display:none;"></div>
165
                    <div class="alert alert-info" id="notesaved" style="display:none;"></div>
165
166
                    [% IF ( OpacMySummaryNote ) %]
166
                    [% IF Koha.Preference('OPACMySummaryNote') %]
167
                        <div id="opac-my-summary-note">[% PROCESS koha_news_block news => OpacMySummaryNote %]</div>
167
                        <div id="opac-my-summary-note">[% Koha.Preference('OPACMySummaryNote') | $raw %]</div>
168
                    [% END %]
168
                    [% END %]
169
169
170
                    [% IF Koha.Preference('AllowPatronToControlAutorenewal') %]
170
                    [% IF Koha.Preference('AllowPatronToControlAutorenewal') %]
171
- 

Return to bug 24221