public function run($id = null, $type = null)
 {
     $controller = $this->getController();
     $params = array();
     $events = Event::getWhere($params);
     if (isset($id) && $id != null) {
         if (isset($type) && $type != null) {
             if (strcmp($type, "person") == 0) {
                 $events = Event::getListCurrentEventsByPeopleId($id);
             } else {
                 if (strcmp($type, "organization") == 0) {
                     $events = Event::getListCurrentEventsByOrganizationId($id);
                 }
             }
         }
     }
     $controller->render("calendarView", array("events" => $events));
 }
 public function run($id, $type)
 {
     $controller = $this->getController();
     $params = array();
     $events = array();
     if ($type == Organization::COLLECTION) {
         $events = Event::getListCurrentEventsByOrganizationId($id, 3);
         $params["organizationId"] = $id;
     } else {
         if ($type == Person::COLLECTION) {
             $events = Event::getListCurrentEventsByPeopleId($id, 3);
             $params["itemId"] = $id;
         }
     }
     $params["eventsAgenda"] = $events;
     if (isset(Yii::app()->session["userId"])) {
         $params["canEdit"] = Authorisation::canEditItem(Yii::app()->session["userId"], $type, $id);
     }
     if (Yii::app()->request->isAjaxRequest) {
         echo $controller->renderPartial("sliderAgenda", $params, true);
     } else {
         $controller->render("sliderAgenda", $params);
     }
 }