コード例 #1
0
 /**
  * Constructor
  *
  * @access public
  * @param
  * 
  */
 public function __construct($a_ref_id)
 {
     global $ilCtrl, $tpl, $lng, $ilUser, $ilObjDataCache;
     $this->ctrl = $ilCtrl;
     $this->tpl = $tpl;
     $this->lng = $lng;
     $this->lng->loadLanguageModule('ps');
     $this->ref_id = $a_ref_id;
     $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
     $this->type = ilObject::_lookupType($this->obj_id);
     $this->fields_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($this->obj_id));
     $this->initFileSystemStorage();
 }
コード例 #2
0
 /**
  * Get selectable columns
  * @return 
  */
 public function getSelectableColumns()
 {
     global $ilSetting;
     $GLOBALS['lng']->loadLanguageModule('ps');
     if (self::$all_columns) {
         # return self::$all_columns;
     }
     include_once './Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
     $ef = ilExportFieldsInfo::_getInstanceByType($this->getParentObject()->object->getType());
     self::$all_columns = $ef->getSelectableFieldsInfo($this->getParentObject()->object->getId());
     if ($this->type == 'member' && $ilSetting->get('user_portfolios')) {
         self::$all_columns['prtf'] = array('txt' => $this->lng->txt('obj_prtf'), 'default' => false);
     }
     return self::$all_columns;
 }
 /**
  * Get selectable columns
  * @return 
  */
 public function getSelectableColumns()
 {
     if (self::$all_columns) {
         return self::$all_columns;
     }
     include_once './Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
     $ef = ilExportFieldsInfo::_getInstanceByType($this->getParentObject()->object->getType());
     self::$all_columns = $ef->getSelectableFieldsInfo($this->getParentObject()->object->getId());
     return self::$all_columns;
 }
コード例 #4
0
 /**
  * show agreement
  *
  * @access private
  * 
  */
 private function showAgreement($send_info = true)
 {
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.crs_user_agreement.html', 'Modules/Course');
     $this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this));
     if ($send_info) {
         $this->sendInfoMessage();
     }
     $this->showCourseDefinedFields();
     include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
     $fields_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($this->obj_id));
     foreach ($fields_info->getExportableFields() as $field) {
         $this->tpl->setCurrentBlock('field');
         $this->tpl->setVariable('FIELD_NAME', $this->lng->txt($field));
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable('AGREEMENT_HEADER', $this->lng->txt($this->type . '_agreement_header'));
     $this->tpl->setVariable('TXT_AGREEMENT', $this->lng->txt($this->type . '_user_agreement'));
     $this->tpl->setVariable('TXT_INFO_AGREEMENT', $this->lng->txt($this->type . '_info_agreement'));
     if ($this->privacy->confirmationRequired($this->type) or ilCourseDefinedFieldDefinition::_hasFields($this->obj_id)) {
         $this->tpl->setCurrentBlock('agreement');
         $this->tpl->setVariable('CHECK_AGREE', ilUtil::formCheckbox(0, 'agreed', 1));
         $this->tpl->setVariable('INFO_AGREE', $this->lng->txt($this->type . '_info_agree'));
         $this->tpl->setVariable('TXT_AGREE', $this->lng->txt($this->type . '_agree'));
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable('TXT_SAVE', $this->lng->txt('save'));
 }
コード例 #5
0
 /**
  * Show user agreement
  *
  * @access protected
  * @return
  */
 protected function fillAgreement()
 {
     global $ilUser;
     if (!$this->isRegistrationPossible()) {
         return true;
     }
     include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
     if (!$this->privacy->confirmationRequired($this->type) and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId())) {
         return true;
     }
     $this->lng->loadLanguageModule('ps');
     include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
     $fields_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($this->container->getId()));
     if (!count($fields_info->getExportableFields())) {
         return true;
     }
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('usr_agreement'));
     $this->form->addItem($section);
     include_once './Services/Membership/classes/class.ilMemberAgreementGUI.php';
     ilMemberAgreementGUI::addExportFieldInfo($this->form, $this->obj_id, $this->type);
     ilMemberAgreementGUI::addCustomFields($this->form, $this->obj_id, $this->type);
     // Checkbox agreement
     if ($this->privacy->confirmationRequired($this->type)) {
         ilMemberAgreementGUI::addAgreement($this->form, $this->obj_id, $this->type);
     }
     return true;
 }
