// validate_projectID() project_get_hold_states()
include_once $relPath . 'project_events.inc';
// log_project_event
require_login();
$projectid = validate_projectID('projectid', @$_POST['projectid']);
$return_uri = urldecode($_POST['return_uri']);
$project = new Project($projectid);
if (!$project->can_be_managed_by_current_user) {
    echo "<p>", _('You are not authorized to manage this project.'), "</p>\n";
    exit;
}
// --------------------------------------------------------------------
// Compute the difference between the requested set of hold-states
// and the current set. (Put each holdable state into one of 4 groups:)
$delta_ = array('remove' => array(), 'keep' => array(), 'add' => array(), 'keepout' => array());
$old_hold_states = $project->get_hold_states();
foreach ($Round_for_round_id_ as $round) {
    foreach (array('project_waiting_state', 'project_available_state') as $s) {
        $state = $round->{$s};
        $old_hold = in_array($state, $old_hold_states);
        // In $_POST keys, dots get converted to underscores.
        $new_hold = @$_POST[str_replace('.', '_', $state)] == 'on';
        if ($old_hold) {
            if ($new_hold) {
                $w = 'keep';
            } else {
                $w = 'remove';
            }
        } else {
            if ($new_hold) {
                $w = 'add';