<?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
#
# ---------------------------------------------------------------------
# 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 Detail Delete Action Page
#
# $RCSfile: test_detail_delete_action.php,v $  $Revision: 1.1.1.1 $
# ---------------------------------------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$s_test_details = session_get_properties("test");
$test_id = $s_test_details['test_id'];
$test_name = test_get_name($test_id);
$redirect_page = "test_detail_page.php";
$delete = util_clean_post_vars('delete');
if ($delete == 'Yes') {
    test_delete_test($test_id);
    $page_name = "DELETE TEST";
    $deletion = 'Y';
    $creation = 'N';
    $upload = 'N';
    $action = "DELETED TEST {$test_name} ";
    log_activity_log($page_name, $deletion, $creation, $upload, $action);
    $redirect_page = "test_page.php";
}
html_redirect($redirect_page);
# ---------------------------------------------------------------------
# $Log: test_detail_delete_action.php,v $
# Revision 1.1.1.1  2005/11/30 23:00:58  gth2
# importing initial version - gth
# ---------------------------------------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$page = basename(__FILE__);
$redirect_page = "results_page.php";
$project_id = session_get_project_id();
$s_results = session_get_properties("results");
$release_id = $s_results['release_id'];
$build_id = $s_results['build_id'];
$testset_id = $s_results['testset_id'];
$test_id = $s_results['test_id'];
$s_user = session_get_user_properties();
$username = $s_user['username'];
$comments = util_clean_post_vars('test_result_comments');
$root_cause = util_clean_post_vars('root_cause');
$status = util_clean_post_vars('test_result_status');
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;
# The bug_id exists in the Bug Table and the Verification table
# The verification_id exists in both the verification table and the bug table
# This is done for performance reasons but requires some extra cleanup when data is
# updated or deleted
$page = basename(__FILE__);
$redirect_page = "results_view_verifications_page.php";
$redirect_on_error = "results_update_verification_page.php?failed=true&error=280";
$s_results = session_get_properties("results");
$testset_id = $s_results['testset_id'];
$test_id = $s_results['test_id'];
$test_run_id = $s_results['test_run_id'];
$verify_id = $s_results['verify_id'];
$comments = util_clean_post_vars('verification_comments');
$status = util_clean_post_vars('verification_status');
$current_bug_id = util_clean_post_vars('current_bug_id');
$new_bug_id = util_clean_post_vars('new_bug_id');
if ($new_bug_id == '') {
    $new_bug_id = 0;
}
# 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 = "");
# ---------------------------------------------------------------------
# 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 Signoff Action Page
#
# $RCSfile: testset_signoff_action.php,v $  $Revision: 1.2 $
# ---------------------------------------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$redirect_page = 'results_page.php';
$testset_id = util_clean_post_vars('testset_id');
$build_id = util_clean_post_vars('build_id');
$status = util_clean_post_vars('signoff_status');
$comments = util_clean_post_vars('signoff_comments');
$user_name = session_get_username();
$date = date_get_short_dt();
testset_update_testset_signoff($testset_id, $build_id, $status, $date, $user_name, $comments);
html_print_operation_successful("testset_signoff_page", $redirect_page);
# ---------------------------------------------------------------------
# $Log: testset_signoff_action.php,v $
# Revision 1.2  2006/01/08 22:00:19  gth2
# bug fixes.  missing some variables - 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
#----------------------------------------------------------------------
# ------------------------------------
# testset lock action
#
# $RCSfile: testset_lock_action.php,v $ $Revision: 1.1 $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
$redirect_page = 'results_page.php';
$testset_id = util_clean_post_vars('testset_id');
$build_id = util_clean_post_vars('build_id');
$comments = util_clean_post_vars('lock_comment');
$user_name = session_get_username();
$date = date_get_short_dt();
testset_update_testset_lock($testset_id, $build_id, $date, $user_name, $comments);
html_print_operation_successful("testset_lock_page", $redirect_page);
# ------------------------------------
# $Log: testset_lock_action.php,v $
# Revision 1.1  2008/07/25 09:50:01  peter_thal
# added lock testset feature
# disabled detail column in test result, because functionality is not implemented yet
#
# ------------------------------------