From 2e9216dcf303917764d4af622dcd212ec1491889 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 6 May 2016 13:24:34 +0200 Subject: * event lists on calendar page --- app/php/controls/EventList.php | 56 ++++++++++++++++++++++++++++++++++++++++++ app/php/controls/EventList.tpl | 6 +++++ 2 files changed, 62 insertions(+) create mode 100644 app/php/controls/EventList.php create mode 100644 app/php/controls/EventList.tpl (limited to 'app/php/controls') diff --git a/app/php/controls/EventList.php b/app/php/controls/EventList.php new file mode 100644 index 0000000..325641b --- /dev/null +++ b/app/php/controls/EventList.php @@ -0,0 +1,56 @@ +setViewState($key, $datetime); + } + + public function setDateFrom($date) { + $this->_setDate('DateFrom', $date); + } + + public function getDateFrom() { + return $this->getViewState('DateFrom'); + } + + public function setDateTo($date) { + $this->_setDate('DateTo', $date); + } + + public function getDateTo() { + return $this->getViewState('DateTo'); + } + + public function setHeaderText($text) { + $this->setViewState('HeaderText', TPropertyValue::ensureString($text)); + } + + public function getHeaderText() { + return $this->getViewState('HeaderText'); + } + + public function setReverse($value) { + $this->setViewState('Reverse', TPropertyValue::ensureBoolean($value)); + } + + public function getReverse() { + return $this->getViewState('Reverse'); + } + + public function getEvents() { + return $this->getFacade()->getEventsForTimeframe( + $this->getCalendar(), + $this->getDateFrom() ?: new DateTime('0000-00-00'), + $this->getDateTo() ?: new DateTime('9999-99-99'), + $this->getReverse() ? 'DESC' : 'ASC' + ); + } + +} + +?> diff --git a/app/php/controls/EventList.tpl b/app/php/controls/EventList.tpl new file mode 100644 index 0000000..5881ce7 --- /dev/null +++ b/app/php/controls/EventList.tpl @@ -0,0 +1,6 @@ + + <%= $this->getHeaderText() %> + + + <%= $this->getEvents() %> + -- cgit v1.2.3