html_print_menu();
test_menu_print($page);
$ids = "";
# if submit from bug_page.php
if (isset($_POST['mass_update_btn']) && isset($_POST['row_bug_arr'])) {
    $field = $_POST['action'];
    foreach ($_POST['row_bug_arr'] as $key => $value) {
        $ids .= $key . ":";
    }
} else {
    error_report_show("test_page.php", NO_BUGS_SELECTED);
}
switch ($field) {
    case 'bug_status':
        $form_title = lang_get('update_bug_status');
        $possible_values = bug_get_status();
        break;
    case 'assign_to':
        $form_title = lang_get('update_assign_to');
        $possible_values = user_get_usernames_by_project($project_id);
        break;
    case 'assign_to_dev':
        $form_title = lang_get('update_assign_to_developer');
        $possible_values = user_get_usernames_by_project($project_id);
        break;
}
print "<br>" . NEWLINE;
print "<div align=center>" . NEWLINE;
print "<form method=post action={$action_page}>" . NEWLINE;
print "<table class=width50>" . NEWLINE;
print "<tr>" . NEWLINE;
function html_print_bug_filter($project_id, $filter_bug_status, $filter_bug_category, $filter_bug_component, $filter_reported_by, $filter_assigned_to, $filter_assigned_to_developer, $filter_found_in_rel, $filter_assigned_to_rel, $filter_per_page, $filter_view_closed, $filter_search, $filter_jump)
{
    print "<table class=width100>" . NEWLINE;
    print "<tr>" . NEWLINE;
    print "<td>" . NEWLINE;
    print "<table class=inner rules=none border=0>" . NEWLINE;
    # TITLES FOR HEADER DIALOG
    print "<tr class=left>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('reported_by') . "</td>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('assigned_to') . "</td>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('assigned_to_developer') . "</td>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('found_in_release') . "</td>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('assigned_to_release') . "</td>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('show') . "</td>" . NEWLINE;
    print "<td>&nbsp;</td>" . NEWLINE;
    print "</tr>" . NEWLINE;
    # REPORTED BY - all users
    print "<td align='center'>" . NEWLINE;
    print "<select name='reported_by'>" . NEWLINE;
    $reported_by = user_get_usernames_by_project($project_id, $blank = true);
    html_print_list_box_from_array($reported_by, $filter_reported_by);
    print "</select>" . NEWLINE;
    print "</td>" . NEWLINE;
    # ASSIGNED TO - all users?? or all users with bug_assign_status
    print "<td align='center'>" . NEWLINE;
    print "<select name='assigned_to'>" . NEWLINE;
    $assigned_to = user_get_usernames_by_project($project_id, $blank = true);
    html_print_list_box_from_array($assigned_to, $filter_assigned_to);
    print "</select>" . NEWLINE;
    print "</td>" . NEWLINE;
    # ASSIGNED TO DEVELOPER
    print "<td align='center'>" . NEWLINE;
    print "<select name='assigned_to_developer'>" . NEWLINE;
    $assigned_to_developer = user_get_usernames_by_project($project_id, $blank = true);
    html_print_list_box_from_array($assigned_to_developer, $filter_assigned_to_developer);
    print "</select>" . NEWLINE;
    print "</td>" . NEWLINE;
    # FOUND IN RELEASE
    print "<td align='center'>" . NEWLINE;
    print "<select name='found_in_release'>" . NEWLINE;
    $found_in_release = admin_get_all_release_names($project_id, $blank = true);
    html_print_list_box_from_array($found_in_release, $filter_found_in_rel);
    print "</select>" . NEWLINE;
    print "</td>" . NEWLINE;
    # ASSIGNED TO RELEASE
    print "<td align='center'>" . NEWLINE;
    print "<select name='assigned_to_release'>" . NEWLINE;
    $assigned_to_release = admin_get_all_release_names($project_id, $blank = true);
    html_print_list_box_from_array($assigned_to_release, $filter_assigned_to_rel);
    print "</select>" . NEWLINE;
    print "</td>" . NEWLINE;
    # PER PAGE
    print "<td align='center'>" . NEWLINE;
    print "<input type='text' size='3' maxlength='3' name='per_page' value='" . $filter_per_page . "'>" . NEWLINE;
    print "</td>" . NEWLINE;
    print "<td align='center' rowspan=4 valign=center><input type='submit' value='Filter'></td>" . NEWLINE;
    print "</tr>" . NEWLINE;
    # SECOND ROW OF FILTERS
    print "<tr class='left'>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('bug_status') . "</td>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('bug_category') . "</td>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('bug_component') . "</td>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('view_closed') . "</td>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('search') . "</td>" . NEWLINE;
    print "<td class=form-header-c>" . lang_get('jump') . "</td>" . NEWLINE;
    print "<td>&nbsp;</td>" . NEWLINE;
    print "</tr>" . NEWLINE;
    print "<tr>" . NEWLINE;
    # STATUS
    print "<td align='center'>" . NEWLINE;
    print "<select name='status'>" . NEWLINE;
    $bug_status = bug_get_status(true);
    html_print_list_box_from_array($bug_status, $filter_bug_status);
    print "</select>" . NEWLINE;
    print "</td>" . NEWLINE;
    # CATEGORY
    print "<td align='center'>" . NEWLINE;
    print "<select name='category'>" . NEWLINE;
    html_print_list_box_from_key_array(bug_get_categories($project_id, $blank = true), $selected = $filter_bug_category);
    print "</select>" . NEWLINE;
    print "</td>" . NEWLINE;
    # COMPONENT
    print "<td align='center'>" . NEWLINE;
    print "<select name='component'>" . NEWLINE;
    html_print_list_box_from_key_array(bug_get_components($project_id, $blank = true), $selected = $filter_bug_component);
    print "</select>" . NEWLINE;
    print "</td>" . NEWLINE;
    # VIEW CLOSED
    print "<td align='center'>" . NEWLINE;
    print "<select name='view_closed'>" . NEWLINE;
    $view_closed_options = array(lang_get('yes'), lang_get('no'));
    html_print_list_box_from_array($view_closed_options, $filter_view_closed);
    print "</select>" . NEWLINE;
    print "</td>" . NEWLINE;
    # SEARCH
    print "<td align='center'>" . NEWLINE;
    print "<input type='text' size='15' maxlength='25' name='bug_search' value='" . $filter_search . "'>" . NEWLINE;
    print "</td>" . NEWLINE;
    # JUMP
    print "<td align='center'>" . NEWLINE;
    print "<input type='text' size='6' maxlength='6' name='filter_jump' value='" . $filter_jump . "'>" . NEWLINE;
    print "</td>" . NEWLINE;
    print "</tr>" . NEWLINE;
    print "</table>" . NEWLINE;
    print "<input type=hidden name=bug_form_filter_value value=true>" . NEWLINE;
    print "</td>" . NEWLINE;
    print "</tr>" . NEWLINE;
    print "</table>" . NEWLINE;
}
 print "<td class=center width='20%' valign='top'>" . NEWLINE;
 print "<form method=post action='{$bug_update_action}'>" . NEWLINE;
 print "<input type='submit' value='" . lang_get('assign_to_developer') . "'>" . NEWLINE;
 print "<select name='assign_to_developer' size='1'>";
 $users = user_get_usernames_by_project($project_id, $blank = true);
 html_print_list_box_from_array($users, $assigned_to_developer);
 print "</select>";
 print "<input type='hidden' name='action' value='update_assign_to_developer'>" . NEWLINE;
 print "</form>" . NEWLINE;
 print "</td>" . NEWLINE;
 # CHANGE STATUS
 print "<td class=center width='20%' valign='top'>" . NEWLINE;
 print "<form method=post action='{$bug_update_action}'>" . NEWLINE;
 print "<input type='submit' value='" . lang_get('change_status') . "'>" . NEWLINE;
 print "<select name='update_status' size='1'>";
 $statuses = bug_get_status();
 html_print_list_box_from_array($statuses, $bug_status);
 print "</select>";
 print "<input type='hidden' name='action' value='update_status'>" . NEWLINE;
 print "</form>" . NEWLINE;
 print "</td>" . NEWLINE;
 # DELETE
 # disable delete button if user does not have the rights
 if ($user_has_delete_rights) {
     $delete_disabled = "";
 } else {
     $delete_disabled = "disabled";
 }
 print "<td class=center width='20%' valign='top'>" . NEWLINE;
 print "<form method=post action='{$delete_page}'>" . NEWLINE;
 print "<input type='submit' value='" . lang_get('delete_bug') . "' {$delete_disabled}>" . NEWLINE;