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

(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 291-296 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
291
('OpacLocationBranchToDisplay','holding','holding|home|both','In the OPAC, under location show which branch for Location in the record details.','Choice'),
291
('OpacLocationBranchToDisplay','holding','holding|home|both','In the OPAC, under location show which branch for Location in the record details.','Choice'),
292
('OpacLocationBranchToDisplayShelving','holding','holding|home|both','In the OPAC, display the shelving location under which which column.',  'Choice'),
292
('OpacLocationBranchToDisplayShelving','holding','holding|home|both','In the OPAC, display the shelving location under which which column.',  'Choice'),
293
('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'),
293
('OpacMaintenance','0','','If ON, enables maintenance warning in OPAC','YesNo'),
294
('OpacMaintenanceNotice','','70|10','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea'),
294
('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'),
295
('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'),
295
('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'),
296
('OpacMaxItemsToDisplay','50','','Max items to display at the OPAC on a biblio detail','Integer'),
296
('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'),
297
('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'),
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 11390-11395 if ( CheckVersion($DBversion) ) { Link Here
11390
    SetVersion ($DBversion);
11390
    SetVersion ($DBversion);
11391
}
11391
}
11392
11392
11393
$DBversion = "3.23.00.XXX";
11394
if(CheckVersion($DBversion)) {
11395
    $dbh->do(q{
11396
        INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type)
11397
        VALUES ('OpacMaintenanceNotice','','70|10','A user-defined block of HTML to appear on screen when OpacMaintenace is enabled','Textarea')
11398
    });
11399
    print "Upgrade to $DBversion done (Bug 15311: Let libraries set text to display when OpacMaintenance = on)\n";
11400
    SetVersion($DBversion);
11401
}
11402
11393
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
11403
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
11394
# SEE bug 13068
11404
# SEE bug 13068
11395
# if there is anything in the atomicupdate, read and execute it.
11405
# if there is anything in the atomicupdate, read and execute it.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+6 lines)
Lines 54-59 OPAC: Link Here
54
                  no: "Don't show"
54
                  no: "Don't show"
55
            - "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."
55
            - "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."
56
        -
56
        -
57
        -
58
            - "Show the following HTML when OpacMaintenance is enabled:"
59
            - pref: OpacMaintenanceNotice
60
              type: htmlarea
61
              class: code
62
        -
57
            - By default, show bib records
63
            - By default, show bib records
58
            - pref: BiblioDefaultView
64
            - pref: BiblioDefaultView
59
              choices:
65
              choices:
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/maintenance.tt (-2 / +8 lines)
Lines 26-33 Link Here
26
        <div class="row-fluid">
26
        <div class="row-fluid">
27
            <div class="span12">
27
            <div class="span12">
28
                <div id="opac-maintenance-message">
28
                <div id="opac-maintenance-message">
29
                    <h2>System maintenance</h2>
29
                    [% IF ( maintenance_notice ) %]
30
                        <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>
30
                        [% maintenance_notice %]
31
                    [% ELSE %]
32
                        <h2>System Maintenance</h2>
33
                          <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>
34
                    [% END %]
31
                </div>
35
                </div>
32
            </div>
36
            </div>
33
        </div>
37
        </div>
Lines 35-37 Link Here
35
39
36
[% INCLUDE 'opac-bottom.inc' is_popup=1 %]
40
[% INCLUDE 'opac-bottom.inc' is_popup=1 %]
37
[% BLOCK jsinclude %][% END %]
41
[% BLOCK jsinclude %][% END %]
42
43
(-)a/opac/maintenance.pl (-2 / +5 lines)
Lines 26-37 use Koha; Link Here
26
26
27
my $query = new CGI;
27
my $query = new CGI;
28
my $template = C4::Templates::gettemplate( 'maintenance.tt', 'opac', $query, 0 );
28
my $template = C4::Templates::gettemplate( 'maintenance.tt', 'opac', $query, 0 );
29
30
my $koha_db_version = C4::Context->preference('Version');
29
my $koha_db_version = C4::Context->preference('Version');
31
my $kohaversion     = Koha::version();
30
my $kohaversion     = Koha::version();
32
# Strip dots from version
31
# Strip dots from version
33
$kohaversion     =~ s/\.//g if defined $kohaversion;
32
$kohaversion     =~ s/\.//g if defined $kohaversion;
34
$koha_db_version =~ s/\.//g if defined $koha_db_version;
33
$koha_db_version =~ s/\.//g if defined $koha_db_version;
34
my $maintenance_notice = C4::Context->preference('OpacMaintenanceNotice');
35
36
$template->param(
37
    maintenance_notice => $maintenance_notice
38
);
35
39
36
if ( !defined $koha_db_version || # DB not populated
40
if ( !defined $koha_db_version || # DB not populated
37
     $kohaversion > $koha_db_version || # Update needed
41
     $kohaversion > $koha_db_version || # Update needed
38
- 

Return to bug 15311