コード例 #6
0
 /**
  * Get ordered enabled fields
  *
  * @access public
  * @param
  * 
  */
 protected function getOrderedExportableFields()
 {
     include_once 'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
     include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
     include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
     include_once 'Services/User/classes/class.ilUserDefinedFields.php';
     $field_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($this->obj_id));
     $fields[] = 'role';
     // Append agreement info
     $privacy = ilPrivacySettings::_getInstance();
     if ($privacy->courseConfirmationRequired() or ilCourseDefinedFieldDefinition::_hasFields($this->obj_id)) {
         $fields[] = 'agreement';
     }
     foreach ($field_info->getExportableFields() as $field) {
         if ($this->settings->enabled($field)) {
             $fields[] = $field;
         }
     }
     $udf = ilUserDefinedFields::_getInstance();
     foreach ($udf->getCourseExportableFields() as $field_id => $udf_data) {
         $fields[] = 'udf_' . $field_id;
     }
     // Add course specific fields
     foreach (ilCourseDefinedFieldDefinition::_getFields($this->obj_id) as $field_obj) {
         if ($this->settings->enabled('cdf_' . $field_obj->getId())) {
             $fields[] = 'cdf_' . $field_obj->getId();
         }
     }
     return $fields ? $fields : array();
 }
コード例 #7
0
 /**
  * Add export field info to form
  * @global type $lng
  * @param type $form
  * @param type $a_obj_id
  * @param type $a_type
  * @return type
  */
 public static function addExportFieldInfo($form, $a_obj_id, $a_type)
 {
     global $lng;
     include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
     $fields_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($a_obj_id));
     $fields = new ilCustomInputGUI($lng->txt($a_type . '_user_agreement'), '');
     $tpl = new ilTemplate('tpl.agreement_form.html', true, true, 'Services/Membership');
     $tpl->setVariable('TXT_INFO_AGREEMENT', $lng->txt($a_type . '_info_agreement'));
     foreach ($fields_info->getExportableFields() as $field) {
         $tpl->setCurrentBlock('field_item');
         $tpl->setVariable('FIELD_NAME', $lng->txt($field));
         $tpl->parseCurrentBlock();
     }
     $fields->setHtml($tpl->get());
     $form->addItem($fields);
     return $form;
 }
コード例 #8
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);
 }
