/**
 * Print the head of the plugin table
 */
function print_thead()
{
    $dynamic_colspan = userprojectapi::get_stat_count() + userprojectapi::get_project_hierarchy_spec_colspan(6, true);
    echo '<thead>' . PHP_EOL;
    print_main_table_head_row($dynamic_colspan);
    echo '<tr>' . PHP_EOL;
    print_main_table_head_col('thead_username', 'userName', plugin_config_get('ShowAvatar') ? 3 : 2);
    print_main_table_head_col('thead_realname', 'realName', null);
    echo '<th colspan="' . ($dynamic_colspan - 4) . '" class="headrow"></th>' . PHP_EOL;
    echo '</tr>' . PHP_EOL;
    echo '<tr>' . PHP_EOL;
    echo '<th></th>' . PHP_EOL;
    echo '<th colspan="' . (plugin_config_get('ShowAvatar') ? 2 : 1) . '" class="headrow"></th>' . PHP_EOL;
    echo '<th colspan="3" class="headrow">' . plugin_lang_get(userprojectapi::get_layer_one_column_name()) . '</th>' . PHP_EOL;
    $project_hierarchy_depth = userprojectapi::get_project_hierarchy_depth(helper_get_current_project());
    if ($project_hierarchy_depth > 1) {
        print_main_table_head_col('thead_layer_issue_project', 'assignedProject', null);
    }
    if ($project_hierarchy_depth > 2) {
        print_main_table_head_col('thead_layer_version_project', 'mainProject', null);
    }
    print_main_table_head_col('thead_targetversion', 'targetVersion', null);
    for ($stat_index = 1; $stat_index <= userprojectapi::get_stat_count(); $stat_index++) {
        $status = MantisEnum::getAssocArrayIndexedByValues(lang_get('status_enum_string'));
        echo '<th style="width:50px;" class="headrow_status" bgcolor="' . get_status_color(plugin_config_get('CStatSelect' . $stat_index), null, null) . '">';
        echo $status[plugin_config_get('CStatSelect' . $stat_index)] . '</th>' . PHP_EOL;
    }
    echo '<th class="headrow">' . plugin_lang_get('thead_remark') . '</th>' . PHP_EOL;
    echo '</tr>' . PHP_EOL . '</thead>' . PHP_EOL;
}