コード例 #1
0
        foreach($rows as $key => $val) {
        	print"$key = $val<br>";
        }
        */
        break;
    case "bugs":
        $headers = array(BUG_ID => lang_get('bug_id'), BUG_PRIORITY => lang_get('bug_priority'), BUG_SEVERITY => lang_get('bug_severity'), BUG_STATUS => lang_get('bug_status'), BUG_CATEGORY => lang_get('bug_category'), BUG_REPORTER => lang_get('reported_by'), BUG_ASSIGNED_TO => lang_get('assigned_to'), BUG_ASSIGNED_TO_DEVELOPER => lang_get('assigned_to_developer'), BUG_FOUND_IN_RELEASE => lang_get('found_in_release'), BUG_ASSIGN_TO_RELEASE => lang_get('assigned_to_release'), BUG_DESCRIPTION => lang_get('bug_description'), BUG_SUMMARY => lang_get('bug_summary'));
        $display_options = session_get_display_options("bug");
        # We really should create a seperate function for csv/excel export
        $rows = bug_get($project_id, $page_number = 0, $display_options['order_by'], $display_options['order_dir'], $display_options['filter']['status'], $display_options['filter']['category'], $display_options['filter']['component'], $display_options['filter']['reported_by'], $display_options['filter']['assigned_to'], $display_options['filter']['assigned_to_developer'], $display_options['filter']['found_in_release'], $display_options['filter']['assigned_to_release']);
        break;
    case "test_steps":
        $headers = array(TEST_STEP_NO => lang_get('step_no'), TEST_STEP_ACTION => lang_get('step_action'), TEST_STEP_TEST_INPUTS => lang_get('test_inputs'), TEST_STEP_EXPECTED => lang_get('step_expected'), TEST_STEP_INFO_STEP => lang_get('info_step'));
        $s_test_details = session_get_properties("test");
        $test_id = $s_test_details['test_id'];
        $rows = test_get_test_steps_for_export($test_id);
        break;
    default:
        exit;
}
if (IMPORT_EXPORT_TO_EXCEL) {
    if (isset($headers)) {
        # HEADER ROW
        $row = $rows[0];
        $header = "";
        $data = "";
        foreach ($headers as $key => $value) {
            # Replace double quotes with two double quotes
            $value = str_replace('"', '""', $value);
            $header .= '"' . $value . '"' . "\t";
        }
コード例 #2
0
function test_copy_test_steps($from_test_id, $to_test_id)
{
    $steps = test_get_test_steps_for_export($from_test_id);
    $first = true;
    $location = 0;
    foreach ($steps as $value) {
        test_add_test_step($to_test_id, $location, $value[TEST_STEP_ACTION], $value[TEST_STEP_EXPECTED], $value[TEST_STEP_TEST_INPUTS], $value[TEST_STEP_INFO_STEP], 'test_detail_copy_page.php');
        if ($first) {
            $location = 'end';
            $first = false;
        }
    }
}