24 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
62 $this->lng->loadLanguageModule(
'ecs');
64 $this->tabs_gui = $ilTabs;
66 $this->log =
$GLOBALS[
'DIC']->logger()->wsrv();
81 $next_class = $this->ctrl->getNextClass($this);
82 $cmd = $this->ctrl->getCmd();
85 switch ($next_class) {
86 case 'ilecsmappingsettingsgui':
87 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSMappingSettingsGUI.php';
89 $this->ctrl->setReturn($this,
'communities');
90 $this->ctrl->forwardCommand($mapset);
93 case 'ilecsparticipantsettingsgui':
94 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettingsGUI.php';
96 (
int) $_REQUEST[
'server_id'],
97 (
int) $_REQUEST[
'mid']
99 $this->ctrl->setReturn($this,
'communities');
100 $this->ctrl->forwardCommand($part);
105 if (!$ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"]) && $cmd !=
"overview" && $cmd !=
"communities") {
106 $this->ctrl->redirect($this,
"overview");
109 if (!$cmd || $cmd ==
'view') {
126 global $ilToolbar,$ilTabs, $ilAccess;
128 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
130 $ilTabs->setSubTabActive(
'overview');
131 if ($ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
132 $ilToolbar->addButton(
133 $this->lng->txt(
'ecs_add_new_ecs'),
134 $this->ctrl->getLinkTarget($this,
'create')
139 $servers->readInactiveServers();
141 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerTableGUI.php';
145 $this->tpl->setContent(
$table->getHTML());
155 $this->
settings->setEnabledStatus(
true);
158 $this->ctrl->redirect($this,
'overview');
167 $this->
settings->setEnabledStatus(
false);
170 $this->ctrl->redirect($this,
'overview');
180 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnector.php');
181 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
182 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php');
183 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
190 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
218 $ilTabs->clearTargets();
219 $ilTabs->clearSubTabs();
220 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'overview'));
223 $this->tabs_gui->setSubTabActive(
'ecs_settings');
225 $this->tpl->setContent($this->form->getHTML());
236 $this->ctrl->saveParameter($this,
'server_id', (
int) $_REQUEST[
'server_id']);
238 $ilTabs->clearTargets();
239 $ilTabs->clearSubTabs();
240 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'overview'));
243 $this->tabs_gui->setSubTabActive(
'ecs_settings');
245 $this->tpl->setContent($this->form->getHTML());
248 protected function cp()
252 $copy = clone $this->settings;
255 $this->ctrl->setParameter($this,
'server_id', $copy->getServerId());
257 $this->ctrl->redirect($this,
'edit');
263 protected function delete()
269 $ilTabs->clearTargets();
270 $ilTabs->clearSubTabs();
271 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'overview'));
273 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
275 $confirm->setFormAction($this->ctrl->getFormAction($this));
276 $confirm->setConfirm($this->lng->txt(
'delete'),
'doDelete');
277 $confirm->setCancel($this->lng->txt(
'cancel'),
'overview');
278 $confirm->setHeaderText($this->lng->txt(
'ecs_delete_setting'));
280 $confirm->addItem(
'',
'', $this->
settings->getServer());
281 $confirm->addHiddenItem(
'server_id', $this->
settings->getServerId());
283 $this->tpl->setContent($confirm->getHTML());
295 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
298 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
301 include_once
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
304 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
307 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
310 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
314 $this->ctrl->redirect($this,
'overview');
326 $this->tabs_gui->setSubTabActive(
'ecs_settings');
328 $this->tpl->setContent($this->form->getHTML());
338 if (is_object($this->form)) {
341 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
344 $this->form->setFormAction($this->ctrl->getFormAction($this,
'settings'));
345 $this->form->setTitle($this->lng->txt(
'ecs_connection_settings'));
350 $this->form->addItem($ena);
352 $server_title =
new ilTextInputGUI($this->lng->txt(
'ecs_server_title'),
'title');
354 $server_title->setSize(80);
355 $server_title->setMaxLength(128);
356 $server_title->setRequired(
true);
357 $this->form->addItem($server_title);
359 $ser =
new ilTextInputGUI($this->lng->txt(
'ecs_server_url'),
'server');
361 $ser->setRequired(
true);
362 $this->form->addItem($ser);
366 #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'), 367 # ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https'))); 369 $pro->setValue($this->
settings->getProtocol());
370 $pro->setRequired(
true);
371 $this->form->addItem($pro);
375 $por->setMaxLength(5);
376 $por->setValue((
string) $this->
settings->getPort());
377 $por->setRequired(
true);
378 $this->form->addItem($por);
382 $this->form->addItem($tcer);
386 $tcer->addOption($cert_based);
388 $cli =
new ilTextInputGUI($this->lng->txt(
'ecs_client_cert'),
'client_cert');
390 $cli->setValue((
string) $this->
settings->getClientCertPath());
391 $cli->setRequired(
true);
392 $cert_based->addSubItem($cli);
397 $key->setRequired(
true);
398 $cert_based->addSubItem(
$key);
400 $cerp =
new ilTextInputGUI($this->lng->txt(
'ecs_key_password'),
'key_password');
402 $cerp->setValue((
string) $this->
settings->getKeyPassword());
403 $cerp->setInputType(
'password');
404 $cerp->setRequired(
true);
405 $cert_based->addSubItem($cerp);
407 $cer =
new ilTextInputGUI($this->lng->txt(
'ecs_ca_cert'),
'ca_cert');
409 $cer->setValue((
string) $this->
settings->getCACertPath());
410 $cer->setRequired(
true);
411 $cert_based->addSubItem($cer);
415 $tcer->addOption($apa_based);
417 $user =
new ilTextInputGUI($this->lng->txt(
'ecs_apache_user'),
'auth_user');
419 $user->setValue((
string) $this->
settings->getAuthUser());
420 $user->setRequired(
true);
421 $apa_based->addSubItem($user);
424 $pass->setRetype(
false);
426 $pass->setMaxLength(128);
428 $pass->setRequired(
true);
429 $pass->setSkipSyntaxCheck(
true);
430 $apa_based->addSubItem(
$pass);
434 $ser->
setValue($this->
settings->getCertSerialNumber() ? $this->
settings->getCertSerialNumber() : $this->lng->txt(
'ecs_no_value'));
435 $cert_based->addSubItem($ser);
438 $loc->setTitle($this->lng->txt(
'ecs_local_settings'));
439 $this->form->addItem($loc);
443 $pol->setShowHours(
false);
444 $pol->setShowMinutes(
true);
445 $pol->setShowSeconds(
true);
446 $pol->setSeconds($this->
settings->getPollingTimeSeconds());
447 $pol->setMinutes($this->
settings->getPollingTimeMinutes());
448 $pol->setRequired(
true);
449 $pol->setInfo($this->lng->txt(
'ecs_polling_info'));
450 $this->form->addItem($pol);
455 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
456 $tpl->setVariable(
'SIZE', 5);
457 $tpl->setVariable(
'MAXLENGTH', 11);
458 $tpl->setVariable(
'POST_VAR',
'import_id');
459 $tpl->setVariable(
'PROPERTY_VALUE', $this->
settings->getImportId());
461 if ($this->
settings->getImportId()) {
464 $imp->setAlert($this->lng->txt(
'err_check_input'));
470 $imp->setHTML(
$tpl->get());
471 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
472 $this->form->addItem($imp);
475 $loc->setTitle($this->lng->txt(
'ecs_remote_user_settings'));
476 $this->form->addItem($loc);
480 $role->setValue($this->
settings->getGlobalRole());
481 $role->setInfo($this->lng->txt(
'ecs_global_role_info'));
482 $role->setRequired(
true);
483 $this->form->addItem($role);
485 $duration =
new ilDurationInputGUI($this->lng->txt(
'ecs_account_duration'),
'duration');
486 $duration->
setInfo($this->lng->txt(
'ecs_account_duration_info'));
487 $duration->setMonths($this->
settings->getDuration());
488 $duration->setShowSeconds(
false);
489 $duration->setShowMinutes(
false);
490 $duration->setShowHours(
false);
491 $duration->setShowDays(
false);
492 $duration->setShowMonths(
true);
493 $duration->setRequired(
true);
494 $this->form->addItem($duration);
498 $loc->setTitle($this->lng->txt(
'ecs_notifications'));
499 $this->form->addItem($loc);
501 $rcp_user =
new ilTextInputGUI($this->lng->txt(
'ecs_user_rcp'),
'user_recipients');
503 $rcp_user->setInfo($this->lng->txt(
'ecs_user_rcp_info'));
504 $this->form->addItem($rcp_user);
506 $rcp_econ =
new ilTextInputGUI($this->lng->txt(
'ecs_econ_rcp'),
'econtent_recipients');
507 $rcp_econ->
setValue((
string) $this->
settings->getEContentRecipientsAsString());
508 $rcp_econ->setInfo($this->lng->txt(
'ecs_econ_rcp_info'));
509 $this->form->addItem($rcp_econ);
511 $rcp_app =
new ilTextInputGUI($this->lng->txt(
'ecs_approval_rcp'),
'approval_recipients');
512 $rcp_app->
setValue((
string) $this->
settings->getApprovalRecipientsAsString());
513 $rcp_app->setInfo($this->lng->txt(
'ecs_approval_rcp_info'));
514 $this->form->addItem($rcp_app);
516 if ($a_mode ==
'update') {
517 $this->form->addCommandButton(
'update', $this->lng->txt(
'save'));
519 $this->form->addCommandButton(
'save', $this->lng->txt(
'save'));
521 $this->form->addCommandButton(
'overview', $this->lng->txt(
'cancel'));
537 #$this->updateTitle(); 561 #$this->updateTitle(); 567 $GLOBALS[
'ilCtrl']->redirect($this,
'overview');
577 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
580 foreach (
$reader->getCommunities() as $community) {
581 foreach ($community->getParticipants() as $part) {
582 $this->log->dump($community);
583 if ($part->isSelf()) {
584 $this->
settings->setTitle($part->getParticipantName());
612 $this->
settings->setPollingTimeMS((
int) $_POST[
'polling'][
'mm'], (
int) $_POST[
'polling'][
'ss']);
614 $this->
settings->setGlobalRole((
int) $_POST[
'global_role']);
615 $this->
settings->setDuration((
int) $_POST[
'duration'][
'MM']);
621 $this->
settings->setAuthType((
int) $_POST[
'auth_type']);
631 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
632 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
633 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
634 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
637 $servers->readInactiveServers();
638 foreach ($servers->getServers() as
$server) {
644 if (!$creader->getParticipantByMID($mid)) {
645 $this->log->notice(
'Deleting deprecated participant: ' .
$server->getServerId() .
' ' . $mid);
655 $this->ctrl->redirect($this,
'communities');
668 if ($ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
670 $this->lng->txt(
'ecs_refresh_participants'),
671 $this->ctrl->getLinkTarget($this,
'refreshParticipants')
676 $this->tabs_gui->setSubTabActive(
'ecs_communities');
678 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_communities.html',
'Services/WebServices/ECS');
680 $this->tpl->setVariable(
'FORMACTION', $this->ctrl->getFormAction($this,
'updateCommunities'));
682 if ($ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
683 $this->tpl->setCurrentBlock(
"submit_buttons");
684 $this->tpl->setVariable(
'TXT_SAVE', $this->lng->txt(
'save'));
685 $this->tpl->setVariable(
'TXT_CANCEL', $this->lng->txt(
'cancel'));
686 $this->tpl->parseCurrentBlock();
689 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
690 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityTableGUI.php');
692 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
694 #$settings->readInactiveServers(); 696 foreach ($settings->getServers() as
$server) {
700 foreach (
$reader->getCommunities() as $community) {
701 $this->tpl->setCurrentBlock(
'table_community');
703 $table_gui->
setTitle($community->getTitle() .
' (' . $community->getDescription() .
')');
704 $table_gui->parse($community->getParticipants());
705 $this->tpl->setVariable(
'TABLE_COMM', $table_gui->getHTML());
706 $this->tpl->parseCurrentBlock();
714 $this->tpl->setCurrentBlock(
'server');
715 $this->tpl->setVariable(
'TXT_SERVER_NAME',
$server->getTitle());
716 $this->tpl->parseCurrentBlock();
727 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
742 $new_types =
array();
748 $new_types[$sid][$mid] = $import_type;
752 $import_types = $new_types;
766 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
767 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
770 $invalidImportTypes =
false;
772 $invalidImportTypes =
true;
776 foreach ($servers->getServers() as
$server) {
782 foreach ($cReader->getCommunities() as $community) {
783 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityCache.php';
785 $cCache->setCommunityName($community->getTitle());
786 $cCache->setMids($community->getMids());
787 $cCache->setOwnId($community->getOwnId());
791 $this->log->error(
'Cannot read ecs communities: ' . $e->getMessage());
795 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
796 foreach ((
array)
$_POST[
'sci_mid'] as $sid => $tmp) {
797 foreach ((
array)
$_POST[
'sci_mid'][$sid] as $mid => $tmp) {
799 #$set->enableExport(array_key_exists($mid, (array) $_POST['export'][$sid]) ? true : false); 800 #$set->enableImport(array_key_exists($mid, (array) $_POST['import'][$sid]) ? true : false); 801 $set->setImportType(
$_POST[
'import_type'][$sid][$mid]);
807 $set->setTitle($part->getParticipantName());
811 $set->setCommunityName($com->getTitle());
814 $this->log->error(
'Cannot read ecs communities: ' . $e->getMessage());
820 if ($invalidImportTypes) {
825 $GLOBALS[
'ilCtrl']->redirect($this,
'communities');
840 global $ilTabs, $ilAccess;
842 $ilTabs->clearTargets();
843 $ilTabs->clearSubTabs();
845 $ilTabs->setBackTarget(
846 $this->lng->txt(
'ecs_settings'),
847 $this->ctrl->getLinkTarget($this,
'overview')
849 if ($ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
852 $this->lng->txt(
'ecs_tab_import'),
853 $this->ctrl->getLinkTarget($this,
'importMappings')
858 $this->lng->txt(
'ecs_tab_export'),
859 $this->ctrl->getLinkTarget($this,
'exportMappings')
864 case self::MAPPING_IMPORT:
865 $ilTabs->activateTab(
'import');
868 case self::MAPPING_EXPORT:
869 $ilTabs->activateTab(
'export');
884 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
889 if (!count($fields)) {
894 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
896 $settings->readInactiveServers();
898 $sel_srv = (int) $_REQUEST[
"ecs_mapping_server"];
907 foreach ($settings->getServers() as
$server) {
915 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
918 $sel->setValue($sel_srv);
919 $ilToolbar->addInputItem($sel);
921 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"importMappings"));
922 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"importMappings");
926 $this->tpl->setContent(
$form->getHTML());
941 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
946 if (!count($fields)) {
951 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
953 $settings->readInactiveServers();
955 $sel_srv = (int) $_REQUEST[
"ecs_mapping_server"];
964 foreach ($settings->getServers() as
$server) {
972 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
975 $sel->setValue($sel_srv);
976 $ilToolbar->addInputItem($sel);
978 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"exportMappings"));
979 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"exportMappings");
983 $this->tpl->setContent(
$form->getHTML());
998 foreach ((
array) $mappings as $ecs_field => $advmd_id) {
999 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1001 (
int) $_REQUEST[
'ecs_mapping_server'],
1005 $map->setAdvMDId($advmd_id);
1011 $this->ctrl->setParameter($this,
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
1012 $this->ctrl->redirect($this,
'importMappings');
1025 foreach ((
array) $mappings as $ecs_field => $advmd_id) {
1026 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1028 (
int)
$_POST[
'ecs_mapping_server'],
1032 $map->setAdvMDId($advmd_id);
1038 $this->ctrl->setParameter($this,
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
1039 $this->ctrl->redirect($this,
'exportMappings');
1053 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1055 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1060 if ($mapping_type == self::MAPPING_IMPORT) {
1061 $form->setTitle($this->lng->txt(
'ecs_mapping_tbl'));
1062 $form->addCommandButton(
'saveImportMappings', $this->lng->txt(
'save'));
1063 $form->addCommandButton(
'importMappings', $this->lng->txt(
'cancel'));
1065 $form->setTitle($this->lng->txt(
'ecs_mapping_exp_tbl'));
1066 $form->addCommandButton(
'saveExportMappings', $this->lng->txt(
'save'));
1067 $form->addCommandButton(
'exportMappings', $this->lng->txt(
'cancel'));
1070 $form->setFormAction($this->ctrl->getFormAction($this,
'saveMappings'));
1072 if ($mapping_type == self::MAPPING_IMPORT) {
1074 $form->addItem($assignments);
1077 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1082 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1084 foreach ($optional as $field_name) {
1085 if ($mapping_type == self::MAPPING_IMPORT) {
1087 $this->lng->txt(
'ecs_field_' . $field_name),
1092 $mapping_settings->getMappingByECSName(
1098 $assignments->addSubItem($select);
1101 $this->lng->txt(
'ecs_field_' . $field_name),
1105 $mapping_settings->getMappingByECSName(
1111 $form->addItem($select);
1116 $server->setValue($a_server_id);
1121 if ($mapping_type == self::MAPPING_EXPORT) {
1126 $form->addItem($rcrs);
1128 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1133 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1135 foreach ($optional as $field_name) {
1137 $this->lng->txt(
'ecs_field_' . $field_name),
1141 $mapping_settings->getMappingByECSName(
1147 $rcrs->addSubItem($select);
1158 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1159 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.category_mapping.html',
'Services/WebServices/ECS');
1165 $this->tpl->setVariable(
'NEW_RULE_TABLE', $this->form->getHTML());
1167 $this->tpl->setVariable(
'RULES_TABLE',
$html);
1180 if ($this->form->checkInput()) {
1181 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1182 $this->rule->setFieldName($this->form->getInput(
'field'));
1183 $this->rule->setMappingType($this->form->getInput(
'type'));
1185 switch ($this->form->getInput(
'type')) {
1187 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1191 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1192 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1196 $this->rule->setByType($this->form->getInput(
'by_type'));
1200 if ($err = $this->rule->validate()) {
1202 $this->form->setValuesByPost();
1207 $this->rule->save();
1214 $this->form->setValuesByPost();
1225 if (!$_REQUEST[
'rule_id']) {
1231 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1232 $this->ctrl->saveParameter($this,
'rule_id');
1233 $this->
initRule((
int) $_REQUEST[
'rule_id']);
1236 $this->tpl->setContent($this->form->getHTML());
1246 if (!$_REQUEST[
'rule_id']) {
1251 $this->ctrl->saveParameter($this,
'rule_id');
1252 $this->
initRule((
int) $_REQUEST[
'rule_id']);
1254 if ($this->form->checkInput()) {
1255 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1256 $this->rule->setFieldName($this->form->getInput(
'field'));
1257 $this->rule->setMappingType($this->form->getInput(
'type'));
1260 switch ($this->form->getInput(
'type')) {
1262 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1266 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1267 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1271 $this->rule->setByType($this->form->getInput(
'by_type'));
1275 if ($err = $this->rule->validate()) {
1277 $this->form->setValuesByPost();
1282 $this->rule->update();
1284 $this->ctrl->redirect($this,
'categoryMapping');
1288 $this->form->setValuesByPost();
1303 foreach (
$_POST[
'rules'] as $rule_id) {
1304 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1319 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
1324 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingTableGUI.php';
1326 $rule_table->parse($rules);
1327 return $rule_table->getHTML();
1337 if (is_object($this->rule)) {
1341 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1353 if (is_object($this->form)) {
1357 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1358 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1362 if ($a_mode ==
'add') {
1363 $this->form->setTitle($this->lng->txt(
'ecs_new_category_mapping'));
1364 $this->form->setFormAction($this->ctrl->getFormAction($this,
'categoryMapping'));
1365 $this->form->addCommandButton(
'addCategoryMapping', $this->lng->txt(
'save'));
1366 $this->form->addCommandButton(
'categoryMapping', $this->lng->txt(
'cancel'));
1368 $this->form->setTitle($this->lng->txt(
'ecs_edit_category_mapping'));
1369 $this->form->setFormAction($this->ctrl->getFormAction($this,
'editCategoryMapping'));
1370 $this->form->addCommandButton(
'updateCategoryMapping', $this->lng->txt(
'save'));
1371 $this->form->addCommandButton(
'categoryMapping', $this->lng->txt(
'cancel'));
1374 $imp =
new ilCustomInputGUI($this->lng->txt(
'ecs_import_id'),
'import_id');
1377 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
1378 $tpl->setVariable(
'SIZE', 5);
1379 $tpl->setVariable(
'MAXLENGTH', 11);
1380 $tpl->setVariable(
'POST_VAR',
'import_id');
1381 $tpl->setVariable(
'PROPERTY_VALUE', $this->rule->getContainerId());
1383 if ($this->
settings->getImportId()) {
1384 $tpl->setVariable(
'COMPLETE_PATH', $this->
buildPath($this->rule->getContainerId()));
1387 $imp->setHTML(
$tpl->get());
1388 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
1389 $this->form->addItem($imp);
1391 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php');
1392 $select =
new ilSelectInputGUI($this->lng->txt(
'ecs_attribute_name'),
'field');
1393 $select->
setValue($this->rule->getFieldName());
1394 $select->setRequired(
true);
1396 $this->form->addItem($select);
1400 $value->
setValue($this->rule->getMappingType());
1401 $value->setRequired(
true);
1404 $fixed->
setInfo($this->lng->txt(
'ecs_cat_mapping_fixed_info'));
1406 $fixed_val =
new ilTextInputGUI($this->lng->txt(
'ecs_cat_mapping_values'),
'mapping_value');
1407 $fixed_val->
setValue($this->rule->getMappingValue());
1408 $fixed_val->setMaxLength(255);
1409 $fixed_val->setSize(40);
1410 $fixed_val->setRequired(
true);
1411 $fixed->addSubItem($fixed_val);
1413 $value->addOption($fixed);
1416 $duration->
setInfo($this->lng->txt(
'ecs_cat_mapping_duration_info'));
1420 $dur_start->setDate($this->rule->getDateRangeStart());
1421 $duration->addSubItem($dur_start);
1425 $dur_end->setDate($this->rule->getDateRangeEnd());
1426 $duration->addSubItem($dur_end);
1428 $value->addOption($duration);
1431 $type->setInfo($this->lng->txt(
'ecs_cat_mapping_by_type_info'));
1437 $types->setValue($this->rule->getByType());
1438 $types->setRequired(
true);
1439 $type->addSubitem($types);
1441 $value->addOption(
$type);
1443 $this->form->addItem($value);
1456 $this->tabs_gui->setSubTabActive(
'ecs_import');
1458 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
1460 $ilToolbar->addButton(
1461 $this->lng->txt(
'ecs_read_remote_links'),
1462 $this->ctrl->getLinkTarget($this,
'readAll')
1465 $ilToolbar->addSeparator();
1469 $sel_type = $_REQUEST[
"otype"];
1474 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
1477 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1480 $sel->setValue($sel_type);
1481 $ilToolbar->addInputItem($sel);
1483 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"imported"));
1484 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"imported");
1487 if (count($robjs)) {
1488 $ilToolbar->addSeparator();
1490 $ilToolbar->addButton(
1491 $this->lng->txt(
'csv_export'),
1492 $this->ctrl->getLinkTarget($this,
'exportImported')
1496 include_once(
'Services/WebServices/ECS/classes/class.ilECSImportedContentTableGUI.php');
1498 $table_gui->setTitle($this->lng->txt(
'ecs_imported_content'));
1499 $table_gui->parse($robjs);
1500 $this->tpl->setContent($table_gui->getHTML());
1513 global $ilObjDataCache,
$ilUser;
1520 include_once(
'./Modules/RemoteCourse/classes/class.ilObjRemoteCourse.php');
1521 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
1529 $ilObjDataCache->preloadReferenceCache($rcourses);
1531 foreach ($rcourses as $rcrs_ref_id) {
1532 $obj_id = $ilObjDataCache->lookupObjId($rcrs_ref_id);
1533 $obj_ids[$obj_id] = $obj_id;
1536 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1539 $writer->addColumn($this->lng->txt(
'title'));
1540 $writer->addColumn($this->lng->txt(
'description'));
1541 $writer->addColumn($this->lng->txt(
'ecs_imported_from'));
1542 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1543 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1544 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1545 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1546 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1547 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1548 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1549 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1550 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1551 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1552 $writer->addColumn($this->lng->txt(
'last_update'));
1554 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1557 foreach ($obj_ids as $obj_id) {
1558 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1566 if (
$reader and ($participant =
$reader->getParticipantByMID($mid))) {
1567 $writer->addColumn($participant->getParticipantName());
1570 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1573 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1576 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1579 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1582 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1585 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1588 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1591 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1595 if (isset($values[$field])) {
1599 $writer->addColumn($dt);
1603 if (isset($values[$field])) {
1607 $writer->addColumn($dt);
1609 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1624 $this->tabs_gui->setSubTabActive(
'ecs_released');
1626 if ($this->
settings->isEnabled()) {
1627 $ilToolbar->addButton(
1628 $this->lng->txt(
'ecs_read_remote_links'),
1629 $this->ctrl->getLinkTarget($this,
'readAll')
1632 $ilToolbar->addSeparator();
1635 $sel_type = $_REQUEST[
"otype"];
1640 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1643 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1646 $sel->setValue($sel_type);
1647 $ilToolbar->addInputItem($sel);
1649 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"released"));
1650 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"released");
1652 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1654 if (count($exported)) {
1655 $ilToolbar->addSeparator();
1657 $ilToolbar->addButton(
1658 $this->lng->txt(
'csv_export'),
1659 $this->ctrl->getLinkTarget($this,
'exportReleased')
1663 include_once(
'Services/WebServices/ECS/classes/class.ilECSReleasedContentTableGUI.php');
1665 $table_gui->setTitle($this->lng->txt(
'ecs_released_content'));
1666 $table_gui->parse($exported);
1667 $this->tpl->setContent($table_gui->getHTML());
1680 global $ilObjDataCache;
1682 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1684 $ilObjDataCache->preloadObjectCache($exported);
1686 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1689 $writer->addColumn($this->lng->txt(
'title'));
1690 $writer->addColumn($this->lng->txt(
'description'));
1691 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1692 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1693 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1694 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1695 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1696 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1697 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1698 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1699 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1700 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1701 $writer->addColumn($this->lng->txt(
'last_update'));
1703 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1706 foreach ($exported as $obj_id) {
1707 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1714 $field = $settings->getMappingByECSName(0,
'courseID');
1715 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1717 $field = $settings->getMappingByECSName(0,
'term');
1718 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1720 $field = $settings->getMappingByECSName(0,
'lecturer');
1721 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1723 $field = $settings->getMappingByECSName(0,
'courseType');
1724 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1726 $field = $settings->getMappingByECSName(0,
'semester_hours');
1727 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1729 $field = $settings->getMappingByECSName(0,
'credits');
1730 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1732 $field = $settings->getMappingByECSName(0,
'room');
1733 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1735 $field = $settings->getMappingByECSName(0,
'cycle');
1736 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1738 $field = $settings->getMappingByECSName(0,
'begin');
1740 if (isset($values[$field])) {
1744 $writer->addColumn($dt);
1746 $field = $settings->getMappingByECSName(0,
'end');
1748 if (isset($values[$field])) {
1752 $writer->addColumn($dt);
1754 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1768 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1770 $options[0] = $this->lng->txt(
'ecs_ignore_field');
1771 foreach ($fields as $field) {
1773 $options[$field->getFieldId()] =
$title .
': ' . $field->getTitle();
1787 include_once(
'Services/WebServices/ECS/classes/class.ilECSSetting.php');
1799 $this->tabs_gui->clearSubTabs();
1801 $this->tabs_gui->addSubTabTarget(
1803 $this->ctrl->getLinkTarget($this,
'overview'),
1809 #ilECSServerSettings::getInstance()->readInactiveServers(); 1814 $this->tabs_gui->addSubTabTarget(
1816 $this->ctrl->getLinkTarget($this,
'communities'),
1821 if (!$ilAccess->checkAccess(
'write',
'', $_REQUEST[
"ref_id"])) {
1825 $this->tabs_gui->addSubTabTarget(
1827 $this->ctrl->getLinkTarget($this,
'importMappings'),
1832 $this->tabs_gui->addSubTabTarget(
1833 'ecs_category_mapping',
1834 $this->ctrl->getLinkTarget($this,
'categoryMapping')
1837 $this->tabs_gui->addSubTabTarget(
1839 $this->ctrl->getLinkTarget($this,
'imported')
1842 $this->tabs_gui->addSubTabTarget(
1844 $this->ctrl->getLinkTarget($this,
'released')
1855 global $rbacreview,$ilObjDataCache;
1858 $rbacreview->getGlobalRoles(),
1864 $select[0] = $this->lng->txt(
'links_select_one');
1865 foreach ($global_roles as $role_id) {
1879 $tree = $DIC->repositoryTree();
1881 if (!$tree->isInTree($a_ref_id) || $tree->isDeleted($a_ref_id)) {
1885 $loc->setTextOnly(
false);
1886 $loc->addContextItems($a_ref_id);
1888 return $loc->getHTML();
1902 'next_execution_' . $this->
settings->getServerId(),
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
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.
Create styles array
The data for the language used.
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.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
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
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Confirmation screen class.
static _getOptionalECourseFields()
get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions ...