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);
87 case 'ilecsparticipantsettingsgui':
88 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettingsGUI.php';
90 (
int) $_REQUEST[
'server_id'],
91 (
int) $_REQUEST[
'mid']
93 $this->ctrl->setReturn($this,
'communities');
94 $this->ctrl->forwardCommand($part);
116 global $ilToolbar,$ilTabs;
118 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
120 $ilTabs->setSubTabActive(
'overview');
121 $ilToolbar->addButton(
122 $this->lng->txt(
'ecs_add_new_ecs'),
123 $this->ctrl->getLinkTarget($this,
'create')
127 $servers->readInactiveServers();
129 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerTableGUI.php';
132 $table->parse($servers);
133 $this->tpl->setContent($table->getHTML());
143 $this->
settings->setEnabledStatus(
true);
146 $this->ctrl->redirect($this,
'overview');
155 $this->
settings->setEnabledStatus(
false);
158 $this->ctrl->redirect($this,
'overview');
168 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnector.php');
169 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
170 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php');
171 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
180 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
212 $ilTabs->clearTargets();
213 $ilTabs->clearSubTabs();
214 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
217 $this->tabs_gui->setSubTabActive(
'ecs_settings');
219 $this->tpl->setContent($this->form->getHTML());
230 $this->ctrl->saveParameter($this,
'server_id',(
int) $_REQUEST[
'server_id']);
232 $ilTabs->clearTargets();
233 $ilTabs->clearSubTabs();
234 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
237 $this->tabs_gui->setSubTabActive(
'ecs_settings');
239 $this->tpl->setContent($this->form->getHTML());
242 protected function cp()
246 $copy = clone $this->settings;
249 $this->ctrl->setParameter($this,
'server_id',$copy->getServerId());
251 $this->ctrl->redirect($this,
'edit');
257 protected function delete()
263 $ilTabs->clearTargets();
264 $ilTabs->clearSubTabs();
265 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
267 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
269 $confirm->setFormAction($this->ctrl->getFormAction($this));
270 $confirm->setConfirm($this->lng->txt(
'delete'),
'doDelete');
271 $confirm->setCancel($this->lng->txt(
'cancel'),
'overview');
272 $confirm->setHeaderText($this->lng->txt(
'ecs_delete_setting'));
274 $confirm->addItem(
'',
'',$this->
settings->getServer());
275 $confirm->addHiddenItem(
'server_id', $this->
settings->getServerId());
277 $this->tpl->setContent($confirm->getHTML());
289 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
292 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
295 include_once
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
298 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
301 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
304 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
308 $this->ctrl->redirect($this,
'overview');
320 $this->tabs_gui->setSubTabActive(
'ecs_settings');
322 $this->tpl->setContent($this->form->getHTML());
332 if(is_object($this->form))
336 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
339 $this->form->setFormAction($this->ctrl->getFormAction($this,
'settings'));
340 $this->form->setTitle($this->lng->txt(
'ecs_connection_settings'));
345 $this->form->addItem($ena);
347 $server_title =
new ilTextInputGUI($this->lng->txt(
'ecs_server_title'),
'title');
349 $server_title->setSize(80);
350 $server_title->setMaxLength(128);
351 $server_title->setRequired(
true);
352 $this->form->addItem($server_title);
354 $ser =
new ilTextInputGUI($this->lng->txt(
'ecs_server_url'),
'server');
356 $ser->setRequired(
true);
357 $this->form->addItem($ser);
361 #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'),
362 # ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https')));
364 $pro->setValue($this->
settings->getProtocol());
365 $pro->setRequired(
true);
366 $this->form->addItem($pro);
370 $por->setMaxLength(5);
371 $por->setValue((
string) $this->
settings->getPort());
372 $por->setRequired(
true);
373 $this->form->addItem($por);
377 $this->form->addItem($tcer);
381 $tcer->addOption($cert_based);
383 $cli =
new ilTextInputGUI($this->lng->txt(
'ecs_client_cert'),
'client_cert');
385 $cli->setValue((
string) $this->
settings->getClientCertPath());
386 $cli->setRequired(
true);
387 $cert_based->addSubItem($cli);
389 $key =
new ilTextInputGUI($this->lng->txt(
'ecs_cert_key'),
'key_path');
391 $key->setValue((
string) $this->
settings->getKeyPath());
392 $key->setRequired(
true);
393 $cert_based->addSubItem($key);
395 $cerp =
new ilTextInputGUI($this->lng->txt(
'ecs_key_password'),
'key_password');
397 $cerp->setValue((
string) $this->
settings->getKeyPassword());
398 $cerp->setInputType(
'password');
399 $cerp->setRequired(
true);
400 $cert_based->addSubItem($cerp);
402 $cer =
new ilTextInputGUI($this->lng->txt(
'ecs_ca_cert'),
'ca_cert');
404 $cer->setValue((
string) $this->
settings->getCACertPath());
405 $cer->setRequired(
true);
406 $cert_based->addSubItem($cer);
410 $tcer->addOption($apa_based);
412 $user =
new ilTextInputGUI($this->lng->txt(
'ecs_apache_user'),
'auth_user');
414 $user->setValue((
string) $this->
settings->getAuthUser());
415 $user->setRequired(
true);
416 $apa_based->addSubItem($user);
419 $pass->setRetype(
false);
421 $pass->setMaxLength(128);
423 $pass->setRequired(
true);
424 $pass->setSkipSyntaxCheck(TRUE);
425 $apa_based->addSubItem(
$pass);
429 $ser->
setValue($this->
settings->getCertSerialNumber() ? $this->
settings->getCertSerialNumber() : $this->lng->txt(
'ecs_no_value'));
430 $cert_based->addSubItem($ser);
433 $loc->setTitle($this->lng->txt(
'ecs_local_settings'));
434 $this->form->addItem($loc);
438 $pol->setShowHours(
false);
439 $pol->setShowMinutes(
true);
440 $pol->setShowSeconds(
true);
441 $pol->setSeconds($this->
settings->getPollingTimeSeconds());
442 $pol->setMinutes($this->
settings->getPollingTimeMinutes());
443 $pol->setRequired(
true);
444 $pol->setInfo($this->lng->txt(
'ecs_polling_info'));
445 $this->form->addItem($pol);
450 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
451 $tpl->setVariable(
'SIZE',5);
452 $tpl->setVariable(
'MAXLENGTH',11);
453 $tpl->setVariable(
'POST_VAR',
'import_id');
454 $tpl->setVariable(
'PROPERTY_VALUE',$this->
settings->getImportId());
461 $imp->setHTML(
$tpl->get());
462 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
463 $this->form->addItem($imp);
466 $loc->setTitle($this->lng->txt(
'ecs_remote_user_settings'));
467 $this->form->addItem($loc);
471 $role->setValue($this->
settings->getGlobalRole());
472 $role->setInfo($this->lng->txt(
'ecs_global_role_info'));
473 $role->setRequired(
true);
474 $this->form->addItem($role);
476 $duration =
new ilDurationInputGUI($this->lng->txt(
'ecs_account_duration'),
'duration');
477 $duration->
setInfo($this->lng->txt(
'ecs_account_duration_info'));
478 $duration->setMonths($this->
settings->getDuration());
479 $duration->setShowSeconds(
false);
480 $duration->setShowMinutes(
false);
481 $duration->setShowHours(
false);
482 $duration->setShowDays(
false);
483 $duration->setShowMonths(
true);
484 $duration->setRequired(
true);
485 $this->form->addItem($duration);
489 $loc->setTitle($this->lng->txt(
'ecs_notifications'));
490 $this->form->addItem($loc);
492 $rcp_user =
new ilTextInputGUI($this->lng->txt(
'ecs_user_rcp'),
'user_recipients');
494 $rcp_user->setInfo($this->lng->txt(
'ecs_user_rcp_info'));
495 $this->form->addItem($rcp_user);
497 $rcp_econ =
new ilTextInputGUI($this->lng->txt(
'ecs_econ_rcp'),
'econtent_recipients');
498 $rcp_econ->
setValue((
string) $this->
settings->getEContentRecipientsAsString());
499 $rcp_econ->setInfo($this->lng->txt(
'ecs_econ_rcp_info'));
500 $this->form->addItem($rcp_econ);
502 $rcp_app =
new ilTextInputGUI($this->lng->txt(
'ecs_approval_rcp'),
'approval_recipients');
503 $rcp_app->
setValue((
string) $this->
settings->getApprovalRecipientsAsString());
504 $rcp_app->setInfo($this->lng->txt(
'ecs_approval_rcp_info'));
505 $this->form->addItem($rcp_app);
507 if($a_mode ==
'update')
509 $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
513 $this->form->addCommandButton(
'save',$this->lng->txt(
'save'));
515 $this->form->addCommandButton(
'overview',$this->lng->txt(
'cancel'));
528 if(!$error = $this->
settings->validate())
532 #$this->updateTitle();
554 if(!$error = $this->
settings->validate())
559 #$this->updateTitle();
567 $GLOBALS[
'ilCtrl']->redirect($this,
'overview');
578 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
581 foreach(
$reader->getCommunities() as $community)
583 foreach($community->getParticipants() as $part)
585 $GLOBALS[
'ilLog']->write(__METHOD__.
': '.print_r($community,
true));
588 $this->
settings->setTitle($part->getParticipantName());
618 $this->
settings->setPollingTimeMS((
int) $_POST[
'polling'][
'mm'],(
int) $_POST[
'polling'][
'ss']);
620 $this->
settings->setGlobalRole((
int) $_POST[
'global_role']);
621 $this->
settings->setDuration((
int) $_POST[
'duration'][
'MM']);
627 $this->
settings->setAuthType((
int) $_POST[
'auth_type']);
638 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
639 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
640 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
641 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
644 $servers->readInactiveServers();
645 foreach($servers->getServers() as
$server)
654 if(!$creader->getParticipantByMID($mid))
656 $GLOBALS[
'ilLog']->write(__METHOD__.
': Deleting deprecated participant '.
$server->getServerId().
' '. $mid);
669 $this->ctrl->redirect($this,
'communities');
682 $this->lng->txt(
'ecs_refresh_participants'),
683 $this->ctrl->getLinkTarget($this,
'refreshParticipants')
686 $this->tabs_gui->setSubTabActive(
'ecs_communities');
688 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_communities.html',
'Services/WebServices/ECS');
690 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this,
'updateCommunities'));
691 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
692 $this->tpl->setVariable(
'TXT_CANCEL', $this->lng->txt(
'cancel'));
694 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
695 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityTableGUI.php');
697 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
699 #$settings->readInactiveServers();
701 foreach($settings->getServers() as
$server)
707 foreach(
$reader->getCommunities() as $community)
709 $this->tpl->setCurrentBlock(
'table_community');
711 $table_gui->
setTitle($community->getTitle().
' ('.$community->getDescription().
')');
712 $table_gui->parse($community->getParticipants());
713 $this->tpl->setVariable(
'TABLE_COMM',$table_gui->getHTML());
714 $this->tpl->parseCurrentBlock();
724 $this->tpl->setCurrentBlock(
'server');
725 $this->tpl->setVariable(
'TXT_SERVER_NAME',
$server->getTitle());
726 $this->tpl->parseCurrentBlock();
737 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
740 foreach((array) $import_types as $sid =>
$server)
742 foreach((array)
$server as $mid => $import_type)
756 $new_types = array();
757 foreach((array) $import_types as $sid =>
$server)
759 foreach((array)
$server as $mid => $import_type)
767 $new_types[$sid][$mid] = $import_type;
771 $import_types = $new_types;
785 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
786 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
789 $invalidImportTypes =
false;
792 $invalidImportTypes =
true;
796 foreach($servers->getServers() as
$server)
803 foreach($cReader->getCommunities() as $community)
805 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityCache.php';
807 $cCache->setCommunityName($community->getTitle());
808 $cCache->setMids($community->getMids());
809 $cCache->setOwnId($community->getOwnId());
815 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot read ecs communities: '.$e->getMessage());
819 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
820 foreach((array)
$_POST[
'sci_mid'] as $sid => $tmp)
822 foreach((array)
$_POST[
'sci_mid'][$sid] as $mid => $tmp)
825 #$set->enableExport(array_key_exists($mid, (array) $_POST['export'][$sid]) ? true : false);
826 #$set->enableImport(array_key_exists($mid, (array) $_POST['import'][$sid]) ? true : false);
827 $set->setImportType(
$_POST[
'import_type'][$sid][$mid]);
834 $set->setTitle($part->getParticipantName());
839 $set->setCommunityName($com->getTitle());
844 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot read ecs communities: '.$e->getMessage());
850 if($invalidImportTypes)
858 $GLOBALS[
'ilCtrl']->redirect($this,
'communities');
875 $ilTabs->clearTargets();
876 $ilTabs->clearSubTabs();
878 $ilTabs->setBackTarget(
879 $this->lng->txt(
'ecs_settings'),
880 $this->ctrl->getLinkTarget($this,
'overview')
884 $this->lng->txt(
'ecs_tab_import'),
885 $this->ctrl->getLinkTarget($this,
'importMappings')
889 $this->lng->txt(
'ecs_tab_export'),
890 $this->ctrl->getLinkTarget($this,
'exportMappings')
896 case self::MAPPING_IMPORT:
897 $ilTabs->activateTab(
'import');
900 case self::MAPPING_EXPORT:
901 $ilTabs->activateTab(
'export');
916 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
927 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
929 $settings->readInactiveServers();
931 $sel_srv = (int)
$_REQUEST[
"ecs_mapping_server"];
942 $options = array(0 => $this->lng->txt(
"please_choose"));
943 foreach($settings->getServers() as
$server)
948 $title =
"ECS (".$server->getServerId().
")";
953 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
956 $sel->setValue($sel_srv);
957 $ilToolbar->addInputItem($sel);
959 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"importMappings"));
960 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"importMappings");
965 $this->tpl->setContent($form->getHTML());
980 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
991 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
993 $settings->readInactiveServers();
995 $sel_srv = (int)
$_REQUEST[
"ecs_mapping_server"];
1006 $options = array(0 => $this->lng->txt(
"please_choose"));
1007 foreach($settings->getServers() as
$server)
1012 $title =
"ECS (".$server->getServerId().
")";
1017 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1020 $sel->setValue($sel_srv);
1021 $ilToolbar->addInputItem($sel);
1023 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"exportMappings"));
1024 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"exportMappings");
1029 $this->tpl->setContent($form->getHTML());
1043 foreach((array)
$_POST[
'mapping'] as $mtype => $mappings)
1045 foreach((array) $mappings as $ecs_field => $advmd_id)
1047 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1053 $map->setAdvMDId($advmd_id);
1059 $this->ctrl->setParameter($this,
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
1060 $this->ctrl->redirect($this,
'importMappings');
1072 foreach((array)
$_POST[
'mapping'] as $mtype => $mappings)
1074 foreach((array) $mappings as $ecs_field => $advmd_id)
1076 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1078 (
int)
$_POST[
'ecs_mapping_server'],
1082 $map->setAdvMDId($advmd_id);
1088 $this->ctrl->setParameter($this,
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
1089 $this->ctrl->redirect($this,
'exportMappings');
1103 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1105 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1110 if($mapping_type == self::MAPPING_IMPORT)
1112 $form->setTitle($this->lng->txt(
'ecs_mapping_tbl'));
1113 $form->addCommandButton(
'saveImportMappings',$this->lng->txt(
'save'));
1114 $form->addCommandButton(
'importMappings',$this->lng->txt(
'cancel'));
1118 $form->setTitle($this->lng->txt(
'ecs_mapping_exp_tbl'));
1119 $form->addCommandButton(
'saveExportMappings',$this->lng->txt(
'save'));
1120 $form->addCommandButton(
'exportMappings',$this->lng->txt(
'cancel'));
1123 $form->setFormAction($this->ctrl->getFormAction($this,
'saveMappings'));
1125 if($mapping_type == self::MAPPING_IMPORT)
1128 $form->addItem($assignments);
1131 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1136 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1138 foreach($optional as $field_name)
1140 if($mapping_type == self::MAPPING_IMPORT)
1143 $this->lng->txt(
'ecs_field_'.$field_name),
1148 $mapping_settings->getMappingByECSName(
1153 $assignments->addSubItem($select);
1158 $this->lng->txt(
'ecs_field_'.$field_name),
1162 $mapping_settings->getMappingByECSName(
1167 $form->addItem($select);
1172 $server->setValue($a_server_id);
1177 if($mapping_type == self::MAPPING_EXPORT)
1183 $form->addItem($rcrs);
1185 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1190 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1192 foreach($optional as $field_name)
1195 $this->lng->txt(
'ecs_field_'.$field_name),
1196 'mapping['.ilECSDataMappingSetting::MAPPING_IMPORT_RCRS.
']['.$field_name.
']');
1198 $mapping_settings->getMappingByECSName(
1203 $rcrs->addSubItem($select);
1214 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1215 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.category_mapping.html',
'Services/WebServices/ECS');
1221 $this->tpl->setVariable(
'NEW_RULE_TABLE',$this->form->getHTML());
1224 $this->tpl->setVariable(
'RULES_TABLE',$html);
1237 if($this->form->checkInput())
1239 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1240 $this->rule->setFieldName($this->form->getInput(
'field'));
1241 $this->rule->setMappingType($this->form->getInput(
'type'));
1243 switch($this->form->getInput(
'type'))
1246 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1250 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1251 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1255 $this->rule->setByType($this->form->getInput(
'by_type'));
1259 if($err = $this->rule->validate())
1262 $this->form->setValuesByPost();
1267 $this->rule->save();
1274 $this->form->setValuesByPost();
1292 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1293 $this->ctrl->saveParameter($this,
'rule_id');
1297 $this->tpl->setContent($this->form->getHTML());
1313 $this->ctrl->saveParameter($this,
'rule_id');
1316 if($this->form->checkInput())
1318 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1319 $this->rule->setFieldName($this->form->getInput(
'field'));
1320 $this->rule->setMappingType($this->form->getInput(
'type'));
1322 switch($this->form->getInput(
'type'))
1325 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1329 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1330 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1334 $this->rule->setByType($this->form->getInput(
'by_type'));
1338 if($err = $this->rule->validate())
1341 $this->form->setValuesByPost();
1346 $this->rule->update();
1348 $this->ctrl->redirect($this,
'categoryMapping');
1352 $this->form->setValuesByPost();
1369 foreach(
$_POST[
'rules'] as $rule_id)
1371 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1386 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
1392 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingTableGUI.php';
1394 $rule_table->parse($rules);
1395 return $rule_table->getHTML();
1405 if(is_object($this->rule))
1410 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1422 if(is_object($this->form))
1427 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1428 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1432 if($a_mode ==
'add')
1434 $this->form->setTitle($this->lng->txt(
'ecs_new_category_mapping'));
1435 $this->form->setFormAction($this->ctrl->getFormAction($this,
'categoryMapping'));
1436 $this->form->addCommandButton(
'addCategoryMapping',$this->lng->txt(
'save'));
1437 $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
1441 $this->form->setTitle($this->lng->txt(
'ecs_edit_category_mapping'));
1442 $this->form->setFormAction($this->ctrl->getFormAction($this,
'editCategoryMapping'));
1443 $this->form->addCommandButton(
'updateCategoryMapping',$this->lng->txt(
'save'));
1444 $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
1450 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
1451 $tpl->setVariable(
'SIZE',5);
1452 $tpl->setVariable(
'MAXLENGTH',11);
1453 $tpl->setVariable(
'POST_VAR',
'import_id');
1454 $tpl->setVariable(
'PROPERTY_VALUE',$this->rule->getContainerId());
1458 $tpl->setVariable(
'COMPLETE_PATH',$this->
buildPath($this->rule->getContainerId()));
1461 $imp->setHTML(
$tpl->get());
1462 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
1463 $this->form->addItem($imp);
1465 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php');
1466 $select =
new ilSelectInputGUI($this->lng->txt(
'ecs_attribute_name'),
'field');
1467 $select->
setValue($this->rule->getFieldName());
1468 $select->setRequired(
true);
1470 $this->form->addItem($select);
1474 $value->
setValue($this->rule->getMappingType());
1475 $value->setRequired(
true);
1478 $fixed->
setInfo($this->lng->txt(
'ecs_cat_mapping_fixed_info'));
1480 $fixed_val =
new ilTextInputGUI($this->lng->txt(
'ecs_cat_mapping_values'),
'mapping_value');
1481 $fixed_val->
setValue($this->rule->getMappingValue());
1482 $fixed_val->setMaxLength(255);
1483 $fixed_val->setSize(40);
1484 $fixed_val->setRequired(
true);
1485 $fixed->addSubItem($fixed_val);
1487 $value->addOption($fixed);
1490 $duration->
setInfo($this->lng->txt(
'ecs_cat_mapping_duration_info'));
1493 $dur_start->
setDate($this->rule->getDateRangeStart());
1494 $duration->addSubItem($dur_start);
1497 $dur_end->
setDate($this->rule->getDateRangeEnd());
1498 $duration->addSubItem($dur_end);
1500 $value->addOption($duration);
1503 $type->
setInfo($this->lng->txt(
'ecs_cat_mapping_by_type_info'));
1509 $types->setValue($this->rule->getByType());
1510 $types->setRequired(
true);
1511 $type->addSubitem($types);
1513 $value->addOption($type);
1515 $this->form->addItem($value);
1529 $this->tabs_gui->setSubTabActive(
'ecs_import');
1531 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
1534 $ilToolbar->addButton(
1535 $this->lng->txt(
'ecs_read_remote_links'),
1536 $this->ctrl->getLinkTarget($this,
'readAll')
1539 $ilToolbar->addSeparator();
1549 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
1552 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1555 $sel->setValue($sel_type);
1556 $ilToolbar->addInputItem($sel);
1558 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"imported"));
1559 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"imported");
1564 $ilToolbar->addSeparator();
1566 $ilToolbar->addButton(
1567 $this->lng->txt(
'csv_export'),
1568 $this->ctrl->getLinkTarget($this,
'exportImported')
1572 include_once(
'Services/WebServices/ECS/classes/class.ilECSImportedContentTableGUI.php');
1574 $table_gui->setTitle($this->lng->txt(
'ecs_imported_content'));
1575 $table_gui->parse($robjs);
1576 $this->tpl->setContent($table_gui->getHTML());
1589 global $ilObjDataCache,
$ilUser;
1596 include_once(
'./Modules/RemoteCourse/classes/class.ilObjRemoteCourse.php');
1597 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
1608 $ilObjDataCache->preloadReferenceCache($rcourses);
1610 foreach($rcourses as $rcrs_ref_id)
1612 $obj_id = $ilObjDataCache->lookupObjId($rcrs_ref_id);
1613 $obj_ids[$obj_id] = $obj_id;
1616 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1619 $writer->addColumn($this->lng->txt(
'title'));
1620 $writer->addColumn($this->lng->txt(
'description'));
1621 $writer->addColumn($this->lng->txt(
'ecs_imported_from'));
1622 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1623 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1624 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1625 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1626 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1627 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1628 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1629 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1630 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1631 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1632 $writer->addColumn($this->lng->txt(
'last_update'));
1634 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1637 foreach($obj_ids as $obj_id)
1639 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1647 if(
$reader and ($participant =
$reader->getParticipantByMID($mid)))
1649 $writer->addColumn($participant->getParticipantName());
1652 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1655 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1658 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1661 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1664 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1667 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1670 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1673 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1681 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1683 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d").
"_ecs_import.csv",
"text/csv");
1696 $this->tabs_gui->setSubTabActive(
'ecs_released');
1700 $ilToolbar->addButton(
1701 $this->lng->txt(
'ecs_read_remote_links'),
1702 $this->ctrl->getLinkTarget($this,
'readAll')
1705 $ilToolbar->addSeparator();
1714 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1717 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1720 $sel->setValue($sel_type);
1721 $ilToolbar->addInputItem($sel);
1723 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"released"));
1724 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"released");
1726 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1728 if(count($exported))
1730 $ilToolbar->addSeparator();
1732 $ilToolbar->addButton(
1733 $this->lng->txt(
'csv_export'),
1734 $this->ctrl->getLinkTarget($this,
'exportReleased')
1738 include_once(
'Services/WebServices/ECS/classes/class.ilECSReleasedContentTableGUI.php');
1740 $table_gui->setTitle($this->lng->txt(
'ecs_released_content'));
1741 $table_gui->parse($exported);
1742 $this->tpl->setContent($table_gui->getHTML());
1755 global $ilObjDataCache;
1757 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1759 $ilObjDataCache->preloadObjectCache($exported);
1761 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1764 $writer->addColumn($this->lng->txt(
'title'));
1765 $writer->addColumn($this->lng->txt(
'description'));
1766 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1767 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1768 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1769 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1770 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1771 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1772 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1773 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1774 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1775 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1776 $writer->addColumn($this->lng->txt(
'last_update'));
1778 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1781 foreach($exported as $obj_id)
1783 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1790 $field = $settings->getMappingByECSName(0,
'courseID');
1791 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1793 $field = $settings->getMappingByECSName(0,
'term');
1794 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1796 $field = $settings->getMappingByECSName(0,
'lecturer');
1797 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1799 $field = $settings->getMappingByECSName(0,
'courseType');
1800 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1802 $field = $settings->getMappingByECSName(0,
'semester_hours');
1803 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1805 $field = $settings->getMappingByECSName(0,
'credits');
1806 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1808 $field = $settings->getMappingByECSName(0,
'room');
1809 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1811 $field = $settings->getMappingByECSName(0,
'cycle');
1812 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1814 $field = $settings->getMappingByECSName(0,
'begin');
1817 $field = $settings->getMappingByECSName(0,
'end');
1820 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1823 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d").
"_ecs_export.csv",
"text/csv");
1834 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1836 $options[0] = $this->lng->txt(
'ecs_ignore_field');
1837 foreach($fields as $field)
1840 $options[$field->getFieldId()] = $title.
': '.$field->getTitle();
1854 include_once(
'Services/WebServices/ECS/classes/class.ilECSSetting.php');
1865 $this->tabs_gui->clearSubTabs();
1867 $this->tabs_gui->addSubTabTarget(
"overview",
1868 $this->ctrl->getLinkTarget($this,
'overview'),
1869 "overview",get_class($this));
1872 #ilECSServerSettings::getInstance()->readInactiveServers();
1878 $this->tabs_gui->addSubTabTarget(
"ecs_communities",
1879 $this->ctrl->getLinkTarget($this,
'communities'),
1880 "communities",get_class($this));
1882 $this->tabs_gui->addSubTabTarget(
'ecs_mappings',
1883 $this->ctrl->getLinkTarget($this,
'importMappings'),
1884 'importMappings',get_class($this));
1886 $this->tabs_gui->addSubTabTarget(
'ecs_category_mapping',
1887 $this->ctrl->getLinkTarget($this,
'categoryMapping'));
1889 $this->tabs_gui->addSubTabTarget(
'ecs_import',
1890 $this->ctrl->getLinkTarget($this,
'imported'));
1892 $this->tabs_gui->addSubTabTarget(
'ecs_released',
1893 $this->ctrl->getLinkTarget($this,
'released'));
1904 global $rbacreview,$ilObjDataCache;
1911 $select[0] = $this->lng->txt(
'links_select_one');
1912 foreach($global_roles as $role_id)
1922 $loc->setTextOnly(
false);
1923 $loc->addContextItems($a_ref_id);
1925 return $loc->getHTML();
1937 #$ilDB->lockTables(array('name' => 'settings', 'type' => ilDB::LOCK_WRITE));
1940 'next_execution_'.$this->
settings->getServerId(),
1941 time() + (int) $this->
settings->getPollingTime()