/** * Show membership limitations * * @access protected * @return */ protected function fillMembershipLimitation() { global $ilAccess, $ilCtrl; include_once 'Modules/Course/classes/class.ilObjCourseGrouping.php'; if (!($items = ilObjCourseGrouping::_getGroupingItems($this->container))) { return true; } $mem = new ilCustomInputGUI($this->lng->txt('groupings')); $tpl = new ilTemplate('tpl.membership_limitation_form.html', true, true, 'Services/Membership'); $tpl->setVariable('LIMIT_INTRO', $this->lng->txt($this->type . '_grp_info_reg')); foreach ($items as $ref_id) { $obj_id = ilObject::_lookupObjId($ref_id); $type = ilObject::_lookupType($obj_id); $title = ilObject::_lookupTitle($obj_id); if ($ilAccess->checkAccess('visible', '', $ref_id, $type)) { include_once './Services/Link/classes/class.ilLink.php'; $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $ref_id); $tpl->setVariable('LINK_ITEM', $ilCtrl->getLinkTargetByClass("ilrepositorygui", "")); $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]); $tpl->setVariable('ITEM_LINKED_TITLE', $title); } else { $tpl->setVariable('ITEM_TITLE'); } $tpl->setCurrentBlock('items'); $tpl->setVariable('TYPE_ICON', ilObject::_getIcon($obj_id, tiny, $type)); $tpl->setVariable('ALT_ICON', $this->lng->txt('obj_' . $type)); $tpl->parseCurrentBlock(); } $mem->setHtml($tpl->get()); if (!ilObjCourseGrouping::_checkGroupingDependencies($this->container)) { $mem->setAlert($this->container->getMessage()); $this->enableRegistration(false); } $this->form->addItem($mem); }
/** * fill row * * @access public * @param * @return */ public function fillRow($a_set) { global $ilUser; include_once './Modules/Course/classes/class.ilObjCourseGrouping.php'; if (!ilObjCourseGrouping::_checkGroupingDependencies($this->getParentObject()->object, $a_set['usr_id']) and $ids = ilObjCourseGrouping::getAssignedObjects()) { $prefix = $this->getParentObject()->object->getType(); $this->tpl->setVariable('ALERT_MSG', sprintf($this->lng->txt($prefix . '_lim_assigned'), ilObject::_lookupTitle(current($ids)))); } $this->tpl->setVariable('VAL_ID', $a_set['usr_id']); $this->tpl->setVariable('VAL_NAME', $a_set['lastname'] . ', ' . $a_set['firstname']); foreach ($this->getSelectedColumns() as $field) { switch ($field) { case 'gender': $a_set['gender'] = $a_set['gender'] ? $this->lng->txt('gender_' . $a_set['gender']) : ''; $this->tpl->setCurrentBlock('custom_fields'); $this->tpl->setVariable('VAL_CUST', $a_set[$field]); $this->tpl->parseCurrentBlock(); break; case 'birthday': $a_set['birthday'] = $a_set['birthday'] ? ilDatePresentation::formatDate(new ilDate($a_set['birthday'], IL_CAL_DATE)) : $this->lng->txt('no_date'); $this->tpl->setCurrentBlock('custom_fields'); $this->tpl->setVariable('VAL_CUST', $a_set[$field]); $this->tpl->parseCurrentBlock(); break; case 'odf_last_update': $this->tpl->setVariable('VAL_CUST', (string) $a_set['odf_info_txt']); break; default: $this->tpl->setCurrentBlock('custom_fields'); $this->tpl->setVariable('VAL_CUST', isset($a_set[$field]) ? (string) $a_set[$field] : ''); $this->tpl->parseCurrentBlock(); break; } } $this->tpl->setVariable('VAL_SUBTIME', ilDatePresentation::formatDate(new ilDateTime($a_set['sub_time'], IL_CAL_UNIX))); $this->showActionLinks($a_set); if ($this->getShowSubject()) { if (strlen($a_set['subject'])) { $this->tpl->setCurrentBlock('subject'); $this->tpl->setVariable('VAL_SUBJECT', '"' . $a_set['subject'] . '"'); $this->tpl->parseCurrentBlock(); } else { $this->tpl->touchBlock('subject'); } } }
/** * fill row * * @access public * @param * @return */ public function fillRow($a_set) { global $ilUser; include_once './Modules/Course/classes/class.ilObjCourseGrouping.php'; if (!ilObjCourseGrouping::_checkGroupingDependencies($this->getParentObject()->object, $a_set['id']) and $ids = ilObjCourseGrouping::getAssignedObjects()) { $prefix = $this->getParentObject()->object->getType(); $this->tpl->setVariable('ALERT_MSG', sprintf($this->lng->txt($prefix . '_lim_assigned'), ilObject::_lookupTitle(current($ids)))); } $this->tpl->setVariable('VAL_ID', $a_set['id']); $this->tpl->setVariable('VAL_NAME', $a_set['name']); $this->tpl->setVariable('VAL_SUBTIME', ilDatePresentation::formatDate(new ilDateTime($a_set['sub_time'], IL_CAL_UNIX))); $this->tpl->setVariable('VAL_LOGIN', $a_set['login']); $this->ctrl->setParameterByClass(get_class($this->getParentObject()), 'member_id', $a_set['id']); $link = $this->ctrl->getLinkTargetByClass(get_class($this->getParentObject()), 'sendMailToSelectedUsers'); $this->tpl->setVariable('MAIL_LINK', $link); $this->tpl->setVariable('MAIL_TITLE', $this->lng->txt('crs_mem_send_mail')); if (strlen($a_set['subject'])) { $this->tpl->setVariable('VAL_SUBJECT', '"' . $a_set['subject'] . '"'); } }