Ejemplo n.º 1
0
/**
 * return an href anchor that links to a bug VIEW page for the given bug
 * account for the user preference and site override
 * @param integer $p_bug_id      A bug identifier.
 * @param integer $p_bugnote_id  A bugnote identifier.
 * @param integer $p_user_id     A valid user identifier.
 * @param boolean $p_detail_info Whether to include more detailed information (e.g. title attribute / project) in the returned string.
 * @param boolean $p_fqdn        Whether to return an absolute or relative link.
 * @return string
 */
function string_get_bugnote_view_link($p_bug_id, $p_bugnote_id, $p_user_id = null, $p_detail_info = true, $p_fqdn = false)
{
    $t_bug_id = (int) $p_bug_id;
    if (bug_exists($t_bug_id) && bugnote_exists($p_bugnote_id)) {
        $t_link = '<a href="';
        if ($p_fqdn) {
            $t_link .= config_get_global('path');
        } else {
            $t_link .= config_get_global('short_path');
        }
        $t_link .= string_get_bugnote_view_url($p_bug_id, $p_bugnote_id, $p_user_id) . '"';
        if ($p_detail_info) {
            $t_reporter = string_attribute(user_get_name(bugnote_get_field($p_bugnote_id, 'reporter_id')));
            $t_update_date = string_attribute(date(config_get('normal_date_format'), bugnote_get_field($p_bugnote_id, 'last_modified')));
            $t_link .= ' title="' . bug_format_id($t_bug_id) . ': [' . $t_update_date . '] ' . $t_reporter . '"';
        }
        $t_link .= '>' . bug_format_id($t_bug_id) . ':' . bugnote_format_id($p_bugnote_id) . '</a>';
    } else {
        $t_link = bugnote_format_id($t_bug_id) . ':' . bugnote_format_id($p_bugnote_id);
    }
    return $t_link;
}
Ejemplo n.º 2
0
        }
    }
    ?>
<tr class="bugnote <?php 
    echo $t_bugnote_css;
    ?>
" id="c<?php 
    echo $t_bugnote->id;
    ?>
">
        <td class="bugnote-meta">
		<?php 
    print_avatar($t_bugnote->reporter_id);
    ?>
		<span class="small bugnote-permalink"><a rel="bookmark" href="<?php 
    echo string_get_bugnote_view_url($t_bugnote->bug_id, $t_bugnote->id);
    ?>
" title="<?php 
    echo lang_get('bugnote_link_title');
    ?>
"><?php 
    echo htmlentities(config_get_global('bugnote_link_tag')) . $t_bugnote_id_formatted;
    ?>
</a></span><br />

		<span class="bugnote-reporter">
		<?php 
    echo print_user($t_bugnote->reporter_id);
    ?>
		<span class="small access-level"><?php 
    if (user_exists($t_bugnote->reporter_id)) {
Ejemplo n.º 3
0
		if ( VS_PRIVATE == $t_bugnote->view_state ) {
			$t_bugnote_css		= 'bugnote-private';
		} else {
			$t_bugnote_css		= 'bugnote-public';
		}

		if ( TIME_TRACKING == $t_bugnote->note_type ) {
		    $t_bugnote_css    .= ' bugnote-time-tracking';
	    } else if ( REMINDER == $t_bugnote->note_type ) {
	        $t_bugnote_css    .= ' bugnote-reminder';
        }
?>
<tr class="bugnote <?php echo $t_bugnote_css ?>" id="c<?php echo $t_bugnote->id ?>">
        <td class="bugnote-meta">
		<?php if ( ON  == config_get("show_avatar") ) print_avatar( $t_bugnote->reporter_id ); ?>
		<span class="small bugnote-permalink"><a rel="bookmark" href="<?php echo string_get_bugnote_view_url($t_bugnote->bug_id, $t_bugnote->id) ?>" title="<?php echo lang_get( 'bugnote_link_title' ) ?>"><?php echo htmlentities( config_get_global( 'bugnote_link_tag' ) ) . $t_bugnote_id_formatted ?></a></span><br />

		<span class="bugnote-reporter">
		<?php
			echo print_user( $t_bugnote->reporter_id );
		?>
		<span class="small access-level"><?php
			if ( user_exists( $t_bugnote->reporter_id ) ) {
				$t_access_level = access_get_project_level( null, (int)$t_bugnote->reporter_id );
				echo '(', get_enum_element( 'access_levels', $t_access_level ), ')';
			}
		?></span>
		</span>

		<?php if ( VS_PRIVATE == $t_bugnote->view_state ) { ?>
		<span class="small bugnote-view-state">[ <?php echo lang_get( 'private' ) ?> ]</span>