/**
 * Print the option panel where the user manage user->project-assignments and the overall amount of issues
 * for each status under the user table
 *
 * @param $stat_issue_count
 */
function print_option_panel($stat_issue_count)
{
    global $print;
    $user_has_level = false;
    $project_ids = array();
    $current_project_id = helper_get_current_project();
    array_push($project_ids, $current_project_id);
    $sub_project_ids = project_hierarchy_get_all_subprojects($current_project_id);
    foreach ($sub_project_ids as $sub_project_id) {
        array_push($project_ids, $sub_project_id);
    }
    foreach ($project_ids as $project_id) {
        $access_level = user_get_access_level(auth_get_current_user_id(), $project_id);
        if ($access_level >= plugin_config_get('UserProjectAccessLevel')) {
            $user_has_level = true;
        }
    }
    echo '<tr>' . PHP_EOL;
    echo '<td colspan="' . userprojectapi::get_project_hierarchy_spec_colspan(6, true) . '">';
    if (!$print) {
        if ($user_has_level) {
            echo '<label for="option"></label>';
            echo '<select id="option" name="option">';
            echo '<option value="removeSingle">' . plugin_lang_get('remove_selectSingle') . '</option>';
            echo '<option value="removeAll">' . plugin_lang_get('remove_selectAll') . '</option>';
            echo '</select>';
            echo '&nbsp;<input type="submit" name="formSubmit" class="button" value="' . lang_get('ok') . '"/>';
        }
    }
    echo '</td>' . PHP_EOL;
    for ($stat_index = 1; $stat_index <= userprojectapi::get_stat_count(); $stat_index++) {
        echo '<td>' . $stat_issue_count[$stat_index] . '</td>' . PHP_EOL;
    }
    echo '<td></td>' . PHP_EOL;
    echo '</tr>' . PHP_EOL;
}