From 377218b506c7caf97bd4b82ee35efc29486f6279 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 9 Apr 2014 10:24:24 +0200 Subject: [PATCH] Bug 12052: New syspref to display message on the OPAC patron summary page Test plan: Fill the OPACMySummaryNote with HTML code or just text. The content should be displayed at the OPAC on the summary page for patrons. Signed-off-by: Bernardo Gonzalez Kriegel Work as described. No koha-qa errors Signed-off-by: Katrin Fischer Works as described, passes tests and QA script. Rephrased the pref text a little bit, using 'logged in' instead of 'connected', also added " so the description appears correctly in the pref editor. Signed-off-by: Galen Charlton (cherry picked from commit f82d22b0df63e2924e9c8b35d2a4eb02edc2650e) Signed-off-by: Fridolin Somers --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 9 +++++++++ .../prog/en/modules/admin/preferences/opac.pref | 4 ++++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 3 +++ koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt | 3 +++ 5 files changed, 20 insertions(+) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index dcc4fc63d2..2a7d297e94 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -243,6 +243,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OpacMainUserBlockMobile','',NULL,'Show the following HTML in its own column on the main page of the OPAC (mobile version):','free'), ('OPACMobileUserCSS','',NULL,'Include the following CSS for the mobile view on all pages in the OPAC:','free'), ('OPACMySummaryHTML','','70|10','Enter the HTML that will appear in a column on the \'my summary\' and \'my reading 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'), +('OPACMySummaryNote','','','Note to display on the patron summary page. This note only appears if the patron is connected.','Free'), ('OpacNav','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'), ('OpacNavBottom','Important links here.','70|10','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','Textarea'), ('OpacNavRight','','70|10','Show the following HTML in the right hand column of the main page under the main login form','Textarea'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 8aa544c60a..92a191fc1d 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -8044,6 +8044,15 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.15.00.XXX"; +if(CheckVersion($DBversion)) { + $dbh->do(q| + INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACMySummaryNote','','','Note to display on the patron summary page. This note only appears if the patron is connected.','Free') + |); + print "Upgrade to $DBversion done (Bug 12052: Add OPACMySummaryNote syspref)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index c80c714364..74f2c38da6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -236,6 +236,10 @@ OPAC: - pref: OPACMySummaryHTML type: textarea class: code + - + - "Note to display on the patron summary page. This note only appears if the patron is logged in:" + - pref: OPACMySummaryNote + type: textarea - - "Include the following HTML under the facets in OPAC search results:" - pref: OPACResultsSidebar diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt index 25305f070b..ea61240253 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -80,6 +80,9 @@ [% END # / IF patron_flagged %] + [% SET OPACMySummaryNote = Koha.Preference('OPACMySummaryNote') %] + [% IF OPACMySummaryNote %][% OPACMySummaryNote %][% END %] +
  • Checked out ([% issues_count %])
  • diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt index e9b1832c86..0df4c82a7d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt @@ -113,6 +113,9 @@ var MSG_CONFIRM_RESUME_HOLDS = _("Are you sure you want to resume all suspended [% END %]
[% END %] + + [% SET OPACMySummaryNote = Koha.Preference('OPACMySummaryNote') %] + [% IF OPACMySummaryNote %][% OPACMySummaryNote %][% END %]
    -- 2.39.5