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                 $ser = 
new ilTextInputGUI($this->lng->txt(
'ecs_server_url'),
'server');
 
  339                 $ser->setRequired(
true);
 
  340                 $this->form->addItem($ser);
 
  344                 #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'), 
  345                 #               ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https'))); 
  347                 $pro->setValue($this->
settings->getProtocol());
 
  348                 $pro->setRequired(
true);
 
  349                 $this->form->addItem($pro);
 
  353                 $por->setMaxLength(5);
 
  354                 $por->setValue((
string) $this->
settings->getPort());
 
  355                 $por->setRequired(
true);
 
  356                 $this->form->addItem($por);
 
  360                 $this->form->addItem($tcer);
 
  364                 $tcer->addOption($cert_based);
 
  366                 $cli = 
new ilTextInputGUI($this->lng->txt(
'ecs_client_cert'),
'client_cert');
 
  368                 $cli->setValue((
string) $this->
settings->getClientCertPath());
 
  369                 $cli->setRequired(
true);
 
  370                 $cert_based->addSubItem($cli);
 
  372                 $key = 
new ilTextInputGUI($this->lng->txt(
'ecs_cert_key'),
'key_path');
 
  374                 $key->setValue((
string) $this->
settings->getKeyPath());
 
  375                 $key->setRequired(
true);
 
  376                 $cert_based->addSubItem($key);
 
  378                 $cerp = 
new ilTextInputGUI($this->lng->txt(
'ecs_key_password'),
'key_password');
 
  380                 $cerp->setValue((
string) $this->
settings->getKeyPassword());
 
  381                 $cerp->setInputType(
'password');
 
  382                 $cerp->setRequired(
true);
 
  383                 $cert_based->addSubItem($cerp);
 
  385                 $cer = 
new ilTextInputGUI($this->lng->txt(
'ecs_ca_cert'),
'ca_cert');
 
  387                 $cer->setValue((
string) $this->
settings->getCACertPath());
 
  388                 $cer->setRequired(
true);
 
  389                 $cert_based->addSubItem($cer);
 
  393                 $tcer->addOption($apa_based);
 
  395                 $user = 
new ilTextInputGUI($this->lng->txt(
'ecs_apache_user'),
'auth_user');
 
  397                 $user->setValue((
string) $this->
settings->getAuthUser());
 
  398                 $user->setRequired(
true);
 
  399                 $apa_based->addSubItem($user);
 
  402                 $pass->setRetype(
false);
 
  404                 $pass->setMaxLength(32);
 
  406                 $pass->setRequired(
true);
 
  407                 $apa_based->addSubItem(
$pass);
 
  411                 $ser->
setValue($this->
settings->getCertSerialNumber() ? $this->
settings->getCertSerialNumber() : $this->lng->txt(
'ecs_no_value'));
 
  412                 $cert_based->addSubItem($ser);
 
  415                 $loc->setTitle($this->lng->txt(
'ecs_local_settings'));
 
  416                 $this->form->addItem($loc);
 
  420                 $pol->setShowHours(
false);
 
  421                 $pol->setShowMinutes(
true);
 
  422                 $pol->setShowSeconds(
true);
 
  423                 $pol->setSeconds($this->
settings->getPollingTimeSeconds());
 
  424                 $pol->setMinutes($this->
settings->getPollingTimeMinutes());
 
  425                 $pol->setRequired(
true);
 
  426                 $pol->setInfo($this->lng->txt(
'ecs_polling_info'));
 
  427                 $this->form->addItem($pol);
 
  432                 $tpl = 
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
 
  433                 $tpl->setVariable(
'SIZE',5);
 
  434                 $tpl->setVariable(
'MAXLENGTH',11);
 
  435                 $tpl->setVariable(
'POST_VAR',
'import_id');
 
  436                 $tpl->setVariable(
'PROPERTY_VALUE',$this->
settings->getImportId());
 
  443                 $imp->setHTML(
$tpl->get());
 
  444                 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
 
  445                 $this->form->addItem($imp);
 
  448                 $loc->setTitle($this->lng->txt(
'ecs_remote_user_settings'));
 
  449                 $this->form->addItem($loc);
 
  453                 $role->setValue($this->
settings->getGlobalRole());
 
  454                 $role->setInfo($this->lng->txt(
'ecs_global_role_info'));
 
  455                 $role->setRequired(
true);
 
  456                 $this->form->addItem($role);
 
  458                 $duration = 
