getRecurOnDays() public method

Returns the days this event recurs on.
public getRecurOnDays ( ) : integer
return integer A mask consisting of Horde_Date::MASK_* constants specifying the day(s) this event recurs on.
Esempio n. 1
0
 /**
  * Set recurrence information for this appointment
  *
  * @param Horde_Date_Recurrence $recurrence  The recurrence data.
  * @param integer $fdow                      The first day of the week.
  *        (A Horde_ActiveSync_Message_Recurrence:: constant).  @since 2.4.0
  */
 public function setRecurrence(Horde_Date_Recurrence $recurrence, $fdow = null)
 {
     $r = Horde_ActiveSync::messageFactory('Recurrence');
     if ($this->_version >= Horde_ActiveSync::VERSION_FOURTEENONE) {
         $r->firstdayofweek = $fdow;
     }
     /* Map the type fields */
     switch ($recurrence->recurType) {
         case Horde_Date_Recurrence::RECUR_DAILY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_DAILY;
             break;
         case Horde_Date_Recurrence::RECUR_WEEKLY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_WEEKLY;
             $r->dayofweek = $recurrence->getRecurOnDays();
             break;
         case Horde_Date_Recurrence::RECUR_MONTHLY_DATE:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_MONTHLY;
             break;
         case Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_MONTHLY_NTH;
             $r->weekofmonth = ceil($recurrence->start->mday / 7);
             $r->dayofweek = $this->_dayOfWeekMap[$recurrence->start->dayOfWeek()];
             break;
         case Horde_Date_Recurrence::RECUR_YEARLY_DATE:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_YEARLY;
             $r->monthofyear = $recurrence->start->month;
             $r->dayofmonth = $recurrence->start->mday;
             break;
         case Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_YEARLYNTH;
             $r->dayofweek = $this->_dayOfWeekMap[$recurrence->start->dayOfWeek()];
             $r->weekofmonth = ceil($recurrence->start->mday / 7);
             $r->monthofyear = $recurrence->start->month;
             break;
     }
     if (!empty($recurrence->recurInterval)) {
         $r->interval = $recurrence->recurInterval;
     }
     /* AS messages can only have one or the other (or none), not both */
     if ($recurrence->hasRecurCount()) {
         $r->occurrences = $recurrence->getRecurCount();
     } elseif ($recurrence->hasRecurEnd()) {
         $r->until = $recurrence->getRecurEnd();
     }
     // We don't support non-gregorian calendars.
     if ($this->_version >= Horde_ActiveSync::VERSION_FOURTEEN) {
         $r->calendartype = Horde_ActiveSync_Message_Recurrence::CALENDAR_TYPE_GREGORIAN;
     }
     $this->_properties['recurrence'] = $r;
 }
Esempio n. 2
0
 /**
  * Return whether or not this object is equal to another recurrence object.
  * The objects are considered equal if the recurrence rules are the same.
  * This does not take any exceptions into account.
  *
  * @param  Horde_Date_Recurrence $recurrence  The recurrence object to check
  *                                            equality to.
  *
  * @return boolean   True if the recurrence rules are the same.
  * @since  2.2.0
  */
 public function isEqual(Horde_Date_Recurrence $recurrence)
 {
     return $this->getRecurType() == $recurrence->getRecurType() && $this->getRecurInterval() == $recurrence->getRecurInterval() && $this->getRecurCount() == $recurrence->getRecurCount() && $this->getRecurEnd() == $recurrence->getRecurEnd() && $this->getRecurStart() == $recurrence->getRecurStart() && $this->getRecurOnDays() == $recurrence->getRecurOnDays();
 }
Esempio n. 3
0
File: Task.php Progetto: horde/horde
 /**
  * Set recurrence information for this task
  *
  * @param Horde_Date_Recurrence $recurrence
  */
 public function setRecurrence(Horde_Date_Recurrence $recurrence)
 {
     $r = Horde_ActiveSync::messageFactory('TaskRecurrence');
     // Map the type fields
     switch ($recurrence->recurType) {
         case Horde_Date_Recurrence::RECUR_DAILY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_DAILY;
             break;
         case Horde_Date_Recurrence::RECUR_WEEKLY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_WEEKLY;
             $r->dayofweek = $recurrence->getRecurOnDays();
             break;
         case Horde_Date_Recurrence::RECUR_MONTHLY_DATE:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_MONTHLY;
             $r->dayofmonth = $recurrence->start->mday;
             break;
         case Horde_Date_Recurrence::RECUR_MONTHLY_WEEKDAY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_MONTHLY_NTH;
             $r->weekofmonth = ceil($recurrence->start->mday / 7);
             $r->dayofweek = $this->_dayOfWeekMap[$recurrence->start->dayOfWeek()];
             break;
         case Horde_Date_Recurrence::RECUR_YEARLY_DATE:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_YEARLY;
             break;
         case Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY:
             $r->type = Horde_ActiveSync_Message_Recurrence::TYPE_YEARLYNTH;
             $r->dayofweek = $this->_dayOfWeekMap[$recurrence->start->dayOfWeek()];
             $r->weekofmonth = ceil($recurrence->start->mday / 7);
             $r->monthofyear = $recurrence->start->month;
             break;
     }
     if (!empty($recurrence->recurInterval)) {
         $r->interval = $recurrence->recurInterval;
     }
     // AS messages can only have one or the other (or none), not both
     if ($recurrence->hasRecurCount()) {
         $r->occurrences = $recurrence->getRecurCount();
     } elseif ($recurrence->hasRecurEnd()) {
         $r->until = $recurrence->getRecurEnd();
     }
     // Set the start of the recurrence series.
     $r->start = clone $this->duedate;
     $this->_properties['recurrence'] = $r;
 }
Esempio n. 4
0
 public function testParseYearlyWeekday()
 {
     $r = new Horde_Date_Recurrence('2007-03-01 10:00:00');
     $r->fromRRule20('FREQ=YEARLY;INTERVAL=1;BYDAY=1TH;BYMONTH=3;UNTIL=20090301');
     $this->assertEquals(Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY, $r->getRecurType());
     $this->assertEquals(1, $r->getRecurInterval());
     $this->assertNull($r->getRecurOnDays());
     $this->assertNull($r->getRecurCount());
     $this->assertEquals('2009-03-02 00:00:00', (string) $r->recurEnd);
     $r->fromRRule20('FREQ=YEARLY;INTERVAL=1;BYDAY=1TH;BYMONTH=3;UNTIL=20090302T090000Z');
     $this->assertEquals(Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY, $r->getRecurType());
     $this->assertEquals(1, $r->getRecurInterval());
     $this->assertNull($r->getRecurOnDays());
     $this->assertNull($r->getRecurCount());
     $this->assertEquals('2009-03-02 09:00:00', (string) $r->recurEnd->setTimezone('UTC'));
     $r->fromRRule20('FREQ=YEARLY;INTERVAL=1;BYDAY=1TH;BYMONTH=3;COUNT=4');
     $this->assertEquals(Horde_Date_Recurrence::RECUR_YEARLY_WEEKDAY, $r->getRecurType());
     $this->assertEquals(1, $r->getRecurInterval());
     $this->assertNull($r->getRecurOnDays());
     $this->assertEquals(4, $r->getRecurCount());
 }