예제 #1
0
				if($task->addTaskItem($_POST['new_item'], $_POST['new_item_parent']) === FALSE){
					$error_msg .= "Error adding new task item!\n";
				}
			}
		}else{
			$error_msg .= "Error updating Task!\n";
		}
		if(empty($error_msg) && $_POST['save'] != "Add"){
			if($project->sendUpdateNotification(array("Updated task ".$_POST['name'])) === FALSE){
				$error_msg .= "Error sending update notification!\n";
				debug_message($project->getLastError());
			}

			goBack();
		}else{
			$task->stripSlashes();
		}
	}
}else if($_REQUEST['mode'] == 'delete'){
	$title = "Delete Task";
	if(!isset($_REQUEST['id'])){
		fatal_error("Task id must be supplied!");
	}
	if(!$task->get($_REQUEST['id'])){
		fatal_error("Could not retreive task!");
		debug_message($task->getLastError());
	}
	if($project->get($task->project_id) === FALSE){
		fatal_error("Could not retreive project!");
		debug_message($project->getLastError());
	}