html_tbl_print_header(lang_get('policy_id'));
 html_tbl_print_header(lang_get('claim_id'));
 print "</tr>" . NEWLINE;
 foreach ($rows_failed_verifications as $row_failed_verification) {
     $row_style = html_tbl_alternate_bgcolor($row_style);
     print "<tr class='{$row_style}'>" . NEWLINE;
     print "<td><a href='{$show_verifications_page}?test_run_id=" . $row_failed_verification[VERIFY_RESULTS_TS_UNIQUE_RUN_ID] . "&amp;release_id={$release_id}&amp;build_id={$build_id}&amp;testset_id={$testset_id}'>" . $row_failed_verification[VERIFY_RESULTS_TS_UNIQUE_RUN_ID] . "</a></td>" . NEWLINE;
     print "<td>" . $row_failed_verification[TEST_RESULTS_TEST_SUITE] . "</td>" . NEWLINE;
     print "<td>" . $row_failed_verification[VERIFY_RESULTS_ACTION] . "</td>" . NEWLINE;
     print "<td>" . $row_failed_verification[VERIFY_RESULTS_EXPECTED_RESULT] . "</td>" . NEWLINE;
     print "<td>" . $row_failed_verification[VERIFY_RESULTS_ACTUAL_RESULT] . "</td>" . NEWLINE;
     print results_verfication_status_icon($row_failed_verification[VERIFY_RESULTS_TEST_STATUS]);
     if ($row_failed_verification[VERIFY_RESULTS_DEFECT_ID] != 0) {
         $defect_id = util_pad_id($row_failed_verification[VERIFY_RESULTS_DEFECT_ID]);
         print "<td><a href='" . VIEW_BUG_URL . "?defect_id={$defect_id}&id={$defect_id}'>{$defect_id}</a></td>" . NEWLINE;
         print "<td>" . bug_get_field_value($defect_id, BUG_STATUS) . "</td>" . NEWLINE;
     } else {
         print "<td></td>" . NEWLINE;
         print "<td></td>" . NEWLINE;
     }
     //print"<td>". bug_get_field_value( $defect_id, BUG_STATUS ) ."</td>". NEWLINE;
     print "<td>" . $row_failed_verification[VERIFY_RESULTS_TIMESTAMP] . "</td>" . NEWLINE;
     print "<td>" . $row_failed_verification[TEST_RESULTS_OS] . "</td>" . NEWLINE;
     print "<td>" . $row_failed_verification[VERIFY_RESULTS_WINDOW] . "</td>" . NEWLINE;
     print "<td>" . $row_failed_verification[VERIFY_RESULTS_OBJ] . "</td>" . NEWLINE;
     print "<td>" . $row_failed_verification[VERIFY_RESULTS_SHOW_CUSTOM_1] . "</td>" . NEWLINE;
     print "<td>" . $row_failed_verification[VERIFY_RESULTS_SHOW_CUSTOM_2] . "</td>" . NEWLINE;
     print "</tr>" . NEWLINE;
 }
 print "</table>" . NEWLINE;
 print "</form>" . NEWLINE;
function bug_email_collect_recipients($bug_id, $notify_type)
{
    global $db;
    $receive_own_email = BUG_EMAIL_ON_OWN_ACTIONS;
    $recipients = "";
    $recipient_ids = array();
    $user_ids = array();
    # Get the current project and user ids
    $project_id = bug_get_field_value($bug_id, BUG_PROJECT_ID);
    $s_user_properties = session_get_user_properties();
    $user_id = $s_user_properties['user_id'];
    $monitor_tbl = BUG_MONITOR_TBL;
    $f_monitor_user_id = BUG_MONITOR_USER_ID;
    $f_monitor_bug_id = BUG_MONITOR_BUG_ID;
    $proj_user_tbl = PROJECT_USER_ASSOC_TBL;
    $f_proj_user_id = PROJ_USER_USER_ID;
    $f_proj_user_proj_id = PROJ_USER_PROJ_ID;
    # Get user_ids for the bug
    $q = "\tSELECT DISTINCT {$f_monitor_user_id}\n\t\t\tFROM {$monitor_tbl}\n\t\t\tWHERE {$f_monitor_bug_id} = {$bug_id}";
    $rs = db_query($db, $q);
    while ($row = db_fetch_row($db, $rs)) {
        # check to see if we should add the user performing the action to the list of recipients
        if ($row[BUG_MONITOR_USER_ID] == $user_id && !$receive_own_email) {
            continue;
        } else {
            $user_ids[] = $row[BUG_MONITOR_USER_ID];
        }
    }
    # Loop through each user_id and find out if the user wants to receive email for the action ($notify_type)
    foreach ($user_ids as $id) {
        switch ($notify_type) {
            case "update_status":
                $f_email_field = PROJ_USER_EMAIL_STATUS_BUG;
                break;
            case "add_bugnote":
                $f_email_field = PROJ_USER_EMAIL_BUGNOTE_BUG;
                break;
            case "assign_bug":
                $f_email_field = PROJ_USER_EMAIL_ASSIGNED_BUG;
                break;
            case "update_bug":
                $f_email_field = PROJ_USER_EMAIL_UPDATE_BUG;
                break;
        }
        # Find out if the user wants email for the specified action
        $q_assoc = "SELECT {$f_email_field}\n\t\t\t\t\tFROM {$proj_user_tbl}\n\t\t\t\t\tWHERE {$f_proj_user_proj_id} = '{$project_id}'\n\t\t\t\t\tAND {$f_proj_user_id} = '{$id}'";
        $rs_assoc = db_query($db, $q_assoc);
        while ($row_assoc = db_fetch_row($db, $rs_assoc)) {
            # If the project_user_assoc preference is Yes, add the user to the list of recipients
            if ($row_assoc[$f_email_field] == 'Y') {
                $recipient_ids[] = $id;
            }
        }
    }
    $recipients = user_get_email_by_user_id($recipient_ids);
    return $recipients;
}