$completed_tasks = $hr->findCompletedTasks(); foreach ($completed_tasks as $completed_task) { if ($completed_task->getId() == $task->getId()) { $found_completed = true; $completed_task->delete(); } } if (!isset($found_completed)) { throw new Exception("Couldn't find the completed task"); } print "Finding Upcoming Tasks...\n"; $tasks = $hr->findUpcomingTasks(); print_r($tasks); // For this to work you need at least two users in the system print "Assigning task to user"; $assigned_task = new HighriseTask($hr); $assigned_task->setBody("Assigned Task"); $assigned_task->setFrame("today"); $users = $hr->findAllUsers(); $me = $hr->findMe(); foreach ($users as $user) { if ($user->getId() != $me->getId()) { $assigned_user = $user; } } $assigned_task->assignToUser($assigned_user); $assigned_task->save(); print "Finding all Assigned Tasks..."; $assigned_tasks = $hr->findAssignedTasks(); print_r($assigned_tasks); foreach ($assigned_tasks as $a_task) {
public function findTaskById($id) { $xml = $this->getURL("/tasks/{$id}.xml"); $this->checkForErrors("Task"); $task_xml = simplexml_load_string($xml); $task = new HighriseTask($this); $task->loadFromXMLObject($task_xml); return $task; }
public function get_task($id) { $xml = $this->make_request('tasks/' . $id); $this->check_for_errors('Task'); $task_xml = simplexml_load_string($xml); $task = new HighriseTask($this); $task->load_from_xml_object($task_xml); return $task; }