Bugzilla – Attachment 45712 Details for
Bug 15311
Let libraries set text to display when OpacMaintenance = on
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15311 - Let libraries set text to display when OpacMaintenance = on
Bug-15311---Let-libraries-set-text-to-display-when.patch (text/plain), 6.64 KB, created by
Aleisha Amohia
on 2015-12-15 22:02:10 UTC
(
hide
)
Description:
Bug 15311 - Let libraries set text to display when OpacMaintenance = on
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2015-12-15 22:02:10 UTC
Size:
6.64 KB
patch
obsolete
>From 22a51dd9d0afe1382c031c93f3a0c3e6af3bf335 Mon Sep 17 00:00:00 2001 >From: Barry Cannon <bc@interleaf.ie> >Date: Tue, 15 Dec 2015 16:48:34 +0000 >Subject: [PATCH] Bug 15311 - Let libraries set text to display when > OpacMaintenance = on > >Added new systempreference OpacMaintenanceNotice. >When OpacMaintenance is ON the HTML contents of OpacMaintenanceNotice will >be displayed. >Enabling OpacMaintenance is all that is required to enable this preference. >If OpacMaintenanceNotice is undefined, the default (original) notice will >appear when OpacMaintenance is enabled. > >To test: >- Enable OpacMaintenance systempreference >- Observe the default maintenance message when OPAC is viewed >- Edit OpacMaintenanceNotice systempreference, adding custom HTML >- Observe the custom HTML appear on the opac >- Remove OpacMaintenanceNotice (mindful of orphaned spaces etc.) >- Observe the default opac notice appears in the opac >- Disable OpacMaintenance >- Observce opac is back online > >Signed-off-by: Aleisha <aleishaamohia@hotmail.com> >--- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 10 ++++++++++ > .../prog/en/modules/admin/preferences/opac.pref | 6 ++++++ > koha-tmpl/opac-tmpl/bootstrap/en/modules/maintenance.tt | 8 ++++++-- > opac/maintenance.pl | 6 +++++- > 5 files changed, 28 insertions(+), 3 deletions(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 484b3cd..ab56498 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -291,6 +291,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OpacLocationBranchToDisplay','holding','holding|home|both','In the OPAC, under location show which branch for Location in the record details.','Choice'), > ('OpacLocationBranchToDisplayShelving','holding','holding|home|both','In the OPAC, display the shelving location under which which column.', 'Choice'), > ('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'), >+('OpacMaintenanceNotice','','70|10','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea'), > ('OpacMainUserBlock','Welcome to Koha...\r\n<hr>','70|10','A user-defined block of HTML in the main content area of the opac main page','Textarea'), > ('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'), > ('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'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index f8ab41e..258ac70 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -11390,6 +11390,16 @@ if ( CheckVersion($DBversion) ) { > SetVersion ($DBversion); > } > >+$DBversion = "3.23.00.XXX"; >+if(CheckVersion($DBversion)) { >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) >+ VALUES ('OpacMaintenanceNotice','','70|10','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea') >+ }); >+ print "Upgrade to $DBversion done (Bug 15311: Let libraries set text to display when OpacMaintenance = on)\n"; >+ SetVersion($DBversion); >+} >+ > # DEVELOPER PROCESS, search for anything to execute in the db_update directory > # SEE bug 13068 > # if there is anything in the atomicupdate, read and execute it. >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 17d0b1a..70cd686 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 >@@ -54,6 +54,12 @@ OPAC: > no: "Don't show" > - "a warning that the OPAC is under maintenance, instead of the OPAC itself. Note: this shows the same warning as when the database needs to be upgraded, but unconditionally." > - >+ - >+ - "Show the following HTML when OpacMaintenance is enabled:" >+ - pref: OpacMaintenanceNotice >+ type: htmlarea >+ class: code >+ - > - By default, show bib records > - pref: BiblioDefaultView > choices: >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/maintenance.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/maintenance.tt >index 62fc15f..a43a0bf 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/maintenance.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/maintenance.tt >@@ -26,8 +26,12 @@ > <div class="row-fluid"> > <div class="span12"> > <div id="opac-maintenance-message"> >- <h2>System maintenance</h2> >- <p>The [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog is offline for system maintenance. We'll be back soon! If you have any questions, please contact the <a href="mailto:[% KohaAdminEmailAddress %]">site administrator</a></p> >+ [% IF ( maintenance_notice ) %] >+ [% maintenance_notice %] >+ [% ELSE %] >+ <h2>System Maintenance</h2> >+ <p>The [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog is offline for system maintenance. We'll be back soon! If you have any questions, please contact the <a href="mailto:[% KohaAdminEmailAddress %]">site administrator</a></p> >+ [% END %] > </div> > </div> > </div> >diff --git a/opac/maintenance.pl b/opac/maintenance.pl >index 1839e2e..cb7a713 100755 >--- a/opac/maintenance.pl >+++ b/opac/maintenance.pl >@@ -26,12 +26,16 @@ use Koha; > > my $query = new CGI; > my $template = C4::Templates::gettemplate( 'maintenance.tt', 'opac', $query, 0 ); >- > my $koha_db_version = C4::Context->preference('Version'); > my $kohaversion = Koha::version(); > # Strip dots from version > $kohaversion =~ s/\.//g if defined $kohaversion; > $koha_db_version =~ s/\.//g if defined $koha_db_version; >+my $maintenance_notice = C4::Context->preference('OpacMaintenanceNotice'); >+ >+$template->param( >+ maintenance_notice => $maintenance_notice >+); > > if ( !defined $koha_db_version || # DB not populated > $kohaversion > $koha_db_version || # Update needed >-- >1.7.10.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 15311
:
45711
|
45712
|
45719
|
47627
|
47769
|
47784
|
47788
|
48400