diff --git a/app/controllers/calendar/date.php b/app/controllers/calendar/date.php index 7eea76653ab0c415a0888b335feca6e625b9f041..c812cb1ae82c9d1f3545c3bcd7432f64f45e8c58 100644 --- a/app/controllers/calendar/date.php +++ b/app/controllers/calendar/date.php @@ -655,7 +655,7 @@ class Calendar_DateController extends AuthenticatedController throw new InvalidArgumentException(); } - if ($this->date->repetition_type) { + if ($this->date->repetition_type !== 'SINGLE') { PageLayout::setTitle(_('Verschieben eines Termins aus einer Terminserie')); //Show the dialog to decide what shall be done with the repetition. if (Request::submitted('move')) { diff --git a/lib/models/calendar/CalendarDate.php b/lib/models/calendar/CalendarDate.php index fcdd65cef1cde1b43d5f8c209b4aa5881ad92397..1d49ff52245149dddf238b8d93c1680925903f4b 100644 --- a/lib/models/calendar/CalendarDate.php +++ b/lib/models/calendar/CalendarDate.php @@ -477,9 +477,10 @@ class CalendarDate extends SimpleORMap implements PrivacyObject if ($this->interval == '1') { //Each day if ($this->number_of_dates > 1) { + $number_of_exceptions = CalendarDateException::countByCalendar_date_id($this->id); $repetition_string = sprintf( _('Täglich (%u Termine)'), - $this->number_of_dates + $this->number_of_dates - $number_of_exceptions ); } elseif ($this->repetition_end < CalendarDate::NEVER_ENDING) { $repetition_string = sprintf( @@ -492,10 +493,11 @@ class CalendarDate extends SimpleORMap implements PrivacyObject } else { //Every %u day if ($this->number_of_dates > 1) { + $number_of_exceptions = CalendarDateException::countByCalendar_date_id($this->id); $repetition_string = sprintf( _('Jeden %1$u. Tag (%2$u Termine)'), $this->interval, - $this->number_of_dates + $this->number_of_dates - $number_of_exceptions ); } elseif ($this->repetition_end < self::NEVER_ENDING) { $repetition_string = sprintf( @@ -535,10 +537,11 @@ class CalendarDate extends SimpleORMap implements PrivacyObject if ($this->interval == '1') { //Each week if ($this->number_of_dates > 1) { + $number_of_exceptions = CalendarDateException::countByCalendar_date_id($this->id); $repetition_string = sprintf( ngettext('Einmal am folgenden %s', 'Jeden %1$s (%2$u Termine)', $this->number_of_dates - 1), $weekday_string, - $this->number_of_dates + $this->number_of_dates - $number_of_exceptions ); } elseif ($this->repetition_end < self::NEVER_ENDING) { $repetition_string = sprintf( @@ -555,11 +558,12 @@ class CalendarDate extends SimpleORMap implements PrivacyObject } else { //Every %u week if ($this->number_of_dates > 1) { + $number_of_exceptions = CalendarDateException::countByCalendar_date_id($this->id); $repetition_string = sprintf( _('Jeden %1$u. %2$s (%3$u Termine)'), $this->interval, $weekday_string, - $this->number_of_dates + $this->number_of_dates - $number_of_exceptions ); } elseif ($this->repetition_end < self::NEVER_ENDING) { $repetition_string = sprintf( @@ -637,11 +641,12 @@ class CalendarDate extends SimpleORMap implements PrivacyObject //in a specific month. if ($this->offset < 0) { if ($this->number_of_dates > 1) { + $number_of_exceptions = CalendarDateException::countByCalendar_date_id($this->id); $repetition_string = sprintf( _('Jedes Jahr im %1$s am letzten %2$s (%3$u Termine)'), getMonthName($this->month, false), getWeekday($this->days, false), - $this->number_of_dates + $this->number_of_dates - $number_of_exceptions ); } elseif ($this->repetition_end < self::NEVER_ENDING) { $repetition_string = sprintf( @@ -659,12 +664,13 @@ class CalendarDate extends SimpleORMap implements PrivacyObject } } else { if ($this->number_of_dates > 1) { + $number_of_exceptions = CalendarDateException::countByCalendar_date_id($this->id); $repetition_string = sprintf( _('Jedes Jahr im %1$s am %2$u. %3$s (%4$u Termine'), getMonthName($this->month, false), $this->offset, getWeekday($this->days, false), - $this->number_of_dates + $this->number_of_dates - $number_of_exceptions ); } elseif ($this->repetition_end < self::NEVER_ENDING) { $repetition_string = sprintf( @@ -686,11 +692,12 @@ class CalendarDate extends SimpleORMap implements PrivacyObject } else { //Repetition on one specific day of month. if ($this->number_of_dates > 1) { + $number_of_exceptions = CalendarDateException::countByCalendar_date_id($this->id); $repetition_string = sprintf( _('Jedes Jahr am %1$u. %2$s (%3$u Termine)'), $this->offset, getMonthName($this->month, false), - $this->number_of_dates + $this->number_of_dates - $number_of_exceptions ); } elseif ($this->repetition_end < self::NEVER_ENDING) { $repetition_string = sprintf( @@ -714,12 +721,13 @@ class CalendarDate extends SimpleORMap implements PrivacyObject //in a specific month. if ($this->offset < 0) { if ($this->number_of_dates > 1) { + $number_of_exceptions = CalendarDateException::countByCalendar_date_id($this->id); $repetition_string = sprintf( _('Jedes %1$u. Jahr im %2$s am letzten %3$s (%4$u Termine)'), $this->interval, getMonthName($this->month, false), getWeekday($this->days, false), - $this->number_of_dates + $this->number_of_dates - $number_of_exceptions ); } elseif ($this->repetition_end < self::NEVER_ENDING) { $repetition_string = sprintf( @@ -739,13 +747,14 @@ class CalendarDate extends SimpleORMap implements PrivacyObject } } else { if ($this->number_of_dates > 1) { + $number_of_exceptions = CalendarDateException::countByCalendar_date_id($this->id); $repetition_string = sprintf( _('Jedes %1$u. Jahr im %2$s am %3$u. %4$s (%5$u Termine)'), $this->interval, getMonthName($this->month, false), $this->offset, getWeekday($this->days, false), - $this->number_of_dates + $this->number_of_dates - $number_of_exceptions ); } elseif ($this->repetition_end < self::NEVER_ENDING) { $repetition_string = sprintf( @@ -769,12 +778,13 @@ class CalendarDate extends SimpleORMap implements PrivacyObject } else { //Repetition on one specific day of month. if ($this->number_of_dates > 1) { + $number_of_exceptions = CalendarDateException::countByCalendar_date_id($this->id); $repetition_string = sprintf( _('Jedes %1$u. Jahr am %2$u. %3$s (%4$u Termine)'), $this->interval, $this->offset, getMonthName($this->month, false), - $this->number_of_dates + $this->number_of_dates - $number_of_exceptions ); } elseif ($this->repetition_end < self::NEVER_ENDING) { $repetition_string = sprintf(