Skip to content

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

show version of entrprise token with plan

Klaus Zanders7955acb681e6
diff --git a/app/helpers/enterprise_helper.rb b/app/helpers/enterprise_helper.rb
index 93d7ffedaeb..af611de46fc 100644
--- a/app/helpers/enterprise_helper.rb
+++ b/app/helpers/enterprise_helper.rb
@@ -13,4 +13,16 @@ module EnterpriseHelper
}
end
end
+
+ def enterprise_token_plan_name(enterprise_token)
+ if enterprise_token.respond_to?(:plan)
+ "#{I18n.t(enterprise_token.plan, scope: [:enterprise_plans])} (#{enterprise_token.version})"
+ end
+ end
+
+ def enterprise_plan_additional_features(enterprise_token)
+ (enterprise_token.try(:features) || [])
+ .map { |feature| I18n.t(feature, scope: [:enterprise_features], default: feature.to_s.humanize) }
+ .join(", ")
+ end
end
diff --git a/app/models/enterprise_token.rb b/app/models/enterprise_token.rb
index 87d5f7cacca..7aff6d7c8c0 100644
--- a/app/models/enterprise_token.rb
+++ b/app/models/enterprise_token.rb
@@ -82,6 +82,7 @@ class EnterpriseToken < ApplicationRecord
:restrictions,
:plan,
:features,
+ :version,
to: :token_object
def token_object
diff --git a/app/views/enterprises/_current.html.erb b/app/views/enterprises/_current.html.erb
index 4e3aaafe6b5..be1a33f9fa8 100644
--- a/app/views/enterprises/_current.html.erb
+++ b/app/views/enterprises/_current.html.erb
@@ -3,12 +3,13 @@
data-email="<%= @current_token.mail %>"
data-company="<%= @current_token.try(:company) %>"
data-domain="<%= @current_token.try(:domain) %>"
- data-plan="<%= (@current_token.respond_to?(:plan) ? I18n.t(@current_token.plan, scope: [:enterprise_plans]) : nil) %>"
+ data-plan="<%= enterprise_token_plan_name(@current_token) %>"
data-user-count="<%= @current_token.restrictions.nil? ? t("js.admin.enterprise.upsale.unlimited") : @current_token.restrictions[:active_user_count] %>"
data-starts-at="<%= format_date @current_token.starts_at %>"
data-expires-at="<%= @current_token.will_expire? ? (format_date @current_token.expires_at) : t("js.admin.enterprise.upsale.unlimited") %>"
data-is-expired="<%= @current_token.expired?(reprieve: false) %>"
data-additional-features="<%= (@current_token.try(:features) || []).map { |feature| I18n.t(feature, scope: [:enterprise_features], default: feature.to_s.humanize) }.join(", ") %>"
+ data-additional-features="<%= enterprise_plan_additional_features(@current_token) %>"
data-reprieve-days-left="<%= @current_token.reprieve_days_left %>">
</opce-enterprise-active-saved-trial>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 1e76744dad9..10d9db3100c 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -4578,11 +4578,7 @@ en:
description: "Adds the OmniAuth SAML provider to OpenProject"
enterprise_plans:
- basic: Baisc Plan
- professional: Professional Plan
- premium: Premium Plan
- corporate: Corporate Plan
- legacy_enterprise: "Enterprise Plan (Legacy)"
+ legacy_enterprise: "Enterprise Plan"
enterprise_features:
baseline_comparison: Baseline Comparison