protected function buildJson(ilECSSetting $a_server)
 {
     global $ilLog;
     $json = $this->getJsonCore('application/ecs-course');
     // meta language
     include_once './Services/MetaData/classes/class.ilMDLanguage.php';
     $lang = ilMDLanguage::_lookupFirstLanguage($this->content_obj->getId(), $this->content_obj->getId(), $this->content_obj->getType());
     if (strlen($lang)) {
         $json->lang = $lang . '_' . strtoupper($lang);
     }
     $json->status = $this->content_obj->isActivated() ? 'online' : 'offline';
     include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
     $definition = ilECSUtils::getEContentDefinition($this->getECSObjectType());
     $this->addMetadataToJson($json, $a_server, $definition);
     return $json;
 }
 /**
  * get strong presentation of participants 
  * @param
  * @return
  */
 public function participantsToString()
 {
     include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
     $part_string = "";
     $part = explode(',', $this->getMappingValue());
     $counter = 0;
     foreach ($part as $part_id) {
         if ($counter++) {
             $part_string .= ', ';
         }
         $part_string .= '"';
         if ($name = ilECSUtils::lookupParticipantName($part_id)) {
             $part_string .= $name;
         } else {
             $part_string .= $part_id;
         }
         $part_string .= '"';
     }
     return $part_string;
 }
 /**
  * Show released materials 
  *
  * @access protected
  * @return
  */
 protected function released()
 {
     global $ilUser, $ilToolbar;
     $this->tabs_gui->setSubTabActive('ecs_released');
     if ($this->settings->isEnabled()) {
         $ilToolbar->addButton($this->lng->txt('ecs_read_remote_links'), $this->ctrl->getLinkTarget($this, 'readAll'));
         $ilToolbar->addSeparator();
     }
     $sel_type = $_REQUEST["otype"];
     if (!$sel_type) {
         $sel_type = "rcrs";
     }
     include "Services/WebServices/ECS/classes/class.ilECSUtils.php";
     $options = ilECSUtils::getPossibleReleaseTypes(true);
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $sel = new ilSelectInputGUI("", "otype");
     $sel->setOptions($options);
     $sel->setValue($sel_type);
     $ilToolbar->addInputItem($sel);
     $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "released"));
     $ilToolbar->addFormButton($this->lng->txt("submit"), "released");
     include_once './Services/WebServices/ECS/classes/class.ilECSExport.php';
     $exported = ilECSExport::getExportedIdsByType($sel_type);
     if (count($exported)) {
         $ilToolbar->addSeparator();
         $ilToolbar->addButton($this->lng->txt('csv_export'), $this->ctrl->getLinkTarget($this, 'exportReleased'));
     }
     include_once 'Services/WebServices/ECS/classes/class.ilECSReleasedContentTableGUI.php';
     $table_gui = new ilECSReleasedContentTableGUI($this, 'released');
     $table_gui->setTitle($this->lng->txt('ecs_released_content'));
     $table_gui->parse($exported);
     $this->tpl->setContent($table_gui->getHTML());
     return true;
 }
 /**
  * Reread all imported econtent.
  *
  * @return bool
  * @static
  * throws ilException, ilECSConnectorException
  */
 public static function handleImportReset(ilECSSetting $server)
 {
     global $ilLog;
     include_once 'Services/WebServices/ECS/classes/class.ilECSConnector.php';
     include_once 'Services/WebServices/ECS/classes/class.ilECSConnectorException.php';
     try {
         include_once './Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
         include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
         include_once './Services/WebServices/ECS/classes/class.ilECSExport.php';
         $types = self::getAllEContentTypes();
         $event_queue = new ilECSEventQueueReader($server->getServerId());
         $event_queue->deleteAllEContentEvents($types);
         $list = self::getAllResourceIds($server, $types);
         $imported = ilECSImport::getAllImportedRemoteObjects($server->getServerId());
         $GLOBALS['ilLog']->write(__METHOD__ . ': Imported = ' . print_r($imported, true));
         $GLOBALS['ilLog']->write(__METHOD__ . ': List = ' . print_r($list, true));
         foreach ($list as $resource_type => $link_ids) {
             if (!in_array($resource_type, ilECSUtils::getPossibleRemoteTypes())) {
                 $GLOBALS['ilLog']->write(__METHOD__ . ': Ignoring resource type ' . $resource_type);
                 continue;
             }
             foreach ((array) $link_ids as $link_id) {
                 if (!isset($imported[$link_id])) {
                     // Add create event for not imported econtent
                     $event_queue->add($resource_type, $link_id, ilECSEvent::CREATED);
                 } else {
                     // Add update event for already existing events
                     $event_queue->add($resource_type, $link_id, ilECSEvent::UPDATED);
                 }
                 if (isset($imported[$link_id])) {
                     unset($imported[$link_id]);
                 }
             }
         }
         if (is_array($imported)) {
             // Delete event for deprecated econtent
             include_once 'Services/WebServices/ECS/classes/class.ilECSObjectSettings.php';
             foreach ($imported as $econtent_id => $obj_id) {
                 $type = self::getEventTypeFromObjectType(ilObject::_lookupType($obj_id));
                 if ($type) {
                     $event_queue->add($type, $econtent_id, ilECSEvent::DESTROYED);
                 }
             }
         }
     } catch (ilECSConnectorException $e1) {
         $ilLog->write('Cannot connect to ECS server: ' . $e1->getMessage());
         throw $e1;
     } catch (ilException $e2) {
         $ilLog->write('Update failed: ' . $e2->getMessage());
         throw $e2;
     }
     return true;
 }
 /**
  * export released
  *
  * @access protected
  * @return
  */
 protected function exportReleased()
 {
     global $ilObjDataCache;
     include_once './Services/WebServices/ECS/classes/class.ilECSExport.php';
     $exported = ilECSExport::getExportedIds();
     $ilObjDataCache->preloadObjectCache($exported);
     include_once 'Services/Utilities/classes/class.ilCSVWriter.php';
     $writer = new ilCSVWriter();
     $writer->addColumn($this->lng->txt('title'));
     $writer->addColumn($this->lng->txt('description'));
     $writer->addColumn($this->lng->txt('ecs_field_courseID'));
     $writer->addColumn($this->lng->txt('ecs_field_term'));
     $writer->addColumn($this->lng->txt('ecs_field_lecturer'));
     $writer->addColumn($this->lng->txt('ecs_field_courseType'));
     $writer->addColumn($this->lng->txt('ecs_field_semester_hours'));
     $writer->addColumn($this->lng->txt('ecs_field_credits'));
     $writer->addColumn($this->lng->txt('ecs_field_room'));
     $writer->addColumn($this->lng->txt('ecs_field_cycle'));
     $writer->addColumn($this->lng->txt('ecs_field_begin'));
     $writer->addColumn($this->lng->txt('ecs_field_end'));
     $writer->addColumn($this->lng->txt('last_update'));
     include_once './Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
     $settings = ilECSDataMappingSettings::_getInstance();
     foreach ($exported as $obj_id) {
         include_once "Services/WebServices/ECS/classes/class.ilECSUtils.php";
         $values = ilECSUtils::getAdvancedMDValuesForObjId($obj_id);
         $writer->addRow();
         $writer->addColumn(ilObject::_lookupTitle($obj_id));
         $writer->addColumn(ilObject::_lookupDescription($obj_id));
         $field = $settings->getMappingByECSName('courseID');
         $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
         $field = $settings->getMappingByECSName('term');
         $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
         $field = $settings->getMappingByECSName('lecturer');
         $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
         $field = $settings->getMappingByECSName('courseType');
         $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
         $field = $settings->getMappingByECSName('semester_hours');
         $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
         $field = $settings->getMappingByECSName('credits');
         $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
         $field = $settings->getMappingByECSName('room');
         $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
         $field = $settings->getMappingByECSName('cycle');
         $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
         $field = $settings->getMappingByECSName('begin');
         $writer->addColumn(isset($values[$field]) ? ilFormat::formatUnixTime($values[$field], true) : '');
         $field = $settings->getMappingByECSName('end');
         $writer->addColumn(isset($values[$field]) ? ilFormat::formatUnixTime($values[$field], true) : '');
         $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
     }
     ilUtil::deliverData($writer->getCSVString(), date("Y_m_d") . "_ecs_export.csv", "text/csv");
 }
 /**
  * update remote object settings from ecs content
  *
  * @param ilECSSetting $a_server
  * @param object $a_ecs_content object with object settings
  * @param int $a_owner
  */
 public function updateFromECSContent(ilECSSetting $a_server, $a_ecs_content, $a_owner)
 {
     global $ilLog;
     $ilLog->write('updateFromECSContent: ' . print_r($a_ecs_content, true));
     // Get organisation for owner (ObjectListGUI performance)
     $organisation = null;
     if ($a_owner) {
         include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
         $organisation = ilECSUtils::lookupParticipantName($a_owner, $a_server->getServerId());
         $ilLog->write('found organisation: ' . $organisation);
     }
     $this->setMID($a_owner);
     // obsolete?
     $this->setOrganization($organisation);
     $this->setTitle($a_ecs_content->title);
     $this->setDescription($a_ecs_content->abstract);
     $this->setRemoteLink($a_ecs_content->url);
     $ilLog->write('updateCustomFromECSContent');
     $this->updateCustomFromECSContent($a_server, $a_ecs_content);
     // we are updating late so custom values can be set
     $ilLog->write('ilObject->update()');
     $this->update();
     include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
     $matchable_content = ilECSUtils::getMatchableContent($this->getECSObjectType(), $a_server->getServerId(), $a_ecs_content, $a_owner);
     // rule-based category mapping
     include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
     ilECSCategoryMapping::handleUpdate($this->getId(), $a_server->getServerId(), $matchable_content);
 }
 protected function updateCustomFromECSContent(ilECSSetting $a_server, $a_ecs_content)
 {
     // add custom values
     $this->setAvailabilityType($a_ecs_content->status == 'online' ? self::ACTIVATION_UNLIMITED : self::ACTIVATION_OFFLINE);
     // :TODO: ACTIVATION_LIMITED is currently not supported in ECS yet
     // adv. metadata
     include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
     include_once './Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
     $definition = ilECSUtils::getEContentDefinition($this->getECSObjectType());
     $this->importMetadataFromJson($a_ecs_content, $a_server, $definition, ilECSDataMappingSetting::MAPPING_IMPORT_RCRS);
     include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
     $import = new ilECSImport($a_server->getServerId(), $this->getId());
     $import->setContentId($a_ecs_content->courseID);
     $import->save();
 }
 /**
  * Fill row
  *
  * @access public
  * @param array row data
  * 
  */
 public function fillRow($a_set)
 {
     global $tree;
     include_once './Services/Link/classes/class.ilLink.php';
     $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
     #$this->tpl->setVariable('VAL_LINK',ilLink::_getLink($a_set['ref_id'],'rcrs'));
     $this->tpl->setVariable('VAL_DESC', $a_set['desc']);
     $this->tpl->setVariable('VAL_REMOTE', $a_set['from']);
     $this->tpl->setVariable('VAL_REMOTE_INFO', $a_set['from_info']);
     $this->tpl->setVariable('TXT_EMAIL', $this->lng->txt('ecs_email'));
     $this->tpl->setVariable('TXT_DNS', $this->lng->txt('ecs_dns'));
     $this->tpl->setVariable('TXT_ABR', $this->lng->txt('ecs_abr'));
     $this->tpl->setVariable('VAL_LAST_UPDATE', ilDatePresentation::formatDate(new ilDateTime($a_set['last_update'], IL_CAL_DATETIME)));
     // Links
     foreach (ilObject::_getAllReferences($a_set['obj_id']) as $ref_id) {
         $parent = $tree->getParentId($ref_id);
         $p_obj_id = ilObject::_lookupObjId($parent);
         $p_title = ilObject::_lookupTitle($p_obj_id);
         $p_type = ilObject::_lookupType($p_obj_id);
         $this->tpl->setCurrentBlock('link');
         $this->tpl->setVariable('LINK_IMG', ilUtil::getTypeIconPath($p_type, $p_obj_id, 'tiny'));
         $this->tpl->setVariable('LINK_CONTAINER', $p_title);
         $this->tpl->setVariable('LINK_LINK', ilLink::_getLink($parent, $p_type));
         $this->tpl->parseCurrentBlock();
     }
     $this->tpl->setVariable('TXT_TERM', $this->lng->txt('ecs_field_term'));
     $this->tpl->setVariable('TXT_CRS_TYPE', $this->lng->txt('ecs_field_courseType'));
     $this->tpl->setVariable('TXT_CRS_ID', $this->lng->txt('ecs_field_courseID'));
     $this->tpl->setVariable('TXT_CREDITS', $this->lng->txt('ecs_field_credits'));
     $this->tpl->setVariable('TXT_ROOM', $this->lng->txt('ecs_field_room'));
     $this->tpl->setVariable('TXT_CYCLE', $this->lng->txt('ecs_field_cycle'));
     $this->tpl->setVariable('TXT_SWS', $this->lng->txt('ecs_field_semester_hours'));
     $this->tpl->setVariable('TXT_START', $this->lng->txt('ecs_field_begin'));
     $this->tpl->setVariable('TXT_END', $this->lng->txt('ecs_field_end'));
     $this->tpl->setVariable('TXT_LECTURER', $this->lng->txt('ecs_field_lecturer'));
     include_once './Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
     $settings = ilECSDataMappingSettings::getInstanceByServerId($a_set['sid']);
     include_once "Services/WebServices/ECS/classes/class.ilECSUtils.php";
     $values = ilECSUtils::getAdvancedMDValuesForObjId($a_set['obj_id']);
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'lecturer')) {
         $this->tpl->setVariable('VAL_LECTURER', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'term')) {
         $this->tpl->setVariable('VAL_TERM', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'courseID')) {
         $this->tpl->setVariable('VAL_CRS_ID', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'courseType')) {
         $this->tpl->setVariable('VAL_CRS_TYPE', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'credits')) {
         $this->tpl->setVariable('VAL_CREDITS', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'semester_hours')) {
         $this->tpl->setVariable('VAL_SWS', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'room')) {
         $this->tpl->setVariable('VAL_ROOM', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'cycle')) {
         $this->tpl->setVariable('VAL_CYCLE', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'begin')) {
         $this->tpl->setVariable('VAL_START', isset($values[$field]) ? ilDatePresentation::formatDate(new ilDateTime($values[$field], IL_CAL_UNIX)) : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'end')) {
         $this->tpl->setVariable('VAL_END', isset($values[$field]) ? ilDatePresentation::formatDate(new ilDateTime($values[$field], IL_CAL_UNIX)) : '--');
     }
 }
 /**
  * 
  *
  * @return
  * @static
  */
 public static function getPossibleFields()
 {
     global $lng;
     $options = array("community" => $lng->txt("ecs_field_community"), "part_id" => $lng->txt("ecs_field_part_id"), "type" => $lng->txt("type"));
     // will be handled by server soon?
     // only courses for now
     include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
     $course_fields = ilECSUtils::_getOptionalECourseFields();
     foreach ($course_fields as $field) {
         $options[$field] = $lng->txt("obj_rcrs") . " - " . $lng->txt("ecs_field_" . $field);
     }
     return $options;
 }
 /**
  * Init settings form
  */
 protected function initFormSettings()
 {
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->getCtrl()->getFormAction($this));
     $form->setTitle($this->getLang()->txt('ecs_part_settings') . ' ' . $this->getParticipant()->getTitle());
     $token = new ilCheckboxInputGUI($this->getLang()->txt('ecs_token_mechanism'), 'token');
     $token->setInfo($this->getLang()->txt('ecs_token_mechanism_info'));
     $token->setValue(1);
     $token->setChecked($this->getParticipant()->isTokenEnabled());
     $form->addItem($token);
     $dtoken = new ilCheckboxInputGUI($this->getLang()->txt('ecs_deprecated_token'), 'dtoken');
     $dtoken->setInfo($this->getLang()->txt('ecs_deprecated_token_info'));
     $dtoken->setValue(1);
     $dtoken->setChecked($this->getParticipant()->isDeprecatedTokenEnabled());
     $form->addItem($dtoken);
     // Export
     $export = new ilCheckboxInputGUI($this->getLang()->txt('ecs_tbl_export'), 'export');
     $export->setValue(1);
     $export->setChecked($this->getParticipant()->isExportEnabled());
     $form->addItem($export);
     // Export types
     $obj_types = new ilCheckboxGroupInputGUI($this->getLang()->txt('ecs_export_types'), 'export_types');
     $obj_types->setValue($this->getParticipant()->getExportTypes());
     include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
     foreach (ilECSUtils::getPossibleReleaseTypes(TRUE) as $type => $trans) {
         $obj_types->addOption(new ilCheckboxOption($trans, $type));
     }
     $export->addSubItem($obj_types);
     // Import
     $import = new ilCheckboxInputGUI($this->getLang()->txt('ecs_tbl_import'), 'import');
     $import->setValue(1);
     $import->setChecked($this->getParticipant()->isImportEnabled());
     $form->addItem($import);
     // Export types
     $imp_types = new ilCheckboxGroupInputGUI($this->getLang()->txt('ecs_import_types'), 'import_types');
     $imp_types->setValue($this->getParticipant()->getImportTypes());
     include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
     foreach (ilECSUtils::getPossibleRemoteTypes(TRUE) as $type => $trans) {
         $imp_types->addOption(new ilCheckboxOption($trans, $type));
     }
     $import->addSubItem($imp_types);
     $form->addCommandButton('saveSettings', $this->getLang()->txt('save'));
     $form->addCommandButton('abort', $this->getLang()->txt('cancel'));
     return $form;
 }
 /**
  * Add advanced metadata to json (export)
  * 
  * @param object $a_json
  * @param ilECSSetting $a_server
  * @param array $a_definition
  */
 protected function addMetadataToJson(&$a_json, ilECSSetting $a_server, array $a_definition)
 {
     include_once './Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
     include_once './Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php';
     include_once './Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php';
     $mappings = ilECSDataMappingSettings::getInstanceByServerId($a_server->getServerId());
     include_once "Services/WebServices/ECS/classes/class.ilECSUtils.php";
     $values = ilECSUtils::getAdvancedMDValuesForObjId($this->content_obj->getId());
     foreach ($a_definition as $id => $type) {
         if (is_array($type)) {
             $target = $type[1];
             $type = $type[0];
         } else {
             $target = $id;
         }
         if ($field = $mappings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, $id)) {
             $value = isset($values[$field]) ? $values[$field] : '';
             switch ($type) {
                 case ilECSUtils::TYPE_ARRAY:
                     $a_json->{$target} = explode(',', $value);
                     break;
                 case ilECSUtils::TYPE_INT:
                     $a_json->{$target} = (int) $value;
                     break;
                 case ilECSUtils::TYPE_STRING:
                     $a_json->{$target} = (string) $value;
                     break;
                 case ilECSUtils::TYPE_TIMEPLACE:
                     if (!isset($a_json->{$target})) {
                         include_once './Services/WebServices/ECS/classes/class.ilECSTimePlace.php';
                         $a_json->{$target} = new ilECSTimePlace();
                     }
                     $a_json->{$target}->{'set' . ucfirst($id)}($value);
                     break;
             }
         }
     }
 }
