]> source.dussan.org Git - redmine.git/commitdiff
Merged r17869 from trunk to 4.0-stable (#30718).
authorGo MAEDA <maeda@farend.jp>
Sat, 16 Feb 2019 00:35:24 +0000 (00:35 +0000)
committerGo MAEDA <maeda@farend.jp>
Sat, 16 Feb 2019 00:35:24 +0000 (00:35 +0000)
git-svn-id: http://svn.redmine.org/redmine/branches/4.0-stable@17872 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/project.rb
app/models/query.rb

index 85d9cb43f717205b9cdba279d76b8f85ba21a56e..6d91d570a6fc80fcae73018ce2acfe7029fea8d9 100644 (file)
@@ -24,12 +24,6 @@ class Project < ActiveRecord::Base
   STATUS_CLOSED     = 5
   STATUS_ARCHIVED   = 9
 
-  LABEL_BY_STATUS = {
-    1 => l(:project_status_active),
-    5 => l(:project_status_closed),
-    9 => l(:project_status_archived),
-  }
-
   # Maximum length for project identifiers
   IDENTIFIER_MAX_LENGTH = 100
 
index 1e8080b86337cbf95af41fdb34898d4bd05d1e22..552b9faad65bc3889f374a1add5503898d3e20cd 100644 (file)
@@ -581,10 +581,10 @@ class Query < ActiveRecord::Base
 
   # Returns a scope of project statuses that are available as columns or filters
   def project_statuses_values
-    project_statuses =  Project::LABEL_BY_STATUS
-    # Remove archived status from filters
-    project_statuses.delete(9)
-    project_statuses.stringify_keys.invert.to_a
+    [
+      [l(:project_status_active), "#{Project::STATUS_ACTIVE}"],
+      [l(:project_status_closed), "#{Project::STATUS_CLOSED}"]
+    ]
   end
 
   # Adds available filters