@@ -430,10 +430,11 @@ function helper_project_specific_where( $p_project_id, $p_user_id = null ) {
430
430
* @param int $p_columns_target
431
431
* @param bool $p_viewable_only
432
432
* @param int $p_user_id
433
+ * @param int $p_project_id
433
434
* @return array
434
435
*/
435
- function helper_get_columns_to_view ( $ p_columns_target = COLUMNS_TARGET_VIEW_PAGE , $ p_viewable_only = true , $ p_user_id = null ) {
436
- $ t_columns = helper_call_custom_function ( 'get_columns_to_view ' , array ( $ p_columns_target , $ p_user_id ) );
436
+ function helper_get_columns_to_view ( $ p_columns_target = COLUMNS_TARGET_VIEW_PAGE , $ p_viewable_only = true , $ p_user_id = null , $ p_project_id = null ) {
437
+ $ t_columns = helper_call_custom_function ( 'get_columns_to_view ' , array ( $ p_columns_target , $ p_user_id, $ p_project_id ) );
437
438
438
439
if ( !$ p_viewable_only ) {
439
440
return $ t_columns ;
@@ -449,17 +450,20 @@ function helper_get_columns_to_view( $p_columns_target = COLUMNS_TARGET_VIEW_PAG
449
450
$ t_keys_to_remove [] = 'overdue ' ;
450
451
}
451
452
452
- if ( $ p_columns_target == COLUMNS_TARGET_EXPORT_PAGE || OFF == config_get ( 'show_attachment_indicator ' ) ) {
453
+ if ( $ p_project_id === null ) {
454
+ $ t_current_project_id = helper_get_current_project ();
455
+ } else {
456
+ $ t_current_project_id = $ p_project_id ;
457
+ }
458
+ if ( $ p_columns_target == COLUMNS_TARGET_EXPORT_PAGE || OFF == config_get ( 'show_attachment_indicator ' , null , $ p_user_id , $ t_current_project_id ) ) {
453
459
$ t_keys_to_remove [] = 'attachment ' ;
454
460
}
455
461
456
- $ t_current_project_id = helper_get_current_project ();
457
-
458
- if ( $ t_current_project_id != ALL_PROJECTS && !access_has_project_level ( config_get ( 'view_handler_threshold ' ), $ t_current_project_id ) ) {
462
+ if ( $ t_current_project_id != ALL_PROJECTS && !access_has_project_level ( config_get ( 'view_handler_threshold ' , null , $ p_user_id , $ t_current_project_id ), $ t_current_project_id ) ) {
459
463
$ t_keys_to_remove [] = 'handler_id ' ;
460
464
}
461
465
462
- if ( $ t_current_project_id != ALL_PROJECTS && !access_has_project_level ( config_get ( 'roadmap_view_threshold ' ), $ t_current_project_id ) ) {
466
+ if ( $ t_current_project_id != ALL_PROJECTS && !access_has_project_level ( config_get ( 'roadmap_view_threshold ' , null , $ p_user_id , $ t_current_project_id ), $ t_current_project_id ) ) {
463
467
$ t_keys_to_remove [] = 'target_version ' ;
464
468
}
465
469
0 commit comments