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
enable ordering work packages by hierarchy items
Bruno Pagno4d71b909cfc9
diff --git a/app/models/custom_field/order_statements.rb b/app/models/custom_field/order_statements.rbindex 86984954fee..0e4da57f8f5 100644--- a/app/models/custom_field/order_statements.rb+++ b/app/models/custom_field/order_statements.rb@@ -31,7 +31,7 @@ module CustomField::OrderStatements# value of the custom field.def order_statementcase field_format- when "string", "date", "bool", "link", "int", "float", "list", "user", "version"+ when "string", "date", "bool", "link", "int", "float", "list", "user", "version", "hierarchy""cf_order_#{id}.value"endend@@ -52,6 +52,8 @@ module CustomField::OrderStatementsjoin_for_order_by_user_sqlwhen "version"join_for_order_by_version_sql+ when "hierarchy"+ join_for_order_by_hierarchy_sqlendend@@ -167,4 +169,9 @@ module CustomField::OrderStatementsmulti_value:)end++ def join_for_order_by_hierarchy_sql+ table_name = CustomField::Hierarchy::Item.quoted_table_name+ join_for_order_sql(value: "item.label", join: "INNER JOIN #{table_name} item ON item.id = cv.value::bigint")+ endend