24 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
63 $ilTabs = $DIC[
'ilTabs'];
67 $this->lng->loadLanguageModule(
'ecs');
69 $this->tabs_gui = $ilTabs;
71 $this->log =
$GLOBALS[
'DIC']->logger()->wsrv();
87 $ilAccess = $DIC[
'ilAccess'];
88 $next_class = $this->ctrl->getNextClass($this);
89 $cmd = $this->ctrl->getCmd();
92 switch ($next_class) {
93 case 'ilecsmappingsettingsgui':
94 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSMappingSettingsGUI.php';
96 $this->ctrl->setReturn($this,
'communities');
97 $this->ctrl->forwardCommand($mapset);
100 case 'ilecsparticipantsettingsgui':
101 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettingsGUI.php';
103 (
int) $_REQUEST[
'server_id'],
104 (
int) $_REQUEST[
'mid']
106 $this->ctrl->setReturn($this,
'communities');
107 $this->ctrl->forwardCommand($part);
112 if (!$ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"]) && $cmd !=
"overview" && $cmd !=
"communities") {
113 $this->ctrl->redirect($this,
"overview");
116 if (!$cmd || $cmd ==
'view') {
135 $ilToolbar = $DIC[
'ilToolbar'];
136 $ilTabs = $DIC[
'ilTabs'];
137 $ilAccess = $DIC[
'ilAccess'];
139 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
141 $ilTabs->setSubTabActive(
'overview');
142 if ($ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
143 $ilToolbar->addButton(
144 $this->lng->txt(
'ecs_add_new_ecs'),
145 $this->ctrl->getLinkTarget($this,
'create')
150 $servers->readInactiveServers();
152 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerTableGUI.php';
156 $this->tpl->setContent(
$table->getHTML());
166 $this->
settings->setEnabledStatus(
true);
168 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
169 $this->ctrl->redirect($this,
'overview');
178 $this->
settings->setEnabledStatus(
false);
180 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
181 $this->ctrl->redirect($this,
'overview');
191 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnector.php');
192 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
193 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php');
194 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
201 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
227 $ilTabs = $DIC[
'ilTabs'];
231 $ilTabs->clearTargets();
232 $ilTabs->clearSubTabs();
233 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'overview'));
236 $this->tabs_gui->setSubTabActive(
'ecs_settings');
238 $this->tpl->setContent($this->form->getHTML());
248 $ilTabs = $DIC[
'ilTabs'];
251 $this->ctrl->saveParameter($this,
'server_id', (
int) $_REQUEST[
'server_id']);
253 $ilTabs->clearTargets();
254 $ilTabs->clearSubTabs();
255 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'overview'));
258 $this->tabs_gui->setSubTabActive(
'ecs_settings');
260 $this->tpl->setContent($this->form->getHTML());
263 protected function cp()
267 $copy = clone $this->settings;
270 $this->ctrl->setParameter($this,
'server_id', $copy->getServerId());
271 ilUtil::sendSuccess($this->lng->txt(
'ecs_settings_cloned'),
true);
272 $this->ctrl->redirect($this,
'edit');
278 protected function delete()
282 $ilTabs = $DIC[
'ilTabs'];
286 $ilTabs->clearTargets();
287 $ilTabs->clearSubTabs();
288 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'overview'));
290 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
292 $confirm->setFormAction($this->ctrl->getFormAction($this));
293 $confirm->setConfirm($this->lng->txt(
'delete'),
'doDelete');
294 $confirm->setCancel($this->lng->txt(
'cancel'),
'overview');
295 $confirm->setHeaderText($this->lng->txt(
'ecs_delete_setting'));
297 $confirm->addItem(
'',
'', $this->
settings->getServer());
298 $confirm->addHiddenItem(
'server_id', $this->
settings->getServerId());
300 $this->tpl->setContent($confirm->getHTML());
312 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
315 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
318 include_once
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
321 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
324 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
327 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
330 ilUtil::sendSuccess($this->lng->txt(
'ecs_setting_deleted'),
true);
331 $this->ctrl->redirect($this,
'overview');
343 $this->tabs_gui->setSubTabActive(
'ecs_settings');
345 $this->tpl->setContent($this->form->getHTML());
355 if (is_object($this->form)) {
358 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
361 $this->form->setFormAction($this->ctrl->getFormAction($this,
'settings'));
362 $this->form->setTitle($this->lng->txt(
'ecs_connection_settings'));
367 $this->form->addItem($ena);
369 $server_title =
new ilTextInputGUI($this->lng->txt(
'ecs_server_title'),
'title');
371 $server_title->setSize(80);
372 $server_title->setMaxLength(128);
373 $server_title->setRequired(
true);
374 $this->form->addItem($server_title);
376 $ser =
new ilTextInputGUI($this->lng->txt(
'ecs_server_url'),
'server');
378 $ser->setRequired(
true);
379 $this->form->addItem($ser);
383 #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'), 384 # ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https'))); 386 $pro->setValue($this->
settings->getProtocol());
387 $pro->setRequired(
true);
388 $this->form->addItem($pro);
392 $por->setMaxLength(5);
393 $por->setValue((
string) $this->
settings->getPort());
394 $por->setRequired(
true);
395 $this->form->addItem($por);
399 $this->form->addItem($tcer);
403 $tcer->addOption($cert_based);
405 $cli =
new ilTextInputGUI($this->lng->txt(
'ecs_client_cert'),
'client_cert');
407 $cli->setValue((
string) $this->
settings->getClientCertPath());
408 $cli->setRequired(
true);
409 $cert_based->addSubItem($cli);
414 $key->setRequired(
true);
415 $cert_based->addSubItem(
$key);
417 $cerp =
new ilTextInputGUI($this->lng->txt(
'ecs_key_password'),
'key_password');
419 $cerp->setValue((
string) $this->
settings->getKeyPassword());
420 $cerp->setInputType(
'password');
421 $cerp->setRequired(
true);
422 $cert_based->addSubItem($cerp);
424 $cer =
new ilTextInputGUI($this->lng->txt(
'ecs_ca_cert'),
'ca_cert');
426 $cer->setValue((
string) $this->
settings->getCACertPath());
427 $cer->setRequired(
true);
428 $cert_based->addSubItem($cer);
432 $tcer->addOption($apa_based);
437 $user->setRequired(
true);
438 $apa_based->addSubItem(
$user);
441 $pass->setRetype(
false);
443 $pass->setMaxLength(128);
445 $pass->setRequired(
true);
446 $pass->setSkipSyntaxCheck(
true);
447 $apa_based->addSubItem(
$pass);
451 $ser->
setValue($this->
settings->getCertSerialNumber() ? $this->
settings->getCertSerialNumber() : $this->lng->txt(
'ecs_no_value'));
452 $cert_based->addSubItem($ser);
455 $loc->setTitle($this->lng->txt(
'ecs_local_settings'));
456 $this->form->addItem($loc);
460 $pol->setShowHours(
false);
461 $pol->setShowMinutes(
true);
462 $pol->setShowSeconds(
true);
463 $pol->setSeconds($this->
settings->getPollingTimeSeconds());
464 $pol->setMinutes($this->
settings->getPollingTimeMinutes());
465 $pol->setRequired(
false);
466 $pol->setInfo($this->lng->txt(
'ecs_polling_info'));
467 $this->form->addItem($pol);
472 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
473 $tpl->setVariable(
'SIZE', 5);
474 $tpl->setVariable(
'MAXLENGTH', 11);
475 $tpl->setVariable(
'POST_VAR',
'import_id');
476 $tpl->setVariable(
'PROPERTY_VALUE', $this->
settings->getImportId());
478 if ($this->
settings->getImportId()) {
481 $imp->setAlert($this->lng->txt(
'err_check_input'));
487 $imp->setHTML(
$tpl->get());
488 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
489 $this->form->addItem($imp);
492 $loc->setTitle($this->lng->txt(
'ecs_remote_user_settings'));
493 $this->form->addItem($loc);
497 $role->setValue($this->
settings->getGlobalRole());
498 $role->setInfo($this->lng->txt(
'ecs_global_role_info'));
499 $role->setRequired(
true);
500 $this->form->addItem($role);
502 $duration =
new ilDurationInputGUI($this->lng->txt(
'ecs_account_duration'),
'duration');
503 $duration->
setInfo($this->lng->txt(
'ecs_account_duration_info'));
504 $duration->setMonths($this->
settings->getDuration());
505 $duration->setShowSeconds(
false);
506 $duration->setShowMinutes(
false);
507 $duration->setShowHours(
false);
508 $duration->setShowDays(
false);
509 $duration->setShowMonths(
true);
510 $duration->setRequired(
true);
511 $this->form->addItem($duration);
515 $loc->setTitle($this->lng->txt(
'ecs_notifications'));
516 $this->form->addItem($loc);
518 $rcp_user =
new ilTextInputGUI($this->lng->txt(
'ecs_user_rcp'),
'user_recipients');
520 $rcp_user->setInfo($this->lng->txt(
'ecs_user_rcp_info'));
521 $this->form->addItem($rcp_user);
523 $rcp_econ =
new ilTextInputGUI($this->lng->txt(
'ecs_econ_rcp'),
'econtent_recipients');
524 $rcp_econ->
setValue((
string) $this->
settings->getEContentRecipientsAsString());
525 $rcp_econ->setInfo($this->lng->txt(
'ecs_econ_rcp_info'));
526 $this->form->addItem($rcp_econ);
528 $rcp_app =
new ilTextInputGUI($this->lng->txt(
'ecs_approval_rcp'),
'approval_recipients');
529 $rcp_app->
setValue((
string) $this->
settings->getApprovalRecipientsAsString());
530 $rcp_app->setInfo($this->lng->txt(
'ecs_approval_rcp_info'));
531 $this->form->addItem($rcp_app);
533 if ($a_mode ==
'update') {
534 $this->form->addCommandButton(
'update', $this->lng->txt(
'save'));
536 $this->form->addCommandButton(
'save', $this->lng->txt(
'save'));
538 $this->form->addCommandButton(
'overview', $this->lng->txt(
'cancel'));
551 if (!$error = $this->
settings->validate()) {
554 #$this->updateTitle(); 574 if (!$error = $this->
settings->validate()) {
578 #$this->updateTitle(); 584 $GLOBALS[
'DIC'][
'ilCtrl']->redirect($this,
'overview');
594 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
597 foreach (
$reader->getCommunities() as $community) {
598 foreach ($community->getParticipants() as $part) {
599 $this->log->dump($community);
600 if ($part->isSelf()) {
601 $this->
settings->setTitle($part->getParticipantName());
629 $this->
settings->setPollingTimeMS((
int) $_POST[
'polling'][
'mm'], (
int) $_POST[
'polling'][
'ss']);
631 $this->
settings->setGlobalRole((
int) $_POST[
'global_role']);
632 $this->
settings->setDuration((
int) $_POST[
'duration'][
'MM']);
638 $this->
settings->setAuthType((
int) $_POST[
'auth_type']);
648 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
649 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
650 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
651 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
654 $servers->readInactiveServers();
655 foreach ($servers->getServers() as
$server) {
661 if (!$creader->getParticipantByMID($mid)) {
662 $this->log->notice(
'Deleting deprecated participant: ' .
$server->getServerId() .
' ' . $mid);
671 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
672 $this->ctrl->redirect($this,
'communities');
685 $ilAccess = $DIC[
'ilAccess'];
687 if ($ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
688 $GLOBALS[
'DIC'][
'ilToolbar']->addButton(
689 $this->lng->txt(
'ecs_refresh_participants'),
690 $this->ctrl->getLinkTarget($this,
'refreshParticipants')
695 $this->tabs_gui->setSubTabActive(
'ecs_communities');
697 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_communities.html',
'Services/WebServices/ECS');
699 $this->tpl->setVariable(
'FORMACTION', $this->ctrl->getFormAction($this,
'updateCommunities'));
701 if ($ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
702 $this->tpl->setCurrentBlock(
"submit_buttons");
703 $this->tpl->setVariable(
'TXT_SAVE', $this->lng->txt(
'save'));
704 $this->tpl->setVariable(
'TXT_CANCEL', $this->lng->txt(
'cancel'));
705 $this->tpl->parseCurrentBlock();
708 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
709 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityTableGUI.php');
711 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
713 #$settings->readInactiveServers(); 715 foreach ($settings->getServers() as
$server) {
719 foreach (
$reader->getCommunities() as $community) {
720 $this->tpl->setCurrentBlock(
'table_community');
722 $table_gui->
setTitle($community->getTitle() .
' (' . $community->getDescription() .
')');
723 $table_gui->parse($community->getParticipants());
724 $this->tpl->setVariable(
'TABLE_COMM', $table_gui->getHTML());
725 $this->tpl->parseCurrentBlock();
733 $this->tpl->setCurrentBlock(
'server');
734 $this->tpl->setVariable(
'TXT_SERVER_NAME',
$server->getTitle());
735 $this->tpl->parseCurrentBlock();
746 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
749 foreach ((array) $import_types as $sid =>
$server) {
750 foreach ((array)
$server as $mid => $import_type) {
761 $new_types = array();
762 foreach ((array) $import_types as $sid =>
$server) {
763 foreach ((array)
$server as $mid => $import_type) {
767 $new_types[$sid][$mid] = $import_type;
771 $import_types = $new_types;
787 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
788 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
791 $invalidImportTypes =
false;
793 $invalidImportTypes =
true;
797 foreach ($servers->getServers() as
$server) {
803 foreach ($cReader->getCommunities() as $community) {
804 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityCache.php';
806 $cCache->setCommunityName($community->getTitle());
807 $cCache->setMids($community->getMids());
808 $cCache->setOwnId($community->getOwnId());
812 $this->log->error(
'Cannot read ecs communities: ' . $e->getMessage());
816 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
817 foreach ((array)
$_POST[
'sci_mid'] as $sid => $tmp) {
818 foreach ((array)
$_POST[
'sci_mid'][$sid] as $mid => $tmp) {
820 #$set->enableExport(array_key_exists($mid, (array) $_POST['export'][$sid]) ? true : false); 821 #$set->enableImport(array_key_exists($mid, (array) $_POST['import'][$sid]) ? true : false); 822 $set->setImportType(
$_POST[
'import_type'][$sid][$mid]);
828 $set->setTitle($part->getParticipantName());
832 $set->setCommunityName($com->getTitle());
835 $this->log->error(
'Cannot read ecs communities: ' . $e->getMessage());
841 if ($invalidImportTypes) {
844 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
846 $GLOBALS[
'DIC'][
'ilCtrl']->redirect($this,
'communities');
863 $ilTabs = $DIC[
'ilTabs'];
864 $ilAccess = $DIC[
'ilAccess'];
866 $ilTabs->clearTargets();
867 $ilTabs->clearSubTabs();
869 $ilTabs->setBackTarget(
870 $this->lng->txt(
'ecs_settings'),
871 $this->ctrl->getLinkTarget($this,
'overview')
873 if ($ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
876 $this->lng->txt(
'ecs_tab_import'),
877 $this->ctrl->getLinkTarget($this,
'importMappings')
882 $this->lng->txt(
'ecs_tab_export'),
883 $this->ctrl->getLinkTarget($this,
'exportMappings')
888 case self::MAPPING_IMPORT:
889 $ilTabs->activateTab(
'import');
892 case self::MAPPING_EXPORT:
893 $ilTabs->activateTab(
'export');
908 $ilToolbar = $DIC[
'ilToolbar'];
910 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
915 if (!count($fields)) {
920 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
922 $settings->readInactiveServers();
924 $sel_srv = (int) $_REQUEST[
"ecs_mapping_server"];
932 $options = array(0 => $this->lng->txt(
"please_choose"));
933 foreach ($settings->getServers() as
$server) {
941 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
944 $sel->setValue($sel_srv);
945 $ilToolbar->addInputItem($sel);
947 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"importMappings"));
948 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"importMappings");
952 $this->tpl->setContent(
$form->getHTML());
967 $ilToolbar = $DIC[
'ilToolbar'];
969 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
974 if (!count($fields)) {
979 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
981 $settings->readInactiveServers();
983 $sel_srv = (int) $_REQUEST[
"ecs_mapping_server"];
991 $options = array(0 => $this->lng->txt(
"please_choose"));
992 foreach ($settings->getServers() as
$server) {
1000 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1003 $sel->setValue($sel_srv);
1004 $ilToolbar->addInputItem($sel);
1006 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"exportMappings"));
1007 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"exportMappings");
1011 $this->tpl->setContent(
$form->getHTML());
1025 foreach ((array)
$_POST[
'mapping'] as
$mtype => $mappings) {
1026 foreach ((array) $mappings as $ecs_field => $advmd_id) {
1027 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1029 (
int) $_REQUEST[
'ecs_mapping_server'],
1033 $map->setAdvMDId($advmd_id);
1039 $this->ctrl->setParameter($this,
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
1040 $this->ctrl->redirect($this,
'importMappings');
1052 foreach ((array)
$_POST[
'mapping'] as
$mtype => $mappings) {
1053 foreach ((array) $mappings as $ecs_field => $advmd_id) {
1054 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1056 (
int)
$_POST[
'ecs_mapping_server'],
1060 $map->setAdvMDId($advmd_id);
1066 $this->ctrl->setParameter($this,
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
1067 $this->ctrl->redirect($this,
'exportMappings');
1081 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1083 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1088 if ($mapping_type == self::MAPPING_IMPORT) {
1089 $form->setTitle($this->lng->txt(
'ecs_mapping_tbl'));
1090 $form->addCommandButton(
'saveImportMappings', $this->lng->txt(
'save'));
1091 $form->addCommandButton(
'importMappings', $this->lng->txt(
'cancel'));
1093 $form->setTitle($this->lng->txt(
'ecs_mapping_exp_tbl'));
1094 $form->addCommandButton(
'saveExportMappings', $this->lng->txt(
'save'));
1095 $form->addCommandButton(
'exportMappings', $this->lng->txt(
'cancel'));
1098 $form->setFormAction($this->ctrl->getFormAction($this,
'saveMappings'));
1100 if ($mapping_type == self::MAPPING_IMPORT) {
1102 $form->addItem($assignments);
1105 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1110 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1112 foreach ($optional as $field_name) {
1113 if ($mapping_type == self::MAPPING_IMPORT) {
1115 $this->lng->txt(
'ecs_field_' . $field_name),
1120 $mapping_settings->getMappingByECSName(
1126 $assignments->addSubItem($select);
1129 $this->lng->txt(
'ecs_field_' . $field_name),
1133 $mapping_settings->getMappingByECSName(
1139 $form->addItem($select);
1144 $server->setValue($a_server_id);
1149 if ($mapping_type == self::MAPPING_EXPORT) {
1154 $form->addItem($rcrs);
1156 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1161 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1163 foreach ($optional as $field_name) {
1165 $this->lng->txt(
'ecs_field_' . $field_name),
1169 $mapping_settings->getMappingByECSName(
1175 $rcrs->addSubItem($select);
1186 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1187 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.category_mapping.html',
'Services/WebServices/ECS');
1193 $this->tpl->setVariable(
'NEW_RULE_TABLE', $this->form->getHTML());
1195 $this->tpl->setVariable(
'RULES_TABLE',
$html);
1208 if ($this->form->checkInput()) {
1209 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1210 $this->rule->setFieldName($this->form->getInput(
'field'));
1211 $this->rule->setMappingType($this->form->getInput(
'type'));
1213 switch ($this->form->getInput(
'type')) {
1215 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1219 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1220 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1224 $this->rule->setByType($this->form->getInput(
'by_type'));
1228 if ($err = $this->rule->validate()) {
1230 $this->form->setValuesByPost();
1235 $this->rule->save();
1242 $this->form->setValuesByPost();
1253 if (!$_REQUEST[
'rule_id']) {
1259 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1260 $this->ctrl->saveParameter($this,
'rule_id');
1261 $this->
initRule((
int) $_REQUEST[
'rule_id']);
1264 $this->tpl->setContent($this->form->getHTML());
1274 if (!$_REQUEST[
'rule_id']) {
1279 $this->ctrl->saveParameter($this,
'rule_id');
1280 $this->
initRule((
int) $_REQUEST[
'rule_id']);
1282 if ($this->form->checkInput()) {
1283 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1284 $this->rule->setFieldName($this->form->getInput(
'field'));
1285 $this->rule->setMappingType($this->form->getInput(
'type'));
1288 switch ($this->form->getInput(
'type')) {
1290 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1294 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1295 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1299 $this->rule->setByType($this->form->getInput(
'by_type'));
1303 if ($err = $this->rule->validate()) {
1305 $this->form->setValuesByPost();
1310 $this->rule->update();
1312 $this->ctrl->redirect($this,
'categoryMapping');
1316 $this->form->setValuesByPost();
1331 foreach (
$_POST[
'rules'] as $rule_id) {
1332 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1347 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
1352 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingTableGUI.php';
1354 $rule_table->parse($rules);
1355 return $rule_table->getHTML();
1365 if (is_object($this->rule)) {
1369 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1381 $ilDB = $DIC[
'ilDB'];
1383 if (is_object($this->form)) {
1387 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1388 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1392 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'));
1398 $this->form->setTitle($this->lng->txt(
'ecs_edit_category_mapping'));
1399 $this->form->setFormAction($this->ctrl->getFormAction($this,
'editCategoryMapping'));
1400 $this->form->addCommandButton(
'updateCategoryMapping', $this->lng->txt(
'save'));
1401 $this->form->addCommandButton(
'categoryMapping', $this->lng->txt(
'cancel'));
1404 $imp =
new ilCustomInputGUI($this->lng->txt(
'ecs_import_id'),
'import_id');
1407 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
1408 $tpl->setVariable(
'SIZE', 5);
1409 $tpl->setVariable(
'MAXLENGTH', 11);
1410 $tpl->setVariable(
'POST_VAR',
'import_id');
1411 $tpl->setVariable(
'PROPERTY_VALUE', $this->rule->getContainerId());
1413 if ($this->
settings->getImportId()) {
1414 $tpl->setVariable(
'COMPLETE_PATH', $this->
buildPath($this->rule->getContainerId()));
1417 $imp->setHTML(
$tpl->get());
1418 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
1419 $this->form->addItem($imp);
1421 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php');
1422 $select =
new ilSelectInputGUI($this->lng->txt(
'ecs_attribute_name'),
'field');
1423 $select->
setValue($this->rule->getFieldName());
1424 $select->setRequired(
true);
1426 $this->form->addItem($select);
1430 $value->
setValue($this->rule->getMappingType());
1431 $value->setRequired(
true);
1434 $fixed->
setInfo($this->lng->txt(
'ecs_cat_mapping_fixed_info'));
1436 $fixed_val =
new ilTextInputGUI($this->lng->txt(
'ecs_cat_mapping_values'),
'mapping_value');
1437 $fixed_val->
setValue($this->rule->getMappingValue());
1438 $fixed_val->setMaxLength(255);
1439 $fixed_val->setSize(40);
1440 $fixed_val->setRequired(
true);
1441 $fixed->addSubItem($fixed_val);
1443 $value->addOption($fixed);
1446 $duration->
setInfo($this->lng->txt(
'ecs_cat_mapping_duration_info'));
1450 $dur_start->setDate($this->rule->getDateRangeStart());
1451 $duration->addSubItem($dur_start);
1455 $dur_end->setDate($this->rule->getDateRangeEnd());
1456 $duration->addSubItem($dur_end);
1458 $value->addOption($duration);
1461 $type->setInfo($this->lng->txt(
'ecs_cat_mapping_by_type_info'));
1467 $types->setValue($this->rule->getByType());
1468 $types->setRequired(
true);
1469 $type->addSubitem($types);
1471 $value->addOption(
$type);
1473 $this->form->addItem($value);
1487 $ilToolbar = $DIC[
'ilToolbar'];
1489 $this->tabs_gui->setSubTabActive(
'ecs_import');
1491 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
1493 $ilToolbar->addButton(
1494 $this->lng->txt(
'ecs_read_remote_links'),
1495 $this->ctrl->getLinkTarget($this,
'readAll')
1498 $ilToolbar->addSeparator();
1502 $sel_type = $_REQUEST[
"otype"];
1507 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
1510 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1513 $sel->setValue($sel_type);
1514 $ilToolbar->addInputItem($sel);
1516 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"imported"));
1517 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"imported");
1520 if (count($robjs)) {
1521 $ilToolbar->addSeparator();
1523 $ilToolbar->addButton(
1524 $this->lng->txt(
'csv_export'),
1525 $this->ctrl->getLinkTarget($this,
'exportImported')
1529 include_once(
'Services/WebServices/ECS/classes/class.ilECSImportedContentTableGUI.php');
1531 $table_gui->setTitle($this->lng->txt(
'ecs_imported_content'));
1532 $table_gui->parse($robjs);
1533 $this->tpl->setContent($table_gui->getHTML());
1548 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1556 include_once(
'./Modules/RemoteCourse/classes/class.ilObjRemoteCourse.php');
1557 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
1565 $ilObjDataCache->preloadReferenceCache($rcourses);
1567 foreach ($rcourses as $rcrs_ref_id) {
1568 $obj_id = $ilObjDataCache->lookupObjId($rcrs_ref_id);
1569 $obj_ids[$obj_id] = $obj_id;
1572 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1575 $writer->addColumn($this->lng->txt(
'title'));
1576 $writer->addColumn($this->lng->txt(
'description'));
1577 $writer->addColumn($this->lng->txt(
'ecs_imported_from'));
1578 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1579 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1580 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1581 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1582 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1583 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1584 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1585 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1586 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1587 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1588 $writer->addColumn($this->lng->txt(
'last_update'));
1590 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1593 foreach ($obj_ids as $obj_id) {
1594 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1603 $writer->addColumn($participant->getParticipantName());
1606 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1609 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1612 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1615 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1618 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1621 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1624 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1627 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1635 $writer->addColumn($dt);
1643 $writer->addColumn($dt);
1645 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1647 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d") .
"_ecs_import.csv",
"text/csv");
1661 $ilToolbar = $DIC[
'ilToolbar'];
1663 $this->tabs_gui->setSubTabActive(
'ecs_released');
1665 if ($this->
settings->isEnabled()) {
1666 $ilToolbar->addButton(
1667 $this->lng->txt(
'ecs_read_remote_links'),
1668 $this->ctrl->getLinkTarget($this,
'readAll')
1671 $ilToolbar->addSeparator();
1674 $sel_type = $_REQUEST[
"otype"];
1679 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1682 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1685 $sel->setValue($sel_type);
1686 $ilToolbar->addInputItem($sel);
1688 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"released"));
1689 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"released");
1691 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1693 if (count($exported)) {
1694 $ilToolbar->addSeparator();
1696 $ilToolbar->addButton(
1697 $this->lng->txt(
'csv_export'),
1698 $this->ctrl->getLinkTarget($this,
'exportReleased')
1702 include_once(
'Services/WebServices/ECS/classes/class.ilECSReleasedContentTableGUI.php');
1704 $table_gui->setTitle($this->lng->txt(
'ecs_released_content'));
1705 $table_gui->parse($exported);
1706 $this->tpl->setContent($table_gui->getHTML());
1721 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1723 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1725 $ilObjDataCache->preloadObjectCache($exported);
1727 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1730 $writer->addColumn($this->lng->txt(
'title'));
1731 $writer->addColumn($this->lng->txt(
'description'));
1732 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1733 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1734 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1735 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1736 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1737 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1738 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1739 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1740 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1741 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1742 $writer->addColumn($this->lng->txt(
'last_update'));
1744 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1747 foreach ($exported as $obj_id) {
1748 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1755 $field = $settings->getMappingByECSName(0,
'courseID');
1756 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1758 $field = $settings->getMappingByECSName(0,
'term');
1759 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1761 $field = $settings->getMappingByECSName(0,
'lecturer');
1762 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1764 $field = $settings->getMappingByECSName(0,
'courseType');
1765 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1767 $field = $settings->getMappingByECSName(0,
'semester_hours');
1768 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1770 $field = $settings->getMappingByECSName(0,
'credits');
1771 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1773 $field = $settings->getMappingByECSName(0,
'room');
1774 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1776 $field = $settings->getMappingByECSName(0,
'cycle');
1777 $writer->addColumn(isset(
$values[$field]) ?
$values[$field] :
'');
1779 $field = $settings->getMappingByECSName(0,
'begin');
1785 $writer->addColumn($dt);
1787 $field = $settings->getMappingByECSName(0,
'end');
1793 $writer->addColumn($dt);
1795 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1798 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d") .
"_ecs_export.csv",
"text/csv");
1809 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1811 $options[0] = $this->lng->txt(
'ecs_ignore_field');
1812 foreach ($fields as $field) {
1814 $options[$field->getFieldId()] =
$title .
': ' . $field->getTitle();
1828 include_once(
'Services/WebServices/ECS/classes/class.ilECSSetting.php');
1841 $ilAccess = $DIC[
'ilAccess'];
1842 $this->tabs_gui->clearSubTabs();
1844 $this->tabs_gui->addSubTabTarget(
1846 $this->ctrl->getLinkTarget($this,
'overview'),
1852 #ilECSServerSettings::getInstance()->readInactiveServers(); 1857 $this->tabs_gui->addSubTabTarget(
1859 $this->ctrl->getLinkTarget($this,
'communities'),
1864 if (!$ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
1868 $this->tabs_gui->addSubTabTarget(
1870 $this->ctrl->getLinkTarget($this,
'importMappings'),
1875 $this->tabs_gui->addSubTabTarget(
1876 'ecs_category_mapping',
1877 $this->ctrl->getLinkTarget($this,
'categoryMapping')
1880 $this->tabs_gui->addSubTabTarget(
1882 $this->ctrl->getLinkTarget($this,
'imported')
1885 $this->tabs_gui->addSubTabTarget(
1887 $this->ctrl->getLinkTarget($this,
'released')
1900 $rbacreview = $DIC[
'rbacreview'];
1901 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1904 $rbacreview->getGlobalRoles(),
1910 $select[0] = $this->lng->txt(
'links_select_one');
1911 foreach ($global_roles as $role_id) {
1925 $tree = $DIC->repositoryTree();
1927 if (!
$tree->isInTree($a_ref_id) ||
$tree->isDeleted($a_ref_id)) {
1931 $loc->setTextOnly(
false);
1932 $loc->addContextItems($a_ref_id);
1934 return $loc->getHTML();
1946 $ilDB = $DIC[
'ilDB'];
1951 'next_execution_' . $this->
settings->getServerId(),
1952 time() + (int) $this->
settings->getPollingTime()
static getPossibleReleaseTypes($a_with_captions=false)
Get all possible release object types.
setMappingTabs($a_active)
Handle tabs for ECS data mapping.
This class represents an option in a radio group.
editCategoryMapping()
Edit category mapping.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
static getInstanceByServerId($a_server_id)
Get singleton instance.
categoryMapping()
Category mappings.
static getPossibleRemoteTypes($a_with_captions=false)
Get all possible remote object types.
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
const MAPPING_IMPORT_RCRS
setValue($a_value)
Set Value.
static handleImportReset(ilECSSetting $server)
Reread all imported econtent.
Helper class to generate CSV files.
static deleteServer($a_server_id)
Delete by server id ilDB $ilDB.
readAll()
Read all importable econtent.
deactivate()
activate server
communities()
show communities
static getInstance()
Get singleton instance.
static _getObjectsByOperations($a_obj_type, $a_operation, $a_usr_id=0, $limit=0)
Get all objects of a specific type and check access This function is not recursive, instead it parses the serialized rbac_pa entries.
static _lookupMID($a_obj_id)
lookup owner mid
validateImportTypes(&$import_types)
Validate import types.
static deleteByServer($a_server_id)
Delete by server id ilDB $ilDB.
Defines a rule for the assignment of ECS remote courses to categories.
exportReleased()
export released
static _lookupTitle($a_id)
lookup object title
static delete($a_server_id)
Delete comunities by server id.
saveImportMappings()
Save mappings.
setInfo($a_info)
Set Info.
saveExportMappings()
Save mappings.
edit()
Edit server setting.
static deleteByServer($a_server_id)
Delete by server id ilDB $ilDB.
deleteCategoryMappings()
Delete selected category mappings.
updateTitle()
Update configuration title.
static getPossibleFields()
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
loadFromPost()
Load from post.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initSettingsForm($a_mode='update')
init settings form
static getActiveRules()
get active rules
static getExportedIds()
Get exported ids ilDB $ilDB.
initTaskScheduler()
Init next task execution <type> $ilDB <type> $ilSetting.
exportMappings()
Show mapping settings (EContent-Data <-> (Remote)Course.
executeCommand()
Execute command.
if(isset($_POST['submit'])) $form
static _sortIds($a_ids, $a_table, $a_field, $a_id_name)
Function that sorts ids by a given table field using WHERE IN E.g: __sort(array(6,7),'usr_data','lastname','usr_id') => sorts by lastname.
released()
Show released materials.
initCategoryMappingForm($a_mode='add')
Init category mapping form.
initMappingsForm($a_server_id, $mapping_type)
init mapping form
static getInstancesByObjType($a_obj_type, $a_active_only=true)
static getAdvancedMDValuesForObjId($a_obj_id)
Get advanced metadata values for object id.
static _lookupDescription($a_id)
lookup object description
foreach($metaentries['hosted'] as $index=> $entity) foreach($metaentries['remote'] as $key=> $set) $mtype
special template class to simplify handling of ITX/PEAR
static delete($a_server_id)
Delete server ilDB $ilDB.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
initRule($a_rule_id=0)
Init rule.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Description of ilECSServerTableGUI.
static _lookupTitle($a_record_id)
Lookup title.
activate()
activate server
overview()
List available servers.
refreshParticipants()
Refresh participants.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _getInstanceByServerId($a_server_id)
get singleton instance Private access use ilECSTaskScheduler::start() or ilECSTaskScheduler::startTas...
static _getOptionalEContentFields()
get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions ...
static getExportedIdsByType($a_type)
Get exported ids by type ilDB $ilDB.
showRulesTable()
Show rules table.
exportImported()
csv export of imported remote courses
This class represents a non editable value in a property form.
static deleteByServer($a_server_id)
Delete by server $ilDB.
static getAvailabeMids($a_server_id)
Get all available mids $ilDB.
__construct()
Constructor.
initSettings($a_server_id=1)
Init settings.
prepareRoleSelect()
get global role array
imported()
Show imported materials.
static handleExportReset(ilECSSetting $server)
Handle export reset.
updateCommunities()
update whitelist
if(empty($password)) $table
delete()
Delete one participant entry <type> $ilDB.
create()
Create new settings ilTabs $ilTabs.
static _getInstance()
Get Singleton instance.
importMappings()
Show mapping settings (EContent-Data <-> (Remote)Course.
addCategoryMapping()
save category mapping
setValue($a_value)
Set Value.
updateCategoryMapping()
update category mapping
prepareFieldSelection($fields)
get options for field selection
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
Confirmation screen class.
static _getOptionalECourseFields()
get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions ...