diff --git a/application/modules/calendar/boxes/Calendar.php b/application/modules/calendar/boxes/Calendar.php index 7dbb99255..ca0b178a5 100644 --- a/application/modules/calendar/boxes/Calendar.php +++ b/application/modules/calendar/boxes/Calendar.php @@ -1,4 +1,5 @@ get('events') ?? [] as $url): ?> + get('events') ?? [] as $url) : ?> { url: '=$this->getUrl($url->getUrl()) ?>' }, diff --git a/application/modules/calendar/config/config.php b/application/modules/calendar/config/config.php index 94264bc03..3ea324d53 100644 --- a/application/modules/calendar/config/config.php +++ b/application/modules/calendar/config/config.php @@ -1,4 +1,5 @@ addContent('calendar', $this->config['boxes']['calendar']); $boxMapper->install($boxModel); - removeDir(APPLICATION_PATH.'/modules/calendar/static/js/fullcalendar/'); + removeDir(APPLICATION_PATH . '/modules/calendar/static/js/fullcalendar/'); // no break case "1.7.0": - removeDir(APPLICATION_PATH.'/modules/calendar/static/js/fullcalendar_5_11_0/'); + removeDir(APPLICATION_PATH . '/modules/calendar/static/js/fullcalendar_5_11_0/'); // no break case "1.8.0": // Add the uid column. This property defines the persistent, globally unique identifier for the calendar component. @@ -254,10 +255,13 @@ public function getUpdate($installedVersion) // no break case "1.9.2": // Remove old version of fullcalendar as this version comes with version 6.1.10. - removeDir(APPLICATION_PATH.'/modules/calendar/static/js/fullcalendar_5_11_3/'); + removeDir(APPLICATION_PATH . '/modules/calendar/static/js/fullcalendar_5_11_3/'); // no break case "1.10.0": // no break + case "1.11.0": } + + return '"' . $this->config['key'] . '" Update-function executed.'; } } diff --git a/application/modules/calendar/controllers/Events.php b/application/modules/calendar/controllers/Events.php index f33fd2253..275a089b7 100644 --- a/application/modules/calendar/controllers/Events.php +++ b/application/modules/calendar/controllers/Events.php @@ -1,4 +1,5 @@ getView()->set('calendar', $calendarMapper->getEntries()) + $this->getView()->set('calendars', $calendarMapper->getEntries()) ->set('calendarMapper', $calendarMapper); } @@ -70,7 +71,7 @@ public function treatAction() $calendarMapper = new CalendarMapper(); $calendarModel = new CalendarModel(); $groupMapper = new GroupMapper(); - + if ($this->getRequest()->getParam('id')) { $this->getLayout()->getAdminHmenu() ->add($this->getTranslator()->trans('menuCalendar'), ['action' => 'index']) @@ -108,7 +109,7 @@ public function treatAction() } if ($this->getRequest()->getPost('end')) { - $validator['end']= 'required|date:d.m.Y H\:i'; + $validator['end'] = 'required|date:d.m.Y H\:i'; } $validation = Validation::create( @@ -147,7 +148,7 @@ public function treatAction() $this->redirect() ->withInput() ->withErrors($validation->getErrorBag()) - ->to(array_merge(['action' => 'treat'], ($calendarModel->getId()?['id' => $calendarModel->getId()]:[]))); + ->to(array_merge(['action' => 'treat'], ($calendarModel->getId() ? ['id' => $calendarModel->getId()] : []))); } if ($calendarModel->getId()) { diff --git a/application/modules/calendar/layouts/events.php b/application/modules/calendar/layouts/events.php index 1ec612ffa..50f4cdc88 100644 --- a/application/modules/calendar/layouts/events.php +++ b/application/modules/calendar/layouts/events.php @@ -1 +1,5 @@ -=$this->getContent() ?> +getContent(); diff --git a/application/modules/calendar/layouts/iCal.php b/application/modules/calendar/layouts/iCal.php index 1ec612ffa..50f4cdc88 100644 --- a/application/modules/calendar/layouts/iCal.php +++ b/application/modules/calendar/layouts/iCal.php @@ -1 +1,5 @@ -=$this->getContent() ?> +getContent(); diff --git a/application/modules/calendar/mappers/Calendar.php b/application/modules/calendar/mappers/Calendar.php index acc7f22fb..fa8f8ceb3 100644 --- a/application/modules/calendar/mappers/Calendar.php +++ b/application/modules/calendar/mappers/Calendar.php @@ -1,4 +1,5 @@ db()->select(); return $this->getEntriesBy( [ $select->orX( [ - $select->andX(['c.end <=' => $end->format('Y-m-d').' 23:59:59']), - $select->andX(['c.start >=' => $start->format('Y-m-d').' 00:00:00', 'c.end <=' => $end->format('Y-m-d').' 23:59:59']), + $select->andX(['c.end <=' => $end->format('Y-m-d') . ' 23:59:59']), + $select->andX(['c.start >=' => $start->format('Y-m-d') . ' 00:00:00', 'c.end <=' => $end->format('Y-m-d') . ' 23:59:59']), $select->andX( [ 'c.period_type !=' => '', - 'c.start <=' => $end->format('Y-m-d').' 00:00:00', - $select->orX(['c.end >=' => $start->format('Y-m-d').' 23:59:59', 'c.end =' => '1000-01-01 00:00:00']) + 'c.start <=' => $end->format('Y-m-d') . ' 00:00:00', + $select->orX(['c.end >=' => $start->format('Y-m-d') . ' 23:59:59', 'c.end =' => '1000-01-01 00:00:00']) ] ) ] @@ -192,11 +193,11 @@ public function saveReadAccess(int $calendarId, $readAccess, bool $addAdmin = tr } // Delete possible old entries to later insert the new ones. - $this->db()->delete($this->tablename.'_access') + $this->db()->delete($this->tablename . '_access') ->where(['calendar_id' => $calendarId]) ->execute(); - $sql = 'INSERT INTO [prefix]_'.$this->tablename.'_access (calendar_id, group_id) VALUES'; + $sql = 'INSERT INTO [prefix]_' . $this->tablename . '_access (calendar_id, group_id) VALUES'; $sqlWithValues = $sql; $rowCount = 0; $groupIds = []; @@ -253,13 +254,13 @@ public function delete($id): bool * @param int $factor * @return array */ - public function repeat(string $type, \Ilch\Date $startdate, \Ilch\Date $enddate, \Ilch\Date $untilDate, int $factor = 1): array + public function repeat(string $type, Date $startdate, Date $enddate, Date $untilDate, int $factor = 1): array { $recurrences = []; $startdateRecurrence = clone $startdate; $enddateRecurrence = clone $enddate; - while($startdateRecurrence <= $untilDate) { + while ($startdateRecurrence <= $untilDate) { $event = []; switch ($type) { case 'monthly': @@ -276,8 +277,8 @@ public function repeat(string $type, \Ilch\Date $startdate, \Ilch\Date $enddate, break; case 'quarterly': // work with a factor and 3 months as a quarter of a year is 3 months? - $startdateRecurrence->modify(($factor * 3). ' months'); - $enddateRecurrence->modify(($factor * 3). ' months'); + $startdateRecurrence->modify(($factor * 3) . ' months'); + $enddateRecurrence->modify(($factor * 3) . ' months'); break; case 'yearly': $startdateRecurrence->modify($factor . ' years'); diff --git a/application/modules/calendar/mappers/Events.php b/application/modules/calendar/mappers/Events.php index 4f80a7748..58f9cf4e3 100644 --- a/application/modules/calendar/mappers/Events.php +++ b/application/modules/calendar/mappers/Events.php @@ -1,4 +1,5 @@ $this->getTranslator()->trans('Monday'), '2' => $this->getTranslator()->trans('Tuesday'), @@ -19,7 +22,7 @@ ?>