.
/**
* This include file prints out the list of bugnotes attached to the bug
* $f_bug_id must be set and be set to the bug id
*
* @package MantisBT
* @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
* @copyright Copyright (C) 2002 - 2014 MantisBT Team - mantisbt-dev@lists.sourceforge.net
* @link http://www.mantisbt.org
*/
/**
* Requires bugnote API
*/
require_once( 'current_user_api.php' );
# grab the user id currently logged in
$t_user_id = auth_get_current_user_id();
#precache access levels
if ( isset( $g_project_override ) ) {
access_cache_matrix_project( $g_project_override );
} else {
access_cache_matrix_project( helper_get_current_project() );
}
# get the bugnote data
$t_bugnote_order = current_user_get_pref( 'bugnote_order' );
$t_bugnotes = bugnote_get_all_visible_bugnotes( $f_bug_id, $t_bugnote_order, 0, $t_user_id );
#precache users
$t_bugnote_users = array();
foreach($t_bugnotes as $t_bugnote) {
$t_bugnote_users[] = $t_bugnote->reporter_id;
}
user_cache_array_rows( $t_bugnote_users );
$num_notes = count( $t_bugnotes );
?>
reporter_id ); ?>
() reporter_id ); ?> reporter_id ) ) { $t_access_level = access_get_project_level( null, (int)$t_bugnote->reporter_id ); // Only display access level when higher than 0 (ANYBODY) if( $t_access_level > ANYBODY ) { echo '(', get_enum_element( 'access_levels', $t_access_level ), ')'; } } ?> view_state ) { ?> [ ] date_submitted ); ?> ' . lang_get( 'edited_on') . lang_get( 'word_separator' ) . date( $t_normal_date_format, $t_bugnote->last_modified ) . ' '; } ?>
reporter_id == $t_user_id ) && ( ON == config_get( 'bugnote_allow_user_edit_delete' ) ) ) ) {
$t_can_edit_note = true;
$t_can_delete_note = true;
}
# users above update_bugnote_threshold should be able to edit this bugnote
if ( $t_can_edit_note || access_has_bug_level( config_get( 'update_bugnote_threshold' ), $f_bug_id ) ) {
print_button( 'bugnote_edit_page.php?bugnote_id='.$t_bugnote->id, lang_get( 'bugnote_edit_link' ) );
}
# users above delete_bugnote_threshold should be able to delete this bugnote
if ( $t_can_delete_note || access_has_bug_level( config_get( 'delete_bugnote_threshold' ), $f_bug_id ) ) {
echo " ";
print_button( 'bugnote_delete.php?bugnote_id='.$t_bugnote->id, lang_get( 'delete_link' ) );
}
# users with access to both update and change view status (or the bugnote author) can change public/private status
if ( $t_can_edit_note || ( access_has_bug_level( config_get( 'update_bugnote_threshold' ), $f_bug_id ) &&
access_has_bug_level( config_get( 'change_view_status_threshold' ), $f_bug_id ) ) ) {
if ( VS_PRIVATE == $t_bugnote->view_state ) {
echo " ";
print_button( 'bugnote_set_view_state.php?private=0&bugnote_id=' . $t_bugnote->id, lang_get( 'make_public' ) );
} else {
echo " ";
print_button( 'bugnote_set_view_state.php?private=1&bugnote_id=' . $t_bugnote->id, lang_get( 'make_private' ) );
}
}
}
?>
|
note_type ) {
case REMINDER:
echo '';
# List of recipients; remove surrounding delimiters
$t_recipients = trim( $t_bugnote->note_attr, '|' );
if( empty( $t_recipients ) ) {
echo lang_get( 'reminder_sent_none' );
} else {
# If recipients list's last char is not a delimiter, it was truncated
$t_truncated = ( '|' != utf8_substr( $t_bugnote->note_attr, utf8_strlen( $t_bugnote->note_attr ) - 1 ) );
# Build recipients list for display
$t_to = array();
foreach ( explode( '|', $t_recipients ) as $t_recipient ) {
$t_to[] = prepare_user_name( $t_recipient );
}
echo lang_get( 'reminder_sent_to' ) . ': '
. implode( ', ', $t_to )
. ( $t_truncated ? ' (' . lang_get( 'reminder_list_truncated' ) . ')' : '' );
}
echo ' '; break; case TIME_TRACKING: if ( access_has_bug_level( config_get( 'time_tracking_view_threshold' ), $f_bug_id ) ) { echo '', lang_get( 'time_tracking_time_spent' ) . ' ' . $t_time_tracking_hhmm, ' '; } break; } echo string_display_links( $t_bugnote->note );; ?> |
', sprintf ( lang_get( 'total_time_for_issue' ), db_minutes_to_hhmm( $t_total_time ) ), ' |