Exemple #1
0
    $history_tabs = array('type_all' => 'All', 'type_comment' => 'Comments', 'type_log' => 'Changes', 'type_svn' => 'Git/SVN commits', 'type_related' => 'Related reports');
    if (!isset($_COOKIE['history_tab']) || !isset($history_tabs[$_COOKIE['history_tab']])) {
        $active_history_tab = 'type_all';
    } else {
        $active_history_tab = $_COOKIE['history_tab'];
    }
    echo '<h2 style="border-bottom:2px solid #666;margin-bottom:0;padding:5px 0;">History</h2>', "<div id='comment_filter' class='controls comments'>";
    foreach ($history_tabs as $id => $label) {
        $class_extra = $id == $active_history_tab ? 'active' : '';
        echo "<span id='{$id}' class='control {$class_extra}' onclick='do_comment(this);'>{$label}</span>";
    }
    echo '			</div>
			';
    echo "<div id='comments_view' style='clear:both;'>\n";
    foreach ($bug_comments as $row) {
        output_note($row['id'], $row['added'], $row['email'], $row['comment'], $row['comment_type'], $row['comment_name'], !($active_history_tab == 'type_all' || 'type_' . $row['comment_type'] == $active_history_tab));
    }
    echo "</div>\n";
}
if ($bug_id == 'PREVIEW') {
    ?>

<form action="report.php?package=<?php 
    htmlspecialchars($_SESSION['bug_preview']['package_name']);
    ?>
" method="post">
<?php 
    foreach ($_SESSION['bug_preview'] as $k => $v) {
        if ($k !== 'ldesc') {
            if ($k === 'ldesc_orig') {
                $k = 'ldesc';
Exemple #2
0
if ($bug['ldesc']) {
    output_note(0, $bug['submitted'], $bug['email'], $bug['ldesc'], $bug['showemail'], $bug['bughandle'], $bug['reporter_name'], $bug['registered']);
}
// Display comments
$query = 'SELECT c.id,c.email,c.comment,UNIX_TIMESTAMP(c.ts) AS added, c.reporter_name as comment_name, IF(c.handle <> "",u.registered,1) as registered,
    u.showemail, u.handle,c.handle as bughandle
    FROM bugdb_comments c
    LEFT JOIN users u ON u.handle = c.handle
    WHERE c.bug = ? AND c.active = 1
    GROUP BY c.id ORDER BY c.ts';
$res = $dbh->query($query, array($id));
if ($res) {
    ?>
<h2>Comments</h2><?php 
    while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {
        output_note($row['id'], $row['added'], $row['email'], $row['comment'], $row['showemail'], $row['bughandle'] ? $row['bughandle'] : $row['handle'], $row['comment_name'], $row['registered']);
    }
}
response_footer();
function output_note($com_id, $ts, $email, $comment, $showemail = 1, $handle = null, $comment_name = null, $registered)
{
    global $edit, $id, $user, $dbh;
    echo '<div class="comment">';
    echo '<a name="' . urlencode($ts) . '">&nbsp;</a>';
    echo "<strong>[", format_date($ts), "] ";
    if (!$registered) {
        echo 'User who submitted this comment has not confirmed identity</strong>';
        if (!auth_check('pear.dev')) {
            echo '<pre class="note">If you submitted this note, check your email.';
            echo 'If you do not have a message, <a href="resend-request-email.php?' . 'handle=' . urlencode($handle) . "\">click here to re-send</a>\n", 'MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to <a href="mailto:' . PEAR_DEV_EMAIL . '">' . PEAR_DEV_EMAIL . '</a>' . "\n", "to request the confirmation link.  All bugs/comments/patches associated with this\n\nemail address will be deleted within 48 hours if the account request is not confirmed!";
            echo "</pre>\n</div>";