コード例 #1
0
function getProjectList()
{
    try {
        $category_status_id = 62473690;
        //the category status id - need to get integer value for status
        // Pitching - 9
        // Bidding - 8
        // Planning - 1
        // Design - 2
        // Proofing - 10
        // IN REVIEW - 7
        // LEGAL REVIEW - 11
        // ON HOLD - 6
        // Development - 3
        // Complete - 4
        // Billed - 12
        // Closed - 13
        $planning_collection = PodioItem::filter(APP_ID, array('filters' => array($category_status_id => array(1)), 'limit' => 250));
        foreach ($planning_collection as $item) {
            echo 'id: ' . $item->id;
            echo '<br>';
            echo 'title: ' . $item->title;
            echo '<br>';
            //due date here retrieved using external_id
            $due_date = $item->fields["due-date"];
            $job = $item->fields["job"];
            print "Job Number " . $job->values;
            echo '<br>';
            print "This field has the external_id: " . $due_date->external_id;
            echo '<br>';
            //print "DATE HERE: " .$due_date->start;
            //print "DATE HERE: " .$due_date->start_date;
            $date = $due_date->start;
            echo date_format($date, 'Y-m-d H:i:s');
            echo '<br>';
            print "DATE HERE: " . $due_date->end->humanized_value;
            //print $field->start_date->humanized_value;
            echo '<br>';
            foreach ($item->fields as $due_date) {
                // You can now work on each individual field object:
                print "This field has the id: " . $due_date->field_id;
                print " This field has the external_id: " . $due_date->external_id;
                echo '<br>';
            }
            echo '<br>';
            echo 'GET ALL TASKS';
            echo '<br>';
            //"due_date", "created_by", "responsible", "app", "space" or "org"
            $tasks = PodioTask::get_all(array('completed' => 0, 'app' => 8060831, 'grouping' => 'due_date', 'offset' => 0, 'limit' => 50));
            foreach ($tasks as $task) {
                echo 'task id: ' . $task->task_id;
                echo '<br>';
                echo 'due_date: ' . $task->due_date;
                echo '<br>';
                echo 'due_time: ' . $task->due_time;
                echo '<br>';
                echo 'text: ' . $task->text;
                echo '<br>';
            }
        }
    } catch (Exception $e) {
        echo $e;
    }
}