Skip to content
Permalink
Browse files

Custom field columns include subprojects fields

Evaluate subprojects of current project to include readable custom
fields in the available columns list.
This allows adding a column for a custom field that is linked to a
subproject, which is the default behaviour when selecting ALL_PROJECTS.
Since columns are related to a project, but the filter by default shows
issues from subproject, extending the behaviour for any
project/subproject is consistent with the expectation that columns for
those custom fields can be used for view-all-bug page

Fixes: #23233
  • Loading branch information...
cproensa authored and dregad committed Aug 17, 2017
1 parent 3476b16 commit fe444f15514dc15763155c8afac91d8014bc0c4a
Showing with 7 additions and 7 deletions.
  1. +7 −7 core/columns_api.php
@@ -252,15 +252,15 @@ function columns_get_all( $p_project_id = null ) {
} else {
$t_project_id = $p_project_id;
}
$t_related_custom_field_ids = custom_field_get_linked_ids( $t_project_id );
# Get custom fields from this project and sub-projects
$t_projects = user_get_all_accessible_projects( null, $t_project_id );
$t_related_custom_field_ids = custom_field_get_linked_ids( $t_projects );
foreach( $t_related_custom_field_ids as $t_id ) {
if( !custom_field_has_read_access_by_project_id( $t_id, $t_project_id ) ) {
continue;
$t_cfdef = custom_field_get_definition( $t_id );
$t_projects_to_check = array_intersect( $t_projects, custom_field_get_project_ids( $t_id ) );
if( access_has_any_project_level( (int)$t_cfdef['access_level_r'], $t_projects_to_check ) ) {
$t_columns[] = column_get_custom_field_column_name( $t_id );
}
$t_def = custom_field_get_definition( $t_id );
$t_columns[] = 'custom_' . $t_def['name'];
}
return $t_columns;

0 comments on commit fe444f1

Please sign in to comment.
You can’t perform that action at this time.