コード例 #1
0
function renderPreviewList()
{
    $options = array('date_min' => getDateTimeFieldValue('time_start'), 'date_max' => getDateTimeFieldValue('time_end'));
    ### author
    if (intval(get('person'))) {
        $options['modified_by'] = get('person');
    }
    ### Object types
    $types = array();
    if (get('type_task') || get('type_topic')) {
        $types[] = ITEM_TASK;
    }
    if (get('type_comment')) {
        $types[] = ITEM_COMMENT;
    }
    $options['type'] = $types;
    $items = DbProjectItem::getAll($options);
    echo "<ol>";
    foreach ($items as $item) {
        if ($item->type == ITEM_COMMENT) {
            $comment = Comment::getById($item->id);
            if (get('only_spam_comments') && !isSpam($comment->name . " " . $comment->description)) {
                continue;
            }
            renderRemovalPreviewComment($comment);
        }
        if ($item->type == ITEM_TASK) {
            $task = Task::getById($item->id);
            renderRemovalPreviewTask($task);
        }
    }
    echo "</ol>";
}
コード例 #2
0
function FieldDatetime_parseForm(&$field, &$obj)
{
    $name = $field->name;
    $field_id = $obj->_type . '_' . $name;
    $obj->{$name} = getDateTimeFieldValue($field_id);
}