コード例 #9
0
 /**
  * show information screen
  */
 function infoScreen()
 {
     global $rbacsystem, $ilUser, $ilSetting;
     $this->tabs_gui->setTabActive('info_short');
     if (!$rbacsystem->checkAccess("visible", $this->ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
     }
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     $info = new ilInfoScreenGUI($this);
     if (strlen($this->object->getInformation())) {
         $info->addSection($this->lng->txt('grp_general_informations'));
         $info->addProperty($this->lng->txt('grp_information'), nl2br(ilUtil::makeClickable($this->object->getInformation(), true)));
     }
     $info->enablePrivateNotes();
     $info->enableLearningProgress(true);
     $info->addSection($this->lng->txt('group_registration'));
     $info->showLDAPRoleGroupMappingInfo();
     if (!$this->object->isRegistrationEnabled()) {
         $info->addProperty($this->lng->txt('group_registration_mode'), $this->lng->txt('grp_reg_deac_info_screen'));
     } else {
         switch ($this->object->getRegistrationType()) {
             case GRP_REGISTRATION_DIRECT:
                 $info->addProperty($this->lng->txt('group_registration_mode'), $this->lng->txt('grp_reg_direct_info_screen'));
                 break;
             case GRP_REGISTRATION_REQUEST:
                 $info->addProperty($this->lng->txt('group_registration_mode'), $this->lng->txt('grp_reg_req_info_screen'));
                 break;
             case GRP_REGISTRATION_PASSWORD:
                 $info->addProperty($this->lng->txt('group_registration_mode'), $this->lng->txt('grp_reg_passwd_info_screen'));
                 break;
         }
         /*			
         $info->addProperty($this->lng->txt('group_registration_time'),
         	ilDatePresentation::formatPeriod(
         		$this->object->getRegistrationStart(),
         		$this->object->getRegistrationEnd()));
         */
         if ($this->object->isRegistrationUnlimited()) {
             $info->addProperty($this->lng->txt('group_registration_time'), $this->lng->txt('grp_registration_unlimited'));
         } elseif ($this->object->getRegistrationStart()->getUnixTime() < time()) {
             $info->addProperty($this->lng->txt("group_registration_time"), $this->lng->txt('cal_until') . ' ' . ilDatePresentation::formatDate($this->object->getRegistrationEnd()));
         } elseif ($this->object->getRegistrationStart()->getUnixTime() >= time()) {
             $info->addProperty($this->lng->txt("group_registration_time"), $this->lng->txt('cal_from') . ' ' . ilDatePresentation::formatDate($this->object->getRegistrationStart()));
         }
         if ($this->object->isMembershipLimited()) {
             $info->addProperty($this->lng->txt("mem_free_places"), max(0, $this->object->getMaxMembers() - $this->object->members_obj->getCountMembers()));
         }
     }
     // Confirmation
     include_once 'Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
     $privacy = ilPrivacySettings::_getInstance();
     include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
     if ($privacy->groupConfirmationRequired() or ilCourseDefinedFieldDefinition::_getFields($this->object->getId()) or $privacy->enabledGroupExport()) {
         include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
         $field_info = ilExportFieldsInfo::_getInstanceByType($this->object->getType());
         $this->lng->loadLanguageModule('ps');
         $info->addSection($this->lng->txt('grp_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_grp_user_fields'), $fields);
         }
     }
     // forward the command
     $this->ctrl->forwardCommand($info);
 }
コード例 #10
0
 /**
  * Show user agreement
  *
  * @access protected
  * @return
  */
 protected function fillAgreement()
 {
     global $ilUser;
     if (!$this->isRegistrationPossible()) {
         return true;
     }
     include_once 'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
     if (!$this->privacy->confirmationRequired($this->type) and !ilCourseDefinedFieldDefinition::_hasFields($this->container->getId())) {
         return true;
     }
     $this->lng->loadLanguageModule('ps');
     include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
     $fields_info = ilExportFieldsInfo::_getInstanceByType(ilObject::_lookupType($this->container->getId()));
     if (!count($fields_info->getExportableFields())) {
         return true;
     }
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('usr_agreement'));
     $this->form->addItem($section);
     $fields = new ilCustomInputGUI($this->lng->txt($this->type . '_user_agreement'), '');
     $tpl = new ilTemplate('tpl.agreement_form.html', true, true, 'Services/Membership');
     $tpl->setVariable('TXT_INFO_AGREEMENT', $this->lng->txt($this->type . '_info_agreement'));
     foreach ($fields_info->getExportableFields() as $field) {
         $tpl->setCurrentBlock('field_item');
         $tpl->setVariable('FIELD_NAME', $this->lng->txt($field));
         $tpl->parseCurrentBlock();
     }
     $fields->setHtml($tpl->get());
     $this->form->addItem($fields);
     $this->showCustomFields();
     // Checkbox agreement
     if ($this->privacy->confirmationRequired($this->type)) {
         $agreement = new ilCheckboxInputGUI($this->lng->txt($this->type . '_agree'), 'agreement');
         $agreement->setRequired(true);
         $agreement->setOptionTitle($this->lng->txt($this->type . '_info_agree'));
         $agreement->setValue(1);
         $this->form->addItem($agreement);
     }
     return true;
 }