Bug 36039: New 'datatabase audit' tab in about page

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: JesseM <jesse@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Pedro Amorim 2024-02-26 16:36:29 +00:00 committed by Katrin Fischer
parent 09bb85409d
commit 6940167048
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
2 changed files with 19 additions and 0 deletions

View File

@ -926,4 +926,10 @@ sub message_broker_check {
}
}
if ( $tab eq 'database' ) {
use Koha::Database::Auditor;
my $db_auditor = Koha::Database::Auditor->new( { is_cli => 0 } );
my $audit_diff = $db_auditor->run;
$template->param( audit_diff => $audit_diff, audit_warning => $db_auditor->get_warning );
}
output_html_with_http_headers $query, $cookie, $template->output;

View File

@ -41,6 +41,7 @@
[% WRAPPER tab_item linktab = 1 tabname = "translations" bt_active = tab == "translations" %] <span>Translations</span> [% END %]
[% WRAPPER tab_item linktab = 1 tabname = "history" bt_active = tab == "history" %] <span>Timeline</span> [% END %]
[% WRAPPER tab_item linktab = 1 tabname = "dedications" bt_active = tab == "dedications" %] <span>Dedications</span> [% END %]
[% WRAPPER tab_item linktab = 1 tabname = "database" bt_active = tab == "database" %] <span>Database audit</span> [% END %]
[% END %]
[% WRAPPER tab_panels %]
[% SWITCH tab %]
@ -52,6 +53,7 @@
[% CASE 'translations' %] [% PROCESS translations_panel %]
[% CASE 'history' %] [% PROCESS history_panel %]
[% CASE 'dedications' %] [% PROCESS dedications_panel %]
[% CASE 'database' %] [% PROCESS database_panel %]
[% CASE %] [% PROCESS about_panel %]
[% END %]
[% END %]
@ -1350,3 +1352,14 @@
</p>
[% END # tab=dedications %]
[% END %]
[% BLOCK database_panel %]
[% WRAPPER tab_panel tabname= "database" bt_active = 1 %]
<h2>Database audit</h2>
<p>Run the following SQL to fix the database:</p>
<code>
[% audit_diff | html %]
</code>
<p class="alert alert-warning">[% audit_warning | html %]</p>
[% END # tab=database %]
[% END %]