/**
 * Print table body
 * @param $status_cols
 */
function print_tbody($status_cols)
{
    $storyboard_db_api = new storyboard_db_api();
    $project_spec_bug_ids = $storyboard_db_api->get_bugarray_by_project(helper_get_current_project());
    $types = $storyboard_db_api->select_all_types();
    echo '<tbody>';
    foreach ($types as $type) {
        echo '<tr>';
        echo '<td class="category">' . $type[1] . '</td>';
        foreach ($status_cols as $status_col) {
            echo '<td class="story_baord">';
            foreach ($project_spec_bug_ids as $project_spec_bug_id) {
                $card = $storyboard_db_api->select_story_card($project_spec_bug_id);
                if ($card[2] == $type[0]) {
                    $bug_status = bug_get_field($project_spec_bug_id, 'status');
                    if ($bug_status == $status_col) {
                        echo '<a href="' . string_get_bug_view_url($project_spec_bug_id) . '" class="rcv_tooltip">';
                        echo '<div class="story_card">';
                        echo string_display_line(bug_format_id($project_spec_bug_id));
                        echo '<span>';
                        print_story_card_title($project_spec_bug_id);
                        print_story_card_info('summary', bug_get_field($project_spec_bug_id, 'summary'), false);
                        print_story_card_info('description', bug_get_text_field($project_spec_bug_id, 'description'), false);
                        print_story_card_info('card_risk', $card[3], true);
                        print_story_card_info('card_story_pt', $card[4], true);
                        print_story_card_info('card_story_pt_post', $card[5], true);
                        print_story_card_info('card_acc_crit', $card[6], true);
                        echo '</span>';
                        echo '</div>';
                        echo '</a><br/><br/><br/>';
                    }
                }
            }
            echo '</td>';
        }
        echo '</tr>';
    }
    echo '</tbody>';
}
$storyboard_config_api->printTableRowHead();
$storyboard_config_api->printFormCategory(1, 'config_footer', false);
$storyboard_config_api->printButton('ShowInFooter');
echo '</tr>';
$storyboard_config_api->printTableRowHead();
$storyboard_config_api->printFormCategory(1, 'config_typeadd', false);
$type = gpc_get_string('type', '');
echo '<td colspan="1">';
echo '<input type="text" id="type" name="type" size="15" maxlength="128" value="', $type, '">&nbsp';
echo '<input type="submit" name="addtype" class="button" value="' . plugin_lang_get('config_add') . '">';
echo '</td>';
echo '</tr>';
$storyboard_config_api->printTableRowHead();
$storyboard_config_api->printFormCategory(1, 'config_types', false);
echo '<td colspan="1">';
$type_rows = $storyboard_db_api->select_all_types();
foreach ($type_rows as $type_row) {
    $types[] = $type_row[1];
}
echo '<span class="select">';
echo '<select ' . helper_get_tab_index() . ' id="types" name="types">';
if (!is_null($types)) {
    foreach ($types as $type) {
        echo '<option value="' . $type . '">' . $type . '</option>';
    }
}
echo '</select>&nbsp';
$new_type = gpc_get_string('newtype', '');
echo '<input type="submit" name="deletetype" class="button" value="' . plugin_lang_get('config_del') . '">&nbsp';
echo '<input type="text" id="newtype" name="newtype" size="15" maxlength="128" value="', $new_type, '">&nbsp';
echo '<input type="submit" name="changetype" class="button" value="' . plugin_lang_get('config_change') . '">';
 /**
  * @param $input
  * @param $input_value
  */
 public function printBugUpdateSelectInput($input, $input_value)
 {
     $storyboard_db_api = new storyboard_db_api();
     $values = array();
     $value_rows = $storyboard_db_api->select_all_types();
     foreach ($value_rows as $value_row) {
         $values[] = $value_row[1];
     }
     $this->printRow();
     echo '<td class="category"><label for="' . $input . '">' . plugin_lang_get($input) . '</label></td>';
     echo '<td colspan="5">';
     echo '<span class="select">';
     echo '<select ' . helper_get_tab_index() . ' id="' . $input . '" name="' . $input . '">';
     echo '<option value=""></option>';
     if (!is_null($values)) {
         foreach ($values as $value) {
             echo '<option value="' . $value . '"';
             if ($value == $input_value) {
                 echo ' selected';
             }
             echo '>' . $value . '</option>';
         }
     }
     echo '</select>&nbsp';
     echo '</td>';
     echo '</tr>';
 }