new ilDurationInputGUI($this->lng->txt(
'ecs_account_duration'),
'duration');
 
  459                 $duration->
setInfo($this->lng->txt(
'ecs_account_duration_info'));
 
  460                 $duration->setMonths($this->
settings->getDuration());
 
  461                 $duration->setShowSeconds(
false);
 
  462                 $duration->setShowMinutes(
false);
 
  463                 $duration->setShowHours(
false);
 
  464                 $duration->setShowDays(
false);
 
  465                 $duration->setShowMonths(
true);
 
  466                 $duration->setRequired(
true);
 
  467                 $this->form->addItem($duration);
 
  471                 $loc->setTitle($this->lng->txt(
'ecs_notifications'));
 
  472                 $this->form->addItem($loc);
 
  474                 $rcp_user = 
new ilTextInputGUI($this->lng->txt(
'ecs_user_rcp'),
'user_recipients');
 
  476                 $rcp_user->setInfo($this->lng->txt(
'ecs_user_rcp_info'));
 
  477                 $this->form->addItem($rcp_user);
 
  479                 $rcp_econ = 
new ilTextInputGUI($this->lng->txt(
'ecs_econ_rcp'),
'econtent_recipients');
 
  480                 $rcp_econ->
setValue((
string) $this->
settings->getEContentRecipientsAsString());
 
  481                 $rcp_econ->setInfo($this->lng->txt(
'ecs_econ_rcp_info'));
 
  482                 $this->form->addItem($rcp_econ);
 
  484                 $rcp_app = 
new ilTextInputGUI($this->lng->txt(
'ecs_approval_rcp'),
'approval_recipients');
 
  485                 $rcp_app->
setValue((
string) $this->
settings->getApprovalRecipientsAsString());
 
  486                 $rcp_app->setInfo($this->lng->txt(
'ecs_approval_rcp_info'));
 
  487                 $this->form->addItem($rcp_app);
 
  489                 if($a_mode == 
'update')
 
  491                         $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
 
  495                         $this->form->addCommandButton(
'save',$this->lng->txt(
'save'));
 
  497                 $this->form->addCommandButton(
'overview',$this->lng->txt(
'cancel'));
 
  510                 if(!$error = $this->
settings->validate())
 
  536                 if(!$error = $this->
settings->validate())
 
  549                 $GLOBALS[
'ilCtrl']->redirect($this,
'overview');
 
  560                         include_once 
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
 
  563                         foreach(
$reader->getCommunities() as $community)
 
  565                                 foreach($community->getParticipants() as $part)
 
  569                                                 $this->
settings->setTitle($part->getParticipantName());
 
  599                 $this->
settings->setPollingTimeMS((
int) $_POST[
'polling'][
'mm'],(
int) $_POST[
'polling'][
'ss']);
 
  601                 $this->
settings->setGlobalRole((
int) $_POST[
'global_role']);
 
  602                 $this->
settings->setDuration((
int) $_POST[
'duration'][
'MM']);
 
  608                 $this->
settings->setAuthType((
int) $_POST[
'auth_type']);
 
  622                 $this->tabs_gui->setSubTabActive(
'ecs_communities');
 
  624                 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.ecs_communities.html',
'Services/WebServices/ECS');
 
  626                 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this,
'updateCommunities'));
 
  627                 $this->tpl->setVariable(
'TXT_SAVE',$this->lng->txt(
'save'));
 
  628                 $this->tpl->setVariable(
'TXT_CANCEL', $this->lng->txt(
'cancel'));
 
  630                 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
 
  631                 include_once(
'Services/WebServices/ECS/classes/class.ilECSCommunityTableGUI.php');
 
  633                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
 
  635                 $settings->readInactiveServers();
 
  637                 foreach($settings->getServers() as 
$server)
 
  643                                 foreach(
$reader->getCommunities() as $community)
 
  645                                         $this->tpl->setCurrentBlock(
'table_community');
 
  647                                         $table_gui->
