示例#1
0
<?php

require_once "../lib/HighriseAPI.class.php";
if (count($argv) != 3) {
    die("Usage: php tasks.test.php [account-name] [access-token]\n");
}
$hr = new HighriseAPI();
$hr->debug = false;
$hr->setAccount($argv[1]);
$hr->setToken($argv[2]);
print "Creating Task...\n";
$task = new HighriseTask($hr);
$task->setBody("Task Body");
$task->setPublic(false);
$task->setFrame("Tomorrow");
$task->save();
print "Updating Task...\n";
$task->setBody("Task Body2");
$task->setPublic(true);
$task->save();
print "Creating Task...\n";
$task = new HighriseTask($hr);
$task->setBody("This will be completed");
$task->setFrame("today");
$task->save();
print "Completing Task ID: " . $task->getId() . "\n";
$task->complete();
print_r($task);
print "Finding Completed Tasks...\n";
$completed_tasks = $hr->findCompletedTasks();
foreach ($completed_tasks as $completed_task) {