$project->updateFromAssocArray($_POST); if($project->update()){ $activities = array("Project details modified"); if(!empty($_FILES['attachment_file']['tmp_name'])){ if($project->addAttachment($_FILES['attachment_file']['tmp_name'], $_FILES['attachment_file']['name'], $_POST['attachment_description']) === FALSE){ $error_msg .= "Error adding attachment!\n"; debug_message($project->getLastError()); }else{ $activities[] = "Added attachment {$_POST['attachment_description']}"; } } if(isset($_POST['right_user_id']) && $_POST['right_user_id'] > 0){ if(!$project->hasRights(PROJECT_RIGHT_FULL)){ fatal_error('Insufficent access rights to add users!'); } if($project->addUserRight($_POST['right_user_id'], $_POST['right_level']) === FALSE){ $error_msg .= "Error adding user access to project!\n"; debug_message($project->getLastError()); }else{ $activities[] = "Added user right level {$_POST['right_level']} to ".SI_User::getUserName($_POST['right_user_id']); } } if(isset($_POST['new_cc_id']) && $_POST['new_cc_id'] > 0){ if($project->addCC($_POST['new_cc_id']) === FALSE){ $error_msg .= "Error adding new CC to project!\n"; debug_message($project->getLastError()); }else{ $activities[] = "Added ".SI_User::getUserName($_POST['new_cc_id'])." to project CC list"; } }