summaryrefslogtreecommitdiffstats
path: root/application/controllers/EventController.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers/EventController.php')
-rw-r--r--application/controllers/EventController.php44
1 files changed, 19 insertions, 25 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index 4966b34..5a53714 100644
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -434,32 +434,26 @@ class EventController extends Zend_Controller_Action
}
}
- public function listAction() {
-
+ public function listAction(){
+
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
-
- $year = date('Y');
- $month = date('m');
-
- echo json_encode(array(
- array(
- 'id' => 111,
- 'title' => "Event1",
- 'start' => "$year-$month-10",
- 'end' => "$year-$month-11",
- 'url' => "http://yahoo.com/"
- ),
-
- array(
- 'id' => 222,
- 'title' => "Event2",
- 'start' => "$year-$month-20",
- 'end' => "$year-$month-22",
- 'url' => "http://yahoo.com/"
- )
-
- ));
- return;
+ $eventList = $this->eventMapper->fetchAll();
+
+ foreach ($eventList as $event){
+ $events[] = array(
+ 'id' => $event->getID(),
+ 'title' => $event->getTitle(),
+ 'start' => $event->getStart(),
+ 'end' => $event->getEnd(),
+ 'category' => $event->getCategory(),
+ 'participants' => $event->getParticipants(),
+ 'note' => $event->getNote(),
+ 'poolID' => $event->getPbs_poolID(),
+ 'bootosID' => $event->getPbs_bootosID(),
+ 'allDay' => false,
+ );
+ }
+ echo json_encode($events);
}
} \ No newline at end of file