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();
87 case 'ilecsmappingsettingsgui':
88 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSMappingSettingsGUI.php';
90 $this->ctrl->setReturn($this,
'communities');
91 $this->ctrl->forwardCommand($mapset);
94 case 'ilecsparticipantsettingsgui':
95 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettingsGUI.php';
97 (
int) $_REQUEST[
'server_id'],
98 (
int) $_REQUEST[
'mid']
100 $this->ctrl->setReturn($this,
'communities');
101 $this->ctrl->forwardCommand($part);
106 if(!$ilAccess->checkAccess(
'write',
'',$_REQUEST[
"ref_id"]) &&
$cmd !=
"overview" &&
$cmd !=
"communities")
108 $this->ctrl->redirect($this,
"overview");
129 global $ilToolbar,$ilTabs, $ilAccess;
131 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
133 $ilTabs->setSubTabActive(
'overview');
134 if($ilAccess->checkAccess(
'write',
'',$_REQUEST[
"ref_id"]))
136 $ilToolbar->addButton(
137 $this->lng->txt(
'ecs_add_new_ecs'),
138 $this->ctrl->getLinkTarget($this,
'create')
143 $servers->readInactiveServers();
145 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerTableGUI.php';
148 $table->parse($servers);
149 $this->tpl->setContent($table->getHTML());
159 $this->
settings->setEnabledStatus(
true);
162 $this->ctrl->redirect($this,
'overview');
171 $this->
settings->setEnabledStatus(
false);
174 $this->ctrl->redirect($this,
'overview');
184 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnector.php');
185 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
186 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php');
187 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
196 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
228 $ilTabs->clearTargets();
229 $ilTabs->clearSubTabs();
230 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
233 $this->tabs_gui->setSubTabActive(
'ecs_settings');
235 $this->tpl->setContent($this->form->getHTML());
246 $this->ctrl->saveParameter($this,
'server_id',(
int) $_REQUEST[
'server_id']);
248 $ilTabs->clearTargets();
249 $ilTabs->clearSubTabs();
250 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
253 $this->tabs_gui->setSubTabActive(
'ecs_settings');
255 $this->tpl->setContent($this->form->getHTML());
258 protected function cp()
262 $copy = clone $this->settings;
265 $this->ctrl->setParameter($this,
'server_id',$copy->getServerId());
267 $this->ctrl->redirect($this,
'edit');
273 protected function delete()
279 $ilTabs->clearTargets();
280 $ilTabs->clearSubTabs();
281 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
283 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
285 $confirm->setFormAction($this->ctrl->getFormAction($this));
286 $confirm->setConfirm($this->lng->txt(
'delete'),
'doDelete');
287 $confirm->setCancel($this->lng->txt(
'cancel'),
'overview');
288 $confirm->setHeaderText($this->lng->txt(
'ecs_delete_setting'));
290 $confirm->addItem(
'',
'',$this->
settings->getServer());
291 $confirm->addHiddenItem(
'server_id', $this->
settings->getServerId());
293 $this->tpl->setContent($confirm->getHTML());
305 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
308 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
311 include_once
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
314 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
317 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
320 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
324 $this->ctrl->redirect($this,
'overview');
336 $this->tabs_gui->setSubTabActive(
'ecs_settings');
338 $this->tpl->setContent($this->form->getHTML());
348 if(is_object($this->form))
352 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
355 $this->form->setFormAction($this->ctrl->getFormAction($this,
'settings'));
356 $this->form->setTitle($this->lng->txt(
'ecs_connection_settings'));
361 $this->form->addItem($ena);
363 $server_title =
new ilTextInputGUI($this->lng->txt(
'ecs_server_title'),
'title');
365 $server_title->setSize(80);
366 $server_title->setMaxLength(128);
367 $server_title->setRequired(
true);
368 $this->form->addItem($server_title);
370 $ser =
new ilTextInputGUI($this->lng->txt(
'ecs_server_url'),
'server');
372 $ser->setRequired(
true);
373 $this->form->addItem($ser);
377 #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'), 378 # ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https'))); 380 $pro->setValue($this->
settings->getProtocol());
381 $pro->setRequired(
true);
382 $this->form->addItem($pro);
386 $por->setMaxLength(5);
387 $por->setValue((
string) $this->
settings->getPort());
388 $por->setRequired(
true);
389 $this->form->addItem($por);
393 $this->form->addItem($tcer);
397 $tcer->addOption($cert_based);
399 $cli =
new ilTextInputGUI($this->lng->txt(
'ecs_client_cert'),
'client_cert');
401 $cli->setValue((
string) $this->
settings->getClientCertPath());
402 $cli->setRequired(
true);
403 $cert_based->addSubItem($cli);
405 $key =
new ilTextInputGUI($this->lng->txt(
'ecs_cert_key'),
'key_path');
407 $key->setValue((
string) $this->
settings->getKeyPath());
408 $key->setRequired(
true);
409 $cert_based->addSubItem($key);
411 $cerp =
new ilTextInputGUI($this->lng->txt(
'ecs_key_password'),
'key_password');
413 $cerp->setValue((
string) $this->
settings->getKeyPassword());
414 $cerp->setInputType(
'password');
415 $cerp->setRequired(
true);
416 $cert_based->addSubItem($cerp);
418 $cer =
new ilTextInputGUI($this->lng->txt(
'ecs_ca_cert'),
'ca_cert');
420 $cer->setValue((
string) $this->
settings->getCACertPath());
421 $cer->setRequired(
true);
422 $cert_based->addSubItem($cer);
426 $tcer->addOption($apa_based);
428 $user =
new ilTextInputGUI($this->lng->txt(
'ecs_apache_user'),
'auth_user');
430 $user->setValue((
string) $this->
settings->getAuthUser());
431 $user->setRequired(
true);
432 $apa_based->addSubItem($user);
435 $pass->setRetype(
false);
437 $pass->setMaxLength(128);
439 $pass->setRequired(
true);
440 $pass->setSkipSyntaxCheck(TRUE);
441 $apa_based->addSubItem(
$pass);
445 $ser->
setValue($this->
settings->getCertSerialNumber() ? $this->
settings->getCertSerialNumber() : $this->lng->txt(
'ecs_no_value'));
446 $cert_based->addSubItem($ser);
449 $loc->setTitle($this->lng->txt(
'ecs_local_settings'));
450 $this->form->addItem($loc);
454 $pol->setShowHours(
false);
455 $pol->setShowMinutes(
true);
456 $pol->setShowSeconds(
true);
457 $pol->setSeconds($this->
settings->getPollingTimeSeconds());
458 $pol->setMinutes($this->
settings->getPollingTimeMinutes());
459 $pol->setRequired(
true);
460 $pol->setInfo($this->lng->txt(
'ecs_polling_info'));
461 $this->form->addItem($pol);
466 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
467 $tpl->setVariable(
'SIZE',5);
468 $tpl->setVariable(
'MAXLENGTH',11);
469 $tpl->setVariable(
'POST_VAR',
'import_id');
470 $tpl->setVariable(
'PROPERTY_VALUE',$this->
settings->getImportId());
477 $imp->setHTML(
$tpl->get());
478 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
479 $this->form->addItem($imp);
482 $loc->setTitle($this->lng->txt(
'ecs_remote_user_settings'));
483 $this->form->addItem($loc);
487 $role->setValue($this->
settings->getGlobalRole());
488 $role->setInfo($this->lng->txt(
'ecs_global_role_info'));
489 $role->setRequired(
true);
490 $this->form->addItem($role);
493 $duration->setInfo($this->lng->txt(
'ecs_account_duration_info'));
505 $loc->setTitle($this->lng->txt(
'ecs_notifications'));
506 $this->form->addItem($loc);
508 $rcp_user =
new ilTextInputGUI($this->lng->txt(
'ecs_user_rcp'),
'user_recipients');
510 $rcp_user->setInfo($this->lng->txt(
'ecs_user_rcp_info'));
511 $this->form->addItem($rcp_user);
513 $rcp_econ =
new ilTextInputGUI($this->lng->txt(
'ecs_econ_rcp'),
'econtent_recipients');
514 $rcp_econ->
setValue((
string) $this->
settings->getEContentRecipientsAsString());
515 $rcp_econ->setInfo($this->lng->txt(
'ecs_econ_rcp_info'));
516 $this->form->addItem($rcp_econ);
518 $rcp_app =
new ilTextInputGUI($this->lng->txt(
'ecs_approval_rcp'),
'approval_recipients');
519 $rcp_app->
setValue((
string) $this->
settings->getApprovalRecipientsAsString());
520 $rcp_app->setInfo($this->lng->txt(
'ecs_approval_rcp_info'));
521 $this->form->addItem($rcp_app);
523 if($a_mode ==
'update')
525 $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
529 $this->form->addCommandButton(
'save',$this->lng->txt(
'save'));
531 $this->form->addCommandButton(
'overview',$this->lng->txt(
'cancel'));
548 #$this->updateTitle(); 575 #$this->updateTitle(); 583 $GLOBALS[
'ilCtrl']->redirect($this,
'overview');
594 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
597 foreach(
$reader->getCommunities() as $community)
599 foreach($community->getParticipants() as $part)
601 $this->log->dump($community);
604 $this->
settings->setTitle($part->getParticipantName());
634 $this->
settings->setPollingTimeMS((
int) $_POST[
'polling'][
'mm'],(
int) $_POST[
'polling'][
'ss']);
636 $this->
settings->setGlobalRole((
int) $_POST[
'global_role']);
637 $this->
settings->setDuration((
int) $_POST[
'duration'][
'MM']);
643 $this->
settings->setAuthType((
int) $_POST[
'auth_type']);
654 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
655 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
656 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
657 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
660 $servers->readInactiveServers();
661 foreach($servers->getServers() as
$server)
670 if(!$creader->getParticipantByMID($mid))
672 $this->log->notice(
'Deleting deprecated participant: ' .
$server->getServerId().
' '. $mid);
684 $this->ctrl->redirect($this,
'communities');
697 if($ilAccess->checkAccess(
'write',
'',$_REQUEST[
"ref_id"]))
700 $this->lng->txt(
'ecs_refresh_participants'),
701 $this->ctrl->getLinkTarget($this,
'refreshParticipants')
706 $this->tabs_gui->setSubTabActive(
'ecs_communities');
708 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_communities.html',
'Services/WebServices/ECS');
710 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this,
'updateCommunities'));
712 if($ilAccess->checkAccess(
'write',
'',$_REQUEST[
"ref_id"]))
714 $this->tpl->setCurrentBlock(
"submit_buttons");
715 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
716 $this->tpl->setVariable(
'TXT_CANCEL', $this->lng->txt(
'cancel'));
717 $this->tpl->parseCurrentBlock();
720 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
721 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityTableGUI.php');
723 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
725 #$settings->readInactiveServers(); 727 foreach($settings->getServers() as
$server)
733 foreach(
$reader->getCommunities() as $community)
735 $this->tpl->setCurrentBlock(
'table_community');
737 $table_gui->
setTitle($community->getTitle().
' ('.$community->getDescription().
')');
738 $table_gui->parse($community->getParticipants());
739 $this->tpl->setVariable(
'TABLE_COMM',$table_gui->getHTML());
740 $this->tpl->parseCurrentBlock();
750 $this->tpl->setCurrentBlock(
'server');
751 $this->tpl->setVariable(
'TXT_SERVER_NAME',
$server->getTitle());
752 $this->tpl->parseCurrentBlock();
763 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
782 $new_types =
array();
793 $new_types[$sid][$mid] = $import_type;
797 $import_types = $new_types;
811 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
812 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
815 $invalidImportTypes =
false;
818 $invalidImportTypes =
true;
822 foreach($servers->getServers() as
$server)
829 foreach($cReader->getCommunities() as $community)
831 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityCache.php';
833 $cCache->setCommunityName($community->getTitle());
834 $cCache->setMids($community->getMids());
835 $cCache->setOwnId($community->getOwnId());
841 $this->log->error(
'Cannot read ecs communities: ' . $e->getMessage());
845 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
848 foreach((
array)
$_POST[
'sci_mid'][$sid] as $mid => $tmp)
851 #$set->enableExport(array_key_exists($mid, (array) $_POST['export'][$sid]) ? true : false); 852 #$set->enableImport(array_key_exists($mid, (array) $_POST['import'][$sid]) ? true : false); 853 $set->setImportType(
$_POST[
'import_type'][$sid][$mid]);
860 $set->setTitle($part->getParticipantName());
865 $set->setCommunityName($com->getTitle());
870 $this->log->error(
'Cannot read ecs communities: ' . $e->getMessage());
876 if($invalidImportTypes)
884 $GLOBALS[
'ilCtrl']->redirect($this,
'communities');
899 global $ilTabs, $ilAccess;
901 $ilTabs->clearTargets();
902 $ilTabs->clearSubTabs();
904 $ilTabs->setBackTarget(
905 $this->lng->txt(
'ecs_settings'),
906 $this->ctrl->getLinkTarget($this,
'overview')
908 if($ilAccess->checkAccess(
'write',
'',$_REQUEST[
"ref_id"]))
912 $this->lng->txt(
'ecs_tab_import'),
913 $this->ctrl->getLinkTarget($this,
'importMappings')
918 $this->lng->txt(
'ecs_tab_export'),
919 $this->ctrl->getLinkTarget($this,
'exportMappings')
925 case self::MAPPING_IMPORT:
926 $ilTabs->activateTab(
'import');
929 case self::MAPPING_EXPORT:
930 $ilTabs->activateTab(
'export');
945 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
956 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
958 $settings->readInactiveServers();
960 $sel_srv = (int)$_REQUEST[
"ecs_mapping_server"];
972 foreach($settings->getServers() as
$server)
977 $title =
"ECS (".$server->getServerId().
")";
982 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
985 $sel->setValue($sel_srv);
986 $ilToolbar->addInputItem($sel);
988 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"importMappings"));
989 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"importMappings");
994 $this->tpl->setContent($form->getHTML());
1009 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1020 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
1022 $settings->readInactiveServers();
1024 $sel_srv = (int)$_REQUEST[
"ecs_mapping_server"];
1036 foreach($settings->getServers() as
$server)
1041 $title =
"ECS (".$server->getServerId().
")";
1046 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1049 $sel->setValue($sel_srv);
1050 $ilToolbar->addInputItem($sel);
1052 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"exportMappings"));
1053 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"exportMappings");
1058 $this->tpl->setContent($form->getHTML());
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) $_REQUEST[
'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,
'importMappings');
1101 foreach((
array)
$_POST[
'mapping'] as $mtype => $mappings)
1103 foreach((
array) $mappings as $ecs_field => $advmd_id)
1105 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1107 (
int)
$_POST[
'ecs_mapping_server'],
1111 $map->setAdvMDId($advmd_id);
1117 $this->ctrl->setParameter($this,
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
1118 $this->ctrl->redirect($this,
'exportMappings');
1132 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1134 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1139 if($mapping_type == self::MAPPING_IMPORT)
1141 $form->setTitle($this->lng->txt(
'ecs_mapping_tbl'));
1142 $form->addCommandButton(
'saveImportMappings',$this->lng->txt(
'save'));
1143 $form->addCommandButton(
'importMappings',$this->lng->txt(
'cancel'));
1147 $form->setTitle($this->lng->txt(
'ecs_mapping_exp_tbl'));
1148 $form->addCommandButton(
'saveExportMappings',$this->lng->txt(
'save'));
1149 $form->addCommandButton(
'exportMappings',$this->lng->txt(
'cancel'));
1152 $form->setFormAction($this->ctrl->getFormAction($this,
'saveMappings'));
1154 if($mapping_type == self::MAPPING_IMPORT)
1157 $form->addItem($assignments);
1160 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1165 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1167 foreach($optional as $field_name)
1169 if($mapping_type == self::MAPPING_IMPORT)
1172 $this->lng->txt(
'ecs_field_'.$field_name),
1177 $mapping_settings->getMappingByECSName(
1182 $assignments->addSubItem($select);
1187 $this->lng->txt(
'ecs_field_'.$field_name),
1191 $mapping_settings->getMappingByECSName(
1196 $form->addItem($select);
1201 $server->setValue($a_server_id);
1206 if($mapping_type == self::MAPPING_EXPORT)
1212 $form->addItem($rcrs);
1214 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1219 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1221 foreach($optional as $field_name)
1224 $this->lng->txt(
'ecs_field_'.$field_name),
1225 'mapping['.ilECSDataMappingSetting::MAPPING_IMPORT_RCRS.
']['.$field_name.
']');
1227 $mapping_settings->getMappingByECSName(
1232 $rcrs->addSubItem($select);
1243 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1244 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.category_mapping.html',
'Services/WebServices/ECS');
1250 $this->tpl->setVariable(
'NEW_RULE_TABLE',$this->form->getHTML());
1253 $this->tpl->setVariable(
'RULES_TABLE',
$html);
1266 if($this->form->checkInput())
1268 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1269 $this->rule->setFieldName($this->form->getInput(
'field'));
1270 $this->rule->setMappingType($this->form->getInput(
'type'));
1272 switch($this->form->getInput(
'type'))
1275 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1279 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1280 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1284 $this->rule->setByType($this->form->getInput(
'by_type'));
1288 if($err = $this->rule->validate())
1291 $this->form->setValuesByPost();
1296 $this->rule->save();
1303 $this->form->setValuesByPost();
1314 if(!$_REQUEST[
'rule_id'])
1321 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1322 $this->ctrl->saveParameter($this,
'rule_id');
1323 $this->
initRule((
int) $_REQUEST[
'rule_id']);
1326 $this->tpl->setContent($this->form->getHTML());
1336 if(!$_REQUEST[
'rule_id'])
1342 $this->ctrl->saveParameter($this,
'rule_id');
1343 $this->
initRule((
int) $_REQUEST[
'rule_id']);
1345 if($this->form->checkInput())
1347 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1348 $this->rule->setFieldName($this->form->getInput(
'field'));
1349 $this->rule->setMappingType($this->form->getInput(
'type'));
1352 switch($this->form->getInput(
'type'))
1355 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1359 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1360 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1364 $this->rule->setByType($this->form->getInput(
'by_type'));
1368 if($err = $this->rule->validate())
1371 $this->form->setValuesByPost();
1376 $this->rule->update();
1378 $this->ctrl->redirect($this,
'categoryMapping');
1382 $this->form->setValuesByPost();
1399 foreach(
$_POST[
'rules'] as $rule_id)
1401 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1416 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
1422 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingTableGUI.php';
1424 $rule_table->parse($rules);
1425 return $rule_table->getHTML();
1435 if(is_object($this->rule))
1440 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1452 if(is_object($this->form))
1457 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1458 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1462 if($a_mode ==
'add')
1464 $this->form->setTitle($this->lng->txt(
'ecs_new_category_mapping'));
1465 $this->form->setFormAction($this->ctrl->getFormAction($this,
'categoryMapping'));
1466 $this->form->addCommandButton(
'addCategoryMapping',$this->lng->txt(
'save'));
1467 $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
1471 $this->form->setTitle($this->lng->txt(
'ecs_edit_category_mapping'));
1472 $this->form->setFormAction($this->ctrl->getFormAction($this,
'editCategoryMapping'));
1473 $this->form->addCommandButton(
'updateCategoryMapping',$this->lng->txt(
'save'));
1474 $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
1480 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
1481 $tpl->setVariable(
'SIZE',5);
1482 $tpl->setVariable(
'MAXLENGTH',11);
1483 $tpl->setVariable(
'POST_VAR',
'import_id');
1484 $tpl->setVariable(
'PROPERTY_VALUE',$this->rule->getContainerId());
1488 $tpl->setVariable(
'COMPLETE_PATH',$this->
buildPath($this->rule->getContainerId()));
1491 $imp->setHTML(
$tpl->get());
1492 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
1493 $this->form->addItem($imp);
1495 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php');
1496 $select =
new ilSelectInputGUI($this->lng->txt(
'ecs_attribute_name'),
'field');
1497 $select->
setValue($this->rule->getFieldName());
1498 $select->setRequired(
true);
1500 $this->form->addItem($select);
1504 $value->
setValue($this->rule->getMappingType());
1505 $value->setRequired(
true);
1508 $fixed->
setInfo($this->lng->txt(
'ecs_cat_mapping_fixed_info'));
1510 $fixed_val =
new ilTextInputGUI($this->lng->txt(
'ecs_cat_mapping_values'),
'mapping_value');
1511 $fixed_val->
setValue($this->rule->getMappingValue());
1512 $fixed_val->setMaxLength(255);
1513 $fixed_val->setSize(40);
1514 $fixed_val->setRequired(
true);
1515 $fixed->addSubItem($fixed_val);
1517 $value->addOption($fixed);
1520 $duration->setInfo($this->lng->txt(
'ecs_cat_mapping_duration_info'));
1524 $dur_start->setDate($this->rule->getDateRangeStart());
1529 $dur_end->setDate($this->rule->getDateRangeEnd());
1535 $type->
setInfo($this->lng->txt(
'ecs_cat_mapping_by_type_info'));
1541 $types->setValue($this->rule->getByType());
1542 $types->setRequired(
true);
1543 $type->addSubitem($types);
1545 $value->addOption($type);
1547 $this->form->addItem($value);
1561 $this->tabs_gui->setSubTabActive(
'ecs_import');
1563 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
1566 $ilToolbar->addButton(
1567 $this->lng->txt(
'ecs_read_remote_links'),
1568 $this->ctrl->getLinkTarget($this,
'readAll')
1571 $ilToolbar->addSeparator();
1575 $sel_type = $_REQUEST[
"otype"];
1581 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
1584 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1587 $sel->setValue($sel_type);
1588 $ilToolbar->addInputItem($sel);
1590 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"imported"));
1591 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"imported");
1596 $ilToolbar->addSeparator();
1598 $ilToolbar->addButton(
1599 $this->lng->txt(
'csv_export'),
1600 $this->ctrl->getLinkTarget($this,
'exportImported')
1604 include_once(
'Services/WebServices/ECS/classes/class.ilECSImportedContentTableGUI.php');
1606 $table_gui->setTitle($this->lng->txt(
'ecs_imported_content'));
1607 $table_gui->parse($robjs);
1608 $this->tpl->setContent($table_gui->getHTML());
1621 global $ilObjDataCache,
$ilUser;
1628 include_once(
'./Modules/RemoteCourse/classes/class.ilObjRemoteCourse.php');
1629 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
1640 $ilObjDataCache->preloadReferenceCache($rcourses);
1642 foreach($rcourses as $rcrs_ref_id)
1644 $obj_id = $ilObjDataCache->lookupObjId($rcrs_ref_id);
1645 $obj_ids[$obj_id] = $obj_id;
1648 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1651 $writer->addColumn($this->lng->txt(
'title'));
1652 $writer->addColumn($this->lng->txt(
'description'));
1653 $writer->addColumn($this->lng->txt(
'ecs_imported_from'));
1654 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1655 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1656 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1657 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1658 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1659 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1660 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1661 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1662 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1663 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1664 $writer->addColumn($this->lng->txt(
'last_update'));
1666 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1669 foreach($obj_ids as $obj_id)
1671 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1681 $writer->addColumn($participant->getParticipantName());
1684 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1687 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1690 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1693 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1696 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1699 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1702 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1705 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1709 if(isset($values[$field]))
1714 $writer->addColumn($dt);
1718 if(isset($values[$field]))
1723 $writer->addColumn($dt);
1725 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1740 $this->tabs_gui->setSubTabActive(
'ecs_released');
1744 $ilToolbar->addButton(
1745 $this->lng->txt(
'ecs_read_remote_links'),
1746 $this->ctrl->getLinkTarget($this,
'readAll')
1749 $ilToolbar->addSeparator();
1752 $sel_type = $_REQUEST[
"otype"];
1758 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1761 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1764 $sel->setValue($sel_type);
1765 $ilToolbar->addInputItem($sel);
1767 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"released"));
1768 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"released");
1770 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1772 if(count($exported))
1774 $ilToolbar->addSeparator();
1776 $ilToolbar->addButton(
1777 $this->lng->txt(
'csv_export'),
1778 $this->ctrl->getLinkTarget($this,
'exportReleased')
1782 include_once(
'Services/WebServices/ECS/classes/class.ilECSReleasedContentTableGUI.php');
1784 $table_gui->setTitle($this->lng->txt(
'ecs_released_content'));
1785 $table_gui->parse($exported);
1786 $this->tpl->setContent($table_gui->getHTML());
1799 global $ilObjDataCache;
1801 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1803 $ilObjDataCache->preloadObjectCache($exported);
1805 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1808 $writer->addColumn($this->lng->txt(
'title'));
1809 $writer->addColumn($this->lng->txt(
'description'));
1810 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1811 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1812 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1813 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1814 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1815 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1816 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1817 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1818 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1819 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1820 $writer->addColumn($this->lng->txt(
'last_update'));
1822 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1825 foreach($exported as $obj_id)
1827 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1834 $field = $settings->getMappingByECSName(0,
'courseID');
1835 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1837 $field = $settings->getMappingByECSName(0,
'term');
1838 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1840 $field = $settings->getMappingByECSName(0,
'lecturer');
1841 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1843 $field = $settings->getMappingByECSName(0,
'courseType');
1844 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1846 $field = $settings->getMappingByECSName(0,
'semester_hours');
1847 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1849 $field = $settings->getMappingByECSName(0,
'credits');
1850 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1852 $field = $settings->getMappingByECSName(0,
'room');
1853 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1855 $field = $settings->getMappingByECSName(0,
'cycle');
1856 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1858 $field = $settings->getMappingByECSName(0,
'begin');
1860 if(isset($values[$field]))
1865 $writer->addColumn($dt);
1867 $field = $settings->getMappingByECSName(0,
'end');
1869 if(isset($values[$field]))
1874 $writer->addColumn($dt);
1876 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1890 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1892 $options[0] = $this->lng->txt(
'ecs_ignore_field');
1893 foreach($fields as $field)
1910 include_once(
'Services/WebServices/ECS/classes/class.ilECSSetting.php');
1922 $this->tabs_gui->clearSubTabs();
1924 $this->tabs_gui->addSubTabTarget(
"overview",
1925 $this->ctrl->getLinkTarget($this,
'overview'),
1926 "overview",get_class($this));
1929 #ilECSServerSettings::getInstance()->readInactiveServers(); 1935 $this->tabs_gui->addSubTabTarget(
"ecs_communities",
1936 $this->ctrl->getLinkTarget($this,
'communities'),
1937 "communities",get_class($this));
1939 if(!$ilAccess->checkAccess(
'write',
'',$_REQUEST[
"ref_id"]))
1944 $this->tabs_gui->addSubTabTarget(
'ecs_mappings',
1945 $this->ctrl->getLinkTarget($this,
'importMappings'),
1946 'importMappings',get_class($this));
1948 $this->tabs_gui->addSubTabTarget(
'ecs_category_mapping',
1949 $this->ctrl->getLinkTarget($this,
'categoryMapping'));
1951 $this->tabs_gui->addSubTabTarget(
'ecs_import',
1952 $this->ctrl->getLinkTarget($this,
'imported'));
1954 $this->tabs_gui->addSubTabTarget(
'ecs_released',
1955 $this->ctrl->getLinkTarget($this,
'released'));
1966 global $rbacreview,$ilObjDataCache;
1973 $select[0] = $this->lng->txt(
'links_select_one');
1974 foreach($global_roles as $role_id)
1984 $loc->setTextOnly(
false);
1985 $loc->addContextItems($a_ref_id);
1987 return $loc->getHTML();
2001 '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.
Base class for ILIAS Exception handling.
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(!is_array($argv)) $options
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
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
Confirmation screen class.
static _getOptionalECourseFields()
get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions ...