Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2864cc2

Browse files
committedMar 5, 2013
Print pages: don't show custom fields user has no access to
Prior to this, if a custom field's 'read' access level were higher than the user's access, the print pages would display the field's label (but not the data). This behavior is not consistent with how this situation is handled in the View Issue page, where the field is not shown at all. For consistency, we now skip the of the custom field users have no read access to in the print pages, so that nothing is displayed. Fixes #15528
1 parent df411e2 commit 2864cc2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
 

‎print_all_bug_page_word.php

+5
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,11 @@
346346
<?php
347347
$t_related_custom_field_ids = custom_field_get_linked_ids( $t_bug->project_id );
348348
foreach( $t_related_custom_field_ids as $t_custom_field_id ) {
349+
# Don't display the field if user does not have read access to it
350+
if ( !custom_field_has_read_access_by_project_id( $t_custom_field_id, $t_bug->project_id ) ) {
351+
continue;
352+
}
353+
349354
$t_def = custom_field_get_definition( $t_custom_field_id );
350355
?>
351356
<tr class="print">

‎print_bug_page.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@
405405

406406
$t_related_custom_field_ids = custom_field_get_linked_ids( $tpl_bug->project_id );
407407
foreach( $t_related_custom_field_ids as $t_id ) {
408+
# Don't display the field if user does not have read access to it
409+
if ( !custom_field_has_read_access_by_project_id( $t_id, $tpl_bug->project_id ) ) {
410+
continue;
411+
}
412+
408413
$t_def = custom_field_get_definition( $t_id );
409414

410415
echo '<tr class="print">';
@@ -509,7 +514,7 @@
509514
echo '</tr>';
510515

511516
$t_history = history_get_events_array( $f_bug_id );
512-
517+
513518
foreach ( $t_history as $t_item ) {
514519
echo '<tr class="print">';
515520
echo '<td class="print">', $t_item['date'], '</td>';
@@ -521,7 +526,7 @@
521526
echo '</tr>';
522527
}
523528
}
524-
529+
525530
echo '</table>';
526531

527532
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'print_bugnote_inc.php' ) ;

0 commit comments

Comments
 (0)
Please sign in to comment.