* Calendar - Include monthly type (by weekday or by date) in recurrence rule strings

This commit is contained in:
nathangray 2017-06-26 10:46:18 -06:00
parent 9743aa0eae
commit d46937fbe3

View File

@ -573,7 +573,7 @@ class calendar_rrule implements Iterator
// Repeated Events // Repeated Events
if($this->type != self::NONE) if($this->type != self::NONE)
{ {
list($str) = explode(' (',lang(self::$types[$this->type])); // remove (by day/date) from Monthly $str = lang(self::$types[$this->type]);
$str_extra = array(); $str_extra = array();
switch ($this->type) switch ($this->type)
@ -799,12 +799,20 @@ class calendar_rrule implements Iterator
$weekdays = 0; $weekdays = 0;
$exceptions = array(); $exceptions = array();
list($type, $conditions) = explode(' (', $rrule); list($type, $sub, $conditions) = explode(' (', $rrule);
if(!$conditions)
{
$conditions = $sub;
}
else
{
$type .= " ($sub";
}
$conditions = explode(', ', substr($conditions, 0, -1)); $conditions = explode(', ', substr($conditions, 0, -1));
foreach(static::$types as $id => $type_name) foreach(static::$types as $id => $type_name)
{ {
list($str) = explode(' (',lang($type_name)); $str = lang($type_name);
if($str == $type) if($str == $type)
{ {
$type_id = $id; $type_id = $id;