<?php
# ---------------------------------------------------------------------
# truc is a tool for requirement and use case tracking
# Copyright (C) 2006 ASDIS - http://sf.net/projects/truc
#
# (rth) Initial truc version based on rth
#       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
#----------------------------------------------------------------------

include"./api/include_api.php";
auth_authenticate_user();

$redirect_page		= 'project_manage_release_page.php';
$proj_properties	= session_get_properties("project_manage");
$project_id		= $proj_properties['project_id'];

session_validate_form_set($_POST, $redirect_page);

if( admin_release_name_exists( $project_id, session_validate_form_get_field('rel_name_required') ) ) {
	
	error_report_show($redirect_page	, DUPLICATE_RELEASE_NAME );
	
}

admin_add_release(	session_validate_form_get_field('rel_name_required'),
					session_validate_form_get_field('rel_description'),
					$project_id,
					"CREATE RELEASE" );

session_validate_form_reset();

html_print_operation_successful( "add_release", $release_page );
?>