OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Show "EE" icon in the project module overview
Henriette Darge759eeb73aab5
diff --git a/app/views/projects/settings/modules/_form.html.erb b/app/views/projects/settings/modules/_form.html.erbindex dc836646c19..813a3f6d278 100644--- a/app/views/projects/settings/modules/_form.html.erb+++ b/app/views/projects/settings/modules/_form.html.erb@@ -29,11 +29,24 @@ See COPYRIGHT and LICENSE files for more details.<% sorted_modules = OpenProject::AccessControl.available_project_modules.sort_by { |name| t(:"project_module_#{name}") } %><% sorted_modules.each do |name| %>- <div class="form--field">- <%= form.collection_check_box :enabled_module_names,- name,- @project.module_enabled?(name),- l_or_humanize(name, prefix: "project_module_") %>+ <div class="form--field">+ <label class="form--label">+ <%= l_or_humanize(name, prefix: "project_module_") %>+ <% if !EnterpriseToken.active? && OpenProject::AccessControl.module_enterprise_feature?(name) %>+ <%= spot_icon('enterprise-addons',+ inline: true,+ size: '1_25',+ classnames: 'upsale-icon_highlighted') %>+ <% end %>+ </label>+ <div class="form--field-container">+ <%= form.collection_check_box :enabled_module_names,+ name,+ @project.module_enabled?(name),+ l_or_humanize(name, prefix: "project_module_"),+ no_label: true+ %>+ </div></div><% end %>diff --git a/frontend/src/global_styles/common/menu/menu.sass b/frontend/src/global_styles/common/menu/menu.sassindex 2d3ee432b47..6bd58dd4a46 100644--- a/frontend/src/global_styles/common/menu/menu.sass+++ b/frontend/src/global_styles/common/menu/menu.sass@@ -12,9 +12,6 @@display: inline-flexalign-items: center- .spot-icon_enterprise-addons- color: $spot-color-feedback-warning-dark-&-actiondisplay: flexalign-items: centerdiff --git a/frontend/src/global_styles/content/_enterprise.sass b/frontend/src/global_styles/content/_enterprise.sassindex e59e6f31e99..7d2a55fea7a 100644--- a/frontend/src/global_styles/content/_enterprise.sass+++ b/frontend/src/global_styles/content/_enterprise.sass@@ -40,6 +40,10 @@.widget-box--blocks--upsale-info-buttonmargin: 0.5rem 1rem 0 0+.upsale-icon+ &_highlighted+ color: $spot-color-feedback-warning-dark+.widget-box--blocks--upsale-titlefont-weight: 400font-size: 20pxdiff --git a/lib/open_project/access_control.rb b/lib/open_project/access_control.rbindex 183297a129a..3773d2a83c1 100644--- a/lib/open_project/access_control.rb+++ b/lib/open_project/access_control.rb@@ -125,6 +125,14 @@ module OpenProject@mapped_permissions.select { |p| p.project_module.nil? || modules.include?(p.project_module.to_s) }end+ def module_enterprise_feature?(name)+ current_module = modules.select { |m| m[:name] == name }[0]++ return false if current_module.nil? || current_module[:enterprise_feature].nil?++ current_module[:enterprise_feature]+ end+def contract_actions_map@contract_actions_map ||= permissions.each_with_object({}) do |p, hash|next if p.contract_actions.none?diff --git a/lib/redmine/menu_manager/menu_helper.rb b/lib/redmine/menu_manager/menu_helper.rbindex af21c917cd7..ae26aefc2a2 100644--- a/lib/redmine/menu_manager/menu_helper.rb+++ b/lib/redmine/menu_manager/menu_helper.rb@@ -231,7 +231,7 @@ module Redmine::MenuManager::MenuHelperlang: menu_item_locale(item)) dotitle_text = ''.html_safe + content_tag(:span, caption, class: 'ellipsis') + badge_for(item)if item.enterprise_feature.present? && !EnterpriseToken.allows_to?(item.enterprise_feature)- title_text << (''.html_safe + spot_icon('enterprise-addons', size: '1_25'))+ title_text << (''.html_safe + spot_icon('enterprise-addons', size: '1_25', classnames: 'upsale-icon_highlighted'))endtitle_textenddiff --git a/modules/team_planner/lib/open_project/team_planner/engine.rb b/modules/team_planner/lib/open_project/team_planner/engine.rbindex 00c9f25a81b..dca9d551464 100644--- a/modules/team_planner/lib/open_project/team_planner/engine.rb+++ b/modules/team_planner/lib/open_project/team_planner/engine.rb@@ -27,7 +27,7 @@ module OpenProject::TeamPlannerbundled: true,settings: {},name: 'OpenProject Team Planner' do- project_module :team_planner_view, dependencies: :work_package_tracking do+ project_module :team_planner_view, dependencies: :work_package_tracking, enterprise_feature: true dopermission :view_team_planner,{ 'team_planner/team_planner': %i[index show upsale overview] },dependencies: %i[view_work_packages],