Пример #1
0
 /**
  * Show content
  */
 public function showContent()
 {
     global $tpl, $ilTabs, $ilAccess, $ilToolbar;
     $ilTabs->activateTab("content");
     // Show add appointment
     if ($ilAccess->checkAccess('write', '', $this->object->getRefId())) {
         // Edit appointment
         $ilToolbar->addButton(ilViteroPlugin::getInstance()->txt('tbbtn_add_appointment'), $this->ctrl->getLinkTarget($this, 'showAppointmentCreation'));
     }
     $this->object->checkInit();
     $table = new ilViteroBookingTableGUI($this, 'showContent');
     $table->setEditable((bool) $ilAccess->checkAccess('write', '', $this->object->getRefId()));
     $table->init();
     $start = new ilDateTime(time(), IL_CAL_UNIX);
     $start->increment(ilDateTime::HOUR, -1);
     $end = clone $start;
     $end->increment(IL_CAL_YEAR, 1);
     try {
         $table->parse($this->object->getVGroupId(), $start, $end);
     } catch (ilViteroConnectorException $e) {
         ilUtil::sendFailure($e->getViteroMessage(), true);
         return false;
     }
     $tpl->setContent($table->getHTML());
 }
 protected function listAppointments()
 {
     global $ilTabs, $tpl;
     $ilTabs->activateTab('appointments');
     $table = new ilViteroBookingTableGUI($this, 'listAppointments');
     $table->setAdminTable(true);
     $table->setEditable(false);
     $table->init();
     $start = new ilDateTime(time(), IL_CAL_UNIX);
     $start->increment(ilDateTime::HOUR, -1);
     $end = clone $start;
     $end->increment(IL_CAL_YEAR, 2);
     try {
         $table->parseAdminTable($start, $end);
     } catch (ilViteroConnectorException $e) {
         ilUtil::sendFailure($e->getViteroMessage(), true);
         return false;
     }
     $tpl->setContent($table->getHTML());
 }