setTitle($community->getTitle().
' ('.$community->getDescription().
')');
 
  648                                         $table_gui->parse($community->getParticipants());
 
  649                                         $this->tpl->setVariable(
'TABLE_COMM',$table_gui->getHTML());
 
  650                                         $this->tpl->parseCurrentBlock();
 
  660                         $this->tpl->setCurrentBlock(
'server');
 
  661                         $this->tpl->setVariable(
'TXT_SERVER_NAME',
$server->getTitle());
 
  662                         $this->tpl->parseCurrentBlock();
 
  673                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
 
  676                 foreach((array) $import_types as $sid => 
$server)
 
  678                         foreach((array) 
$server as $mid => $import_type)
 
  692                 $new_types = array();
 
  693                 foreach((array) $import_types as $sid => 
$server)
 
  695                         foreach((array) 
$server as $mid => $import_type)
 
  703                                         $new_types[$sid][$mid] = $import_type;
 
  707                 $import_types = $new_types;
 
  721                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
 
  722                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
 
  725                 $invalidImportTypes = 
false;
 
  728                         $invalidImportTypes = 
true;
 
  732                 foreach($servers->getServers() as 
$server)
 
  739                                 foreach($cReader->getCommunities() as $community)
 
  741                                         include_once 
'./Services/WebServices/ECS/classes/class.ilECSCommunityCache.php';
 
  743                                         $cCache->setCommunityName($community->getTitle());
 
  744                                         $cCache->setMids($community->getMids());
 
  745                                         $cCache->setOwnId($community->getOwnId());
 
  751                                 $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot read ecs communities: '.$e->getMessage());
 
  755                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
 
  756                 foreach((array) 
$_POST[
'sci_mid'] as $sid => $tmp)
 
  758                         foreach((array) 
$_POST[
'sci_mid'][$sid] as $mid => $tmp)
 
  761                                 $set->enableExport(array_key_exists($mid, (array) 
$_POST[
'export'][$sid]) ? 
true : 
false);
 
  762                                 $set->enableImport(array_key_exists($mid, (array) 
$_POST[
'import'][$sid]) ? 
true : 
false);
 
  763                                 $set->setImportType(
$_POST[
'import_type'][$sid][$mid]);
 
  770                                                 $set->setTitle($part->getParticipantName());
 
  775                                                 $set->setCommunityName($com->getTitle());
 
  780                                         $GLOBALS[
'ilLog']->write(__METHOD__.
': Cannot read ecs communities: '.$e->getMessage());
 
  786                 if($invalidImportTypes)
 
  794                 $GLOBALS[
'ilCtrl']->redirect($this,
'communities');
 
  811                 $ilTabs->clearTargets();
 
  812                 $ilTabs->clearSubTabs();
 
  814                 $ilTabs->setBackTarget(
 
  815                         $this->lng->txt(
'ecs_settings'),
 
  816                         $this->ctrl->getLinkTarget($this,
'overview')
 
  820                         $this->lng->txt(
'ecs_tab_import'),
 
  821                         $this->ctrl->getLinkTarget($this,
'importMappings')
 
  825                         $this->lng->txt(
'ecs_tab_export'),
 
  826                         $this->ctrl->getLinkTarget($this,
'exportMappings')
 
  832                         case self::MAPPING_IMPORT:
 
  833                                 $ilTabs->activateTab(
'import');
 
  836                         case self::MAPPING_EXPORT:
 
  837                                 $ilTabs->activateTab(
'export');
 
  852                 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
 
  863                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
 
  865                 $settings->readInactiveServers();
 
  867                 $sel_srv = (int)
$_REQUEST[
"ecs_mapping_server"];
 
  878                 $options = array(0 => $this->lng->txt(
"please_choose"));
 
  879                 foreach($settings->getServers() as 
$server)
 
  884                                 $title = 
"ECS (".$server->getServerId().
")";
 
  889                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";               
 
  891                 $sel->setOptions($options);
 
  892                 $sel->setValue($sel_srv);
 
  893                 $ilToolbar->addInputItem($sel);
 
  895                 $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 
"importMappings"));         
 
  896                 $ilToolbar->addFormButton($this->lng->txt(
"submit"), 
"importMappings");
 
  901                         $this->tpl->setContent($form->getHTML());
 
  916                 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
 
  927                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
 
  929                 $settings->readInactiveServers();
 
  931                 $sel_srv = (int)
$_REQUEST[
"ecs_mapping_server"];
 
  942                 $options = array(0 => $this->lng->txt(
"please_choose"));
 
  943                 foreach($settings->getServers() as 
$server)
 
  948                                 $title = 
"ECS (".$server->getServerId().
")";
 
  953                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";               
 
  955                 $sel->setOptions($options);
 
  956                 $sel->setValue($sel_srv);
 
  957                 $ilToolbar->addInputItem($sel);
 
  959                 $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 
"exportMappings"));         
 
  960                 $ilToolbar->addFormButton($this->lng->txt(
"submit"), 
"exportMappings");
 
  965                         $this->tpl->setContent($form->getHTML());
 
  979                 foreach((array) 
$_POST[
'mapping'] as $mtype => $mappings)
 
  981                         foreach((array) $mappings as $ecs_field => $advmd_id)
 
  983                                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
 
  985                                         (
int) 
$_POST[
'ecs_mapping_server'],
 
  989                                 $map->setAdvMDId($advmd_id);
 
  995                 $this->ctrl->setParameter($this, 
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
 
  996                 $this->ctrl->redirect($this,
'importMappings');
 
 1008                 foreach((array) 
$_POST[
'mapping'] as $mtype => $mappings)
 
 1010                         foreach((array) $mappings as $ecs_field => $advmd_id)
 
 1012                                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
 
 1014                                         (
int) 
$_POST[
'ecs_mapping_server'],
 
 1018                                 $map->setAdvMDId($advmd_id);
 
 1024                 $this->ctrl->setParameter($this, 
"ecs_mapping_server", (
int)
$_POST[
'ecs_mapping_server']);
 
 1025                 $this->ctrl->redirect($this,
'exportMappings');
 
 1039                 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');            
 
 1041                 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
 
 1046                 if($mapping_type == self::MAPPING_IMPORT)
 
 1048                         $form->setTitle($this->lng->txt(
'ecs_mapping_tbl'));
 
 1049                         $form->addCommandButton(
'saveImportMappings',$this->lng->txt(
'save'));
 
 1050                         $form->addCommandButton(
'importMappings',$this->lng->txt(
'cancel'));
 
 1054                         $form->setTitle($this->lng->txt(
'ecs_mapping_exp_tbl'));
 
 1055                         $form->addCommandButton(
'saveExportMappings',$this->lng->txt(
'save'));
 
 1056                         $form->addCommandButton(
'exportMappings',$this->lng->txt(
'cancel'));
 
 1059                 $form->setFormAction($this->ctrl->getFormAction($this,
'saveMappings'));
 
 1061                 if($mapping_type == self::MAPPING_IMPORT)
 
 1064                         $form->addItem($assignments);
 
 1067                 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
 
 1072                 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
 
 1074                 foreach($optional as $field_name)
 
 1076                         if($mapping_type == self::MAPPING_IMPORT)
 
 1079                                         $this->lng->txt(
'ecs_field_'.$field_name),
 
 1084                                         $mapping_settings->getMappingByECSName(
 
 1088                                 $select->setOptions($options);
 
 1089                                 $assignments->addSubItem($select);
 
 1094                                         $this->lng->txt(
'ecs_field_'.$field_name),
 
 1098                                         $mapping_settings->getMappingByECSName(
 
 1102                                 $select->setOptions($options);
 
 1103                                 $form->addItem($select);
 
 1108                 $server->setValue($a_server_id);
 
 1113                 if($mapping_type == self::MAPPING_EXPORT)
 
 1119                 $form->addItem($rcrs);
 
 1121                 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
 
 1126                 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
 
 1128                 foreach($optional as $field_name)
 
 1131                                 $this->lng->txt(
'ecs_field_'.$field_name),
 
 1132                                 'mapping['.ilECSDataMappingSetting::MAPPING_IMPORT_RCRS.
']['.$field_name.
']');
 
 1134                                 $mapping_settings->getMappingByECSName(
 
 1138                         $select->setOptions($options);
 
 1139                         $rcrs->addSubItem($select);
 
 1150                 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
 
 1151                 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.category_mapping.html',
'Services/WebServices/ECS');
 
 1157                 $this->tpl->setVariable(
'NEW_RULE_TABLE',$this->form->getHTML());
 
 1160                         $this->tpl->setVariable(
'RULES_TABLE',$html);                   
 
 1173                 if($this->form->checkInput())
 
 1175                         $this->rule->setContainerId($this->form->getInput(
'import_id'));
 
 1176                         $this->rule->setFieldName($this->form->getInput(
'field'));
 
 1177                         $this->rule->setMappingType($this->form->getInput(
'type'));
 
 1179                         switch($this->form->getInput(
'type'))
 
 1182                                         $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
 
 1186                                         $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
 
 1187                                         $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
 
 1191                                         $this->rule->setByType($this->form->getInput(
'by_type'));
 
 1195                         if($err = $this->rule->validate())
 
 1198                                 $this->form->setValuesByPost();
 
 1203                         $this->rule->save();
 
 1210                 $this->form->setValuesByPost();
 
 1228                 $this->tabs_gui->setSubTabActive(
'ecs_category_mapping');
 
 1229                 $this->ctrl->saveParameter($this,
'rule_id');
 
 1233                 $this->tpl->setContent($this->form->getHTML());
 
 1249                 $this->ctrl->saveParameter($this,
'rule_id');
 
 1252                 if($this->form->checkInput())
 
 1254                         $this->rule->setContainerId($this->form->getInput(
'import_id'));                        
 
 1255                         $this->rule->setFieldName($this->form->getInput(
'field'));
 
 1256                         $this->rule->setMappingType($this->form->getInput(
'type'));
 
 1258                         switch($this->form->getInput(
'type'))
 
 1261                                         $this->rule->setMappingValue($this->form->getInput(
'mapping_value'));
 
 1265                                         $this->rule->setDateRangeStart($this->form->getItemByPostVar(
'dur_begin')->getDate());
 
 1266                                         $this->rule->setDateRangeEnd($this->form->getItemByPostVar(
'dur_end')->getDate());
 
 1270                                         $this->rule->setByType($this->form->getInput(
'by_type'));
 
 1274                         if($err = $this->rule->validate())
 
 1277                                 $this->form->setValuesByPost();
 
 1282                         $this->rule->update();
 
 1284                         $this->ctrl->redirect($this,
'categoryMapping');
 
 1288                 $this->form->setValuesByPost();
 
 1305                 foreach(
$_POST[
'rules'] as $rule_id)
 
 1307                         include_once 
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
 
 1322                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
 
 1328                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingTableGUI.php';
 
 1330                 $rule_table->parse($rules);
 
 1331                 return $rule_table->getHTML();
 
 1341                 if(is_object($this->rule))
 
 1346                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
 
 1358                 if(is_object($this->form))
 
 1363                 include_once 
'./Services/Form/classes/class.ilPropertyFormGUI.php';
 
 1364                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
 
 1368                 if($a_mode == 
'add') 
 
 1370                         $this->form->setTitle($this->lng->txt(
'ecs_new_category_mapping'));
 
 1371                         $this->form->setFormAction($this->ctrl->getFormAction($this,
'categoryMapping'));
 
 1372                         $this->form->addCommandButton(
'addCategoryMapping',$this->lng->txt(
'save'));
 
 1373                         $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
 
 1377                         $this->form->setTitle($this->lng->txt(
'ecs_edit_category_mapping'));
 
 1378                         $this->form->setFormAction($this->ctrl->getFormAction($this,
'editCategoryMapping'));
 
 1379                         $this->form->addCommandButton(
'updateCategoryMapping',$this->lng->txt(
'save'));
 
 1380                         $this->form->addCommandButton(
'categoryMapping',$this->lng->txt(
'cancel'));
 
 1386                 $tpl = 
new ilTemplate(
'tpl.ecs_import_id_form.html',
true,
true,
'Services/WebServices/ECS');
 
 1387                 $tpl->setVariable(
'SIZE',5);
 
 1388                 $tpl->setVariable(
'MAXLENGTH',11);
 
 1389                 $tpl->setVariable(
'POST_VAR',
'import_id');
 
 1390                 $tpl->setVariable(
'PROPERTY_VALUE',$this->rule->getContainerId());
 
 1394                         $tpl->setVariable(
'COMPLETE_PATH',$this->
buildPath($this->rule->getContainerId()));
 
 1397                 $imp->setHTML(
$tpl->get());
 
 1398                 $imp->setInfo($this->lng->txt(
'ecs_import_id_info'));
 
 1399                 $this->form->addItem($imp);
 
 1401                 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php');              
 
 1402                 $select = 
new ilSelectInputGUI($this->lng->txt(
'ecs_attribute_name'),
'field');
 
 1403                 $select->
setValue($this->rule->getFieldName());
 
 1404                 $select->setRequired(
true);
 
 1406                 $this->form->addItem($select);
 
 1410                 $value->
setValue($this->rule->getMappingType());
 
 1411                 $value->setRequired(
true);
 
 1414                 $fixed->
setInfo($this->lng->txt(
'ecs_cat_mapping_fixed_info'));
 
 1416                         $fixed_val = 
new ilTextInputGUI($this->lng->txt(
'ecs_cat_mapping_values'),
'mapping_value');
 
 1417                         $fixed_val->
setValue($this->rule->getMappingValue());
 
 1418                         $fixed_val->setMaxLength(255);
 
 1419                         $fixed_val->setSize(40);
 
 1420                         $fixed_val->setRequired(
true);
 
 1421                         $fixed->addSubItem($fixed_val);
 
 1423                 $value->addOption($fixed);
 
 1426                 $duration->
setInfo($this->lng->txt(
'ecs_cat_mapping_duration_info'));
 
 1429                         $dur_start->
setDate($this->rule->getDateRangeStart());
 
 1430                         $duration->addSubItem($dur_start);
 
 1433                         $dur_end->
setDate($this->rule->getDateRangeEnd());
 
 1434                         $duration->addSubItem($dur_end);
 
 1436                 $value->addOption($duration);
 
 1439                 $type->
setInfo($this->lng->txt(
'ecs_cat_mapping_by_type_info'));
 
 1445                         $types->setValue($this->rule->getByType());
 
 1446                         $types->setRequired(
true);
 
 1447                         $type->addSubitem($types);
 
 1449                 $value->addOption($type);
 
 1451                 $this->form->addItem($value);
 
 1465                 $this->tabs_gui->setSubTabActive(
'ecs_import');
 
 1467                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
 
 1470                         $ilToolbar->addButton(
 
 1471                                 $this->lng->txt(
'ecs_read_remote_links'),
 
 1472                                 $this->ctrl->getLinkTarget($this,
'readAll')
 
 1475                         $ilToolbar->addSeparator();
 
 1485                 include_once 
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
 
 1488                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";               
 
 1490                 $sel->setOptions($options);
 
 1491                 $sel->setValue($sel_type);
 
 1492                 $ilToolbar->addInputItem($sel);
 
 1494                 $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 
"imported"));               
 
 1495                 $ilToolbar->addFormButton($this->lng->txt(
"submit"), 
"imported");
 
 1500                         $ilToolbar->addSeparator();
 
 1502                         $ilToolbar->addButton(
 
 1503                                 $this->lng->txt(
'csv_export'),
 
 1504                                 $this->ctrl->getLinkTarget($this,
'exportImported')
 
 1508                 include_once(
'Services/WebServices/ECS/classes/class.ilECSImportedContentTableGUI.php');
 
 1510                 $table_gui->setTitle($this->lng->txt(
'ecs_imported_content'));
 
 1511                 $table_gui->parse($robjs);
 
 1512                 $this->tpl->setContent($table_gui->getHTML());
 
 1525                 global $ilObjDataCache,
$ilUser;
 
 1532                 include_once(
'./Modules/RemoteCourse/classes/class.ilObjRemoteCourse.php');
 
 1533                 include_once(
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
 
 1544                 $ilObjDataCache->preloadReferenceCache($rcourses);
 
 1546                 foreach($rcourses as $rcrs_ref_id)
 
 1548                         $obj_id = $ilObjDataCache->lookupObjId($rcrs_ref_id);
 
 1549                         $obj_ids[$obj_id] = $obj_id; 
 
 1552                 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
 
 1555                 $writer->addColumn($this->lng->txt(
'title'));
 
 1556                 $writer->addColumn($this->lng->txt(
'description'));
 
 1557                 $writer->addColumn($this->lng->txt(
'ecs_imported_from'));                       
 
 1558                 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));                      
 
 1559                 $writer->addColumn($this->lng->txt(
'ecs_field_term'));                  
 
 1560                 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));                      
 
 1561                 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));                    
 
 1562                 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));                        
 
 1563                 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));                       
 
 1564                 $writer->addColumn($this->lng->txt(
'ecs_field_room'));                  
 
 1565                 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));                 
 
 1566                 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));                 
 
 1567                 $writer->addColumn($this->lng->txt(
'ecs_field_end'));                   
 
 1568                 $writer->addColumn($this->lng->txt(
'last_update'));     
 
 1570                 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
 
 1573                 foreach($obj_ids as $obj_id)
 
 1575                         include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
 
 1583                         if(
$reader and ($participant = 
$reader->getParticipantByMID($mid)))
 
 1585                                 $writer->addColumn($participant->getParticipantName());
 
 1588                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1591                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1594                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1597                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1600                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1603                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1606                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1609                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1617                         $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
 
 1619                 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d").
"_ecs_import.csv", 
"text/csv");      
 
 1632                 $this->tabs_gui->setSubTabActive(
'ecs_released');
 
 1636                         $ilToolbar->addButton(
 
 1637                                 $this->lng->txt(
'ecs_read_remote_links'),
 
 1638                                 $this->ctrl->getLinkTarget($this,
'readAll')
 
 1641                         $ilToolbar->addSeparator();
 
 1650                 include 
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
 
 1653                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";               
 
 1655                 $sel->setOptions($options);
 
 1656                 $sel->setValue($sel_type);
 
 1657                 $ilToolbar->addInputItem($sel);
 
 1659                 $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 
"released"));               
 
 1660                 $ilToolbar->addFormButton($this->lng->txt(
"submit"), 
"released");
 
 1662                 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
 
 1664                 if(count($exported))
 
 1666                         $ilToolbar->addSeparator();
 
 1668                         $ilToolbar->addButton(
 
 1669                                 $this->lng->txt(
'csv_export'),
 
 1670                                 $this->ctrl->getLinkTarget($this,
'exportReleased')
 
 1674                 include_once(
'Services/WebServices/ECS/classes/class.ilECSReleasedContentTableGUI.php');
 
 1676                 $table_gui->setTitle($this->lng->txt(
'ecs_released_content'));
 
 1677                 $table_gui->parse($exported);
 
 1678                 $this->tpl->setContent($table_gui->getHTML());
 
 1691                 global $ilObjDataCache;
 
 1693                 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
 
 1695                 $ilObjDataCache->preloadObjectCache($exported);
 
 1697                 include_once(
'Services/Utilities/classes/class.ilCSVWriter.php');
 
 1700                 $writer->addColumn($this->lng->txt(
'title'));
 
 1701                 $writer->addColumn($this->lng->txt(
'description'));                     
 
 1702                 $writer->addColumn($this->lng->txt(
'ecs_field_courseID'));                      
 
 1703                 $writer->addColumn($this->lng->txt(
'ecs_field_term'));                  
 
 1704                 $writer->addColumn($this->lng->txt(
'ecs_field_lecturer'));                      
 
 1705                 $writer->addColumn($this->lng->txt(
'ecs_field_courseType'));                    
 
 1706                 $writer->addColumn($this->lng->txt(
'ecs_field_semester_hours'));                        
 
 1707                 $writer->addColumn($this->lng->txt(
'ecs_field_credits'));                       
 
 1708                 $writer->addColumn($this->lng->txt(
'ecs_field_room'));                  
 
 1709                 $writer->addColumn($this->lng->txt(
'ecs_field_cycle'));                 
 
 1710                 $writer->addColumn($this->lng->txt(
'ecs_field_begin'));                 
 
 1711                 $writer->addColumn($this->lng->txt(
'ecs_field_end'));                   
 
 1712                 $writer->addColumn($this->lng->txt(
'last_update'));     
 
 1714                 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
 
 1717                 foreach($exported as $obj_id)
 
 1719                         include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
 
 1726                         $field = $settings->getMappingByECSName(
'courseID');
 
 1727                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1729                         $field = $settings->getMappingByECSName(
'term');
 
 1730                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1732                         $field = $settings->getMappingByECSName(
'lecturer');
 
 1733                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1735                         $field = $settings->getMappingByECSName(
'courseType');
 
 1736                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1738                         $field = $settings->getMappingByECSName(
'semester_hours');
 
 1739                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1741                         $field = $settings->getMappingByECSName(
'credits');
 
 1742                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1744                         $field = $settings->getMappingByECSName(
'room');
 
 1745                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1747                         $field = $settings->getMappingByECSName(
'cycle');
 
 1748                         $writer->addColumn(isset($values[$field]) ? $values[$field] : 
'');
 
 1750                         $field = $settings->getMappingByECSName(
'begin');
 
 1753                         $field = $settings->getMappingByECSName(
'end');
 
 1756                         $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
 
 1759                 ilUtil::deliverData($writer->getCSVString(), date(
"Y_m_d").
"_ecs_export.csv", 
"text/csv");      
 
 1770                 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
 
 1772                 $options[0] = $this->lng->txt(
'ecs_ignore_field');
 
 1773                 foreach($fields as $field)
 
 1777                         $options[$field->getFieldId()] = 
$title.
': '.$field->getTitle();                
 
 1791                 include_once(
'Services/WebServices/ECS/classes/class.ilECSSetting.php');
 
 1802                 $this->tabs_gui->clearSubTabs();
 
 1804                 $this->tabs_gui->addSubTabTarget(
"overview",
 
 1805                         $this->ctrl->getLinkTarget($this,
'overview'),
 
 1806                         "overview",get_class($this));
 
 1815                 $this->tabs_gui->addSubTabTarget(
"ecs_communities",
 
 1816                         $this->ctrl->getLinkTarget($this,
'communities'),
 
 1817                         "communities",get_class($this));
 
 1819                 $this->tabs_gui->addSubTabTarget(
'ecs_mappings',
 
 1820                         $this->ctrl->getLinkTarget($this,
'importMappings'),
 
 1821                         'importMappings',get_class($this));
 
 1823                 $this->tabs_gui->addSubTabTarget(
'ecs_category_mapping',
 
 1824                         $this->ctrl->getLinkTarget($this,
'categoryMapping'));
 
 1826                 $this->tabs_gui->addSubTabTarget(
'ecs_import',
 
 1827                         $this->ctrl->getLinkTarget($this,
'imported'));
 
 1829                 $this->tabs_gui->addSubTabTarget(
'ecs_released',
 
 1830                         $this->ctrl->getLinkTarget($this,
'released'));
 
 1841                 global $rbacreview,$ilObjDataCache;
 
 1848                 $select[0] = $this->lng->txt(
'links_select_one');
 
 1849                 foreach($global_roles as $role_id)
 
 1859                 $loc->setTextOnly(
false);
 
 1860                 $loc->addContextItems($a_ref_id);
 
 1862                 return $loc->getHTML();
 
 1874                 #$ilDB->lockTables(array('name' => 'settings', 'type' => ilDB::LOCK_WRITE)); 
 1877                         'next_execution_'.$this->
settings->getServerId(),
 
 1878                         time() + (int) $this->
settings->getPollingTime()