/**
  * build property form for extended category settings
  *
  * @access protected
  */
 protected function initExtendedSettings()
 {
     if (is_object($this->form)) {
         return true;
     }
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this));
     $this->form->setTitle($this->lng->txt('ext_cat_settings'));
     $this->form->addCommandButton('updateInfo', $this->lng->txt('save'));
     $this->form->addCommandButton('editInfo', $this->lng->txt('cancel'));
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'cat', $this->object->getId());
     $record_gui->setPropertyForm($this->form);
     $record_gui->parse();
     return true;
 }
 /**
  * Init filter
  */
 function initFilter()
 {
     global $lng, $rbacreview, $ilUser, $ilDB;
     // term
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ti = new ilTextInputGUI($lng->txt("cont_term"), "term");
     $ti->setMaxLength(64);
     $ti->setSize(20);
     $ti->setSubmitFormOnEnter(true);
     $this->addFilterItem($ti);
     $ti->readFromSession();
     $this->filter["term"] = $ti->getValue();
     // definition
     if ($ilDB->getDBType() != "oracle") {
         include_once "./Services/Form/classes/class.ilTextInputGUI.php";
         $ti = new ilTextInputGUI($lng->txt("cont_definition"), "defintion");
         $ti->setMaxLength(64);
         $ti->setSize(20);
         $ti->setSubmitFormOnEnter(true);
         $this->addFilterItem($ti);
         $ti->readFromSession();
         $this->filter["definition"] = $ti->getValue();
     }
     // advanced metadata
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_FILTER, 'glo', $this->glossary->getId(), 'term');
     $record_gui->setSelectedOnly(true);
     $record_gui->setTableGUI($this);
     $record_gui->parse();
 }
예제 #3
0
 /**
  * show information screen
  */
 function infoScreen()
 {
     global $ilAccess, $ilCtrl;
     if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
     }
     if (!$this->info_screen_enabled) {
         return;
     }
     // #10986
     $this->tabs_gui->setTabActive('info_short');
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     $info = new ilInfoScreenGUI($this);
     $info->enablePrivateNotes();
     if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
         $info->enableNews();
     }
     // no news editing for files, just notifications
     $info->enableNewsEditing(false);
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         $news_set = new ilSetting("news");
         $enable_internal_rss = $news_set->get("enable_rss_for_internal");
         if ($enable_internal_rss) {
             $info->setBlockProperty("news", "settings", true);
             $info->setBlockProperty("news", "public_notifications_option", true);
         }
     }
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'cat', $this->object->getId());
     $record_gui->setInfoObject($info);
     $record_gui->parse();
     // standard meta data
     $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
     // forward the command
     if ($ilCtrl->getNextClass() == "ilinfoscreengui") {
         $ilCtrl->forwardCommand($info);
     } else {
         return $ilCtrl->getHTML($info);
     }
 }
예제 #4
0
 /**
  * Update Advanced Metadata
  */
 protected function updateAdvancedSettings()
 {
     if (!$this->ilAccess->checkAccess("write", "", $this->ref_id)) {
         ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
         $this->ctrl->redirect($this);
     }
     $form = $this->initAdvancedSettingsForm();
     $gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'orgu', $this->object->getId(), 'orgu_type', $this->object->getOrgUnitTypeId());
     $gui->setPropertyForm($form);
     $gui->setSelectedOnly(true);
     $form->checkInput();
     $gui->parse();
     if ($gui->importEditFormPostValues()) {
         $gui->writeEditForm();
         ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
         $this->ctrl->redirect($this, 'editAdvancedSettings');
     } else {
         $this->tpl->setContent($form->getHTML());
     }
 }
