~ubuntu-branches/ubuntu/vivid/davical/vivid

« back to all changes in this revision

Viewing changes to inc/DAVResource.php

  • Committer: Bazaar Package Importer
  • Author(s): Andrew McMillan
  • Date: 2011-10-24 20:09:10 UTC
  • Revision ID: james.westby@ubuntu.com-20111024200910-2mz5wmc9ukh22vge
Tags: 0.9.9.7-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
360
360
      $params[':resourcetypes'] = sprintf('<DAV::collection/><urn:ietf:params:xml:ns:caldav:%s/>', $this->collection_type );
361
361
      $sql = <<<EOSQL
362
362
INSERT INTO collection ( user_no, parent_container, dav_name, dav_displayname, is_calendar, created, modified, dav_etag, resourcetypes )
363
 
    VALUES( (SELECT user_no FROM usr WHERE username = :username),
 
363
    VALUES( (SELECT user_no FROM usr WHERE username = text(:username)),
364
364
            :parent_container, :dav_name,
365
 
            (SELECT fullname FROM usr WHERE username = :username) || :boxname,
 
365
            (SELECT fullname FROM usr WHERE username = text(:username)) || :boxname,
366
366
             FALSE, current_timestamp, current_timestamp, '1', :resourcetypes )
367
367
EOSQL;
368
368
      $qry = new AwlQuery( $sql, $params );
1590
1590
 
1591
1591
      case 'urn:ietf:params:xml:ns:caldav:supported-calendar-component-set':
1592
1592
        if ( ! $this->_is_collection ) return false;
1593
 
        if ( $this->IsCalendar() )
1594
 
          $set_of_components = array( 'VEVENT', 'VTODO', 'VJOURNAL', 'VTIMEZONE', 'VFREEBUSY' );
 
1593
        if ( $this->IsCalendar() ) {
 
1594
          if ( !isset($this->dead_properties) ) $this->FetchDeadProperties();
 
1595
          if ( isset($this->dead_properties[$tag]) ) {
 
1596
            $set_of_components = explode('"', $this->dead_properties[$tag]);
 
1597
            foreach( $set_of_components AS $k => $v ) {
 
1598
              if ( !preg_match('{(VEVENT|VTODO|VJOURNAL|VTIMEZONE|VFREEBUSY)}', $v) ) {
 
1599
                unset( $set_of_components[$k] );
 
1600
              }
 
1601
            }
 
1602
          }
 
1603
          else {
 
1604
            $set_of_components = array( 'VEVENT', 'VTODO', 'VJOURNAL', 'VTIMEZONE', 'VFREEBUSY' );
 
1605
          }
 
1606
        }
1595
1607
        else if ( $this->IsSchedulingCollection() )
1596
1608
          $set_of_components = array( 'VEVENT', 'VTODO', 'VFREEBUSY' );
1597
1609
        else return false;