Permalink
Browse files

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
  • Loading branch information...
1 parent df411e2 commit 2864cc21c371af1d34d7168fdd1c479443ceaa57 @dregad dregad committed Mar 5, 2013
Showing with 12 additions and 2 deletions.
  1. +5 −0 print_all_bug_page_word.php
  2. +7 −2 print_bug_page.php
@@ -346,6 +346,11 @@
<?php
$t_related_custom_field_ids = custom_field_get_linked_ids( $t_bug->project_id );
foreach( $t_related_custom_field_ids as $t_custom_field_id ) {
+ # Don't display the field if user does not have read access to it
+ if ( !custom_field_has_read_access_by_project_id( $t_custom_field_id, $t_bug->project_id ) ) {
+ continue;
+ }
+
$t_def = custom_field_get_definition( $t_custom_field_id );
?>
<tr class="print">
View
@@ -405,6 +405,11 @@
$t_related_custom_field_ids = custom_field_get_linked_ids( $tpl_bug->project_id );
foreach( $t_related_custom_field_ids as $t_id ) {
+ # Don't display the field if user does not have read access to it
+ if ( !custom_field_has_read_access_by_project_id( $t_id, $tpl_bug->project_id ) ) {
+ continue;
+ }
+
$t_def = custom_field_get_definition( $t_id );
echo '<tr class="print">';
@@ -509,7 +514,7 @@
echo '</tr>';
$t_history = history_get_events_array( $f_bug_id );
-
+
foreach ( $t_history as $t_item ) {
echo '<tr class="print">';
echo '<td class="print">', $t_item['date'], '</td>';
@@ -521,7 +526,7 @@
echo '</tr>';
}
}
-
+
echo '</table>';
include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'print_bugnote_inc.php' ) ;

0 comments on commit 2864cc2

Please sign in to comment.