diff --git a/installer/data/mysql/atomicupdate/Bug_15311-OpacMaintenanceNotice_syspref.sql b/installer/data/mysql/atomicupdate/Bug_15311-OpacMaintenanceNotice_syspref.sql
new file mode 100644
index 0000000000..258d76ba47
--- /dev/null
+++ b/installer/data/mysql/atomicupdate/Bug_15311-OpacMaintenanceNotice_syspref.sql
@@ -0,0 +1 @@
+INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ('OpacMaintenanceNotice','','','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea');
diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql
index e56f5ee223..ef3d10a7d5 100644
--- a/installer/data/mysql/sysprefs.sql
+++ b/installer/data/mysql/sysprefs.sql
@@ -299,6 +299,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','','','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea'),
('OpacMainUserBlock','Welcome to Koha...\r\n
','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 b600e67c04..47b791d5af 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/installer/data/mysql/updatedatabase.pl
@@ -11870,6 +11870,16 @@ if ( CheckVersion($DBversion) ) {
SetVersion($DBversion);
}
+$DBversion = "3.23.00.XXX";
+if(CheckVersion($DBversion)) {
+ $dbh->do(q{
+ INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type)
+ VALUES ('OpacMaintenanceNotice','','','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 5d1fca0d76..b041ddfd30 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
@@ -53,6 +53,12 @@ OPAC:
yes: Show
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
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/maintenance.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/maintenance.tt
index 62fc15fd0d..01202cdc77 100644
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/maintenance.tt
+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/maintenance.tt
@@ -1,3 +1,4 @@
+[% USE Koha %]
[% INCLUDE 'doc-head-open.inc' %]
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
[% INCLUDE 'doc-head-close.inc' %]
@@ -26,8 +27,12 @@
-
System maintenance
-
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 site administrator
+ [% IF Koha.Preference( 'OpacMaintenanceNotice' ) %]
+ [% Koha.Preference( 'OpacMaintenanceNotice' ).raw %]
+ [% ELSE %]
+
System Maintenance
+
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 site administrator
+ [% END %]