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 <david@davidnind.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit aa90b60ea2)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Katrin Fischer 2022-08-18 21:26:54 +00:00 committed by Lucas Gass
parent 20995f10fc
commit cb5049a7bc
3 changed files with 14 additions and 16 deletions

View file

@ -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 {

View file

@ -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;

View file

@ -67,6 +67,13 @@
</ul>
[% END %]
[% IF CAN_user_plugins && plugins_enabled %]
<h5>Plugins</h5>
<ul>
<li><a href="/cgi-bin/koha/plugins/plugins-home.pl">Plugins</a></li>
</ul>
[% END %]
[% IF CAN_user_parameters_manage_background_jobs %]
<h5>Background jobs</h5>
<ul>
@ -74,7 +81,7 @@
</ul>
[% 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 ) %]
<h5>Catalog</h5>
<ul>
[% IF ( CAN_user_parameters_manage_marc_frameworks ) %]
@ -86,11 +93,14 @@
<li><a href="/cgi-bin/koha/admin/authtypes.pl">Authority types</a></li>
[% END %]
[% IF ( CAN_user_parameters_manage_classifications ) %]
<li><a href="/cgi-bin/koha/admin/classsources.pl">Classification sources</a></li>
<li><a href="/cgi-bin/koha/admin/classsources.pl">Classification configuration</a></li>
[% END %]
[% IF ( CAN_user_parameters_manage_matching_rules ) %]
<li><a href="/cgi-bin/koha/admin/matching-rules.pl">Record matching rules</a></li>
[% END %]
[% IF ( CAN_user_parameters_manage_marc_overlay_rules ) %]
<li><a href="/cgi-bin/koha/admin/marc-overlay-rules.pl">Record overlay rules</a></li>
[% END %]
[% IF ( CAN_user_parameters_manage_oai_sets ) %]
<li><a href="/cgi-bin/koha/admin/oai_sets.pl">OAI sets configuration</a></li>
[% END %]
@ -100,15 +110,11 @@
[% IF ( CAN_user_parameters_manage_search_engine_config ) %]
<li><a href="/cgi-bin/koha/admin/searchengine/elasticsearch/mappings.pl">Search engine configuration (Elasticsearch)</a></li>
[% END %]
[% IF ( CAN_user_parameters_manage_marc_overlay_rules ) %]
<li><a href="/cgi-bin/koha/admin/marc-overlay-rules.pl">MARC overlay rules</a></li>
[% END %]
</ul>
[% 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 ) ) %]
<h5>Acquisition parameters</h5>
<ul>
[% IF ( CAN_user_acquisition_currencies_manage ) %]
<li><a href="/cgi-bin/koha/admin/currency.pl">Currencies and exchange rates</a></li>
@ -126,13 +132,6 @@
</ul>
[% END %]
[% IF CAN_user_plugins && plugins_enabled %]
<h5>Plugins</h5>
<ul>
<li><a href="/cgi-bin/koha/plugins/plugins-home.pl">Manage plugins</a></li>
</ul>
[% 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 ) ) %]
<h5>Additional parameters</h5>
<ul>