include "./api/include_api.php";
auth_authenticate_user();
# TO DO
# check for test_run_id
# check for req_version_id
# add bug relationships
# create bug history
$project_properties = session_get_project_properties();
$project_id = $project_properties['project_id'];
$page = basename(__FILE__);
$redirect_on_error = 'bug_add_page.php';
session_validate_form_set($_POST, $redirect_on_error);
$bug_id = bug_add($project_id, session_validate_form_get_field('bug_category'), session_validate_form_get_field('bug_component'), session_validate_form_get_field('discovery_period'), session_validate_form_get_field('bug_priority'), session_validate_form_get_field('bug_severity'), session_validate_form_get_field('found_in_release'), session_validate_form_get_field('assign_to_release'), session_validate_form_get_field('assigned_to'), session_validate_form_get_field('assigned_to_developer'), session_validate_form_get_field('summary_required'), session_validate_form_get_field('description_required', "", session_use_FCKeditor()), session_validate_form_get_field('req_version_id'), session_validate_form_get_field('verify_id'));
session_validate_form_reset();
# REDIRECT THE USER BACK TO THE TEST RUN PAGE IF THAT'S WHERE THEY CAME FROM
if (!empty($_POST['test_run_id'])) {
    $test_run_id = $_POST['test_run_id'];
    $redirect_on_success = "results_view_verifications_page.php?test_run_id={$test_run_id}";
} else {
    $redirect_on_success = "bug_detail_page.php?bug_id={$bug_id}";
}
html_print_operation_successful('add_bug_page', $redirect_on_success);
# ------------------------------------
# $Log: bug_add_action.php,v $
# Revision 1.2  2006/02/27 17:51:34  gth2
# added bug email functionality - gth
#
# Revision 1.1.1.1  2005/11/30 23:00:56  gth2
# importing initial version - gth
#
# ------------------------------------
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ---------------------------------------------------------------------
# Test Requirement Edit Coverage Action Page
#
# $RCSfile: test_req_edit_coverage_action.php,v $  $Revision: 1.2 $
# ---------------------------------------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$s_test_details = session_get_properties("test");
$s_test_id = $s_test_details['test_id'];
$assoc_id = $_POST['assoc_id'];
$percent_covered = $_POST['percent_covered'];
$project_id = session_get_project_id();
$page = 'test_detail_page.php';
$redirect_page = "test_detail_page.php?test_id={$s_test_id}&project_id={$project_id}&tab=3";
session_validate_form_set($_POST, $redirect_page);
test_set_percent_req_coverage($assoc_id, $percent_covered);
session_validate_form_reset();
html_print_operation_successful("test_req_coverage_page", $redirect_page);
# ---------------------------------------------------------------------
# $Log: test_req_edit_coverage_action.php,v $
# Revision 1.2  2008/07/21 07:42:34  peter_thal
# small bug fixes for test_detail_page linking parameter
#
# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
# importing initial version - gth
#
# ---------------------------------------------------------------------
$s_user = session_get_user_properties();
$username = $s_user['username'];
$test_name = test_get_name($test_id);
$comments = session_validate_form_get_field('comments');
$doc_type = session_validate_form_get_field('doc_type');
$upload_file_name = $_FILES['uploadfile']['name'];
$_FILES['uploadfile']['name'] = str_replace(" ", "_", $upload_file_name);
# ------------------------------------------------
# FILE UPLOAD
# ------------------------------------------------
if ($_FILES['uploadfile']['size'] != '0' && is_uploaded_file($_FILES['uploadfile']['tmp_name'])) {
    file_add_supporting_test_doc($_FILES['uploadfile']['tmp_name'], $_FILES['uploadfile']['name'], $test_id, $comments, $doc_type);
} else {
    error_report_show($redirect_on_error, NO_FILE_SPECIFIED);
}
html_print_operation_successful('file_upload_page', $redirect_page);
# ---------------------------------------------------------------------
# $Log: test_detail_new_upload_action.php,v $
# Revision 1.8  2008/08/07 10:57:51  peter_thal
# Now blanks are replaced with underscores by adding a new supporting doc
#
# Revision 1.7  2008/07/23 14:53:50  peter_thal
# delete supporting docs feature added (linux/unix)
#
# Revision 1.6  2008/07/09 07:13:24  peter_thal
# added direct linking of test detail by adding project_id link parameter
# added automated project switching if necessary
#
# Revision 1.5  2006/06/30 00:39:46  gth2
# correct page title - gth
#
<?php

# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ------------------------------------
# Project Add Req Doc Type Action
#
# $RCSfile: project_add_reqfunctionality_action.php,v $  $Revision: 1.1.1.1 $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$project_id = session_get_project_id();
$redirect_page = 'project_manage_reqfunctionality_page.php';
$proj_properties = session_get_properties("project_manage");
session_validate_form_set($_POST, $redirect_page);
if (project_reqfunctionality_exists($proj_properties['project_id'], session_validate_form_get_field('req_functionality_required'))) {
    error_report_show($redirect_page, DUPLICATE_REQUIREMENT_FUNCTIONALITY);
}
project_add_req_functionality($proj_properties['project_id'], session_validate_form_get_field('req_functionality_required'));
session_validate_form_reset();
html_print_operation_successful("add_req_functionality_page", $redirect_page);
# ------------------------------------
# $Log: project_add_reqfunctionality_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:57  gth2
# importing initial version - gth
#
# ------------------------------------
<?php

# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ------------------------------------
# Project Edit Machine Action
#
# $RCSfile: project_edit_machine_action.php,v $  $Revision: 1.1.1.1 $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$redirect_page = 'project_manage_testmachines_page.php';
$edit_page = 'project_edit_machine_page.php';
$proj_properties = session_set_properties("project_manage", $_POST);
session_validate_form_set($_POST, $edit_page);
project_edit_machine($_POST['project_id'], $_POST['machine_id'], session_validate_form_get_field('machine_name_required'), session_validate_form_get_field('machine_ip_required'), session_validate_form_get_field('machine_location_required'));
session_validate_form_reset();
html_print_operation_successful("edit_machine_page", $redirect_page);
# ------------------------------------
# $Log: project_edit_machine_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:57  gth2
# importing initial version - gth
#
# ------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ------------------------------------
# Project Add Users Action
#
# $RCSfile: project_add_users_action.php,v $  $Revision: 1.2 $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$project_id = session_get_project_id();
$redirect_page = 'project_manage_page.php';
$proj_properties = session_get_properties("project_manage");
session_validate_form_set($_POST, $redirect_page);
if (!isset($_POST['add_users'])) {
    error_report_show($redirect_page, REQUIRED_FIELD_MISSING);
}
project_add_users($proj_properties['project_id'], $_POST['add_users'], $_POST['add_users_rights'], isset($_POST['add_user_delete_rights']) ? "Y" : "N", isset($_POST['add_user_email_testset']) ? "Y" : "N", isset($_POST['add_user_email_discussions']) ? "Y" : "N", isset($_POST['add_user_qa_tester']) ? "Y" : "N", isset($_POST['add_user_ba_tester']) ? "Y" : "N");
session_validate_form_reset();
html_print_operation_successful("add_users_page", $redirect_page . "#users");
# ------------------------------------
# $Log: project_add_users_action.php,v $
# Revision 1.2  2006/02/27 17:26:16  gth2
# added email functionality to bug tracker - gth
#
# Revision 1.1.1.1  2005/11/30 23:00:57  gth2
# importing initial version - gth
#
# ------------------------------------
    foreach ($_POST as $key => $value) {
        $exploded_key = explode("_", $key);
        if ($exploded_key[0] == "row") {
            $rows[] = $exploded_key[1];
        }
    }
    if (empty($rows)) {
        error_report_show("requirement_page.php", NO_REQ_SELECTED);
    }
}
# if submit from this page
if (isset($_POST['submit_assigned_release'])) {
    foreach (explode(":", $_POST['req_ids']) as $value) {
        requirement_version_table_set_field($value, REQ_VERS_ASSIGN_RELEASE, $_POST['assign_release']);
    }
    html_print_operation_successful('build_page', "requirement_page.php");
}
$req_ids = implode(":", $rows);
$page = basename(__FILE__);
$project_properties = session_get_project_properties();
$project_name = $project_properties['project_name'];
$project_id = $project_properties['project_id'];
html_window_title();
html_print_body();
html_page_title($project_name . " - " . lang_get('req_update_assign_release_page'));
html_page_header($db, $project_name);
html_print_menu();
requirement_menu_print($page);
print "<br>" . NEWLINE;
print "<div align=center>" . NEWLINE;
print "<form method=post action=requirement_change_assigned_release_page.php>" . NEWLINE;
        break;
    case 'status':
        foreach ($rows_version_ids as $row_version_id) {
            requirement_update_req_version_field($row_version_id, $field_name, $field_value);
            //print"need to update req_id $req_id and version $row_version_id<br>";
        }
        break;
}
/*
if( $field_name == 'assigned_release' ) {

	requirement_group_assoc_release( $rows_version_ids, $field_value );
} else {

	foreach( $rows_version_ids as $row_version_id ) {

		requirement_update_req_version_field( $row_version_id, $field_name, $field_value );
		//print"need to update req_id $req_id and version $row_version_id<br>";
	}
}
*/
html_print_operation_successful("req_page", $redirect_page);
# ---------------------------------------------------------------------
# $Log: requirement_group_action.php,v $
# Revision 1.2  2005/12/08 22:13:40  gth2
# adding Assign To Release to requirment edit page - gth
#
# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
# importing initial version - gth
#
# ---------------------------------------------------------------------
<?php

# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ------------------------------------
# Project Add Req Area Covered Action
#
# $RCSfile: project_add_reqareacovered_action.php,v $  $Revision: 1.1.1.1 $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$project_id = session_get_project_id();
$redirect_page = 'project_manage_reqareacovered_page.php';
$proj_properties = session_get_properties("project_manage");
session_validate_form_set($_POST, $redirect_page);
if (project_req_area_covered_exists($proj_properties['project_id'], session_validate_form_get_field('req_area_covered_required'))) {
    error_report_show($redirect_page, DUPLICATE_AREANAME);
}
project_add_req_area_covered($proj_properties['project_id'], session_validate_form_get_field('req_area_covered_required'));
session_validate_form_reset();
html_print_operation_successful("add_req_area_covered_page", $redirect_page);
# ------------------------------------
# $Log: project_add_reqareacovered_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:57  gth2
# importing initial version - gth
#
# ------------------------------------
# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ---------------------------------------------------------------------
# Requirement Test Assoc Action Page
#
# $RCSfile: requirement_test_assoc_action.php,v $  $Revision: 1.1.1.1 $
# ---------------------------------------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$s_project_properties = session_get_project_properties();
$project_name = $s_project_properties['project_name'];
$project_id = $s_project_properties['project_id'];
$s_properties = session_set_properties("requirements", $_GET);
$s_req_id = $s_properties['req_id'];
$s_req_version_id = $s_properties['req_version_id'];
$redirect_page = 'requirement_tests_assoc_page.php';
session_records("requirement_tests_assoc");
session_validate_form_set($_POST);
requirement_edit_assoc_tests($s_req_id, "requirement_tests_assoc", "percent_covered_");
session_validate_form_reset();
html_print_operation_successful("req_assoc_tests_page", $redirect_page);
# ---------------------------------------------------------------------
# $Log: requirement_test_assoc_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
# importing initial version - gth
#
# ---------------------------------------------------------------------
$test_id = $_POST['test_id'];
$test_step_id = $_POST['test_step_id'];
//$test_version_id	= $_POST['test_version_id'];
$project_id = session_get_project_id();
$page = 'test_step_edit_page.php';
$error_page = 'test_step_edit_page.php?test_step_id=' . $test_step_id . '&test_id=' . $test_id;
$redirect_page = 'test_detail_page.php?test_id=' . $test_id . '&project_id=' . $project_id;
session_validate_form_set($_POST, $error_page);
$info_step = "N";
if (isset($_POST['info_step'])) {
    $info_step = "Y";
}
#added to every session_validate... mysql_real_escape_string(), because it doesnt work for session_validate...(fck-textfield)
test_update_test_step($test_id, $test_step_id, session_validate_form_get_field('location'), mysql_real_escape_string(session_validate_form_get_field('step_action_required', "", session_use_FCKeditor())), mysql_real_escape_string(session_validate_form_get_field('step_input', "", session_use_FCKeditor())), mysql_real_escape_string(session_validate_form_get_field('step_expected_required', "", session_use_FCKeditor())), $info_step);
session_validate_form_reset();
html_print_operation_successful("edit_test_step_page", $redirect_page);
# ---------------------------------------------------------------------
# $Log: test_step_edit_action.php,v $
# Revision 1.6  2009/03/26 08:04:05  sca_gs
# fixed problem with wrong caption
#
# Revision 1.5  2008/07/21 07:42:34  peter_thal
# small bug fixes for test_detail_page linking parameter
#
# Revision 1.4  2008/07/03 09:30:27  peter_thal
# enabled writing and saving backslashes in all fields
#
# Revision 1.3  2007/03/14 17:23:44  gth2
# removing Test Input as a required field so that it's consistent witth the
# test detail page. - gth
#
<?php

# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ------------------------------------
# New Add Action Page
#
# $RCSfile: news_add_action.php,v $ $Revision: 1.1.1.1 $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$redirect_page = 'home_page.php';
$edit_page = 'project_manage_page.php';
session_validate_form_set($_POST, $edit_page);
#### Call api function to add/update database passing in form field values ####
news_add($_POST['project_id'], session_validate_form_get_field('subject'), session_validate_form_get_field('body'), $_POST['poster']);
html_print_operation_successful('news_add_page', $redirect_page);
# ------------------------------------
# $Log: news_add_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:57  gth2
# importing initial version - gth
#
# ------------------------------------
$page = basename(__FILE__);
$action_page = 'requirement_assoc_action.php';
$s_project_properties = session_get_project_properties();
$project_name = $s_project_properties['project_name'];
$project_id = $s_project_properties['project_id'];
$properties = session_get_properties("test");
$test_id = $properties['test_id'];
$username = session_get_username();
$row_style = '';
$redirect_page = "test_detail_page.php?test_id=" . $test_id . "&project_id=" . $project_id;
$display_options = session_set_display_options("requirements", array_merge($_POST, $_GET));
$s_tab = $display_options['tab'];
$s_properties = session_set_properties("requirements", $_GET);
$s_req_id = $s_properties['req_id'];
switch ($_GET['assoc']) {
    case "req":
        requirement_delete_test_assoc($_GET['assoc_id']);
}
html_print_operation_successful('req_assoc_page', $redirect_page);
# ---------------------------------------------------------------------
# $Log: test_delete_assoc_action.php,v $
# Revision 1.3  2008/07/21 07:42:34  peter_thal
# small bug fixes for test_detail_page linking parameter
#
# Revision 1.2  2006/01/06 00:34:53  gth2
# fixed bug with associations - gth
#
# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
# importing initial version - gth
#
# ---------------------------------------------------------------------
<?php

# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ---------------------------------------------------------------------
# Test Plan Upload New Version Action Page
#
# $RCSfile: testset_upload_new_test_plan_version_action.php,v $  $Revision: 1.1.1.1 $
# ---------------------------------------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$project_id = session_get_project_id();
#### Change to correct redirect page ####
$redirect_page = 'testset_page.php';
$s_properties = session_get_properties("release");
file_add_test_plan_version($_FILES['upload_file']['tmp_name'], $_POST['test_plan_name'], $_POST['build_id'], $_POST['comments'], $_POST['old_test_plan_id'], $_POST['version'], $redirect_page);
html_print_operation_successful(lang_get('test_plan_add'), $redirect_page);
# ---------------------------------------------------------------------
# $Log: testset_upload_new_test_plan_version_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
# importing initial version - gth
#
# ---------------------------------------------------------------------
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ------------------------------------
# $RCSfile: field_add_action.php,v $
# $Revision   $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$s_project_properties = session_get_project_properties();
$project_id = $s_project_properties['project_id'];
$redirect_page = 'field_add_page.php';
$redirect_on_error = 'field_add_page.php';
$screen_id = session_validate_form_get_field('screen_id');
# Make sure user completed required fields
session_validate_form_set($_POST, $redirect_page);
# Make sure the screen name doesn't already exist for this project
$num = test_field_name_exists(session_validate_form_get_field('field_name_required'), session_validate_form_get_field('screen_id'));
if ($num > 0) {
    error_report_show($redirect_page, DUPLICATE_FIELD_NAME);
}
test_add_field(session_validate_form_get_field('field_name_required'), session_validate_form_get_field('screen_id'), session_validate_form_get_field('field_desc'), session_validate_form_get_field('field_order'), session_validate_form_get_field('text_box'));
session_validate_form_reset();
html_print_operation_successful('field_page', $redirect_page);
# ------------------------------------
# $Log: field_add_action.php,v $
# Revision 1.1  2006/05/03 20:18:31  gth2
# no message
#
# ------------------------------------
# Need to verify the user entered a valid id and
# update the bug table if the user has changed this value
if ($current_bug_id != $new_bug_id) {
    # return the user to the previous page if the new_bug_id doesn't exist in the bug table
    if (!bug_exists($new_bug_id) && $new_bug_id != 0) {
        html_redirect($redirect_on_error);
    }
    # see if the verify_id exists anywhere in the bug table
    $related_bug_id = bug_get_bug_id_from_verification_id($verify_id);
    # remove the old verify_id from the bug table if it exists
    if (!empty($related_bug_id)) {
        bug_update_field($related_bug_id, BUG_TEST_VERIFY_ID, $value = "");
    }
    # set the new verify_id in the bug table
    bug_update_field($new_bug_id, BUG_TEST_VERIFY_ID, $verify_id);
}
# Update the verify results table
results_update_verification($test_run_id, $verify_id, $status, $comments, $new_bug_id);
html_print_operation_successful('update_verification', $redirect_page);
# ---------------------------------------------------------------------
# $Log: results_update_verification_action.php,v $
# Revision 1.3  2006/09/25 12:46:39  gth2
# Working on linking rth and other bugtrackers - gth
#
# Revision 1.2  2006/01/20 02:36:05  gth2
# enable export to excel functionaltiy - gth
#
# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
# importing initial version - gth
#
# ---------------------------------------------------------------------
# Requirement Assoc Action
#
# $RCSfile: requirement_assoc_action.php,v $  $Revision: 1.1.1.1 $
# ---------------------------------------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$page = basename(__FILE__);
$action_page = 'requirement_assoc_action.php';
$s_project_properties = session_get_project_properties();
$project_name = $s_project_properties['project_name'];
$project_id = $s_project_properties['project_id'];
$s_properties = session_set_properties("requirements", $_GET);
$s_req_id = $s_properties['req_id'];
$s_req_version_id = $s_properties['req_version_id'];
session_records("requirement_requirement_assoc");
requirement_edit_children($project_id, $s_req_id, "requirement_requirement_assoc");
############################################################################
# EMAIL NOTIFICATION
############################################################################
$recipients = requirement_get_notify_users($project_id, $s_req_id);
requirement_email($project_id, $s_req_id, $recipients, $action = "edit_children");
############################################################################
############################################################################
session_validate_form_reset();
html_print_operation_successful('req_req_assoc_page', "requirement_detail_page.php");
# ---------------------------------------------------------------------
# $Log: requirement_assoc_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:57  gth2
# importing initial version - gth
#
# ---------------------------------------------------------------------
# EMAIL NOTIFICATION
############################################################################
$send_message = false;
if (!empty($_POST['email_users'])) {
    $email_to = $_POST['email_users'];
    for ($i = 0; $i < sizeof($email_to); $i++) {
        if ($email_to[$i] != "") {
            $send_message = true;
        }
    }
}
if ($send_message) {
    results_email($project_id, $release_id, $build_id, $testset_id, $test_id, $email_to, "update_test_result");
}
session_validate_form_reset();
html_print_operation_successful('run_manual_test_page', $redirect_page);
# ---------------------------------------------------------------------
# $Log: results_continue_manual_test_action.php,v $
# Revision 1.6  2007/02/06 03:27:56  gth2
# correct email problem when updating test results - gth
#
# Revision 1.5  2007/02/03 11:58:12  gth2
# no message
#
# Revision 1.4  2006/02/24 11:33:08  gth2
# minor bug fixes and enhancements for 1.5.1 release - gth
#
# Revision 1.3  2006/01/09 02:02:14  gth2
# fixing some defects found while writing help file
#
# Revision 1.2  2006/01/08 22:00:19  gth2
$test_run_docs = FILE_UPLOAD_PATH . $project_folder_name . "_test_run_docs/";
$test_plan_docs = FILE_UPLOAD_PATH . $project_folder_name . "_test_plan_docs/";
$defect_docs = FILE_UPLOAD_PATH . $project_folder_name . "_defect_docs/";
# check username unique
if (!is_null(project_get_id($project_name))) {
    error_report_show($add_page, PROJECT_NOT_UNIQUE);
}
if (mkdir($req_docs, 0700) && mkdir($test_docs, 0700) && mkdir($test_run_docs, 0700) && mkdir($test_plan_docs, 0700) && mkdir($defect_docs, 0700)) {
    project_add($project_name, $project_description, $_POST['project_status'], isset($_POST['show_custom_1']) ? "Y" : "N", isset($_POST['show_custom_2']) ? "Y" : "N", isset($_POST['show_custom_3']) ? "Y" : "N", isset($_POST['show_custom_4']) ? "Y" : "N", isset($_POST['show_custom_5']) ? "Y" : "N", isset($_POST['show_custom_6']) ? "Y" : "N", isset($_POST['show_window']) ? "Y" : "N", isset($_POST['show_object']) ? "Y" : "N", isset($_POST['show_memory_stats']) ? "Y" : "N", isset($_POST['show_priority']) ? "Y" : "N", isset($_POST['show_test_input']) ? "Y" : "N", $req_docs, $test_docs, $test_run_docs, $test_plan_docs, $defect_docs);
} else {
    error_report_show($add_page, UNABLE_TO_CREATE_PROJECT_FOLDERS);
}
// add new project to user settings
array_push($_SESSION['s_user_projects'], $project_name);
session_validate_form_reset();
html_print_operation_successful("project_add_page", $redirect_page);
# ------------------------------------
# $Log: project_add_action.php,v $
# Revision 1.5  2007/02/02 03:26:42  gth2
# make new project appear in the project list box when
# a new project is added - gth
#
# Revision 1.4  2006/12/05 04:57:21  gth2
# Allow users to rename project - gth
#
# Revision 1.3  2006/10/05 02:42:19  gth2
# adding file upload to the bug page - gth
#
# Revision 1.2  2006/02/06 13:08:20  gth2
# fixing minor bugs - gth
#
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ------------------------------------
# Page name
#
# $RCSfile: screen_edit_action.php,v $
# $Revision: 1.1 $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$s_project_properties = session_get_project_properties();
$project_id = $s_project_properties['project_id'];
$redirect_page = 'screen_page.php';
$redirect_on_error = 'screen_edit_page.php';
session_validate_form_set($_POST, $redirect_on_error);
# Make sure the screen name doesn't already exist for this project
$num = test_screen_name_exists($project_id, session_validate_form_get_field('screen_name_required'));
if ($num > 1) {
    error_report_show($redirect_page, DUPLICATE_SCREEN_NAME);
}
test_update_screen(session_validate_form_get_field('screen_id'), session_validate_form_get_field('screen_name_required'), session_validate_form_get_field('screen_desc'), session_validate_form_get_field('screen_order'));
session_validate_form_reset();
html_print_operation_successful('screen_page', $redirect_page);
# ------------------------------------
# $Log: screen_edit_action.php,v $
# Revision 1.1  2006/05/03 20:24:01  gth2
# no message
#
# ------------------------------------
<?php

# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ------------------------------------
# Project Add Test Type Action
#
# $RCSfile: project_add_testtype_action.php,v $  $Revision: 1.1.1.1 $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$project_id = session_get_project_id();
$redirect_page = 'project_manage_testtype_page.php';
$proj_properties = session_get_properties("project_manage");
session_validate_form_set($_POST, $redirect_page);
if (project_testtype_exists($proj_properties['project_id'], session_validate_form_get_field('testtype_required'))) {
    error_report_show($redirect_page, DUPLICATE_TESTTYPE_NAME);
}
project_add_testtype($proj_properties['project_id'], session_validate_form_get_field('testtype_required'));
session_validate_form_reset();
html_print_operation_successful("add_testtype_page", $redirect_page);
# ------------------------------------
# $Log: project_add_testtype_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:57  gth2
# importing initial version - gth
#
# ------------------------------------
<?php

# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ---------------------------------------------------------------------
# Test Set Edit Action Page
#
# $RCSfile: testset_edit_action.php,v $  $Revision: 1.1.1.1 $
# ---------------------------------------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$project_id = session_get_project_id();
#### Change to correct redirect page ####
$redirect_page = 'testset_page.php';
$s_properties = session_get_properties("release");
$s_release_id = $s_properties['release_id'];
$s_build_id = $s_properties['build_id'];
$s_testset_id = $s_properties['testset_id'];
session_records("testset_edit");
testset_edit_from_session($s_testset_id, TEST_TESTTYPE, "testset_edit");
html_print_operation_successful("edit_testset", $redirect_page);
# ---------------------------------------------------------------------
# $Log: testset_edit_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
# importing initial version - gth
#
# ---------------------------------------------------------------------
Exemplo n.º 23
0
            break;
        case "delete_uploaded_testrun_document":
            file_delete_test_run_doc($_POST['confirm_id']);
            $delete_successful = true;
            break;
        case "delete_screen":
            test_delete_screen($_POST['confirm_id']);
            $delete_successful = true;
            break;
    }
    /*if( $delete_successful ) {
    		print"<div class=operation-successful>Delete Successful</div>". NEWLINE;
    	} else {
    		print"<div class=operation-successful>Delete Unsuccessful</div>". NEWLINE;
    	}*/
    html_print_operation_successful("delete_page", $_POST['confirm_r_page']);
}
# ------------------------------------
# $Log: delete_page.php,v $
# Revision 1.4  2006/08/05 22:07:59  gth2
# adding NEWLINE constant to support multiple OS newline chars - gth
#
# Revision 1.3  2006/05/03 20:00:10  gth2
# no message
#
# Revision 1.2  2006/02/24 11:38:20  gth2
# update to div - class=div-c not working in firefox - gth
#
# Revision 1.1.1.1  2005/11/30 23:00:56  gth2
# importing initial version - gth
#
if ($status == "Passed") {
    $finished = '1';
} else {
    $finished = '0';
}
results_update_test_result($testset_id, $test_id, $username, $status, $root_cause, $finished, $comments);
############################################################################
# EMAIL NOTIFICATION
############################################################################
$send_message = false;
if (!empty($_POST['email_users'])) {
    $email_to = $_POST['email_users'];
    for ($i = 0; $i < sizeof($email_to); $i++) {
        if ($email_to[$i] != "") {
            $send_message = true;
        }
    }
}
if ($send_message) {
    results_email($project_id, $release_id, $build_id, $testset_id, $test_id, $email_to, "update_test_result");
}
html_print_operation_successful('update_test_result_page', $redirect_page);
# ---------------------------------------------------------------------
# $Log: results_update_test_result_action.php,v $
# Revision 1.2  2007/02/06 03:27:56  gth2
# correct email problem when updating test results - gth
#
# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
# importing initial version - gth
#
# ---------------------------------------------------------------------
<?php

# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ------------------------------------
# Project Edit Area Tested Action
#
# $RCSfile: project_edit_user_action.php,v $  $Revision: 1.1.1.1 $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$redirect_page = 'project_manage_page.php';
$proj_properties = session_set_properties("project_manage", $_POST);
project_edit_user($proj_properties['project_id'], $proj_properties['user_id'], $_POST['user_rights'], isset($_POST['user_delete_rights']) ? "Y" : "N", isset($_POST['user_email_testset']) ? "Y" : "N", isset($_POST['user_email_discussions']) ? "Y" : "N", isset($_POST['user_qa_owner']) ? "Y" : "N", isset($_POST['user_ba_owner']) ? "Y" : "N");
html_print_operation_successful("user_edit_page", $redirect_page . "#users");
# ------------------------------------
# $Log: project_edit_user_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:57  gth2
# importing initial version - gth
#
# ------------------------------------
<?php

# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ------------------------------------
# Project Edit Environment Action
#
# $RCSfile: project_edit_environment_action.php,v $  $Revision: 1.1.1.1 $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$redirect_page = 'project_manage_testenvironment_page.php';
$edit_page = 'project_edit_environment_page.php';
$proj_properties = session_set_properties("project_manage", $_POST);
session_validate_form_set($_POST, $edit_page);
project_edit_environment($_POST['project_id'], $_POST['environment_id'], session_validate_form_get_field('environment_name_required'));
session_validate_form_reset();
html_print_operation_successful("edit_environment_page", $redirect_page);
# ------------------------------------
# $Log: project_edit_environment_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:57  gth2
# importing initial version - gth
#
# ------------------------------------
$s_delete_rights = $s_user_properties['delete_rights'];
$s_email = $s_user_properties['email'];
$project_name = $s_project_properties['project_name'];
$project_id = $s_project_properties['project_id'];
$project_details = project_get_details($project_id);
$s_show_test_input = $project_details[PROJ_SHOW_TEST_INPUT];
$test_id = util_pad_id($s_test_details['test_id']);
$test_version_id = $s_test_details['test_version_id'];
$redirect_page = "test_detail_page.php?test_id={$test_id}&project_id={$project_id}&tab=1";
# Upload function
if (IMPORT_EXPORT_TO_EXCEL) {
    test_import_excel($test_id, 'upload_file');
} else {
    test_import_csv($test_id, 'upload_file');
}
html_print_operation_successful('test_import_csv_page', $redirect_page);
# ---------------------------------------------------------------------
# $Log: test_step_import_csv_action.php,v $
# Revision 1.4  2008/07/17 13:54:12  peter_thal
# added new feature: test sets status (overview)
# +fixed some bugs with project_id parameter in testdetail_page references
#
# Revision 1.3  2006/04/11 12:11:03  gth2
# create a test version when uploading test steps - gth
#
# Revision 1.2  2006/01/16 13:27:45  gth2
# adding excel integration - gth
#
# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
# importing initial version - gth
#
    #Build up the message and format to be sent
    $subject = $testname." is currently Not Running. ";

    $message = "$assigned_user_firstname $assigned_user_lastname, you have been assigned to fix ".
                $testname.". $current_user_firstname $current_user_lastname has stated \"$testcomments\".
                When you have resolved this issue, please inform $current_user_firstname. Thank you.";

    $headers = "From: support@bhtconsulting\r\n"."To: ".$assigned_user_email."\r\n"."Reply-To: ".$current_user_email."\r". NEWLINE;
    mail($send_to, $subject, $message, $headers);
}
*/
# validation succeeded
#html_redirect($redirect_page);
session_validate_form_reset();
html_print_operation_successful("update_test_page", $redirect_page);
# ---------------------------------------------------------------------
# $Log: test_detail_update_action.php,v $
# Revision 1.10  2009/01/27 12:44:41  cryobean
# fixed problem during update of tests
#
# Revision 1.9  2008/08/08 11:22:08  peter_thal
# disabled update buildname to an existing buildname
# test_detail_update_action.php: changed redirect page on error
#
# Revision 1.8  2008/08/08 09:44:09  peter_thal
# test name validation added on test update page
#
# Revision 1.7  2008/08/04 08:57:07  peter_thal
# fixed bug with required fields
#
<?php

# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ---------------------------------------------------------------------
# Test Set Edit Description Page
#
# $RCSfile: testset_edit_description_action.php,v $  $Revision: 1.1.1.1 $
# ---------------------------------------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$redirect_page = 'testset_page.php';
$edit_page = 'testset_edit_description_page.php';
session_validate_form_set($_POST, $edit_page);
#### Call api function to add/update database passing in form field values ####
admin_edit_testset(util_clean_post_vars('testset_id'), session_validate_form_get_field('testset_edit_name_required'), session_validate_form_get_field('testset_edit_date'), session_validate_form_get_field('testset_edit_description'));
session_validate_form_reset();
html_print_operation_successful('release_page', $redirect_page);
# ---------------------------------------------------------------------
# $Log: testset_edit_description_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
# importing initial version - gth
#
# ---------------------------------------------------------------------
<?php

# ---------------------------------------------------------------------
# rth is a requirement, test, and bugtracking system
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net
# This program is distributed under the terms and conditions of the GPL
# See the README and LICENSE files for details
#----------------------------------------------------------------------
# ---------------------------------------------------------------------
# User Edit My Account Action Page
#
# $RCSfile: user_edit_my_account_action.php,v $  $Revision: 1.1.1.1 $
# ---------------------------------------------------------------------
require_once "user_edit_action.php";
html_print_operation_successful("user_edit_page", "user_edit_my_account_page.php");
# ---------------------------------------------------------------------
# $Log: user_edit_my_account_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:59  gth2
# importing initial version - gth
#
# ---------------------------------------------------------------------