24 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
58 $this->lng->loadLanguageModule(
'ecs');
60 $this->tabs_gui = $ilTabs;
75 $next_class = $this->ctrl->getNextClass($this);
76 $cmd = $this->ctrl->getCmd();
81 case 'ilecsmappingsettingsgui':
82 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSMappingSettingsGUI.php';
84 $this->ctrl->setReturn($this,
'communities');
85 $this->ctrl->forwardCommand($mapset);
88 case 'ilecsparticipantsettingsgui':
89 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettingsGUI.php';
91 (
int) $_REQUEST[
'server_id'],
92 (
int) $_REQUEST[
'mid']
94 $this->ctrl->setReturn($this,
'communities');
95 $this->ctrl->forwardCommand($part);
100 if(!$ilAccess->checkAccess(
'write',
'',$_REQUEST[
"ref_id"]) &&
$cmd !=
"overview" &&
$cmd !=
"communities")
102 $this->ctrl->redirect($this,
"overview");
123 global $ilToolbar,$ilTabs, $ilAccess;
125 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
127 $ilTabs->setSubTabActive(
'overview');
128 if($ilAccess->checkAccess(
'write',
'',
$_REQUEST[
"ref_id"]))
130 $ilToolbar->addButton(
131 $this->lng->txt(
'ecs_add_new_ecs'),
132 $this->ctrl->getLinkTarget($this,
'create')
137 $servers->readInactiveServers();
139 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerTableGUI.php';
142 $table->parse($servers);
143 $this->tpl->setContent($table->getHTML());
153 $this->
settings->setEnabledStatus(
true);
156 $this->ctrl->redirect($this,
'overview');
165 $this->
settings->setEnabledStatus(
false);
168 $this->ctrl->redirect($this,
'overview');
178 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnector.php');
179 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
180 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php');
181 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
190 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
222 $ilTabs->clearTargets();
223 $ilTabs->clearSubTabs();
224 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
227 $this->tabs_gui->setSubTabActive(
'ecs_settings');
229 $this->tpl->setContent($this->form->getHTML());
240 $this->ctrl->saveParameter($this,
'server_id',(
int) $_REQUEST[
'server_id']);
242 $ilTabs->clearTargets();
243 $ilTabs->clearSubTabs();
244 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
247 $this->tabs_gui->setSubTabActive(
'ecs_settings');
249 $this->tpl->setContent($this->form->getHTML());
252 protected function cp()
256 $copy = clone $this->settings;
259 $this->ctrl->setParameter($this,
'server_id',$copy->getServerId());
261 $this->ctrl->redirect($this,
'edit');
267 protected function delete()
273 $ilTabs->clearTargets();
274 $ilTabs->clearSubTabs();
275 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
277 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
279 $confirm->setFormAction($this->ctrl->getFormAction($this));
280 $confirm->setConfirm($this->lng->txt(
'delete'),
'doDelete');
281 $confirm->setCancel($this->lng->txt(
'cancel'),
'overview');
282 $confirm->setHeaderText($this->lng->txt(
'ecs_delete_setting'));
284 $confirm->addItem(
'',
'',$this->
settings->getServer());
285 $confirm->addHiddenItem(
'server_id', $this->
settings->getServerId());
287 $this->tpl->setContent($confirm->getHTML());
299 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
302 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
305 include_once
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
308 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
311 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
314 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
318 $this->ctrl->redirect($this,
'overview');
330 $this->tabs_gui->setSubTabActive(
'ecs_settings');
332 $this->tpl->setContent($this->form->getHTML());
342 if(is_object($this->form))
346 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
349 $this->form->setFormAction($this->ctrl->getFormAction($this,
'settings'));
350 $this->form->setTitle($this->lng->txt(
'ecs_connection_settings'));
355 $this->form->addItem($ena);
357 $server_title =
new ilTextInputGUI($this->lng->txt(
'ecs_server_title'),
'title');
359 $server_title->setSize(80);
360 $server_title->setMaxLength(128);
361 $server_title->setRequired(
true);
362 $this->form->addItem($server_title);
364 $ser =
new ilTextInputGUI($this->lng->txt(
'ecs_server_url'),
'server');
366 $ser->setRequired(
true);
367 $this->form->addItem($ser);
371 #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'), 372 # ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https'))); 374 $pro->setValue($this->
settings->getProtocol());
375 $pro->setRequired(
true);
376 $this->form->addItem($pro);
380 $por->setMaxLength(5);
381 $por->setValue((
string) $this->
settings->getPort());
382 $por->setRequired(
true);
383 $this->form->addItem($por);
387 $this->form->addItem($tcer);
391 $tcer->addOption($cert_based);
393 $cli =
new ilTextInputGUI($this->lng->txt(
'ecs_client_cert'),
'client_cert');
395 $cli->setValue((
string) $this->
settings->getClientCertPath());
396 $cli->setRequired(
true);
397 $cert_based->addSubItem($cli);
399 $key =
new ilTextInputGUI($this->lng->txt(
'ecs_cert_key'),
'key_path');
401 $key->setValue((
string) $this->
settings->getKeyPath());
402 $key->setRequired(
true);
403 $cert_based->addSubItem($key);
405 $cerp =
new ilTextInputGUI($this->lng->txt(
'ecs_key_password'),
'key_password');
407 $cerp->setValue((
string) $this->
settings->getKeyPassword());
408 $cerp->setInputType(
'password');
409 $cerp->setRequired(
true);
410 $cert_based->addSubItem($cerp);
412 $cer =
new ilTextInputGUI($this->lng->txt(
'ecs_ca_cert'),
'ca_cert');
414 $cer->setValue((
string) $this->
settings->getCACertPath());
415 $cer->setRequired(
true);
416 $cert_based->addSubItem($cer);
420 $tcer->addOption($apa_based);
422 $user =
new ilTextInputGUI($this->lng->txt(
'ecs_apache_user'),
'auth_user');
424 $user->setValue((
string) $this->
settings->getAuthUser());
425 $user->setRequired(
true);
426 $apa_based->addSubItem($user);
429 $pass->setRetype(
false);
431 $pass->setMaxLength(128);
433 $pass->setRequired(
true);
434 $pass->setSkipSyntaxCheck(TRUE);
435 $apa_based->addSubItem(
$pass);
439 $ser->
setValue($this->
settings->getCertSerialNumber() ? $this->
settings->getCertSerialNumber() : $this->lng->txt(
'ecs_no_value'));
440 $cert_based->addSubItem($ser);
443 $loc->setTitle($this->lng->txt(
'ecs_local_settings'));
444 $this->form->addItem($loc);
448 $pol->setShowHours(
false);
449 $pol->setShowMinutes(
true);
450 $pol->setShowSeconds(
true);
451 $pol->setSeconds($this->
settings->getPollingTimeSeconds());
452 $pol->setMinutes($this->
settings->getPollingTimeMinutes());
453 $pol->setRequired(
true);
454 $pol->setInfo($this->lng->txt(
'ecs_polling_info'));
455 $this->form->addItem($pol);
460 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
461 $tpl->setVariable(
'SIZE',5);
462 $tpl->setVariable(
'MAXLENGTH',11);
463 $tpl->setVariable(
'POST_VAR',
'import_id');
464 $tpl->setVariable(
'PROPERTY_VALUE',$this->
settings->getImportId());
471 $imp->setHTML(
$tpl->get());
472 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
473 $this->form->addItem($imp);
476 $loc->setTitle($this->lng->txt(
'ecs_remote_user_settings'));
477 $this->form->addItem($loc);
481 $role->setValue($this->
settings->getGlobalRole());
482 $role->setInfo($this->lng->txt(
'ecs_global_role_info'));
483 $role->setRequired(
true);
484 $this->form->addItem($role);
486 $duration =
new ilDurationInputGUI($this->lng->txt(
'ecs_account_duration'),
'duration');
487 $duration->
setInfo($this->lng->txt(
'ecs_account_duration_info'));
488 $duration->setMonths($this->
settings->getDuration());
489 $duration->setShowSeconds(
false);
490 $duration->setShowMinutes(
false);
491 $duration->setShowHours(
false);
492 $duration->setShowDays(
false);
493 $duration->setShowMonths(
true);
494 $duration->setRequired(
true);
495 $this->form->addItem($duration);
499 $loc->setTitle($this->lng->txt(
'ecs_notifications'));
500 $this->form->addItem($loc);
502 $rcp_user =
new ilTextInputGUI($this->lng->txt(
'ecs_user_rcp'),
'user_recipients');
504 $rcp_user->setInfo($this->lng->txt(
'ecs_user_rcp_info'));
505 $this->form->addItem($rcp_user);
507 $rcp_econ =
new ilTextInputGUI($this->lng->txt(
'ecs_econ_rcp'),
'econtent_recipients');
508 $rcp_econ->
setValue((
string) $this->
settings->getEContentRecipientsAsString());
509 $rcp_econ->setInfo($this->lng->txt(
'ecs_econ_rcp_info'));
510 $this->form->addItem($rcp_econ);
512 $rcp_app =
new ilTextInputGUI($this->lng->txt(
'ecs_approval_rcp'),
'approval_recipients');
513 $rcp_app->
setValue((
string) $this->
settings->getApprovalRecipientsAsString());
514 $rcp_app->setInfo($this->lng->txt(
'ecs_approval_rcp_info'));
515 $this->form->addItem($rcp_app);
517 if($a_mode ==
'update')
519 $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
523 $this->form->addCommandButton(
'save',$this->lng->txt(
'save'));
525 $this->form->addCommandButton(
'overview',$this->lng->txt(
'cancel'));
538 if(!$error = $this->
settings->validate())
542 #$this->updateTitle(); 564 if(!$error = $this->
settings->validate())
569 #$this->updateTitle(); 577 $GLOBALS[
'ilCtrl']->redirect($this,
'overview');
588 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
591 foreach(
$reader->getCommunities() as $community)
593 foreach($community->getParticipants() as $part)
595 $GLOBALS[
'ilLog']->write(__METHOD__.
': '.print_r($community,
true));
598 $this->
settings->setTitle($part->getParticipantName());
628 $this->
settings->setPollingTimeMS((
int) $_POST[
'polling'][
'mm'],(
int) $_POST[
'polling'][
'ss']);
630 $this->
settings->setGlobalRole((
int) $_POST[
'global_role']);
631 $this->
settings->setDuration((
int) $_POST[
'duration'][
'MM']);
637 $this->
settings->setAuthType((
int) $_POST[
'auth_type']);
648 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
649 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
650 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
651 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
654 $servers->readInactiveServers();
655 foreach($servers->getServers() as
$server)
664 if(!$creader->getParticipantByMID($mid))
666 $GLOBALS[
'ilLog']->write(__METHOD__.
': Deleting deprecated participant '.
$server->getServerId().
' '. $mid);
679 $this->ctrl->redirect($this,
'communities');
692 if($ilAccess->checkAccess(
'write',
'',
$_REQUEST[
"ref_id"]))
695 $this->lng->txt(
'ecs_refresh_participants'),
696 $this->ctrl->getLinkTarget($this,
'refreshParticipants')
701 $this->tabs_gui->setSubTabActive(
'ecs_communities');
703 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_communities.html',
'Services/WebServices/ECS');
705 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this,
'updateCommunities'));
707 if($ilAccess->checkAccess(
'write',
'',
$_REQUEST[
"ref_id"]))
709 $this->tpl->setCurrentBlock(
"submit_buttons");
710 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
711 $this->tpl->setVariable(
'TXT_CANCEL', $this->lng->txt(
'cancel'));
712 $this->tpl->parseCurrentBlock();
715 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
716 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityTableGUI.php');
718 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
720 #$settings->readInactiveServers(); 722 foreach($settings->getServers() as
$server)
728 foreach(
$reader->getCommunities() as $community)
730 $this->tpl->setCurrentBlock(
'table_community');
732 $table_gui->
setTitle($community->getTitle().
' ('.$community->getDescription().
')');
733 $table_gui->parse($community->getParticipants());
734 $this->tpl->setVariable(
'TABLE_COMM',$table_gui->getHTML());
735 $this->tpl->parseCurrentBlock();
745 $this->tpl->setCurrentBlock(
'server');
746 $this->tpl->setVariable(
'TXT_SERVER_NAME',
$server->getTitle());
747 $this->tpl->parseCurrentBlock();
758 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
761 foreach((array) $import_types as $sid =>
$server)
763 foreach((array)
$server as $mid => $import_type)
777 $new_types = array();
778 foreach((array) $import_types as $sid =>
$server)
780 foreach((array)
$server as $mid => $import_type)
788 $new_types[$sid][$mid] = $import_type;
792 $import_types = $new_types;
806 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
807 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
810 $invalidImportTypes =
false;
813 $invalidImportTypes =
true;
817 foreach($servers->getServers() as
$server)
824 foreach($cReader->getCommunities() as $community)
826 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityCache.php';
828 $cCache->setCommunityName($community->getTitle());
829 $cCache->setMids($community->getMids());
830 $cCache->setOwnId($community->getOwnId());
836 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot read ecs communities: '.$e->getMessage());
840 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
841 foreach((array)
$_POST[
'sci_mid'] as $sid => $tmp)
843 foreach((array)
$_POST[
'sci_mid'][$sid] as $mid => $tmp)
846 #$set->enableExport(array_key_exists($mid, (array) $_POST['export'][$sid]) ? true : false); 847 #$set->enableImport(array_key_exists($mid, (array) $_POST['import'][$sid]) ? true : false); 848 $set->setImportType(
$_POST[
'import_type'][$sid][$mid]);
855 $set->setTitle($part->getParticipantName());
860 $set->setCommunityName($com->getTitle());
865 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot read ecs communities: '.$e->getMessage());
871 if($invalidImportTypes)
879 $GLOBALS[
'ilCtrl']->redirect($this,
'communities');
894 global $ilTabs, $ilAccess;
896 $ilTabs->clearTargets();
897 $ilTabs->clearSubTabs();
899 $ilTabs->setBackTarget(
900 $this->lng->txt(
'ecs_settings'),
901 $this->ctrl->getLinkTarget($this,
'overview')
903 if($ilAccess->checkAccess(
'write',
'',
$_REQUEST[
"ref_id"]))
907 $this->lng->txt(
'ecs_tab_import'),
908 $this->ctrl->getLinkTarget($this,
'importMappings')
913 $this->lng->txt(
'ecs_tab_export'),
914 $this->ctrl->getLinkTarget($this,
'exportMappings')
920 case self::MAPPING_IMPORT:
921 $ilTabs->activateTab(
'import');
924 case self::MAPPING_EXPORT:
925 $ilTabs->activateTab(
'export');
940 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
951 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
953 $settings->readInactiveServers();
955 $sel_srv = (int)
$_REQUEST[
"ecs_mapping_server"];
966 $options = array(0 => $this->lng->txt(
"please_choose"));
967 foreach($settings->getServers() as
$server)
972 $title =
"ECS (".$server->getServerId().
")";
977 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
980 $sel->setValue($sel_srv);
981 $ilToolbar->addInputItem($sel);
983 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"importMappings"));
984 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"importMappings");
989 $this->tpl->setContent($form->getHTML());
1004 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1015 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
1017 $settings->readInactiveServers();
1019 $sel_srv = (int)
$_REQUEST[
"ecs_mapping_server"];
1030 $options = array(0 => $this->lng->txt(
"please_choose"));
1031 foreach($settings->getServers() as
$server)
1036 $title =
"ECS (".$server->getServerId().
")";
1041 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1044 $sel->setValue($sel_srv);
1045 $ilToolbar->addInputItem($sel);
1047 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"exportMappings"));
1048 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"exportMappings");
1053 $this->tpl->setContent($form->getHTML());
1067 foreach((array)
$_POST[
'mapping'] as $mtype => $mappings)
1069 foreach((array) $mappings as $ecs_field => $advmd_id)
1071 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1077 $map->setAdvMDId($advmd_id);
1083 $this->ctrl->setParameter($this,
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
1084 $this->ctrl->redirect($this,
'importMappings');
1096 foreach((array)
$_POST[
'mapping'] as $mtype => $mappings)
1098 foreach((array) $mappings as $ecs_field => $advmd_id)
1100 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1102 (
int)
$_POST[
'ecs_mapping_server'],
1106 $map->setAdvMDId($advmd_id);
1112 $this->ctrl->setParameter($this,
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
1113 $this->ctrl->redirect($this,
'exportMappings');
1127 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1129 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1134 if($mapping_type == self::MAPPING_IMPORT)
1136 $form->setTitle($this->lng->txt(
'ecs_mapping_tbl'));
1137 $form->addCommandButton(
'saveImportMappings',$this->lng->txt(
'save'));
1138 $form->addCommandButton(
'importMappings',$this->lng->txt(
'cancel'));
1142 $form->setTitle($this->lng->txt(
'ecs_mapping_exp_tbl'));
1143 $form->addCommandButton(
'saveExportMappings',$this->lng->txt(
'save'));
1144 $form->addCommandButton(
'exportMappings',$this->lng->txt(
'cancel'));
1147 $form->setFormAction($this->ctrl->getFormAction($this,
'saveMappings'));
1149 if($mapping_type == self::MAPPING_IMPORT)
1152 $form->addItem($assignments);
1155 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1160 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1162 foreach($optional as $field_name)
1164 if($mapping_type == self::MAPPING_IMPORT)
1167 $this->lng->txt(
'ecs_field_'.$field_name),
1172 $mapping_settings->getMappingByECSName(
1177 $assignments->addSubItem($select);
1182 $this->lng->txt(
'ecs_field_'.$field_name),
1186 $mapping_settings->getMappingByECSName(
1191 $form->addItem($select);
1196 $server->setValue($a_server_id);
1201 if($mapping_type == self::MAPPING_EXPORT)
1207 $form->addItem($rcrs);
1209 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1214 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1216 foreach($optional as $field_name)
1219 $this->lng->txt(
'ecs_field_'.$field_name),
1220 'mapping['.ilECSDataMappingSetting::MAPPING_IMPORT_RCRS.
']['.$field_name.
']');
1222 $mapping_settings->getMappingByECSName(
1227 $rcrs->addSubItem($select);
1238 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1239 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.category_mapping.html',
'Services/WebServices/ECS');
1245 $this->tpl->setVariable(
'NEW_RULE_TABLE',$this->form->getHTML());
1248 $this->tpl->setVariable(
'RULES_TABLE',
$html);
1261 if($this->form->checkInput())
1263 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1264 $this->rule->setFieldName($this->form->getInput(
'field'));
1265 $this->rule->setMappingType($this->form->getInput(
'type'));
1267 switch($this->form->getInput(
'type'))
1270 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1274 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1275 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1279 $this->rule->setByType($this->form->getInput(
'by_type'));
1283 if($err = $this->rule->validate())
1286 $this->form->setValuesByPost();
1291 $this->rule->save();
1298 $this->form->setValuesByPost();
1316 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1317 $this->ctrl->saveParameter($this,
'rule_id');
1321 $this->tpl->setContent($this->form->getHTML());
1337 $this->ctrl->saveParameter($this,
'rule_id');
1340 if($this->form->checkInput())
1342 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1343 $this->rule->setFieldName($this->form->getInput(
'field'));
1344 $this->rule->setMappingType($this->form->getInput(
'type'));
1347 switch($this->form->getInput(
'type'))
1350 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1354 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1355 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1359 $this->rule->setByType($this->form->getInput(
'by_type'));
1363 if($err = $this->rule->validate())
1366 $this->form->setValuesByPost();
1371 $this->rule->update();
1373 $this->ctrl->redirect($this,
'categoryMapping');
1377 $this->form->setValuesByPost();
1394 foreach(
$_POST[
'rules'] as $rule_id)
1396 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1411 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
1417 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingTableGUI.php';
1419 $rule_table->parse($rules);
1420 return $rule_table->getHTML();
1430 if(is_object($this->rule))
1435 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1447 if(is_object($this->form))
1452 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1453 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1457 if($a_mode ==
'add')
1459 $this->form->setTitle($this->lng->txt(
'ecs_new_category_mapping'));
1460 $this->form->setFormAction($this->ctrl->getFormAction($this,
'categoryMapping'));
1461 $this->form->addCommandButton(
'addCategoryMapping',$this->lng->txt(
'save'));
1462 $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
1466 $this->form->setTitle($this->lng->txt(
'ecs_edit_category_mapping'));
1467 $this->form->setFormAction($this->ctrl->getFormAction($this,
'editCategoryMapping'));
1468 $this->form->addCommandButton(
'updateCategoryMapping',$this->lng->txt(
'save'));
1469 $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
1475 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
1476 $tpl->setVariable(
'SIZE',5);
1477 $tpl->setVariable(
'MAXLENGTH',11);
1478 $tpl->setVariable(
'POST_VAR',
'import_id');
1479 $tpl->setVariable(
'PROPERTY_VALUE',$this->rule->getContainerId());
1483 $tpl->setVariable(
'COMPLETE_PATH',$this->
buildPath($this->rule->getContainerId()));
1486 $imp->setHTML(
$tpl->get());
1487 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
1488 $this->form->addItem($imp);
1490 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php');
1491 $select =
new ilSelectInputGUI($this->lng->txt(
'ecs_attribute_name'),
'field');
1492 $select->
setValue($this->rule->getFieldName());
1493 $select->setRequired(
true);
1495 $this->form->addItem($select);
1499 $value->
setValue($this->rule->getMappingType());
1500 $value->setRequired(
true);
1503 $fixed->
setInfo($this->lng->txt(
'ecs_cat_mapping_fixed_info'));
1505 $fixed_val =
new ilTextInputGUI($this->lng->txt(
'ecs_cat_mapping_values'),
'mapping_value');
1506 $fixed_val->
setValue($this->rule->getMappingValue());
1507 $fixed_val->setMaxLength(255);
1508 $fixed_val->setSize(40);
1509 $fixed_val->setRequired(
true);
1510 $fixed->addSubItem($fixed_val);
1512 $value->addOption($fixed);
1515 $duration->
setInfo($this->lng->txt(
'ecs_cat_mapping_duration_info'));
1518 $dur_start->
setDate($this->rule->getDateRangeStart());
1519 $duration->addSubItem($dur_start);
1522 $dur_end->
setDate($this->rule->getDateRangeEnd());
1523 $duration->addSubItem($dur_end);
1525 $value->addOption($duration);
1528 $type->
setInfo($this->lng->txt(
'ecs_cat_mapping_by_type_info'));
1534 $types->setValue($this->rule->getByType());
1535 $types->setRequired(
true);
1536 $type->addSubitem($types);
1538 $value->addOption($type);
1540 $this->form->addItem($value);
1554 $this->tabs_gui->setSubTabActive(
'ecs_import');
1556 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
1559 $ilToolbar->addButton(
1560 $this->lng->txt(
'ecs_read_remote_links'),
1561 $this->ctrl->getLinkTarget($this,
'readAll')
1564 $ilToolbar->addSeparator();
1574 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
1577 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1580 $sel->setValue($sel_type);
1581 $ilToolbar->addInputItem($sel);
1583 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"imported"));
1584 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"imported");
1589 $ilToolbar->addSeparator();
1591 $ilToolbar->addButton(
1592 $this->lng->txt(
'csv_export'),
1593 $this->ctrl->getLinkTarget($this,
'exportImported')
1597 include_once(
'Services/WebServices/ECS/classes/class.ilECSImportedContentTableGUI.php');
1599 $table_gui->setTitle($this->lng->txt(
'ecs_imported_content'));
1600 $table_gui->parse($robjs);
1601 $this->tpl->setContent($table_gui->getHTML());
1614 global $ilObjDataCache,
$ilUser;
1621 include_once(
'./Modules/RemoteCourse/classes/class.ilObjRemoteCourse.php');
1622 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
1633 $ilObjDataCache->preloadReferenceCache($rcourses);
1635 foreach($rcourses as $rcrs_ref_id)
1637 $obj_id = $ilObjDataCache->lookupObjId($rcrs_ref_id);
1638 $obj_ids[$obj_id] = $obj_id;
1641 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1644 $writer->addColumn($this->lng->txt(
'title'));
1645 $writer->addColumn($this->lng->txt(
'description'));
1646 $writer->addColumn($this->lng->txt(
'ecs_imported_from'));
1647 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1648 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1649 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1650 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1651 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1652 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1653 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1654 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1655 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1656 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1657 $writer->addColumn($this->lng->txt(
'last_update'));
1659 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1662 foreach($obj_ids as $obj_id)
1664 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1672 if(
$reader and ($participant =
$reader->getParticipantByMID($mid)))
1674 $writer->addColumn($participant->getParticipantName());
1677 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1680 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1683 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1686 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1689 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1692 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1695 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1698 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1706 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1708 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d").
"_ecs_import.csv",
"text/csv");
1721 $this->tabs_gui->setSubTabActive(
'ecs_released');
1725 $ilToolbar->addButton(
1726 $this->lng->txt(
'ecs_read_remote_links'),
1727 $this->ctrl->getLinkTarget($this,
'readAll')
1730 $ilToolbar->addSeparator();
1739 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1742 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1745 $sel->setValue($sel_type);
1746 $ilToolbar->addInputItem($sel);
1748 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"released"));
1749 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"released");
1751 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1753 if(count($exported))
1755 $ilToolbar->addSeparator();
1757 $ilToolbar->addButton(
1758 $this->lng->txt(
'csv_export'),
1759 $this->ctrl->getLinkTarget($this,
'exportReleased')
1763 include_once(
'Services/WebServices/ECS/classes/class.ilECSReleasedContentTableGUI.php');
1765 $table_gui->setTitle($this->lng->txt(
'ecs_released_content'));
1766 $table_gui->parse($exported);
1767 $this->tpl->setContent($table_gui->getHTML());
1780 global $ilObjDataCache;
1782 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1784 $ilObjDataCache->preloadObjectCache($exported);
1786 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1789 $writer->addColumn($this->lng->txt(
'title'));
1790 $writer->addColumn($this->lng->txt(
'description'));
1791 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1792 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1793 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1794 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1795 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1796 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1797 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1798 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1799 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1800 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1801 $writer->addColumn($this->lng->txt(
'last_update'));
1803 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1806 foreach($exported as $obj_id)
1808 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1815 $field = $settings->getMappingByECSName(0,
'courseID');
1816 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1818 $field = $settings->getMappingByECSName(0,
'term');
1819 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1821 $field = $settings->getMappingByECSName(0,
'lecturer');
1822 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1824 $field = $settings->getMappingByECSName(0,
'courseType');
1825 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1827 $field = $settings->getMappingByECSName(0,
'semester_hours');
1828 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1830 $field = $settings->getMappingByECSName(0,
'credits');
1831 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1833 $field = $settings->getMappingByECSName(0,
'room');
1834 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1836 $field = $settings->getMappingByECSName(0,
'cycle');
1837 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1839 $field = $settings->getMappingByECSName(0,
'begin');
1842 $field = $settings->getMappingByECSName(0,
'end');
1845 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1848 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d").
"_ecs_export.csv",
"text/csv");
1859 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1861 $options[0] = $this->lng->txt(
'ecs_ignore_field');
1862 foreach($fields as $field)
1865 $options[$field->getFieldId()] = $title.
': '.$field->getTitle();
1879 include_once(
'Services/WebServices/ECS/classes/class.ilECSSetting.php');
1891 $this->tabs_gui->clearSubTabs();
1893 $this->tabs_gui->addSubTabTarget(
"overview",
1894 $this->ctrl->getLinkTarget($this,
'overview'),
1895 "overview",get_class($this));
1898 #ilECSServerSettings::getInstance()->readInactiveServers(); 1904 $this->tabs_gui->addSubTabTarget(
"ecs_communities",
1905 $this->ctrl->getLinkTarget($this,
'communities'),
1906 "communities",get_class($this));
1908 if(!$ilAccess->checkAccess(
'write',
'',
$_REQUEST[
"ref_id"]))
1913 $this->tabs_gui->addSubTabTarget(
'ecs_mappings',
1914 $this->ctrl->getLinkTarget($this,
'importMappings'),
1915 'importMappings',get_class($this));
1917 $this->tabs_gui->addSubTabTarget(
'ecs_category_mapping',
1918 $this->ctrl->getLinkTarget($this,
'categoryMapping'));
1920 $this->tabs_gui->addSubTabTarget(
'ecs_import',
1921 $this->ctrl->getLinkTarget($this,
'imported'));
1923 $this->tabs_gui->addSubTabTarget(
'ecs_released',
1924 $this->ctrl->getLinkTarget($this,
'released'));
1935 global $rbacreview,$ilObjDataCache;
1942 $select[0] = $this->lng->txt(
'links_select_one');
1943 foreach($global_roles as $role_id)
1953 $loc->setTextOnly(
false);
1954 $loc->addContextItems($a_ref_id);
1956 return $loc->getHTML();
1968 #$ilDB->lockTables(array('name' => 'settings', 'type' => ilDB::LOCK_WRITE)); 1971 'next_execution_'.$this->
settings->getServerId(),
1972 time() + (int) $this->
settings->getPollingTime()
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.
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()
static _lookupMID($a_obj_id)
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
special template class to simplify handling of ITX/PEAR
static delete($a_server_id)
Delete server ilDB $ilDB.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
initRule($a_rule_id=0)
Init rule.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Description of ilECSServerTableGUI.
static _lookupTitle($a_record_id)
Lookup title.
activate()
activate server
overview()
List available servers.
refreshParticipants()
Refresh participants.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _getInstanceByServerId($a_server_id)
get singleton instance Private access use ilECSTaskScheduler::start() or ilECSTaskScheduler::startTas...
static _getOptionalEContentFields()
get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions ...
static getExportedIdsByType($a_type)
Get exported ids by type ilDB $ilDB.
showRulesTable()
Show rules table.
exportImported()
csv export of imported remote courses
This class represents a non editable value in a property form.
static deleteByServer($a_server_id)
Delete by server $ilDB.
static getAvailabeMids($a_server_id)
Get all available mids $ilDB.
__construct()
Constructor.
initSettings($a_server_id=1)
Init settings.
prepareRoleSelect()
get global role array
imported()
Show imported materials.
static handleExportReset(ilECSSetting $server)
Handle export reset.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
updateCommunities()
update whitelist
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.
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 ...