|
|
@ -161,14 +161,15 @@ class MyProjectsOverviewsController < ApplicationController |
|
|
|
:object_callback |
|
|
|
:object_callback |
|
|
|
|
|
|
|
|
|
|
|
def childprojects |
|
|
|
def childprojects |
|
|
|
@childprojects ||= project.children.visible.all |
|
|
|
@childprojects ||= project.children.visible |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def recent_news |
|
|
|
def recent_news |
|
|
|
@news ||= project.news.all :limit => 5, |
|
|
|
@news ||= project |
|
|
|
:include => [ :author, :project ], |
|
|
|
.news |
|
|
|
:order => "#{News.table_name}.created_on DESC" |
|
|
|
.includes([:author, :project]) |
|
|
|
|
|
|
|
.order("#{News.table_name}.created_on DESC") |
|
|
|
|
|
|
|
.limit(5) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def types |
|
|
|
def types |
|
|
@ -176,24 +177,32 @@ class MyProjectsOverviewsController < ApplicationController |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def open_work_packages_by_type |
|
|
|
def open_work_packages_by_type |
|
|
|
@open_work_packages_by_tracker ||= WorkPackage.visible.count(:group => :type, |
|
|
|
@open_work_packages_by_tracker ||= work_packages_by_type |
|
|
|
:include => [:project, :status, :type], |
|
|
|
.where(statuses: { is_closed: false }) |
|
|
|
:conditions => ["(#{subproject_condition}) AND #{Status.table_name}.is_closed=?", false]) |
|
|
|
.count |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def total_work_packages_by_type |
|
|
|
def total_work_packages_by_type |
|
|
|
@total_work_packages_by_tracker ||= WorkPackage.visible.count(:group => :type, |
|
|
|
@total_work_packages_by_tracker ||= work_packages_by_type.count |
|
|
|
:include => [:project, :status, :type], |
|
|
|
end |
|
|
|
:conditions => subproject_condition) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def work_packages_by_type |
|
|
|
|
|
|
|
WorkPackage |
|
|
|
|
|
|
|
.visible |
|
|
|
|
|
|
|
.group(:type) |
|
|
|
|
|
|
|
.includes([:project, :status, :type]) |
|
|
|
|
|
|
|
.where(subproject_condition) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def assigned_work_packages |
|
|
|
def assigned_work_packages |
|
|
|
@assigned_issues ||= WorkPackage.visible.open.find(:all, |
|
|
|
@assigned_issues ||= WorkPackage |
|
|
|
:conditions => { :assigned_to_id => User.current.id }, |
|
|
|
.visible |
|
|
|
:limit => 10, |
|
|
|
.open |
|
|
|
:include => [ :status, :project, :type, :priority ], |
|
|
|
.where(assigned_to: User.current.id) |
|
|
|
:order => "#{IssuePriority.table_name}.position DESC, #{WorkPackage.table_name}.updated_on DESC") |
|
|
|
.limit(10) |
|
|
|
|
|
|
|
.includes([:status, :project, :type, :priority]) |
|
|
|
|
|
|
|
.order("#{IssuePriority.table_name}.position DESC, |
|
|
|
|
|
|
|
#{WorkPackage.table_name}.updated_on DESC") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def users_by_role(limit = 100) |
|
|
|
def users_by_role(limit = 100) |
|
|
@ -278,7 +287,7 @@ class MyProjectsOverviewsController < ApplicationController |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def overview |
|
|
|
def overview |
|
|
|
@overview ||= MyProjectsOverview.find_or_create_by_project_id(project.id) |
|
|
|
@overview ||= MyProjectsOverview.find_or_create_by(project_id: project.id) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def attachments |
|
|
|
def attachments |
|
|
|