[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/phpgwapi/inc/horde/Horde/iCalendar/ -> vtodo.php (source)

   1  <?php
   2  /**
   3   * Class representing vTodos.
   4   *
   5   * $Horde: framework/iCalendar/iCalendar/vtodo.php,v 1.13 2004/08/13 19:11:35 karsten Exp $
   6   *
   7   * Copyright 2003-2004 Mike Cochrane <mike@graftonhall.co.nz>
   8   *
   9   * See the enclosed file COPYING for license information (LGPL). If you
  10   * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
  11   *
  12   * @author  Mike Cochrane <mike@graftonhall.co.nz>
  13   * @version $Revision: 18844 $
  14   * @since   Horde 3.0
  15   * @package Horde_iCalendar
  16   */
  17  class Horde_iCalendar_vtodo extends Horde_iCalendar {
  18  
  19      function getType()
  20      {
  21          return 'vTodo';
  22      }
  23  
  24      function parsevCalendar($data)
  25      {
  26          parent::parsevCalendar($data, 'VTODO');
  27      }
  28  
  29      function exportvCalendar()
  30      {
  31          return parent::_exportvData('VTODO');
  32      }
  33  
  34      /**
  35       * Convert this todo to an array of attributes.
  36       *
  37       * @return array  Array containing the details of the todo in a hash
  38       *                as used by Horde applications.
  39       */
  40      function toArray()
  41      {
  42          $todo = array();
  43  
  44          $name = $this->getAttribute('SUMMARY');
  45          if (!is_array($name) && !is_a($name, 'PEAR_Error')) {
  46              $todo['name'] = $name;
  47          }
  48          $desc = $this->getAttribute('DESCRIPTION');
  49          if (!is_array($desc) && !is_a($desc, 'PEAR_Error')) {
  50              $todo['desc'] = $desc;
  51          }
  52  
  53          $priority = $this->getAttribute('PRIORITY');
  54          if (!is_array($priority) && !is_a($priority, 'PEAR_Error')) {
  55              $todo['priority'] = $priority;
  56          }
  57  
  58          $due = $this->getAttribute('DTSTAMP');
  59          if (!is_array($due) && !is_a($due, 'PEAR_Error')) {
  60              $todo['due'] = $due;
  61          }
  62  
  63          return $todo;
  64      }
  65  
  66      /**
  67       * Set the attributes for this todo item from an array.
  68       *
  69       * @param array $todo  Array containing the details of the todo in
  70       *                     the same format that toArray() exports.
  71       */
  72      function fromArray($todo)
  73      {
  74          if (isset($todo['name'])) {
  75              $this->setAttribute('SUMMARY', $todo['name']);
  76          }
  77          if (isset($todo['desc'])) {
  78              $this->setAttribute('DESCRIPTION', $todo['desc']);
  79          }
  80  
  81          if (isset($todo['priority'])) {
  82              $this->setAttribute('PRIORITY', $todo['priority']);
  83          }
  84  
  85          if (isset($todo['due'])) {
  86              $this->setAttribute('DTSTAMP', $todo['due']);
  87          }
  88      }
  89  
  90  }


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7