/** * 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()); }
/** * parse * * @access public * @return */ public function parse() { global $ilUser, $tree; include_once './Services/Calendar/classes/class.ilCalendarCategories.php'; $cats = ilCalendarCategories::_getInstance($ilUser->getId()); $cats->initialize(ilCalendarCategories::MODE_MANAGE); $tmp_title_counter = array(); $categories = array(); foreach ($cats->getCategoriesInfo() as $category) { $tmp_arr['obj_id'] = $category['obj_id']; $tmp_arr['id'] = $category['cat_id']; $tmp_arr['title'] = $category['title']; $tmp_arr['type'] = $category['type']; // Append object type to make type sortable $tmp_arr['type_sortable'] = ilCalendarCategory::lookupCategorySortIndex($category['type']); if ($category['type'] == ilCalendarCategory::TYPE_OBJ) { $tmp_arr['type_sortable'] .= '_' . ilObject::_lookupType($category['obj_id']); } $tmp_arr['color'] = $category['color']; $tmp_arr['editable'] = $category['editable']; $tmp_arr['accepted'] = $category['accepted']; $tmp_arr['remote'] = $category['remote']; $categories[] = $tmp_arr; // count title for appending the parent container if there is more than one entry. $tmp_title_counter[$category['type'] . '_' . $category['title']]++; } $path_categories = array(); foreach ($categories as $cat) { if ($cat['type'] == ilCalendarCategory::TYPE_OBJ) { if ($tmp_title_counter[$cat['type'] . '_' . $cat['title']] > 1) { foreach (ilObject::_getAllReferences($cat['obj_id']) as $ref_id) { include_once './Services/Tree/classes/class.ilPathGUI.php'; $path = new ilPathGUI(); $path->setUseImages(false); $path->enableTextOnly(false); $cat['path'] = $path->getPath(ROOT_FOLDER_ID, $ref_id); break; } } } $path_categories[] = $cat; } $this->setData($path_categories); }
/** * Append path * @return */ protected function appendPath($a_ref_id) { include_once './Services/Tree/classes/class.ilPathGUI.php'; $path_gui = new ilPathGUI(); $path_gui->enableTextOnly(false); $path_gui->setUseImages(false); $tpl = new ilTemplate('tpl.lucene_path.html', true, true, 'Services/Search'); $tpl->setVariable('PATH_ITEM', $path_gui->getPath(ROOT_FOLDER_ID, $a_ref_id)); return $tpl->get(); }
/** * insert path */ function insertPath() { global $tree, $lng; if ($this->getPathStatus() != false) { include_once 'Services/Tree/classes/class.ilPathGUI.php'; $path_gui = new ilPathGUI(); $path_gui->enableTextOnly(!$this->path_linked); $path_gui->setUseImages(false); $start_node = $this->path_start_node ? $this->path_start_node : ROOT_FOLDER_ID; $this->tpl->setCurrentBlock("path_item"); $this->tpl->setVariable('PATH_ITEM', $path_gui->getPath($start_node, $this->ref_id)); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("path"); $this->tpl->setVariable("TXT_LOCATION", $lng->txt("locator")); $this->tpl->parseCurrentBlock(); return true; } }