/** * Fill template row * @param <type> $a_set */ public function fillRow($a_set) { $this->tpl->setVariable('TIME', $a_set['time']); $this->tpl->setVariable('DURATION', $a_set['duration']); $this->tpl->setVariable('REC', ilViteroUtils::recurrenceToString($a_set['rec'])); if ($this->isAdminTable()) { include_once './Services/Tree/classes/class.ilPathGUI.php'; $path = new ilPathGUI(); $path->setUseImages(false); $path->enableTextOnly(false); $this->tpl->setVariable('OBJ_PATH', $path->getPath(ROOT_FOLDER_ID, end(ilObject::_getAllReferences($a_set['group'])))); } if ($a_set['rec']) { $this->tpl->setVariable('ENDS', $a_set['ends']); } else { $this->tpl->setVariable('ENDS', ''); } if (!$this->isEditable()) { return true; } include_once './Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php'; $list = new ilAdvancedSelectionListGUI(); $list->setId('booka_' . $a_set['start']->get(IL_CAL_UNIX) . '_' . $a_set['id']); $list->setListTitle($this->lng->txt('actions')); // no recurrence if ($a_set['rec'] == 0) { $GLOBALS['ilCtrl']->setParameter($this->getParentObject(), 'bookid', $a_set['id']); $list->addItem(ilViteroPlugin::getInstance()->txt('edit_booking'), '', $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(), 'editBooking')); // delete appointment $list->addItem(ilViteroPlugin::getInstance()->txt('delete_appointment'), '', $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(), 'confirmDeleteAppointment')); } // A recurrence if ($a_set['rec'] > 0) { // Delete single appointment $GLOBALS['ilCtrl']->setParameter($this->getParentObject(), 'atime', $a_set['start']->get(IL_CAL_UNIX)); $GLOBALS['ilCtrl']->setParameter($this->getParentObject(), 'bookid', $a_set['id']); $list->addItem(ilViteroPlugin::getInstance()->txt('edit_bookings'), '', $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(), 'editBooking')); // not supported /* $list->addItem( ilViteroPlugin::getInstance()->txt('delete_appointment'), '', $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(),'confirmDeleteAppointmentInSeries') ); */ // Delete appointment series $list->addItem(ilViteroPlugin::getInstance()->txt('delete_reccurrence'), '', $GLOBALS['ilCtrl']->getLinkTarget($this->getParentObject(), 'confirmDeleteBooking')); } $this->tpl->setVariable('ACTION_PART', $list->getHTML()); }
public function confirmDeleteBooking() { global $tpl, $ilTabs; $ilTabs->activateTab('content'); try { $booking_service = new ilViteroBookingSoapConnector(); $book = $booking_service->getBookingById($_REQUEST['bookid']); } catch (ilViteroConnectorException $e) { ilUtil::sendFailure($e->getMessage(), true); $GLOBALS['ilCtrl']->redirect($this, 'showContent'); } include_once './Services/Utilities/classes/class.ilConfirmationGUI.php'; $confirm = new ilConfirmationGUI(); $confirm->setFormAction($GLOBALS['ilCtrl']->getFormAction($this)); $confirm->setHeaderText(ilViteroPlugin::getInstance()->txt('sure_delete_appointment_series')); $start = ilViteroUtils::parseSoapDate($book->booking->start); ilDatePresentation::setUseRelativeDates(false); $confirm->addItem('bookid[]', (int) $_REQUEST['bookid'], sprintf(ilViteroPlugin::getInstance()->txt('confirm_delete_series_txt'), ilDatePresentation::formatDate($start), ilViteroUtils::recurrenceToString($book->booking->repetitionpattern))); $confirm->setConfirm($GLOBALS['lng']->txt('delete'), 'deleteBooking'); $confirm->setCancel($GLOBALS['lng']->txt('cancel'), 'showContent'); $tpl->setContent($confirm->getHTML()); }
/** * insert * * @access public * @param * @return */ public function insert($a_tpl) { $tpl = ilViteroPlugin::getInstance()->getTemplate('tpl.recurrence_input.html', true, true); $options = array(ilViteroUtils::REC_ONCE => ilViteroUtils::recurrenceToString(ilViteroUtils::REC_ONCE), ilViteroUtils::REC_DAILY => ilViteroUtils::recurrenceToString(ilViteroUtils::REC_DAILY), ilViteroUtils::REC_WEEKLY => ilViteroUtils::recurrenceToString(ilViteroUtils::REC_WEEKLY), ilViteroUtils::REC_WEEKDAYS => ilViteroUtils::recurrenceToString(ilViteroUtils::REC_WEEKDAYS), ilViteroUtils::REC_WEEKENDS => ilViteroUtils::recurrenceToString(ilViteroUtils::REC_WEEKENDS)); $tpl->setVariable('FREQUENCE', ilUtil::formSelect($this->getReccurrence(), 'frequence', $options, false, true, '', '', array('onchange' => 'ilHideFrequencies();', 'id' => 'il_recurrence_1'))); $tpl->setVariable('TXT_EVERY', $this->lng->txt('cal_every')); // UNTIL $this->buildUntilSelection($tpl); $a_tpl->setCurrentBlock("prop_custom"); $a_tpl->setVariable("CUSTOM_CONTENT", $tpl->get()); $a_tpl->parseCurrentBlock(); }