24 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
58 $this->lng->loadLanguageModule(
'ecs');
60 $this->tabs_gui = $ilTabs;
74 $next_class = $this->ctrl->getNextClass($this);
75 $cmd = $this->ctrl->getCmd();
80 case 'ilecsmappingsettingsgui':
81 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSMappingSettingsGUI.php';
83 $this->ctrl->setReturn($this,
'communities');
84 $this->ctrl->forwardCommand($mapset);
106 global $ilToolbar,$ilTabs;
108 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
110 $ilTabs->setSubTabActive(
'overview');
111 $ilToolbar->addButton(
112 $this->lng->txt(
'ecs_add_new_ecs'),
113 $this->ctrl->getLinkTarget($this,
'create')
117 $servers->readInactiveServers();
119 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerTableGUI.php';
122 $table->parse($servers);
123 $this->tpl->setContent($table->getHTML());
133 $this->
settings->setEnabledStatus(
true);
136 $this->ctrl->redirect($this,
'overview');
145 $this->
settings->setEnabledStatus(
false);
148 $this->ctrl->redirect($this,
'overview');
158 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnector.php');
159 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
160 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php');
161 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
170 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
202 $ilTabs->clearTargets();
203 $ilTabs->clearSubTabs();
204 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
207 $this->tabs_gui->setSubTabActive(
'ecs_settings');
209 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_settings.html',
'Services/WebServices/ECS');
210 $this->tpl->setVariable(
'SETTINGS_TABLE',$this->form->getHTML());
221 $this->ctrl->saveParameter($this,
'server_id',(
int) $_REQUEST[
'server_id']);
223 $ilTabs->clearTargets();
224 $ilTabs->clearSubTabs();
225 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
228 $this->tabs_gui->setSubTabActive(
'ecs_settings');
230 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_settings.html',
'Services/WebServices/ECS');
231 $this->tpl->setVariable(
'SETTINGS_TABLE',$this->form->getHTML());
234 protected function cp()
238 $copy = clone $this->settings;
241 $this->ctrl->setParameter($this,
'server_id',$copy->getServerId());
243 $this->ctrl->redirect($this,
'edit');
249 protected function delete()
255 $ilTabs->clearTargets();
256 $ilTabs->clearSubTabs();
257 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
259 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
261 $confirm->setFormAction($this->ctrl->getFormAction($this));
262 $confirm->setConfirm($this->lng->txt(
'delete'),
'doDelete');
263 $confirm->setCancel($this->lng->txt(
'cancel'),
'overview');
264 $confirm->setHeaderText($this->lng->txt(
'ecs_delete_setting'));
266 $confirm->addItem(
'',
'',$this->
settings->getServer());
267 $confirm->addHiddenItem(
'server_id', $this->
settings->getServerId());
269 $this->tpl->setContent($confirm->getHTML());
281 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
284 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
287 include_once
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
290 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
293 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
296 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
300 $this->ctrl->redirect($this,
'overview');
312 $this->tabs_gui->setSubTabActive(
'ecs_settings');
314 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_settings.html',
'Services/WebServices/ECS');
315 $this->tpl->setVariable(
'SETTINGS_TABLE',$this->form->getHTML());
325 if(is_object($this->form))
329 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
332 $this->form->setFormAction($this->ctrl->getFormAction($this,
'settings'));
333 $this->form->setTitle($this->lng->txt(
'ecs_connection_settings'));
338 $this->form->addItem($ena);
340 $ser =
new ilTextInputGUI($this->lng->txt(
'ecs_server_url'),
'server');
342 $ser->setRequired(
true);
343 $this->form->addItem($ser);
347 #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'),
348 # ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https')));
350 $pro->setValue($this->
settings->getProtocol());
351 $pro->setRequired(
true);
352 $this->form->addItem($pro);
356 $por->setMaxLength(5);
357 $por->setValue((
string) $this->
settings->getPort());
358 $por->setRequired(
true);
359 $this->form->addItem($por);
363 $this->form->addItem($tcer);
367 $tcer->addOption($cert_based);
369 $cli =
new ilTextInputGUI($this->lng->txt(
'ecs_client_cert'),
'client_cert');
371 $cli->setValue((
string) $this->
settings->getClientCertPath());
372 $cli->setRequired(
true);
373 $cert_based->addSubItem($cli);
375 $key =
new ilTextInputGUI($this->lng->txt(
'ecs_cert_key'),
'key_path');
377 $key->setValue((
string) $this->
settings->getKeyPath());
378 $key->setRequired(
true);
379 $cert_based->addSubItem($key);
381 $cerp =
new ilTextInputGUI($this->lng->txt(
'ecs_key_password'),
'key_password');
383 $cerp->setValue((
string) $this->
settings->getKeyPassword());
384 $cerp->setInputType(
'password');
385 $cerp->setRequired(
true);
386 $cert_based->addSubItem($cerp);
388 $cer =
new ilTextInputGUI($this->lng->txt(
'ecs_ca_cert'),
'ca_cert');
390 $cer->setValue((
string) $this->
settings->getCACertPath());
391 $cer->setRequired(
true);
392 $cert_based->addSubItem($cer);
396 $tcer->addOption($apa_based);
398 $user =
new ilTextInputGUI($this->lng->txt(
'ecs_apache_user'),
'auth_user');
400 $user->setValue((
string) $this->
settings->getAuthUser());
401 $user->setRequired(
true);
402 $apa_based->addSubItem($user);
405 $pass->setRetype(
false);
407 $pass->setMaxLength(32);
409 $pass->setRequired(
true);
410 $apa_based->addSubItem(
$pass);
414 $ser->
setValue($this->
settings->getCertSerialNumber() ? $this->
settings->getCertSerialNumber() : $this->lng->txt(
'ecs_no_value'));
415 $cert_based->addSubItem($ser);
418 $loc->setTitle($this->lng->txt(
'ecs_local_settings'));
419 $this->form->addItem($loc);
423 $pol->setShowHours(
false);
424 $pol->setShowMinutes(
true);
425 $pol->setShowSeconds(
true);
426 $pol->setSeconds($this->
settings->getPollingTimeSeconds());
427 $pol->setMinutes($this->
settings->getPollingTimeMinutes());
428 $pol->setRequired(
true);
429 $pol->setInfo($this->lng->txt(
'ecs_polling_info'));
430 $this->form->addItem($pol);
435 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
436 $tpl->setVariable(
'SIZE',5);
437 $tpl->setVariable(
'MAXLENGTH',11);
438 $tpl->setVariable(
'POST_VAR',
'import_id');
439 $tpl->setVariable(
'PROPERTY_VALUE',$this->
settings->getImportId());
446 $imp->setHTML(
$tpl->get());
447 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
448 $this->form->addItem($imp);
451 $loc->setTitle($this->lng->txt(
'ecs_remote_user_settings'));
452 $this->form->addItem($loc);
456 $role->setValue($this->
settings->getGlobalRole());
457 $role->setInfo($this->lng->txt(
'ecs_global_role_info'));
458 $role->setRequired(
true);
459 $this->form->addItem($role);
461 $duration =
new ilDurationInputGUI($this->lng->txt(
'ecs_account_duration'),
'duration');
462 $duration->
setInfo($this->lng->txt(
'ecs_account_duration_info'));
463 $duration->setMonths($this->
settings->getDuration());
464 $duration->setShowSeconds(
false);
465 $duration->setShowMinutes(
false);
466 $duration->setShowHours(
false);
467 $duration->setShowDays(
false);
468 $duration->setShowMonths(
true);
469 $duration->setRequired(
true);
470 $this->form->addItem($duration);
474 $loc->setTitle($this->lng->txt(
'ecs_notifications'));
475 $this->form->addItem($loc);
477 $rcp_user =
new ilTextInputGUI($this->lng->txt(
'ecs_user_rcp'),
'user_recipients');
479 $rcp_user->setInfo($this->lng->txt(
'ecs_user_rcp_info'));
480 $this->form->addItem($rcp_user);
482 $rcp_econ =
new ilTextInputGUI($this->lng->txt(
'ecs_econ_rcp'),
'econtent_recipients');
483 $rcp_econ->
setValue((
string) $this->
settings->getEContentRecipientsAsString());
484 $rcp_econ->setInfo($this->lng->txt(
'ecs_econ_rcp_info'));
485 $this->form->addItem($rcp_econ);
487 $rcp_app =
new ilTextInputGUI($this->lng->txt(
'ecs_approval_rcp'),
'approval_recipients');
488 $rcp_app->
setValue((
string) $this->
settings->getApprovalRecipientsAsString());
489 $rcp_app->setInfo($this->lng->txt(
'ecs_approval_rcp_info'));
490 $this->form->addItem($rcp_app);
492 if($a_mode ==
'update')
494 $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
498 $this->form->addCommandButton(
'save',$this->lng->txt(
'save'));
500 $this->form->addCommandButton(
'overview',$this->lng->txt(
'cancel'));
513 if(!$error = $this->
settings->validate())
539 if(!$error = $this->
settings->validate())
563 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
566 foreach(
$reader->getCommunities() as $community)
568 foreach($community->getParticipants() as $part)
572 $this->
settings->setTitle($part->getParticipantName());
602 $this->
settings->setPollingTimeMS((
int) $_POST[
'polling'][
'mm'],(
int) $_POST[
'polling'][
'ss']);
604 $this->
settings->setGlobalRole((
int) $_POST[
'global_role']);
605 $this->
settings->setDuration((
int) $_POST[
'duration'][
'MM']);
611 $this->
settings->setAuthType((
int) $_POST[
'auth_type']);
625 $this->tabs_gui->setSubTabActive(
'ecs_communities');
627 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_communities.html',
'Services/WebServices/ECS');
629 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this,
'updateCommunities'));
630 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
631 $this->tpl->setVariable(
'TXT_CANCEL', $this->lng->txt(
'cancel'));
633 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
634 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityTableGUI.php');
636 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
638 $settings->readInactiveServers();
640 foreach($settings->getServers() as
$server)
646 foreach(
$reader->getCommunities() as $community)
648 $this->tpl->setCurrentBlock(
'table_community');
650 $table_gui->
setTitle($community->getTitle().
' ('.$community->getDescription().
')');
651 $table_gui->parse($community->getParticipants());
652 $this->tpl->setVariable(
'TABLE_COMM',$table_gui->getHTML());
653 $this->tpl->parseCurrentBlock();
663 $this->tpl->setCurrentBlock(
'server');
664 $this->tpl->setVariable(
'TXT_SERVER_NAME',
$server->getTitle());
665 $this->tpl->parseCurrentBlock();
676 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
679 foreach((array) $import_types as $sid =>
$server)
681 foreach((array)
$server as $mid => $import_type)
695 $new_types = array();
696 foreach((array) $import_types as $sid =>
$server)
698 foreach((array)
$server as $mid => $import_type)
706 $new_types[$sid][$mid] = $import_type;
710 $import_types = $new_types;
724 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
725 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
728 $invalidImportTypes =
false;
731 $invalidImportTypes =
true;
735 foreach($servers->getServers() as
$server)
742 foreach($cReader->getCommunities() as $community)
744 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityCache.php';
746 $cCache->setCommunityName($community->getTitle());
747 $cCache->setMids($community->getMids());
748 $cCache->setOwnId($community->getOwnId());
754 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot read ecs communities: '.$e->getMessage());
758 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
759 foreach((array)
$_POST[
'sci_mid'] as $sid => $tmp)
761 foreach((array)
$_POST[
'sci_mid'][$sid] as $mid => $tmp)
764 $set->enableExport(array_key_exists($mid, (array)
$_POST[
'export'][$sid]) ?
true :
false);
765 $set->enableImport(array_key_exists($mid, (array)
$_POST[
'import'][$sid]) ?
true :
false);
766 $set->setImportType(
$_POST[
'import_type'][$sid][$mid]);
773 $set->setTitle($part->getParticipantName());
778 $set->setCommunityName($com->getTitle());
783 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot read ecs communities: '.$e->getMessage());
789 if($invalidImportTypes)
797 $GLOBALS[
'ilCtrl']->redirect($this,
'communities');
892 $ilTabs->clearTargets();
893 $ilTabs->clearSubTabs();
895 $ilTabs->setBackTarget(
896 $this->lng->txt(
'ecs_settings'),
897 $this->ctrl->getLinkTarget($this,
'overview')
901 $this->lng->txt(
'ecs_tab_import'),
902 $this->ctrl->getLinkTarget($this,
'importMappings')
906 $this->lng->txt(
'ecs_tab_export'),
907 $this->ctrl->getLinkTarget($this,
'exportMappings')
913 case self::MAPPING_IMPORT:
914 $ilTabs->activateTab(
'import');
917 case self::MAPPING_EXPORT:
918 $ilTabs->activateTab(
'export');
931 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
942 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
944 $settings->readInactiveServers();
946 include_once
'./Services/Accordion/classes/class.ilAccordionGUI.php';
950 foreach($settings->getServers() as
$server)
953 $acc->setId(
'ecs_mapping_import_'.
$server->getServerId());
959 '<br />'.$form->getHTML().
'<br />'
965 $this->tpl->setContent($acc->getHTML());
977 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
988 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
990 $settings->readInactiveServers();
992 include_once
'./Services/Accordion/classes/class.ilAccordionGUI.php';
996 foreach($settings->getServers() as
$server)
999 $acc->setId(
'ecs_mapping_import_'.
$server->getServerId());
1005 '<br />'.$form->getHTML().
'<br />'
1011 $this->tpl->setContent($acc->getHTML());
1024 foreach((array)
$_POST[
'mapping'] as $mtype => $mappings)
1026 foreach((array) $mappings as $ecs_field => $advmd_id)
1028 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1030 (
int)
$_POST[
'ecs_mapping_server'],
1034 $map->setAdvMDId($advmd_id);
1040 $this->ctrl->redirect($this,
'importMappings');
1052 foreach((array)
$_POST[
'mapping'] as $mtype => $mappings)
1054 foreach((array) $mappings as $ecs_field => $advmd_id)
1056 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1058 (
int)
$_POST[
'ecs_mapping_server'],
1062 $map->setAdvMDId($advmd_id);
1068 $this->ctrl->redirect($this,
'exportMappings');
1082 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1085 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1090 if($mapping_type == self::MAPPING_IMPORT)
1092 $form->setTitle($this->lng->txt(
'ecs_mapping_tbl'));
1093 $form->addCommandButton(
'saveImportMappings',$this->lng->txt(
'save'));
1094 $form->addCommandButton(
'importMappings',$this->lng->txt(
'cancel'));
1098 $form->setTitle($this->lng->txt(
'ecs_mapping_exp_tbl'));
1099 $form->addCommandButton(
'saveExportMappings',$this->lng->txt(
'save'));
1100 $form->addCommandButton(
'exportMappings',$this->lng->txt(
'cancel'));
1103 $form->setFormAction($this->ctrl->getFormAction($this,
'saveMappings'));
1105 if($mapping_type == self::MAPPING_IMPORT)
1108 $form->addItem($assignments);
1110 $option =
new ilCheckboxInputGUI($this->lng->txt(
'ecs_mapping_crs'),
'mapping_type');
1113 $assignments->addOption($option);
1116 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1121 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1123 foreach($optional as $field_name)
1125 if($mapping_type == self::MAPPING_IMPORT)
1128 $this->lng->txt(
'ecs_field_'.$field_name),
1133 $mapping_settings->getMappingByECSName(
1137 $select->setOptions($options);
1138 $option->addSubItem($select);
1143 $this->lng->txt(
'ecs_field_'.$field_name),
1147 $mapping_settings->getMappingByECSName(
1151 $select->setOptions($options);
1152 $form->addItem($select);
1157 $server->setValue($a_server_id);
1162 if($mapping_type == self::MAPPING_EXPORT)
1170 $assignments->addOption($rcrs);
1172 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1177 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1179 foreach($optional as $field_name)
1182 $this->lng->txt(
'ecs_field_'.$field_name),
1183 'mapping['.ilECSDataMappingSetting::MAPPING_IMPORT_RCRS.
']['.$field_name.
']');
1185 $mapping_settings->getMappingByECSName(
1189 $select->setOptions($options);
1190 $rcrs->addSubItem($select);
1201 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1202 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.category_mapping.html',
'Services/WebServices/ECS');
1208 $this->tpl->setVariable(
'NEW_RULE_TABLE',$this->form->getHTML());
1211 $this->tpl->setVariable(
'RULES_TABLE',$html);
1224 if($this->form->checkInput())
1226 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1227 $this->rule->setMappingType($this->form->getInput(
'type'));
1228 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1229 $this->rule->setFieldName($this->form->getInput(
'field'));
1230 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1231 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1233 if($err = $this->rule->validate())
1236 $this->form->setValuesByPost();
1240 $this->rule->save();
1247 $this->form->setValuesByPost();
1265 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1266 $this->ctrl->saveParameter($this,
'rule_id');
1270 $this->tpl->setContent($this->form->getHTML());
1286 $this->ctrl->saveParameter($this,
'rule_id');
1289 if($this->form->checkInput())
1291 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1292 $this->rule->setMappingType($this->form->getInput(
'type'));
1293 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1294 $this->rule->setFieldName($this->form->getInput(
'field'));
1295 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1296 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1298 if($err = $this->rule->validate())
1301 $this->form->setValuesByPost();
1305 $this->rule->update();
1307 $this->ctrl->redirect($this,
'categoryMapping');
1311 $this->form->setValuesByPost();
1328 foreach(
$_POST[
'rules'] as $rule_id)
1330 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1345 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
1351 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingTableGUI.php';
1353 $rule_table->parse($rules);
1354 return $rule_table->getHTML();
1364 if(is_object($this->rule))
1369 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1381 if(is_object($this->form))
1386 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1387 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1391 if($a_mode ==
'add')
1393 $this->form->setTitle($this->lng->txt(
'ecs_new_category_mapping'));
1394 $this->form->setFormAction($this->ctrl->getFormAction($this,
'categoryMapping'));
1395 $this->form->addCommandButton(
'addCategoryMapping',$this->lng->txt(
'save'));
1396 $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
1400 $this->form->setTitle($this->lng->txt(
'ecs_edit_category_mapping'));
1401 $this->form->setFormAction($this->ctrl->getFormAction($this,
'editCategoryMapping'));
1402 $this->form->addCommandButton(
'updateCategoryMapping',$this->lng->txt(
'save'));
1403 $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
1409 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
1410 $tpl->setVariable(
'SIZE',5);
1411 $tpl->setVariable(
'MAXLENGTH',11);
1412 $tpl->setVariable(
'POST_VAR',
'import_id');
1413 $tpl->setVariable(
'PROPERTY_VALUE',$this->rule->getContainerId());
1417 $tpl->setVariable(
'COMPLETE_PATH',$this->
buildPath($this->rule->getContainerId()));
1420 $imp->setHTML(
$tpl->get());
1421 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
1422 $this->form->addItem($imp);
1424 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php');
1426 foreach($fields as $field)
1428 $options[$field] = $this->lng->txt(
'ecs_field_'.$field);
1430 $select =
new ilSelectInputGUI($this->lng->txt(
'ecs_attribute_name'),
'field');
1431 $select->
setValue($this->rule->getFieldName());
1432 $select->setRequired(
true);
1433 $select->setOptions($options);
1434 $this->form->addItem($select);
1438 $value->
setValue($this->rule->getMappingType());
1439 $value->setRequired(
true);
1442 $fixed->
setInfo($this->lng->txt(
'ecs_cat_mapping_fixed_info'));
1444 $fixed_val =
new ilTextInputGUI($this->lng->txt(
'ecs_cat_mapping_values'),
'mapping_value');
1445 $fixed_val->
setValue($this->rule->getMappingValue());
1446 $fixed_val->setMaxLength(255);
1447 $fixed_val->setSize(40);
1448 $fixed->addSubItem($fixed_val);
1450 $value->addOption($fixed);
1453 $duration->
setInfo($this->lng->txt(
'ecs_cat_mapping_duration_info'));
1456 $dur_start->
setDate($this->rule->getDateRangeStart());
1457 $duration->addSubItem($dur_start);
1460 $dur_end->
setDate($this->rule->getDateRangeEnd());
1461 $duration->addSubItem($dur_end);
1463 $value->addOption($duration);
1465 $this->form->addItem($value);
1479 $this->tabs_gui->setSubTabActive(
'ecs_import');
1483 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_imported.html',
'Services/WebServices/ECS');
1485 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1488 if(count($rcourses))
1491 $this->lng->txt(
'csv_export'),
1492 $this->ctrl->getLinkTarget($this,
'exportImported')
1495 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
1499 $this->lng->txt(
'ecs_read_remote_links'),
1500 $this->ctrl->getLinkTarget($this,
'readAll')
1503 $this->tpl->setVariable(
'ACTION_BUTTONS',$tb->getHTML());
1505 include_once(
'Services/WebServices/ECS/classes/class.ilECSImportedContentTableGUI.php');
1509 $table_gui->setTitle($this->lng->txt(
'ecs_imported_content'));
1510 $table_gui->parse($rcourses);
1511 $this->tpl->setVariable(
'TBL_IMPORTED',$table_gui->getHTML());
1524 global $ilObjDataCache,$ilUser;
1529 include_once(
'./Modules/RemoteCourse/classes/class.ilObjRemoteCourse.php');
1530 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
1541 $ilObjDataCache->preloadReferenceCache($rcourses);
1543 foreach($rcourses as $rcrs_ref_id)
1545 $obj_id = $ilObjDataCache->lookupObjId($rcrs_ref_id);
1546 $obj_ids[$obj_id] = $obj_id;
1549 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1552 $writer->addColumn($this->lng->txt(
'title'));
1553 $writer->addColumn($this->lng->txt(
'description'));
1554 $writer->addColumn($this->lng->txt(
'ecs_imported_from'));
1555 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1556 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1557 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1558 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1559 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1560 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1561 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1562 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1563 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1564 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1565 $writer->addColumn($this->lng->txt(
'last_update'));
1567 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1570 foreach($obj_ids as $obj_id)
1572 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
1580 if(
$reader and ($participant =
$reader->getParticipantByMID($mid)))
1582 $writer->addColumn($participant->getParticipantName());
1585 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1588 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1591 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1594 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1597 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1600 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1603 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1606 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1614 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1616 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d").
"_ecs_import.csv",
"text/csv");
1629 $this->tabs_gui->setSubTabActive(
'ecs_released');
1631 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1632 $exported = ilECSExport::getExportedIDs();
1634 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_released.html',
'Services/WebServices/ECS');
1636 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1639 if(count($exported))
1642 $this->lng->txt(
'csv_export'),
1643 $this->ctrl->getLinkTarget($this,
'exportReleased')
1649 $this->lng->txt(
'ecs_read_remote_links'),
1650 $this->ctrl->getLinkTarget($this,
'readAll')
1653 $this->tpl->setVariable(
'ACTION_BUTTONS',$tb->getHTML());
1655 include_once(
'Services/WebServices/ECS/classes/class.ilECSReleasedContentTableGUI.php');
1658 $table_gui->setTitle($this->lng->txt(
'ecs_released_content'));
1659 $table_gui->parse($exported);
1660 $this->tpl->setVariable(
'TABLE_REL',$table_gui->getHTML());
1674 global $ilObjDataCache;
1676 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1678 $ilObjDataCache->preloadObjectCache($exported);
1680 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1683 $writer->addColumn($this->lng->txt(
'title'));
1684 $writer->addColumn($this->lng->txt(
'description'));
1685 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1686 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1687 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1688 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1689 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1690 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1691 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1692 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1693 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1694 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1695 $writer->addColumn($this->lng->txt(
'last_update'));
1697 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1700 foreach($exported as $obj_id)
1702 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
1709 $field = $settings->getMappingByECSName(
'courseID');
1710 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1712 $field = $settings->getMappingByECSName(
'term');
1713 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1715 $field = $settings->getMappingByECSName(
'lecturer');
1716 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1718 $field = $settings->getMappingByECSName(
'courseType');
1719 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1721 $field = $settings->getMappingByECSName(
'semester_hours');
1722 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1724 $field = $settings->getMappingByECSName(
'credits');
1725 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1727 $field = $settings->getMappingByECSName(
'room');
1728 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1730 $field = $settings->getMappingByECSName(
'cycle');
1731 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1733 $field = $settings->getMappingByECSName(
'begin');
1736 $field = $settings->getMappingByECSName(
'end');
1739 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1742 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d").
"_ecs_export.csv",
"text/csv");
1753 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1755 $options[0] = $this->lng->txt(
'ecs_ignore_field');
1756 foreach($fields as $field)
1760 $options[$field->getFieldId()] =
$title.
': '.$field->getTitle();
1774 include_once(
'Services/WebServices/ECS/classes/class.ilECSSetting.php');
1785 $this->tabs_gui->clearSubTabs();
1787 $this->tabs_gui->addSubTabTarget(
"overview",
1788 $this->ctrl->getLinkTarget($this,
'overview'),
1789 "overview",get_class($this));
1798 $this->tabs_gui->addSubTabTarget(
"ecs_communities",
1799 $this->ctrl->getLinkTarget($this,
'communities'),
1800 "communities",get_class($this));
1802 $this->tabs_gui->addSubTabTarget(
'ecs_mappings',
1803 $this->ctrl->getLinkTarget($this,
'importMappings'),
1804 'importMappings',get_class($this));
1806 $this->tabs_gui->addSubTabTarget(
'ecs_category_mapping',
1807 $this->ctrl->getLinkTarget($this,
'categoryMapping'));
1809 $this->tabs_gui->addSubTabTarget(
'ecs_import',
1810 $this->ctrl->getLinkTarget($this,
'imported'));
1812 $this->tabs_gui->addSubTabTarget(
'ecs_released',
1813 $this->ctrl->getLinkTarget($this,
'released'));
1824 global $rbacreview,$ilObjDataCache;
1831 $select[0] = $this->lng->txt(
'links_select_one');
1832 foreach($global_roles as $role_id)
1842 $loc->setTextOnly(
false);
1843 $loc->addContextItems($a_ref_id);
1845 return $loc->getHTML();
1857 #$ilDB->lockTables(array('name' => 'settings', 'type' => ilDB::LOCK_WRITE));
1860 'next_execution_'.$this->
settings->getServerId(),
1861 time() + (int) $this->
settings->getPollingTime()