<?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();

$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'];

$user_properties		= session_get_user_properties();
$user_id				= $user_properties['user_id'];
$username				= $user_properties['username'];
        if (requirement_locked($project_id,$s_req_id,$username)) {
                 html_print_operation_failed( 'req_edit_page',error_report_msg(CAN_NOT_MODIFY_REQUIREMENT_LOCKED,requirement_locked_by($project_id,$s_req_id)), "requirement_detail_page.php?req_id=".$s_req_id);
                 exit;
       }
       
$redirect_page	= 'requirement_detail_page.php';

requirement_edit_assoc_releases($s_req_version_id, $_POST["row_releases"]);

############################################################################
# EMAIL NOTIFICATION
############################################################################
$recipients		= requirement_get_notify_users($project_id, $s_req_id);

requirement_email($project_id, $s_req_id, $recipients, $action="edit_release_assoc");
############################################################################
############################################################################

html_print_operation_successful("req_assoc_releases_page", $redirect_page);
?>