phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] calendar/class.icalendar_vtodo.php, 1.1.2.1


From: nomail
Subject: [Phpgroupware-cvs] calendar/class.icalendar_vtodo.php, 1.1.2.1
Date: Thu, 20 May 2004 20:55:54 -0000

Update of /calendar
Added Files:
        Branch: proposal-branch
          class.icalendar_vtodo.php

date: 2004/04/16 21:22:00;  author: seek3r;  state: Exp;  lines: +91 -0

Log Message:
bringing savannah cvs back up to date with what we were doing on our private 
cvs server. We will not be doing dev from this cvs tree
=====================================================================
No syntax errors detected in -
=====================================================================
<?php
        
/**************************************************************************\
        * phpGroupWare                                                          
   *
        * http://www.phpgroupware.org                                           
   *
        * This file written by Mike Cochrane <address@hidden>              *
        * Ported from Horde by Dan Kuykendall <address@hidden>                 *
        * Copyright (C) 2003 Mike Cochrane, Dan Kuykendall                      
   *
        * 
-------------------------------------------------------------------------*
        * This program is free software; you can redistribute it and/or modify 
it  *
        * under the terms of the GNU General Public License as published by the 
   *
        * Free Software Foundation; either version 2 of the License, or (at 
your   *
        * option) any later version.                                            
   *
        
\**************************************************************************/

        /* $Id: class.icalendar_vtodo.php,v 1.1.2.1 2004/04/16 21:22:00 seek3r 
Exp $ */
        /* $Source: 
/cvsroot/phpgroupware/calendar/Attic/class.icalendar_vtodo.php,v $ */

 class calendar_icalendar_vtodo extends calendar_icalendar {

    function getType()
    {
        return 'vTodo';
    }

    function parsevCalendar($data)
    {
        parent::parsevCalendar($data, 'VTODO');
    }

    function exportvCalendar(&$container)
    {
        return parent::_exportvData('VTODO');
    }

    /**
     * Convert this todo to an array of attributes.
     *
     * @return array  Array containing the details of the todo in a hash
     *                as used by Horde applications.
     */
    function toArray()
    {
        $todo = array();

        $name = $this->getAttribute('SUMMARY');
        if (!is_array($name) && !is_a($name, 'PEAR_Error')) {
            $todo['name'] = $name;
        }
        $desc = $this->getAttribute('DESCRIPTION');
        if (!is_array($desc) && !is_a($desc, 'PEAR_Error')) {
            $todo['desc'] = $desc;
        }

        $priority = $this->getAttribute('PRIORITY');
        if (!is_array($priority) && !is_a($priority, 'PEAR_Error')) {
            $todo['priority'] = $priority;
        }

        $due = $this->getAttribute('DTSTAMP');
        if (!is_array($due) && !is_a($due, 'PEAR_Error')) {
            $todo['due'] = $due;
        }

        return $todo;
    }

    /**
     * Set the attributes for this todo item from an array.
     *
     * @param array $todo  Array containing the details of the todo in
     *                     the same format that toArray() exports.
     */
    function fromArray($todo)
    {
        if (isset($todo['name'])) {
            $this->setAttribute('SUMMARY', $todo['name']);
        }
        if (isset($todo['desc'])) {
            $this->setAttribute('DESCRIPTION', $todo['desc']);
        }

        if (isset($todo['priority'])) {
            $this->setAttribute('PRIORITY', $todo['priority']);
        }

        if (isset($todo['due'])) {
            $this->setAttribute('DTSTAMP', $todo['due']);
        }
    }

}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]