24 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
58 $this->lng->loadLanguageModule(
'ecs');
60 $this->tabs_gui = $ilTabs;
74 $next_class = $this->ctrl->getNextClass($this);
75 $cmd = $this->ctrl->getCmd();
80 case 'ilecsmappingsettingsgui':
81 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSMappingSettingsGUI.php';
83 $this->ctrl->setReturn($this,
'communities');
84 $this->ctrl->forwardCommand($mapset);
106 global $ilToolbar,$ilTabs;
108 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
110 $ilTabs->setSubTabActive(
'overview');
111 $ilToolbar->addButton(
112 $this->lng->txt(
'ecs_add_new_ecs'),
113 $this->ctrl->getLinkTarget($this,
'create')
117 $servers->readInactiveServers();
119 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerTableGUI.php';
122 $table->parse($servers);
123 $this->tpl->setContent($table->getHTML());
133 $this->
settings->setEnabledStatus(
true);
136 $this->ctrl->redirect($this,
'overview');
145 $this->
settings->setEnabledStatus(
false);
148 $this->ctrl->redirect($this,
'overview');
158 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnector.php');
159 include_once(
'Services/WebServices/ECS/classes/class.ilECSConnectorException.php');
160 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php');
161 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
170 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
202 $ilTabs->clearTargets();
203 $ilTabs->clearSubTabs();
204 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
207 $this->tabs_gui->setSubTabActive(
'ecs_settings');
209 $this->tpl->setContent($this->form->getHTML());
220 $this->ctrl->saveParameter($this,
'server_id',(
int) $_REQUEST[
'server_id']);
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());
232 protected function cp()
236 $copy = clone $this->settings;
239 $this->ctrl->setParameter($this,
'server_id',$copy->getServerId());
241 $this->ctrl->redirect($this,
'edit');
247 protected function delete()
253 $ilTabs->clearTargets();
254 $ilTabs->clearSubTabs();
255 $ilTabs->setBackTarget($this->lng->txt(
'back'),$this->ctrl->getLinkTarget($this,
'overview'));
257 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
259 $confirm->setFormAction($this->ctrl->getFormAction($this));
260 $confirm->setConfirm($this->lng->txt(
'delete'),
'doDelete');
261 $confirm->setCancel($this->lng->txt(
'cancel'),
'overview');
262 $confirm->setHeaderText($this->lng->txt(
'ecs_delete_setting'));
264 $confirm->addItem(
'',
'',$this->
settings->getServer());
265 $confirm->addHiddenItem(
'server_id', $this->
settings->getServerId());
267 $this->tpl->setContent($confirm->getHTML());
279 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
282 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
285 include_once
'./Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
288 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
291 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
294 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
298 $this->ctrl->redirect($this,
'overview');
310 $this->tabs_gui->setSubTabActive(
'ecs_settings');
312 $this->tpl->setContent($this->form->getHTML());
322 if(is_object($this->form))
326 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
329 $this->form->setFormAction($this->ctrl->getFormAction($this,
'settings'));
330 $this->form->setTitle($this->lng->txt(
'ecs_connection_settings'));
335 $this->form->addItem($ena);
337 $server_title =
new ilTextInputGUI($this->lng->txt(
'ecs_server_title'),
'title');
339 $server_title->setSize(80);
340 $server_title->setMaxLength(128);
341 $server_title->setRequired(
true);
342 $this->form->addItem($server_title);
344 $ser =
new ilTextInputGUI($this->lng->txt(
'ecs_server_url'),
'server');
346 $ser->setRequired(
true);
347 $this->form->addItem($ser);
351 #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'),
352 # ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https')));
354 $pro->setValue($this->
settings->getProtocol());
355 $pro->setRequired(
true);
356 $this->form->addItem($pro);
360 $por->setMaxLength(5);
361 $por->setValue((
string) $this->
settings->getPort());
362 $por->setRequired(
true);
363 $this->form->addItem($por);
367 $this->form->addItem($tcer);
371 $tcer->addOption($cert_based);
373 $cli =
new ilTextInputGUI($this->lng->txt(
'ecs_client_cert'),
'client_cert');
375 $cli->setValue((
string) $this->
settings->getClientCertPath());
376 $cli->setRequired(
true);
377 $cert_based->addSubItem($cli);
379 $key =
new ilTextInputGUI($this->lng->txt(
'ecs_cert_key'),
'key_path');
381 $key->setValue((
string) $this->
settings->getKeyPath());
382 $key->setRequired(
true);
383 $cert_based->addSubItem($key);
385 $cerp =
new ilTextInputGUI($this->lng->txt(
'ecs_key_password'),
'key_password');
387 $cerp->setValue((
string) $this->
settings->getKeyPassword());
388 $cerp->setInputType(
'password');
389 $cerp->setRequired(
true);
390 $cert_based->addSubItem($cerp);
392 $cer =
new ilTextInputGUI($this->lng->txt(
'ecs_ca_cert'),
'ca_cert');
394 $cer->setValue((
string) $this->
settings->getCACertPath());
395 $cer->setRequired(
true);
396 $cert_based->addSubItem($cer);
400 $tcer->addOption($apa_based);
402 $user =
new ilTextInputGUI($this->lng->txt(
'ecs_apache_user'),
'auth_user');
404 $user->setValue((
string) $this->
settings->getAuthUser());
405 $user->setRequired(
true);
406 $apa_based->addSubItem($user);
409 $pass->setRetype(
false);
411 $pass->setMaxLength(128);
413 $pass->setRequired(
true);
414 $pass->setSkipSyntaxCheck(TRUE);
415 $apa_based->addSubItem(
$pass);
419 $ser->
setValue($this->
settings->getCertSerialNumber() ? $this->
settings->getCertSerialNumber() : $this->lng->txt(
'ecs_no_value'));
420 $cert_based->addSubItem($ser);
423 $loc->setTitle($this->lng->txt(
'ecs_local_settings'));
424 $this->form->addItem($loc);
428 $pol->setShowHours(
false);
429 $pol->setShowMinutes(
true);
430 $pol->setShowSeconds(
true);
431 $pol->setSeconds($this->
settings->getPollingTimeSeconds());
432 $pol->setMinutes($this->
settings->getPollingTimeMinutes());
433 $pol->setRequired(
true);
434 $pol->setInfo($this->lng->txt(
'ecs_polling_info'));
435 $this->form->addItem($pol);
440 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
441 $tpl->setVariable(
'SIZE',5);
442 $tpl->setVariable(
'MAXLENGTH',11);
443 $tpl->setVariable(
'POST_VAR',
'import_id');
444 $tpl->setVariable(
'PROPERTY_VALUE',$this->
settings->getImportId());
451 $imp->setHTML(
$tpl->get());
452 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
453 $this->form->addItem($imp);
456 $loc->setTitle($this->lng->txt(
'ecs_remote_user_settings'));
457 $this->form->addItem($loc);
461 $role->setValue($this->
settings->getGlobalRole());
462 $role->setInfo($this->lng->txt(
'ecs_global_role_info'));
463 $role->setRequired(
true);
464 $this->form->addItem($role);
466 $duration =
new ilDurationInputGUI($this->lng->txt(
'ecs_account_duration'),
'duration');
467 $duration->
setInfo($this->lng->txt(
'ecs_account_duration_info'));
468 $duration->setMonths($this->
settings->getDuration());
469 $duration->setShowSeconds(
false);
470 $duration->setShowMinutes(
false);
471 $duration->setShowHours(
false);
472 $duration->setShowDays(
false);
473 $duration->setShowMonths(
true);
474 $duration->setRequired(
true);
475 $this->form->addItem($duration);
479 $loc->setTitle($this->lng->txt(
'ecs_notifications'));
480 $this->form->addItem($loc);
482 $rcp_user =
new ilTextInputGUI($this->lng->txt(
'ecs_user_rcp'),
'user_recipients');
484 $rcp_user->setInfo($this->lng->txt(
'ecs_user_rcp_info'));
485 $this->form->addItem($rcp_user);
487 $rcp_econ =
new ilTextInputGUI($this->lng->txt(
'ecs_econ_rcp'),
'econtent_recipients');
488 $rcp_econ->
setValue((
string) $this->
settings->getEContentRecipientsAsString());
489 $rcp_econ->setInfo($this->lng->txt(
'ecs_econ_rcp_info'));
490 $this->form->addItem($rcp_econ);
492 $rcp_app =
new ilTextInputGUI($this->lng->txt(
'ecs_approval_rcp'),
'approval_recipients');
493 $rcp_app->
setValue((
string) $this->
settings->getApprovalRecipientsAsString());
494 $rcp_app->setInfo($this->lng->txt(
'ecs_approval_rcp_info'));
495 $this->form->addItem($rcp_app);
497 if($a_mode ==
'update')
499 $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
503 $this->form->addCommandButton(
'save',$this->lng->txt(
'save'));
505 $this->form->addCommandButton(
'overview',$this->lng->txt(
'cancel'));
518 if(!$error = $this->
settings->validate())
522 #$this->updateTitle();
544 if(!$error = $this->
settings->validate())
549 #$this->updateTitle();
557 $GLOBALS[
'ilCtrl']->redirect($this,
'overview');
568 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
571 foreach(
$reader->getCommunities() as $community)
573 foreach($community->getParticipants() as $part)
575 $GLOBALS[
'ilLog']->write(__METHOD__.
': '.print_r($community,
true));
578 $this->
settings->setTitle($part->getParticipantName());
608 $this->
settings->setPollingTimeMS((
int) $_POST[
'polling'][
'mm'],(
int) $_POST[
'polling'][
'ss']);
610 $this->
settings->setGlobalRole((
int) $_POST[
'global_role']);
611 $this->
settings->setDuration((
int) $_POST[
'duration'][
'MM']);
617 $this->
settings->setAuthType((
int) $_POST[
'auth_type']);
628 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
629 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
630 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
631 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
634 $servers->readInactiveServers();
635 foreach($servers->getServers() as
$server)
642 if(!$creader->getParticipantByMID($mid))
644 $GLOBALS[
'ilLog']->write(__METHOD__.
': Deleting deprecated participant '.
$server->getServerId().
' '. $mid);
652 $this->ctrl->redirect($this,
'communities');
665 $this->lng->txt(
'ecs_refresh_participants'),
666 $this->ctrl->getLinkTarget($this,
'refreshParticipants')
669 $this->tabs_gui->setSubTabActive(
'ecs_communities');
671 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_communities.html',
'Services/WebServices/ECS');
673 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this,
'updateCommunities'));
674 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
675 $this->tpl->setVariable(
'TXT_CANCEL', $this->lng->txt(
'cancel'));
677 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
678 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityTableGUI.php');
680 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
682 $settings->readInactiveServers();
684 foreach($settings->getServers() as
$server)
690 foreach(
$reader->getCommunities() as $community)
692 $this->tpl->setCurrentBlock(
'table_community');
694 $table_gui->
setTitle($community->getTitle().
' ('.$community->getDescription().
')');
695 $table_gui->parse($community->getParticipants());
696 $this->tpl->setVariable(
'TABLE_COMM',$table_gui->getHTML());
697 $this->tpl->parseCurrentBlock();
707 $this->tpl->setCurrentBlock(
'server');
708 $this->tpl->setVariable(
'TXT_SERVER_NAME',
$server->getTitle());
709 $this->tpl->parseCurrentBlock();
720 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
723 foreach((array) $import_types as $sid =>
$server)
725 foreach((array)
$server as $mid => $import_type)
739 $new_types = array();
740 foreach((array) $import_types as $sid =>
$server)
742 foreach((array)
$server as $mid => $import_type)
750 $new_types[$sid][$mid] = $import_type;
754 $import_types = $new_types;
768 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
769 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
772 $invalidImportTypes =
false;
775 $invalidImportTypes =
true;
779 foreach($servers->getServers() as
$server)
786 foreach($cReader->getCommunities() as $community)
788 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityCache.php';
790 $cCache->setCommunityName($community->getTitle());
791 $cCache->setMids($community->getMids());
792 $cCache->setOwnId($community->getOwnId());
798 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot read ecs communities: '.$e->getMessage());
802 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
803 foreach((array)
$_POST[
'sci_mid'] as $sid => $tmp)
805 foreach((array)
$_POST[
'sci_mid'][$sid] as $mid => $tmp)
808 $set->enableExport(array_key_exists($mid, (array)
$_POST[
'export'][$sid]) ?
true :
false);
809 $set->enableImport(array_key_exists($mid, (array)
$_POST[
'import'][$sid]) ?
true :
false);
810 $set->setImportType(
$_POST[
'import_type'][$sid][$mid]);
817 $set->setTitle($part->getParticipantName());
822 $set->setCommunityName($com->getTitle());
827 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot read ecs communities: '.$e->getMessage());
833 if($invalidImportTypes)
841 $GLOBALS[
'ilCtrl']->redirect($this,
'communities');
858 $ilTabs->clearTargets();
859 $ilTabs->clearSubTabs();
861 $ilTabs->setBackTarget(
862 $this->lng->txt(
'ecs_settings'),
863 $this->ctrl->getLinkTarget($this,
'overview')
867 $this->lng->txt(
'ecs_tab_import'),
868 $this->ctrl->getLinkTarget($this,
'importMappings')
872 $this->lng->txt(
'ecs_tab_export'),
873 $this->ctrl->getLinkTarget($this,
'exportMappings')
879 case self::MAPPING_IMPORT:
880 $ilTabs->activateTab(
'import');
883 case self::MAPPING_EXPORT:
884 $ilTabs->activateTab(
'export');
899 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
910 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
912 $settings->readInactiveServers();
914 $sel_srv = (int)
$_REQUEST[
"ecs_mapping_server"];
925 $options = array(0 => $this->lng->txt(
"please_choose"));
926 foreach($settings->getServers() as
$server)
931 $title =
"ECS (".$server->getServerId().
")";
936 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
939 $sel->setValue($sel_srv);
940 $ilToolbar->addInputItem($sel);
942 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"importMappings"));
943 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"importMappings");
948 $this->tpl->setContent($form->getHTML());
963 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
974 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
976 $settings->readInactiveServers();
978 $sel_srv = (int)
$_REQUEST[
"ecs_mapping_server"];
989 $options = array(0 => $this->lng->txt(
"please_choose"));
990 foreach($settings->getServers() as
$server)
995 $title =
"ECS (".$server->getServerId().
")";
1000 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1003 $sel->setValue($sel_srv);
1004 $ilToolbar->addInputItem($sel);
1006 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"exportMappings"));
1007 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"exportMappings");
1012 $this->tpl->setContent($form->getHTML());
1026 foreach((array)
$_POST[
'mapping'] as $mtype => $mappings)
1028 foreach((array) $mappings as $ecs_field => $advmd_id)
1030 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1036 $map->setAdvMDId($advmd_id);
1042 $this->ctrl->setParameter($this,
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
1043 $this->ctrl->redirect($this,
'importMappings');
1055 foreach((array)
$_POST[
'mapping'] as $mtype => $mappings)
1057 foreach((array) $mappings as $ecs_field => $advmd_id)
1059 include_once
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1061 (
int)
$_POST[
'ecs_mapping_server'],
1065 $map->setAdvMDId($advmd_id);
1071 $this->ctrl->setParameter($this,
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
1072 $this->ctrl->redirect($this,
'exportMappings');
1086 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
1088 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1093 if($mapping_type == self::MAPPING_IMPORT)
1095 $form->setTitle($this->lng->txt(
'ecs_mapping_tbl'));
1096 $form->addCommandButton(
'saveImportMappings',$this->lng->txt(
'save'));
1097 $form->addCommandButton(
'importMappings',$this->lng->txt(
'cancel'));
1101 $form->setTitle($this->lng->txt(
'ecs_mapping_exp_tbl'));
1102 $form->addCommandButton(
'saveExportMappings',$this->lng->txt(
'save'));
1103 $form->addCommandButton(
'exportMappings',$this->lng->txt(
'cancel'));
1106 $form->setFormAction($this->ctrl->getFormAction($this,
'saveMappings'));
1108 if($mapping_type == self::MAPPING_IMPORT)
1111 $form->addItem($assignments);
1114 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1119 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1121 foreach($optional as $field_name)
1123 if($mapping_type == self::MAPPING_IMPORT)
1126 $this->lng->txt(
'ecs_field_'.$field_name),
1131 $mapping_settings->getMappingByECSName(
1136 $assignments->addSubItem($select);
1141 $this->lng->txt(
'ecs_field_'.$field_name),
1145 $mapping_settings->getMappingByECSName(
1150 $form->addItem($select);
1155 $server->setValue($a_server_id);
1160 if($mapping_type == self::MAPPING_EXPORT)
1166 $form->addItem($rcrs);
1168 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1173 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1175 foreach($optional as $field_name)
1178 $this->lng->txt(
'ecs_field_'.$field_name),
1179 'mapping['.ilECSDataMappingSetting::MAPPING_IMPORT_RCRS.
']['.$field_name.
']');
1181 $mapping_settings->getMappingByECSName(
1186 $rcrs->addSubItem($select);
1197 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1198 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.category_mapping.html',
'Services/WebServices/ECS');
1204 $this->tpl->setVariable(
'NEW_RULE_TABLE',$this->form->getHTML());
1207 $this->tpl->setVariable(
'RULES_TABLE',$html);
1220 if($this->form->checkInput())
1222 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1223 $this->rule->setFieldName($this->form->getInput(
'field'));
1224 $this->rule->setMappingType($this->form->getInput(
'type'));
1226 switch($this->form->getInput(
'type'))
1229 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1233 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1234 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1238 $this->rule->setByType($this->form->getInput(
'by_type'));
1242 if($err = $this->rule->validate())
1245 $this->form->setValuesByPost();
1250 $this->rule->save();
1257 $this->form->setValuesByPost();
1275 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
1276 $this->ctrl->saveParameter($this,
'rule_id');
1280 $this->tpl->setContent($this->form->getHTML());
1296 $this->ctrl->saveParameter($this,
'rule_id');
1299 if($this->form->checkInput())
1301 $this->rule->setContainerId($this->form->getInput(
'import_id'));
1302 $this->rule->setFieldName($this->form->getInput(
'field'));
1303 $this->rule->setMappingType($this->form->getInput(
'type'));
1305 switch($this->form->getInput(
'type'))
1308 $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
1312 $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
1313 $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
1317 $this->rule->setByType($this->form->getInput(
'by_type'));
1321 if($err = $this->rule->validate())
1324 $this->form->setValuesByPost();
1329 $this->rule->update();
1331 $this->ctrl->redirect($this,
'categoryMapping');
1335 $this->form->setValuesByPost();
1352 foreach(
$_POST[
'rules'] as $rule_id)
1354 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1369 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
1375 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingTableGUI.php';
1377 $rule_table->parse($rules);
1378 return $rule_table->getHTML();
1388 if(is_object($this->rule))
1393 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1405 if(is_object($this->form))
1410 include_once
'./Services/Form/classes/class.ilPropertyFormGUI.php';
1411 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1415 if($a_mode ==
'add')
1417 $this->form->setTitle($this->lng->txt(
'ecs_new_category_mapping'));
1418 $this->form->setFormAction($this->ctrl->getFormAction($this,
'categoryMapping'));
1419 $this->form->addCommandButton(
'addCategoryMapping',$this->lng->txt(
'save'));
1420 $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
1424 $this->form->setTitle($this->lng->txt(
'ecs_edit_category_mapping'));
1425 $this->form->setFormAction($this->ctrl->getFormAction($this,
'editCategoryMapping'));
1426 $this->form->addCommandButton(
'updateCategoryMapping',$this->lng->txt(
'save'));
1427 $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
1433 $tpl =
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
1434 $tpl->setVariable(
'SIZE',5);
1435 $tpl->setVariable(
'MAXLENGTH',11);
1436 $tpl->setVariable(
'POST_VAR',
'import_id');
1437 $tpl->setVariable(
'PROPERTY_VALUE',$this->rule->getContainerId());
1441 $tpl->setVariable(
'COMPLETE_PATH',$this->
buildPath($this->rule->getContainerId()));
1444 $imp->setHTML(
$tpl->get());
1445 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
1446 $this->form->addItem($imp);
1448 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php');
1449 $select =
new ilSelectInputGUI($this->lng->txt(
'ecs_attribute_name'),
'field');
1450 $select->
setValue($this->rule->getFieldName());
1451 $select->setRequired(
true);
1453 $this->form->addItem($select);
1457 $value->
setValue($this->rule->getMappingType());
1458 $value->setRequired(
true);
1461 $fixed->
setInfo($this->lng->txt(
'ecs_cat_mapping_fixed_info'));
1463 $fixed_val =
new ilTextInputGUI($this->lng->txt(
'ecs_cat_mapping_values'),
'mapping_value');
1464 $fixed_val->
setValue($this->rule->getMappingValue());
1465 $fixed_val->setMaxLength(255);
1466 $fixed_val->setSize(40);
1467 $fixed_val->setRequired(
true);
1468 $fixed->addSubItem($fixed_val);
1470 $value->addOption($fixed);
1473 $duration->
setInfo($this->lng->txt(
'ecs_cat_mapping_duration_info'));
1476 $dur_start->
setDate($this->rule->getDateRangeStart());
1477 $duration->addSubItem($dur_start);
1480 $dur_end->
setDate($this->rule->getDateRangeEnd());
1481 $duration->addSubItem($dur_end);
1483 $value->addOption($duration);
1486 $type->
setInfo($this->lng->txt(
'ecs_cat_mapping_by_type_info'));
1492 $types->setValue($this->rule->getByType());
1493 $types->setRequired(
true);
1494 $type->addSubitem($types);
1496 $value->addOption($type);
1498 $this->form->addItem($value);
1512 $this->tabs_gui->setSubTabActive(
'ecs_import');
1514 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
1517 $ilToolbar->addButton(
1518 $this->lng->txt(
'ecs_read_remote_links'),
1519 $this->ctrl->getLinkTarget($this,
'readAll')
1522 $ilToolbar->addSeparator();
1532 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
1535 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1538 $sel->setValue($sel_type);
1539 $ilToolbar->addInputItem($sel);
1541 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"imported"));
1542 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"imported");
1547 $ilToolbar->addSeparator();
1549 $ilToolbar->addButton(
1550 $this->lng->txt(
'csv_export'),
1551 $this->ctrl->getLinkTarget($this,
'exportImported')
1555 include_once(
'Services/WebServices/ECS/classes/class.ilECSImportedContentTableGUI.php');
1557 $table_gui->setTitle($this->lng->txt(
'ecs_imported_content'));
1558 $table_gui->parse($robjs);
1559 $this->tpl->setContent($table_gui->getHTML());
1572 global $ilObjDataCache,
$ilUser;
1579 include_once(
'./Modules/RemoteCourse/classes/class.ilObjRemoteCourse.php');
1580 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
1591 $ilObjDataCache->preloadReferenceCache($rcourses);
1593 foreach($rcourses as $rcrs_ref_id)
1595 $obj_id = $ilObjDataCache->lookupObjId($rcrs_ref_id);
1596 $obj_ids[$obj_id] = $obj_id;
1599 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1602 $writer->addColumn($this->lng->txt(
'title'));
1603 $writer->addColumn($this->lng->txt(
'description'));
1604 $writer->addColumn($this->lng->txt(
'ecs_imported_from'));
1605 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1606 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1607 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1608 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1609 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1610 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1611 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1612 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1613 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1614 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1615 $writer->addColumn($this->lng->txt(
'last_update'));
1617 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1620 foreach($obj_ids as $obj_id)
1622 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
1630 if(
$reader and ($participant =
$reader->getParticipantByMID($mid)))
1632 $writer->addColumn($participant->getParticipantName());
1635 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1638 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1641 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1644 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1647 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1650 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1653 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1656 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1664 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1666 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d").
"_ecs_import.csv",
"text/csv");
1679 $this->tabs_gui->setSubTabActive(
'ecs_released');
1683 $ilToolbar->addButton(
1684 $this->lng->txt(
'ecs_read_remote_links'),
1685 $this->ctrl->getLinkTarget($this,
'readAll')
1688 $ilToolbar->addSeparator();
1697 include
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
1700 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1703 $sel->setValue($sel_type);
1704 $ilToolbar->addInputItem($sel);
1706 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
"released"));
1707 $ilToolbar->addFormButton($this->lng->txt(
"submit"),
"released");
1709 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1711 if(count($exported))
1713 $ilToolbar->addSeparator();
1715 $ilToolbar->addButton(
1716 $this->lng->txt(
'csv_export'),
1717 $this->ctrl->getLinkTarget($this,
'exportReleased')
1721 include_once(
'Services/WebServices/ECS/classes/class.ilECSReleasedContentTableGUI.php');
1723 $table_gui->setTitle($this->lng->txt(
'ecs_released_content'));
1724 $table_gui->parse($exported);
1725 $this->tpl->setContent($table_gui->getHTML());
1738 global $ilObjDataCache;
1740 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
1742 $ilObjDataCache->preloadObjectCache($exported);
1744 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
1747 $writer->addColumn($this->lng->txt(
'title'));
1748 $writer->addColumn($this->lng->txt(
'description'));
1749 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));
1750 $writer->addColumn($this->lng->txt(
'ecs_field_term'));
1751 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));
1752 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));
1753 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));
1754 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));
1755 $writer->addColumn($this->lng->txt(
'ecs_field_room'));
1756 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));
1757 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));
1758 $writer->addColumn($this->lng->txt(
'ecs_field_end'));
1759 $writer->addColumn($this->lng->txt(
'last_update'));
1761 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1764 foreach($exported as $obj_id)
1766 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
1773 $field = $settings->getMappingByECSName(
'courseID');
1774 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1776 $field = $settings->getMappingByECSName(
'term');
1777 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1779 $field = $settings->getMappingByECSName(
'lecturer');
1780 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1782 $field = $settings->getMappingByECSName(
'courseType');
1783 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1785 $field = $settings->getMappingByECSName(
'semester_hours');
1786 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1788 $field = $settings->getMappingByECSName(
'credits');
1789 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1791 $field = $settings->getMappingByECSName(
'room');
1792 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1794 $field = $settings->getMappingByECSName(
'cycle');
1795 $writer->addColumn(isset($values[$field]) ? $values[$field] :
'');
1797 $field = $settings->getMappingByECSName(
'begin');
1800 $field = $settings->getMappingByECSName(
'end');
1803 $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1806 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d").
"_ecs_export.csv",
"text/csv");
1817 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1819 $options[0] = $this->lng->txt(
'ecs_ignore_field');
1820 foreach($fields as $field)
1824 $options[$field->getFieldId()] = $title.
': '.$field->getTitle();
1838 include_once(
'Services/WebServices/ECS/classes/class.ilECSSetting.php');
1849 $this->tabs_gui->clearSubTabs();
1851 $this->tabs_gui->addSubTabTarget(
"overview",
1852 $this->ctrl->getLinkTarget($this,
'overview'),
1853 "overview",get_class($this));
1862 $this->tabs_gui->addSubTabTarget(
"ecs_communities",
1863 $this->ctrl->getLinkTarget($this,
'communities'),
1864 "communities",get_class($this));
1866 $this->tabs_gui->addSubTabTarget(
'ecs_mappings',
1867 $this->ctrl->getLinkTarget($this,
'importMappings'),
1868 'importMappings',get_class($this));
1870 $this->tabs_gui->addSubTabTarget(
'ecs_category_mapping',
1871 $this->ctrl->getLinkTarget($this,
'categoryMapping'));
1873 $this->tabs_gui->addSubTabTarget(
'ecs_import',
1874 $this->ctrl->getLinkTarget($this,
'imported'));
1876 $this->tabs_gui->addSubTabTarget(
'ecs_released',
1877 $this->ctrl->getLinkTarget($this,
'released'));
1888 global $rbacreview,$ilObjDataCache;
1895 $select[0] = $this->lng->txt(
'links_select_one');
1896 foreach($global_roles as $role_id)
1906 $loc->setTextOnly(
false);
1907 $loc->addContextItems($a_ref_id);
1909 return $loc->getHTML();
1921 #$ilDB->lockTables(array('name' => 'settings', 'type' => ilDB::LOCK_WRITE));
1924 'next_execution_'.$this->
settings->getServerId(),
1925 time() + (int) $this->
settings->getPollingTime()