예제 #5
0
 /**
  * show information screen
  */
 function infoScreen()
 {
     global $ilErr, $ilAccess, $ilUser, $ilSetting;
     $this->checkPermission('visible');
     // Fill meta header tags
     include_once 'Services/MetaData/classes/class.ilMDUtils.php';
     ilMDUtils::_fillHTMLMetaTags($this->object->getId(), $this->object->getId(), 'crs');
     $this->tabs_gui->setTabActive('info_short');
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     include_once 'Modules/Course/classes/class.ilCourseFile.php';
     $files =& ilCourseFile::_readFilesByCourse($this->object->getId());
     $info = new ilInfoScreenGUI($this);
     $info->enablePrivateNotes();
     $info->enableFeedback();
     $info->enableNews();
     if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
         $info->enableNewsEditing();
     }
     if (strlen($this->object->getImportantInformation()) or strlen($this->object->getSyllabus()) or count($files)) {
         $info->addSection($this->lng->txt('crs_general_informations'));
     }
     if (strlen($this->object->getImportantInformation())) {
         $info->addProperty($this->lng->txt('crs_important_info'), "<strong>" . nl2br(ilUtil::makeClickable($this->object->getImportantInformation(), true) . "</strong>"));
     }
     if (strlen($this->object->getSyllabus())) {
         $info->addProperty($this->lng->txt('crs_syllabus'), nl2br(ilUtil::makeClickable($this->object->getSyllabus(), true)));
     }
     // files
     if (count($files)) {
         $tpl = new ilTemplate('tpl.event_info_file.html', true, true, 'Modules/Course');
         foreach ($files as $file) {
             $tpl->setCurrentBlock("files");
             $this->ctrl->setParameter($this, 'file_id', $file->getFileId());
             $tpl->setVariable("DOWN_LINK", $this->ctrl->getLinkTarget($this, 'sendfile'));
             $tpl->setVariable("DOWN_NAME", $file->getFileName());
             $tpl->setVariable("DOWN_INFO_TXT", $this->lng->txt('crs_file_size_info'));
             $tpl->setVariable("DOWN_SIZE", $file->getFileSize());
             $tpl->setVariable("TXT_BYTES", $this->lng->txt('bytes'));
             $tpl->parseCurrentBlock();
         }
         $info->addProperty($this->lng->txt('crs_file_download'), $tpl->get());
     }
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'crs', $this->object->getId());
     $record_gui->setInfoObject($info);
     $record_gui->parse();
     // meta data
     $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
     // contact
     if ($this->object->hasContactData()) {
         $info->addSection($this->lng->txt("crs_contact"));
     }
     if (strlen($this->object->getContactName())) {
         $info->addProperty($this->lng->txt("crs_contact_name"), $this->object->getContactName());
     }
     if (strlen($this->object->getContactResponsibility())) {
         $info->addProperty($this->lng->txt("crs_contact_responsibility"), $this->object->getContactResponsibility());
     }
     if (strlen($this->object->getContactPhone())) {
         $info->addProperty($this->lng->txt("crs_contact_phone"), $this->object->getContactPhone());
     }
     if ($this->object->getContactEmail()) {
         require_once 'Services/Mail/classes/class.ilMailFormCall.php';
         $emails = split(",", $this->object->getContactEmail());
         foreach ($emails as $email) {
             $email = trim($email);
             $etpl = new ilTemplate("tpl.crs_contact_email.html", true, true, 'Modules/Course');
             $etpl->setVariable("EMAIL_LINK", ilMailFormCall::getLinkTarget($info, 'showSummary', array(), array('type' => 'new', 'rcp_to' => $email, 'sig' => $this->createMailSignature())));
             $etpl->setVariable("CONTACT_EMAIL", $email);
             $mailString .= $etpl->get() . "<br />";
         }
         $info->addProperty($this->lng->txt("crs_contact_email"), $mailString);
     }
     if (strlen($this->object->getContactConsultation())) {
         $info->addProperty($this->lng->txt("crs_contact_consultation"), nl2br($this->object->getContactConsultation()));
     }
     //
     // access
     //
     // #10360
     $this->lng->loadLanguageModule("rep");
     $info->addSection($this->lng->txt("rep_activation_availability"));
     $info->showLDAPRoleGroupMappingInfo();
     // activation
     if ($this->object->getActivationUnlimitedStatus()) {
         $info->addProperty($this->lng->txt("rep_activation_access"), $this->lng->txt('crs_visibility_limitless'));
     } else {
         $info->addProperty($this->lng->txt('rep_activation_access'), ilDatePresentation::formatPeriod(new ilDateTime($this->object->getActivationStart(), IL_CAL_UNIX), new ilDateTime($this->object->getActivationEnd(), IL_CAL_UNIX)));
     }
     switch ($this->object->getSubscriptionLimitationType()) {
         case IL_CRS_SUBSCRIPTION_DEACTIVATED:
             $txt = $this->lng->txt("crs_info_reg_deactivated");
             break;
         default:
             switch ($this->object->getSubscriptionType()) {
                 case IL_CRS_SUBSCRIPTION_CONFIRMATION:
                     $txt = $this->lng->txt("crs_info_reg_confirmation");
                     break;
                 case IL_CRS_SUBSCRIPTION_DIRECT:
                     $txt = $this->lng->txt("crs_info_reg_direct");
                     break;
                 case IL_CRS_SUBSCRIPTION_PASSWORD:
                     $txt = $this->lng->txt("crs_info_reg_password");
                     break;
             }
     }
     // subscription
     $info->addProperty($this->lng->txt("crs_info_reg"), $txt);
     if ($this->object->getSubscriptionLimitationType() != IL_CRS_SUBSCRIPTION_DEACTIVATED) {
         if ($this->object->getSubscriptionUnlimitedStatus()) {
             $info->addProperty($this->lng->txt("crs_reg_until"), $this->lng->txt('crs_unlimited'));
         } elseif ($this->object->getSubscriptionStart() < time()) {
             $info->addProperty($this->lng->txt("crs_reg_until"), $this->lng->txt('crs_to') . ' ' . ilDatePresentation::formatDate(new ilDateTime($this->object->getSubscriptionEnd(), IL_CAL_UNIX)));
         } elseif ($this->object->getSubscriptionStart() > time()) {
             $info->addProperty($this->lng->txt("crs_reg_until"), $this->lng->txt('crs_from') . ' ' . ilDatePresentation::formatDate(new ilDateTime($this->object->getSubscriptionStart(), IL_CAL_UNIX)));
         }
         if ($this->object->isSubscriptionMembershipLimited()) {
             include_once './Services/Membership/classes/class.ilParticipants.php';
             $info->addProperty($this->lng->txt("mem_free_places"), max(0, $this->object->getSubscriptionMaxMembers() - ilParticipants::lookupNumberOfMembers($this->object->getRefId())));
         }
     }
     // archive
     if ($this->object->getViewMode() == IL_CRS_VIEW_ARCHIVE) {
         if ($this->object->getArchiveType() != IL_CRS_ARCHIVE_NONE) {
             $info->addProperty($this->lng->txt("crs_archive"), ilDatePresentation::formatPeriod(new ilDateTime($this->object->getArchiveStart(), IL_CAL_UNIX), new ilDateTime($this->object->getArchiveStart(), IL_CAL_UNIX)));
         }
     }
     // Confirmation
     include_once 'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
     $privacy = ilPrivacySettings::_getInstance();
     include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
     if ($privacy->courseConfirmationRequired() or ilCourseDefinedFieldDefinition::_getFields($this->object->getId()) or $privacy->enabledCourseExport()) {
         include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
         $field_info = ilExportFieldsInfo::_getInstanceByType($this->object->getType());
         $this->lng->loadLanguageModule('ps');
         $info->addSection($this->lng->txt('crs_user_agreement_info'));
         $info->addProperty($this->lng->txt('ps_export_data'), $field_info->exportableFieldsToInfoString());
         if ($fields = ilCourseDefinedFieldDefinition::_fieldsToInfoString($this->object->getId())) {
             $info->addProperty($this->lng->txt('ps_crs_user_fields'), $fields);
         }
     }
     $info->enableLearningProgress(true);
     // forward the command
     $this->ctrl->forwardCommand($info);
 }
 /**
  * 
  *
  * @access protected
  */
 protected function initAdvancedMetaDataForm()
 {
     if (is_object($this->form)) {
         return $this->form;
     }
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php';
     include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $this->form = new ilPropertyFormGUI();
     $this->form->setFormAction($this->ctrl->getFormAction($this, 'performAdvMDSearch'));
     $this->form->setTitle($this->lng->txt('adv_md_search_title'));
     $this->form->addCommandButton('performAdvMDSearch', $this->lng->txt('search'));
     #$this->form->setSubformMode('right');
     $content = new ilTextInputGUI($this->lng->txt('meta_title') . '/' . $this->lng->txt('meta_keyword') . '/' . $this->lng->txt('meta_description'), 'title');
     $content->setValue($this->options['title']);
     $content->setSize(30);
     $content->setMaxLength(255);
     //		$content->setSubformMode('right');
     $group = new ilRadioGroupInputGUI('', 'title_ao');
     $group->setValue($this->options['title_ao']);
     $radio_option = new ilRadioOption($this->lng->txt("search_any_word"), 0);
     $group->addOption($radio_option);
     $radio_option = new ilRadioOption($this->lng->txt("search_all_words"), 1);
     $group->addOption($radio_option);
     $content->addSubItem($group);
     $this->form->addItem($content);
     $type = new ilSelectInputGUI($this->lng->txt('type'), 'type');
     $options['adv_all'] = $this->lng->txt('search_any');
     foreach (ilAdvancedMDRecord::_getActivatedObjTypes() as $obj_type) {
         $options[$obj_type] = $this->lng->txt('objs_' . $obj_type);
     }
     $type->setOptions($options);
     $type->setValue($this->options['type']);
     $this->form->addItem($type);
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_SEARCH);
     $record_gui->setPropertyForm($this->form);
     $record_gui->setSearchValues($this->options);
     $record_gui->parse();
 }
 /**
  * Init edit settings form
  *
  * @return ilPropertyFormGUI
  */
 protected function initEditForm()
 {
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->setTitle($this->lng->txt('ecs_general_info'));
     $form->addCommandButton('update', $this->lng->txt('save'));
     $form->addCommandButton('edit', $this->lng->txt('cancel'));
     $text = new ilTextInputGUI($this->lng->txt('title'), 'title');
     $text->setValue($this->object->getTitle());
     $text->setSize(40);
     $text->setMaxLength(128);
     $text->setDisabled(true);
     $form->addItem($text);
     $area = new ilTextAreaInputGUI($this->lng->txt('description'), 'description');
     $area->setValue($this->object->getDescription());
     $area->setRows(3);
     $area->setCols(80);
     $area->setDisabled(true);
     $form->addItem($area);
     $area = new ilTextAreaInputGUI($this->lng->txt('ecs_local_information'), 'local_info');
     $area->setValue($this->object->getLocalInformation());
     $area->setRows(3);
     $area->setCols(80);
     $form->addItem($area);
     $this->addCustomEditForm($form);
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, $this->getType(), $this->object->getId());
     $record_gui->setPropertyForm($form);
     $record_gui->parse();
     return $form;
 }
 /**
  * Get edit term form
  *
  * @param
  * @return
  */
 function getEditTermForm()
 {
     global $ilTabs, $ilCtrl;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, "updateTerm"));
     $form->setTitle($this->lng->txt("cont_edit_term"));
     $term = new ilTextInputGUI($this->lng->txt("cont_term"), "term");
     $term->setRequired(true);
     $term->setValue($this->term->getTerm());
     $form->addItem($term);
     $lang = new ilSelectInputGUI($this->lng->txt("language"), "term_language");
     $lang->setRequired(true);
     $lang->setOptions(ilMDLanguageItem::_getLanguages());
     $lang->setValue($this->term->getLanguage());
     $form->addItem($lang);
     // taxonomy
     if ($this->glossary->getTaxonomyId() > 0) {
         include_once "./Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php";
         $tax_node_assign = new ilTaxSelectInputGUI($this->glossary->getTaxonomyId(), "tax_node", true);
         include_once "./Services/Taxonomy/classes/class.ilTaxNodeAssignment.php";
         $ta = new ilTaxNodeAssignment("glo", $this->glossary->getId(), "term", $this->glossary->getTaxonomyId());
         $assgnmts = $ta->getAssignmentsOfItem($this->term->getId());
         $node_ids = array();
         foreach ($assgnmts as $a) {
             $node_ids[] = $a["node_id"];
         }
         $tax_node_assign->setValue($node_ids);
         $form->addItem($tax_node_assign);
     }
     // advanced metadata
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'glo', $this->glossary->getId(), 'term', $this->term->getId());
     $record_gui->setPropertyForm($form);
     $record_gui->setSelectedOnly(true);
     $record_gui->parse();
     $form->addCommandButton("updateTerm", $this->lng->txt("save"));
     return $form;
 }
 /**
  * init info editor
  *
  * @access public
  * @param
  * 
  */
 public function initInfoEditor()
 {
     include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this, 'updateInfo'));
     $form->setMultipart(true);
     $form->setTitle($this->lng->txt('crs_general_info'));
     $form->addCommandButton('updateInfo', $this->lng->txt('save'));
     $form->addCommandButton('cancel', $this->lng->txt('cancel'));
     $area = new ilTextAreaInputGUI($this->lng->txt('crs_important_info'), 'important');
     $area->setValue($this->object->getImportantInformation());
     $area->setRows(6);
     $area->setCols(80);
     $form->addItem($area);
     $area = new ilTextAreaInputGUI($this->lng->txt('crs_syllabus'), 'syllabus');
     $area->setValue($this->object->getSyllabus());
     $area->setRows(6);
     $area->setCols(80);
     $form->addItem($area);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('crs_info_download'));
     $form->addItem($section);
     $file = new ilFileInputGUI($this->lng->txt('crs_file'), 'file');
     $file->enableFileNameSelection('file_name');
     $form->addItem($file);
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('crs_contact'));
     $form->addItem($section);
     $text = new ilTextInputGUI($this->lng->txt('crs_contact_name'), 'contact_name');
     $text->setValue($this->object->getContactName());
     $text->setSize(40);
     $text->setMaxLength(70);
     $form->addItem($text);
     $text = new ilTextInputGUI($this->lng->txt('crs_contact_responsibility'), 'contact_responsibility');
     $text->setValue($this->object->getContactResponsibility());
     $text->setSize(40);
     $text->setMaxLength(70);
     $form->addItem($text);
     $text = new ilTextInputGUI($this->lng->txt('crs_contact_phone'), 'contact_phone');
     $text->setValue($this->object->getContactPhone());
     $text->setSize(40);
     $text->setMaxLength(40);
     $form->addItem($text);
     $text = new ilTextInputGUI($this->lng->txt('crs_contact_email'), 'contact_email');
     $text->setValue($this->object->getContactEmail());
     $text->setInfo($this->lng->txt('crs_contact_email_info'));
     $text->setSize(40);
     $text->setMaxLength(255);
     $form->addItem($text);
     $area = new ilTextAreaInputGUI($this->lng->txt('crs_contact_consultation'), 'contact_consultation');
     $area->setValue($this->object->getContactConsultation());
     $area->setRows(6);
     $area->setCols(80);
     $form->addItem($area);
     include_once 'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php';
     $record_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'crs', $this->object->getId());
     $record_gui->setPropertyForm($form);
     $record_gui->parse();
     return $form;
 }