|
|
|
@ -61,8 +61,10 @@ class WorkPackagesController < ApplicationController |
|
|
|
|
:protect_from_unauthorized_export, :only => [:index, :all, :preview] |
|
|
|
|
before_filter :load_query, :only => :index |
|
|
|
|
|
|
|
|
|
# The order in here is actually imporant for the angular client. |
|
|
|
|
# The order in here is actually important for the angular client. |
|
|
|
|
# The first 6 are always to be displayed. |
|
|
|
|
# Beware that 'percentageDone' may be removed if the related setting is |
|
|
|
|
# disabled. |
|
|
|
|
DEFAULT_WORK_PACKAGE_PROPERTIES = [:status, :assignee, :responsible, |
|
|
|
|
:date, :percentageDone, :priority, |
|
|
|
|
:category, :estimatedTime, :versionName, :spentTime] |
|
|
|
@ -460,7 +462,15 @@ class WorkPackagesController < ApplicationController |
|
|
|
|
parse_preview_data_helper :work_package, [:notes, :description] |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def hook_overview_attributes(initial_attributes = DEFAULT_WORK_PACKAGE_PROPERTIES) |
|
|
|
|
def enabled_default_work_package_properties |
|
|
|
|
@enabled_default_work_package_properties ||= begin |
|
|
|
|
properties = DEFAULT_WORK_PACKAGE_PROPERTIES |
|
|
|
|
properties.delete(:percentageDone) if Setting.work_package_done_ratio == 'disabled' |
|
|
|
|
properties |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
def hook_overview_attributes(initial_attributes = enabled_default_work_package_properties) |
|
|
|
|
attributes = initial_attributes |
|
|
|
|
call_hook(:work_packages_overview_attributes, |
|
|
|
|
project: @project, |
|
|
|
|