#
# $RCSfile: requirement_add_action.php,v $  $Revision: 1.2 $
# ---------------------------------------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
# if $parent_req==0, then the requirement is not a child of any other requirement
if (isset($_POST["parent_req"])) {
    $parent_req = $_POST["parent_req"];
} else {
    $parent_req = 0;
}
$add_req_page = "requirement_add_page.php?type=" . $_POST['req_record_or_file'] . "&parent_req={$parent_req}";
session_validate_form_set($_POST, $add_req_page);
# if requirement is a file
if ($_POST['req_record_or_file'] == "F") {
    $uploaded_filename = file_add_requirement($add_req_page);
    $detail = "";
} else {
    $uploaded_filename = "";
    $detail = session_validate_form_get_field('req_detail_required', "", session_use_FCKeditor());
}
$req_reason_for_change = session_validate_form_get_field("req_reason_change");
$project_id = $_POST['project_id'];
$req_name = session_validate_form_get_field('req_name_required');
$req_area = session_validate_form_get_field('req_area_covered');
$req_type = session_validate_form_get_field('req_type');
$req_rec_or_file = $_POST['req_record_or_file'];
$req_version = session_validate_form_get_field('req_version');
$req_status = session_validate_form_get_field('req_status');
$req_priority = session_validate_form_get_field('req_priority');
$req_assigned_to = session_validate_form_get_field('req_assigned_to');
# 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 Add New Version Action
#
# $RCSfile: requirement_add_new_version_action.php,v $  $Revision: 1.7 $
# ------------------------------------
include "./api/include_api.php";
auth_authenticate_user();
//print_r($_POST);exit;
session_validate_form_set($_POST, "requirement_add_new_version_page.php");
# if requirement is a file
if ($_POST['req_record_or_file'] == "F") {
    $uploaded_filename = file_add_requirement("requirement_add_new_version_page.php");
    //"requirement_detail_page.php");
    $detail = "";
} else {
    $uploaded_filename = "";
    $detail = session_validate_form_get_field('req_detail_required', "", session_use_FCKeditor());
}
$redirect_on_error = "requirement_add_new_version_page.php?failed=true&error=280";
$project_id = $_POST["project_id"];
$req_id = $_POST["req_id"];
$req_name = session_validate_form_get_field('req_name_required');
$req_area = session_validate_form_get_field('req_area');
$req_type = session_validate_form_get_field('req_type');
$req_record_or_file = $_POST['req_record_or_file'];
$req_version = session_validate_form_get_field('req_version');
$req_priority = session_validate_form_get_field('req_priority');