From cb5049a7bc2306863abcffbbbcdd3d4c95b30c63 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Thu, 18 Aug 2022 21:26:54 +0000 Subject: [PATCH] Bug 31401: Update administration sidebar to match entries on administration start page This makes sure that all entries on the administration start page have a matching entry in the administration sidebar that shows on the left side if you are on any of the administration sub pages. Changes made: * Rename 'Classification sources' to 'Classification configuration' * Make Plugins entry show and appear in correct spot This relied on the variable plugins_enabled that wasn't available in all the different templates. I therefore moved it to Auth.pm and cleaned up the code for the admin start page. * Move 'MARC overlay rules' and rename to 'Record overlay rules' To test: * Make sure plugins are enabled and visible on admin start page * Compare admin start page and sidebar * Sequence should be the same * All entries should appear on both pages * Naming should be the same Signed-off-by: David Nind Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi (cherry picked from commit aa90b60ea2979279a5e134eb9cbc7cb3d6075417) Signed-off-by: Lucas Gass --- C4/Auth.pm | 3 ++- admin/admin-home.pl | 2 -- .../prog/en/includes/admin-menu.inc | 25 +++++++++---------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 7960909f81..7732eef56f 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -524,7 +524,7 @@ sub get_template_and_user { $template->param( AmazonCoverImages => C4::Context->preference("AmazonCoverImages"), AutoLocation => C4::Context->preference("AutoLocation"), - PatronAutoComplete => C4::Context->preference("PatronAutoComplete"), + PatronAutoComplete => C4::Context->preference("PatronAutoComplete"), FRBRizeEditions => C4::Context->preference("FRBRizeEditions"), IndependentBranches => C4::Context->preference("IndependentBranches"), IntranetNav => C4::Context->preference("IntranetNav"), @@ -549,6 +549,7 @@ sub get_template_and_user { UseCourseReserves => C4::Context->preference("UseCourseReserves"), useDischarge => C4::Context->preference('useDischarge'), pending_checkout_notes => Koha::Checkouts->search({ noteseen => 0 }), + plugins_enabled => C4::Context->config("enable_plugins"), ); } else { diff --git a/admin/admin-home.pl b/admin/admin-home.pl index 73f2cc8edf..6595841e70 100755 --- a/admin/admin-home.pl +++ b/admin/admin-home.pl @@ -24,7 +24,6 @@ use Koha::Plugins; my $query = CGI->new; -my $plugins_enabled = C4::Context->config("enable_plugins"); my $mana_url = C4::Context->config('mana_config'); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( @@ -36,7 +35,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -$template->param( plugins_enabled => $plugins_enabled, ); $template->param( mana_url => $mana_url, ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc index 03ac6e69db..8fb7ccccd7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc @@ -67,6 +67,13 @@ [% END %] + [% IF CAN_user_plugins && plugins_enabled %] +
Plugins
+ + [% END %] + [% IF CAN_user_parameters_manage_background_jobs %]
Background jobs
    @@ -74,7 +81,7 @@
[% END %] - [% IF ( CAN_user_parameters_manage_marc_frameworks || CAN_user_parameters_manage_classifications || CAN_user_parameters_manage_matching_rules || CAN_user_parameters_manage_oai_sets || CAN_user_parameters_manage_item_search_fields || CAN_user_parameters_manage_search_engine_config || CAN_user_parameters_manage_marc_overlay_rules ) %] + [% IF ( CAN_user_parameters_manage_marc_frameworks || CAN_user_parameters_manage_classifications || CAN_user_parameters_manage_matching_rules || CAN_user_parameters_manage_oai_sets || CAN_user_parameters_manage_item_search_fields || CAN_user_parameters_manage_search_engine_config || CAN_user_parameters_manage_marc_overlay_rules || CAN_user_parameters_manage_marc_overlay_rules ) %]
Catalog
[% END %] [% IF ( CAN_user_acquisition_currencies_manage || CAN_user_acquisition_period_manage || CAN_user_acquisition_budget_manage || ( Koha.Preference('EDIFACT') && CAN_user_acquisition_edi_manage ) ) %]
Acquisition parameters
- [% END %] - [% IF CAN_user_plugins && plugins_enabled %] -
Plugins
- - [% END %] - [% IF ( CAN_user_parameters_manage_smtp_servers || CAN_user_parameters_manage_search_targets || CAN_user_parameters_manage_didyoumean || CAN_user_parameters_manage_column_config || CAN_user_parameters_manage_audio_alerts || ( CAN_user_parameters_manage_sms_providers && Koha.Preference('SMSSendDriver') == 'Email' ) || CAN_user_parameters_manage_usage_stats || CAN_user_parameters_manage_additional_fields || ( Koha.Preference('EnableAdvancedCatalogingEditor') && CAN_user_parameters_manage_keyboard_shortcuts ) ) %]
Additional parameters
    -- 2.39.5