Beispiel #12
0
 /**
  * get all imported links
  *
  * @access public
  * @static
  *
  */
 public static function getAllImportedRemoteObjects($a_server_id)
 {
     global $ilDB;
     include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
     $query = "SELECT * FROM ecs_import ei JOIN object_data obd ON ei.obj_id = obd.obj_id " . 'WHERE server_id = ' . $ilDB->quote($a_server_id) . ' ' . 'AND ' . $ilDB->in('type', ilECSUtils::getPossibleRemoteTypes(), false, 'text');
     $res = $ilDB->query($query);
     while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
         $all[$row->econtent_id] = $row->obj_id;
     }
     return $all ? $all : array();
 }
 /**
  * Fill row
  *
  * @access public
  * @param array row data
  * 
  */
 public function fillRow($a_set)
 {
     include_once './Services/Link/classes/class.ilLink.php';
     $this->tpl->setVariable('VAL_TITLE', $a_set['title']);
     $this->tpl->setVariable('VAL_LINK', ilLink::_getLink($a_set['ref_id'], 'rcrs'));
     $this->tpl->setVariable('VAL_DESC', $a_set['desc']);
     $this->tpl->setVariable('VAL_REMOTE', $a_set['from']);
     $this->tpl->setVariable('VAL_REMOTE_INFO', $a_set['from_info']);
     $this->tpl->setVariable('TXT_EMAIL', $this->lng->txt('ecs_email'));
     $this->tpl->setVariable('TXT_DNS', $this->lng->txt('ecs_dns'));
     $this->tpl->setVariable('TXT_ABR', $this->lng->txt('ecs_abr'));
     $this->tpl->setVariable('VAL_LAST_UPDATE', $a_set['last_update']);
     $this->tpl->setVariable('TXT_TERM', $this->lng->txt('ecs_field_term'));
     $this->tpl->setVariable('TXT_CRS_TYPE', $this->lng->txt('ecs_field_courseType'));
     $this->tpl->setVariable('TXT_CRS_ID', $this->lng->txt('ecs_field_courseID'));
     $this->tpl->setVariable('TXT_CREDITS', $this->lng->txt('ecs_field_credits'));
     $this->tpl->setVariable('TXT_ROOM', $this->lng->txt('ecs_field_room'));
     $this->tpl->setVariable('TXT_CYCLE', $this->lng->txt('ecs_field_cycle'));
     $this->tpl->setVariable('TXT_SWS', $this->lng->txt('ecs_field_semester_hours'));
     $this->tpl->setVariable('TXT_START', $this->lng->txt('ecs_field_begin'));
     $this->tpl->setVariable('TXT_END', $this->lng->txt('ecs_field_end'));
     $this->tpl->setVariable('TXT_LECTURER', $this->lng->txt('ecs_field_lecturer'));
     $sid = array_pop($a_set['sids']);
     include_once './Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
     $settings = ilECSDataMappingSettings::getInstanceByServerId($sid);
     include_once "Services/WebServices/ECS/classes/class.ilECSUtils.php";
     $values = ilECSUtils::getAdvancedMDValuesForObjId($a_set['obj_id']);
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'lecturer')) {
         $this->tpl->setVariable('VAL_LECTURER', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'term')) {
         $this->tpl->setVariable('VAL_TERM', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'courseID')) {
         $this->tpl->setVariable('VAL_CRS_ID', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'courseType')) {
         $this->tpl->setVariable('VAL_CRS_TYPE', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'credits')) {
         $this->tpl->setVariable('VAL_CREDITS', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'semester_hours')) {
         $this->tpl->setVariable('VAL_SWS', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'room')) {
         $this->tpl->setVariable('VAL_ROOM', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'cycle')) {
         $this->tpl->setVariable('VAL_CYCLE', isset($values[$field]) ? $values[$field] : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'begin')) {
         $this->tpl->setVariable('VAL_START', isset($values[$field]) ? ilDatePresentation::formatDate(new ilDateTime($values[$field], IL_CAL_UNIX)) : '--');
     }
     if ($field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_EXPORT, 'end')) {
         $this->tpl->setVariable('VAL_END', isset($values[$field]) ? ilDatePresentation::formatDate(new ilDateTime($values[$field], IL_CAL_UNIX)) : '--');
     }
 }