Add new admin menu node "Budgets" && remove Plugin configure link

pull/7444/head
Henriette Dinger 5 years ago
parent 21967f3099
commit 69cdbade42
  1. 8
      app/controllers/settings_controller.rb
  2. 2
      app/views/admin/plugins.html.erb
  3. 10
      config/initializers/menus.rb
  4. 5
      modules/costs/lib/open_project/costs/engine.rb

@ -33,9 +33,15 @@ class SettingsController < ApplicationController
before_action :require_admin before_action :require_admin
current_menu_item do |controller| current_menu_item [:index, :edit] do
:settings
end
current_menu_item :plugin do |controller|
plugin = Redmine::Plugin.find(controller.params[:id]) plugin = Redmine::Plugin.find(controller.params[:id])
plugin.settings[:menu_item] || :settings plugin.settings[:menu_item] || :settings
rescue Redmine::PluginNotFound
:settings
end end
def index def index

@ -36,7 +36,6 @@ See docs/COPYRIGHT.rdoc for more details.
<col> <col>
<col> <col>
<col> <col>
<col>
</colgroup> </colgroup>
<tbody> <tbody>
<% @plugins.each do |plugin| %> <% @plugins.each do |plugin| %>
@ -53,7 +52,6 @@ See docs/COPYRIGHT.rdoc for more details.
<%= h plugin.version %> <%= h plugin.version %>
<% end %> <% end %>
</td> </td>
<td class="configure"><%= link_to(l(:button_configure), controller: '/settings', action: 'plugin', id: plugin.id) if plugin.configurable? %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

@ -261,6 +261,16 @@ Redmine::MenuManager.map :admin_menu do |menu|
icon: 'icon2 icon-headset', icon: 'icon2 icon-headset',
if: proc { OpenProject::Configuration.ee_manager_visible? } if: proc { OpenProject::Configuration.ee_manager_visible? }
menu.push :admin_costs,
{ controller: '/settings', action: 'plugin', id: :openproject_costs },
caption: :label_cost_object_plural,
icon: 'icon2 icon-budget'
menu.push :costs_setting,
{ controller: '/settings', action: 'plugin', id: :openproject_costs },
caption: :label_settings,
parent: :admin_costs
menu.push :admin_backlogs, menu.push :admin_backlogs,
{ controller: '/settings', action: 'plugin', id: :openproject_backlogs }, { controller: '/settings', action: 'plugin', id: :openproject_backlogs },
caption: :label_backlogs, caption: :label_backlogs,

@ -30,7 +30,8 @@ module OpenProject::Costs
bundled: true, bundled: true,
settings: { settings: {
default: { 'costs_currency' => 'EUR','costs_currency_format' => '%n %u' }, default: { 'costs_currency' => 'EUR','costs_currency_format' => '%n %u' },
partial: 'settings/openproject_costs' partial: 'settings/openproject_costs',
menu_item: :costs_setting
}, },
name: 'OpenProject Costs' do name: 'OpenProject Costs' do
@ -66,7 +67,7 @@ module OpenProject::Costs
menu :admin_menu, menu :admin_menu,
:cost_types, :cost_types,
{ controller: '/cost_types', action: 'index' }, { controller: '/cost_types', action: 'index' },
icon: 'icon2 icon-cost-types', parent: :admin_costs,
caption: :label_cost_type_plural caption: :label_cost_type_plural
menu :project_menu, menu :project_menu,

Loading…
Cancel
Save