ILIAS  release_4-4 Revision
ilECSSettingsGUI Class Reference
+ Collaboration diagram for ilECSSettingsGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 overview ()
 List available servers. More...
 
 communities ()
 show communities More...
 
 importMappings ()
 Show mapping settings (EContent-Data <-> (Remote)Course. More...
 

Data Fields

const MAPPING_EXPORT = 1
 
const MAPPING_IMPORT = 2
 

Protected Member Functions

 activate ()
 activate server More...
 
 deactivate ()
 activate server More...
 
 readAll ()
 Read all importable econtent. More...
 
 create ()
 Create new settings ilTabs $ilTabs. More...
 
 edit ()
 Edit server setting. More...
 
 cp ()
 
 delete ()
 Delete confirmation. More...
 
 doDelete ()
 Do delete. More...
 
 settings ()
 show settings More...
 
 initSettingsForm ($a_mode='update')
 init settings form More...
 
 update ()
 save settings More...
 
 save ()
 Save settings. More...
 
 updateTitle ()
 Update configuration title. More...
 
 loadFromPost ()
 Load from post. More...
 
 refreshParticipants ()
 Refresh participants. More...
 
 validateImportTypes (&$import_types)
 Validate import types. More...
 
 updateCommunities ()
 update whitelist More...
 
 setMappingTabs ($a_active)
 Handle tabs for ECS data mapping. More...
 
 exportMappings ()
 Show mapping settings (EContent-Data <-> (Remote)Course. More...
 
 saveImportMappings ()
 Save mappings. More...
 
 saveExportMappings ()
 Save mappings. More...
 
 initMappingsForm ($a_server_id, $mapping_type)
 init mapping form More...
 
 categoryMapping ()
 Category mappings. More...
 
 addCategoryMapping ()
 save category mapping More...
 
 editCategoryMapping ()
 Edit category mapping. More...
 
 updateCategoryMapping ()
 update category mapping More...
 
 deleteCategoryMappings ()
 Delete selected category mappings. More...
 
 showRulesTable ()
 Show rules table. More...
 
 initRule ($a_rule_id=0)
 Init rule. More...
 
 initCategoryMappingForm ($a_mode='add')
 Init category mapping form. More...
 
 imported ()
 Show imported materials. More...
 
 exportImported ()
 csv export of imported remote courses More...
 
 released ()
 Show released materials. More...
 
 exportReleased ()
 export released More...
 
 prepareFieldSelection ($fields)
 get options for field selection More...
 
 initSettings ($a_server_id=1)
 Init settings. More...
 
 setSubTabs ()
 set sub tabs More...
 
 initTaskScheduler ()
 Init next task execution <type> $ilDB <type> $ilSetting. More...
 

Protected Attributes

 $tpl
 
 $lng
 
 $ctrl
 
 $tabs_gui
 

Private Member Functions

 prepareRoleSelect ()
 get global role array More...
 
 buildPath ($a_ref_id)
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilECSSettingsGUI::__construct ( )

Constructor.

public

Definition at line 52 of file class.ilECSSettingsGUI.php.

References $ilCtrl, $lng, $tpl, and initSettings().

53  {
54  global $lng,$tpl,$ilCtrl,$ilTabs;
55 
56  $this->tpl = $tpl;
57  $this->lng = $lng;
58  $this->lng->loadLanguageModule('ecs');
59  $this->ctrl = $ilCtrl;
60  $this->tabs_gui = $ilTabs;
61 
62  $this->initSettings();
63  }
global $ilCtrl
Definition: ilias.php:18
initSettings($a_server_id=1)
Init settings.
+ Here is the call graph for this function:

Member Function Documentation

◆ activate()

ilECSSettingsGUI::activate ( )
protected

activate server

Definition at line 130 of file class.ilECSSettingsGUI.php.

References $_REQUEST, initSettings(), ilUtil\sendSuccess(), and settings().

131  {
132  $this->initSettings($_REQUEST['server_id']);
133  $this->settings->setEnabledStatus(true);
134  $this->settings->update();
135  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
136  $this->ctrl->redirect($this,'overview');
137  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initSettings($a_server_id=1)
Init settings.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ addCategoryMapping()

ilECSSettingsGUI::addCategoryMapping ( )
protected

save category mapping

Returns

Definition at line 1215 of file class.ilECSSettingsGUI.php.

References categoryMapping(), initCategoryMappingForm(), initRule(), ilUtil\sendInfo(), ilECSCategoryMappingRule\TYPE_BY_TYPE, ilECSCategoryMappingRule\TYPE_DURATION, and ilECSCategoryMappingRule\TYPE_FIXED.

1216  {
1217  $this->initRule();
1218 
1219  $this->initCategoryMappingForm('add');
1220  if($this->form->checkInput())
1221  {
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'));
1225 
1226  switch($this->form->getInput('type'))
1227  {
1229  $this->rule->setMappingValue($this->form->getInput('mapping_value'));
1230  break;
1231 
1233  $this->rule->setDateRangeStart($this->form->getItemByPostVar('dur_begin')->getDate());
1234  $this->rule->setDateRangeEnd($this->form->getItemByPostVar('dur_end')->getDate());
1235  break;
1236 
1238  $this->rule->setByType($this->form->getInput('by_type'));
1239  break;
1240  }
1241 
1242  if($err = $this->rule->validate())
1243  {
1244  ilUtil::sendInfo($this->lng->txt($err));
1245  $this->form->setValuesByPost();
1246  $this->categoryMapping();
1247  return false;
1248  }
1249 
1250  $this->rule->save();
1251  ilUtil::sendInfo($this->lng->txt('settings_saved'));
1252  unset($this->rule);
1253  $this->categoryMapping();
1254  return true;
1255  }
1256  ilUtil::sendInfo($this->lng->txt('err_check_input'));
1257  $this->form->setValuesByPost();
1258  $this->categoryMapping();
1259  return false;
1260  }
categoryMapping()
Category mappings.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initCategoryMappingForm($a_mode='add')
Init category mapping form.
initRule($a_rule_id=0)
Init rule.
+ Here is the call graph for this function:

◆ buildPath()

ilECSSettingsGUI::buildPath (   $a_ref_id)
private

Definition at line 1903 of file class.ilECSSettingsGUI.php.

Referenced by initCategoryMappingForm(), and initSettingsForm().

1904  {
1905  $loc = new ilLocatorGUI();
1906  $loc->setTextOnly(false);
1907  $loc->addContextItems($a_ref_id);
1908 
1909  return $loc->getHTML();
1910  }
locator handling class
+ Here is the caller graph for this function:

◆ categoryMapping()

ilECSSettingsGUI::categoryMapping ( )
protected

Category mappings.

Returns

Definition at line 1195 of file class.ilECSSettingsGUI.php.

References initCategoryMappingForm(), initRule(), and showRulesTable().

Referenced by addCategoryMapping(), deleteCategoryMappings(), editCategoryMapping(), and updateCategoryMapping().

1196  {
1197  $this->tabs_gui->setSubTabActive('ecs_category_mapping');
1198  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.category_mapping.html','Services/WebServices/ECS');
1199 
1200  $this->initRule();
1201  $this->initCategoryMappingForm();
1202 
1203 
1204  $this->tpl->setVariable('NEW_RULE_TABLE',$this->form->getHTML());
1205  if($html = $this->showRulesTable())
1206  {
1207  $this->tpl->setVariable('RULES_TABLE',$html);
1208  }
1209  }
initCategoryMappingForm($a_mode='add')
Init category mapping form.
initRule($a_rule_id=0)
Init rule.
showRulesTable()
Show rules table.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ communities()

ilECSSettingsGUI::communities ( )

show communities

public

Definition at line 661 of file class.ilECSSettingsGUI.php.

References $GLOBALS, $reader, $server, ilECSServerSettings\getInstance(), ilECSCommunityReader\getInstanceByServerId(), and ilTable2GUI\setTitle().

662  {
663  // add toolbar to refresh communities
664  $GLOBALS['ilToolbar']->addButton(
665  $this->lng->txt('ecs_refresh_participants'),
666  $this->ctrl->getLinkTarget($this,'refreshParticipants')
667  );
668 
669  $this->tabs_gui->setSubTabActive('ecs_communities');
670 
671  $this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.ecs_communities.html','Services/WebServices/ECS');
672 
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'));
676 
677  include_once('Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
678  include_once('Services/WebServices/ECS/classes/class.ilECSCommunityTableGUI.php');
679 
680  include_once './Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
681  $settings = ilECSServerSettings::getInstance();
682  $settings->readInactiveServers();
683 
684  foreach($settings->getServers() as $server)
685  {
686  // Try to read communities
687  try
688  {
690  foreach($reader->getCommunities() as $community)
691  {
692  $this->tpl->setCurrentBlock('table_community');
693  $table_gui = new ilECSCommunityTableGUI($server,$this,'communities',$community->getId());
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();
698  }
699  }
700  catch(ilECSConnectorException $exc)
701  {
702  // Maybe server is not fully configured
703  continue;
704  }
705 
706  // Show section for each server
707  $this->tpl->setCurrentBlock('server');
708  $this->tpl->setVariable('TXT_SERVER_NAME',$server->getTitle());
709  $this->tpl->parseCurrentBlock();
710  }
711  }
static getInstance()
Get singleton instance.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static getInstanceByServerId($a_server_id)
Get instance by server id.
$GLOBALS['ct_recipient']
$server
+ Here is the call graph for this function:

◆ cp()

ilECSSettingsGUI::cp ( )
protected

Definition at line 232 of file class.ilECSSettingsGUI.php.

References $_REQUEST, initSettings(), and ilUtil\sendSuccess().

233  {
234  $this->initSettings((int) $_REQUEST['server_id']);
235 
236  $copy = clone $this->settings;
237  $copy->save();
238 
239  $this->ctrl->setParameter($this,'server_id',$copy->getServerId());
240  ilUtil::sendSuccess($this->lng->txt('ecs_settings_cloned'),true);
241  $this->ctrl->redirect($this,'edit');
242  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initSettings($a_server_id=1)
Init settings.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ create()

ilECSSettingsGUI::create ( )
protected

Create new settings ilTabs $ilTabs.

Definition at line 196 of file class.ilECSSettingsGUI.php.

References initSettings(), and initSettingsForm().

Referenced by save().

197  {
198  global $ilTabs;
199 
200  $this->initSettings(0);
201 
202  $ilTabs->clearTargets();
203  $ilTabs->clearSubTabs();
204  $ilTabs->setBackTarget($this->lng->txt('back'),$this->ctrl->getLinkTarget($this,'overview'));
205 
206  $this->initSettingsForm('create');
207  $this->tabs_gui->setSubTabActive('ecs_settings');
208 
209  $this->tpl->setContent($this->form->getHTML());
210  }
initSettingsForm($a_mode='update')
init settings form
initSettings($a_server_id=1)
Init settings.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deactivate()

ilECSSettingsGUI::deactivate ( )
protected

activate server

Definition at line 142 of file class.ilECSSettingsGUI.php.

References $_REQUEST, initSettings(), ilUtil\sendSuccess(), and settings().

143  {
144  $this->initSettings($_REQUEST['server_id']);
145  $this->settings->setEnabledStatus(false);
146  $this->settings->update();
147  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
148  $this->ctrl->redirect($this,'overview');
149  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
initSettings($a_server_id=1)
Init settings.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ delete()

ilECSSettingsGUI::delete ( )
protected

Delete confirmation.

Definition at line 247 of file class.ilECSSettingsGUI.php.

References $_REQUEST, initSettings(), and settings().

248  {
249  global $ilTabs;
250 
251  $this->initSettings((int) $_REQUEST['server_id']);
252 
253  $ilTabs->clearTargets();
254  $ilTabs->clearSubTabs();
255  $ilTabs->setBackTarget($this->lng->txt('back'),$this->ctrl->getLinkTarget($this,'overview'));
256 
257  include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
258  $confirm = new ilConfirmationGUI();
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'));
263 
264  $confirm->addItem('','',$this->settings->getServer());
265  $confirm->addHiddenItem('server_id', $this->settings->getServerId());
266 
267  $this->tpl->setContent($confirm->getHTML());
268  }
initSettings($a_server_id=1)
Init settings.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteCategoryMappings()

ilECSSettingsGUI::deleteCategoryMappings ( )
protected

Delete selected category mappings.

Definition at line 1344 of file class.ilECSSettingsGUI.php.

References $_POST, categoryMapping(), and ilUtil\sendInfo().

1345  {
1346  if(!is_array($_POST['rules']) or !$_POST['rules'])
1347  {
1348  ilUtil::sendInfo($this->lng->txt('no_checkbox'));
1349  $this->categoryMapping();
1350  return false;
1351  }
1352  foreach($_POST['rules'] as $rule_id)
1353  {
1354  include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1355  $rule = new ilECSCategoryMappingRule($rule_id);
1356  $rule->delete();
1357  }
1358  ilUtil::sendInfo($this->lng->txt('settings_saved'));
1359  $this->categoryMapping();
1360  return true;
1361  }
categoryMapping()
Category mappings.
$_POST['username']
Definition: cron.php:12
Defines a rule for the assignment of ECS remote courses to categories.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ doDelete()

ilECSSettingsGUI::doDelete ( )
protected

Do delete.

Definition at line 273 of file class.ilECSSettingsGUI.php.

References $_REQUEST, ilECSCommunitiesCache\delete(), ilECSDataMappingSettings\delete(), ilECSParticipantSettings\deleteByServer(), ilECSExport\deleteByServer(), ilECSImport\deleteByServer(), ilECSEventQueueReader\deleteServer(), initSettings(), ilUtil\sendSuccess(), and settings().

274  {
275  $this->initSettings($_REQUEST['server_id']);
276  $this->settings->delete();
277 
278  // Delete communities
279  include_once './Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
280  ilECSCommunitiesCache::delete((int) $_REQUEST['server_id']);
281 
282  include_once './Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php';
283  ilECSDataMappingSettings::delete((int) $_REQUEST['server_id']);
284 
285  include_once './Services/WebServices/ECS/classes/class.ilECSEventQueueReader.php';
287 
288  include_once './Services/WebServices/ECS/classes/class.ilECSExport.php';
289  ilECSExport::deleteByServer((int) $_REQUEST['server_id']);
290 
291  include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
292  ilECSImport::deleteByServer((int) $_REQUEST['server_id']);
293 
294  include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
296 
297  ilUtil::sendSuccess($this->lng->txt('ecs_setting_deleted'),true);
298  $this->ctrl->redirect($this,'overview');
299  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static deleteServer($a_server_id)
Delete by server id ilDB $ilDB.
static deleteByServer($a_server_id)
Delete by server id ilDB $ilDB.
static delete($a_server_id)
Delete comunities by server id.
static deleteByServer($a_server_id)
Delete by server id ilDB $ilDB.
static delete($a_server_id)
Delete server ilDB $ilDB.
static deleteByServer($a_server_id)
Delete by server $ilDB.
initSettings($a_server_id=1)
Init settings.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ edit()

ilECSSettingsGUI::edit ( )
protected

Edit server setting.

Definition at line 215 of file class.ilECSSettingsGUI.php.

References $_REQUEST, initSettings(), and initSettingsForm().

Referenced by update().

216  {
217  global $ilTabs;
218 
219  $this->initSettings((int) $_REQUEST['server_id']);
220  $this->ctrl->saveParameter($this,'server_id',(int) $_REQUEST['server_id']);
221 
222  $ilTabs->clearTargets();
223  $ilTabs->clearSubTabs();
224  $ilTabs->setBackTarget($this->lng->txt('back'),$this->ctrl->getLinkTarget($this,'overview'));
225 
226  $this->initSettingsForm();
227  $this->tabs_gui->setSubTabActive('ecs_settings');
228 
229  $this->tpl->setContent($this->form->getHTML());
230  }
initSettingsForm($a_mode='update')
init settings form
initSettings($a_server_id=1)
Init settings.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editCategoryMapping()

ilECSSettingsGUI::editCategoryMapping ( )
protected

Edit category mapping.

Returns

Definition at line 1266 of file class.ilECSSettingsGUI.php.

References $_REQUEST, categoryMapping(), initCategoryMappingForm(), initRule(), and ilUtil\sendInfo().

Referenced by updateCategoryMapping().

1267  {
1268  if(!$_REQUEST['rule_id'])
1269  {
1270  ilUtil::sendInfo($this->lng->txt('select_one'));
1271  $this->categoryMapping();
1272  return false;
1273  }
1274 
1275  $this->tabs_gui->setSubTabActive('ecs_category_mapping');
1276  $this->ctrl->saveParameter($this,'rule_id');
1277  $this->initRule((int) $_REQUEST['rule_id']);
1278 
1279  $this->initCategoryMappingForm('edit');
1280  $this->tpl->setContent($this->form->getHTML());
1281  return true;
1282  }
categoryMapping()
Category mappings.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initCategoryMappingForm($a_mode='add')
Init category mapping form.
initRule($a_rule_id=0)
Init rule.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilECSSettingsGUI::executeCommand ( )

Execute command.

public

Parameters

Definition at line 72 of file class.ilECSSettingsGUI.php.

References $_REQUEST, $cmd, and setSubTabs().

73  {
74  $next_class = $this->ctrl->getNextClass($this);
75  $cmd = $this->ctrl->getCmd();
76 
77  $this->setSubTabs();
78  switch($next_class)
79  {
80  case 'ilecsmappingsettingsgui':
81  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSMappingSettingsGUI.php';
82  $mapset = new ilECSMappingSettingsGUI($this, (int) $_REQUEST['server_id'], (int) $_REQUEST['mid']);
83  $this->ctrl->setReturn($this,'communities');
84  $this->ctrl->forwardCommand($mapset);
85  break;
86 
87  default:
88  if(!$cmd || $cmd == 'view')
89  {
90  $cmd = "overview";
91  }
92  $this->$cmd();
93  break;
94  }
95  return true;
96  }
$cmd
Definition: sahs_server.php:35
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ exportImported()

ilECSSettingsGUI::exportImported ( )
protected

csv export of imported remote courses

protected

Returns

Definition at line 1570 of file class.ilECSSettingsGUI.php.

References $ilUser, $reader, ilECSDataMappingSettings\_getInstance(), ilECSCommunityReader\_getInstance(), ilUtil\_getObjectsByOperations(), ilAdvancedMDValues\_getValuesByObjId(), ilObject\_lookupDescription(), ilObjRemoteCourse\_lookupMID(), ilObject\_lookupTitle(), ilUtil\deliverData(), ilFormat\formatUnixTime(), and ilECSDataMappingSetting\MAPPING_IMPORT_RCRS.

1571  {
1572  global $ilObjDataCache,$ilUser;
1573 
1574  // :TODO: mind resource type and move to ilRemoteObjectBase...
1575 
1576  $rcourses = ilUtil::_getObjectsByOperations('rcrs','visible',$ilUser->getId(),-1);
1577 
1578  // Read participants
1579  include_once('./Modules/RemoteCourse/classes/class.ilObjRemoteCourse.php');
1580  include_once('./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php');
1581  try
1582  {
1584  }
1585  catch(ilECSConnectorException $e)
1586  {
1587  $reader = null;
1588  }
1589 
1590  // read obj_ids
1591  $ilObjDataCache->preloadReferenceCache($rcourses);
1592  $obj_ids = array();
1593  foreach($rcourses as $rcrs_ref_id)
1594  {
1595  $obj_id = $ilObjDataCache->lookupObjId($rcrs_ref_id);
1596  $obj_ids[$obj_id] = $obj_id;
1597  }
1598 
1599  include_once('Services/Utilities/classes/class.ilCSVWriter.php');
1600  $writer = new ilCSVWriter();
1601 
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'));
1616 
1617  include_once('./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1619 
1620  foreach($obj_ids as $obj_id)
1621  {
1622  include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
1623  $values = ilAdvancedMDValues::_getValuesByObjId($obj_id);
1624 
1625  $writer->addRow();
1626  $writer->addColumn(ilObject::_lookupTitle($obj_id));
1627  $writer->addColumn(ilObject::_lookupDescription($obj_id));
1628 
1629  $mid = ilObjRemoteCourse::_lookupMID($obj_id);
1630  if($reader and ($participant = $reader->getParticipantByMID($mid)))
1631  {
1632  $writer->addColumn($participant->getParticipantName());
1633  }
1634  $field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS,'courseID');
1635  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1636 
1637  $field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS,'term');
1638  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1639 
1640  $field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS,'lecturer');
1641  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1642 
1643  $field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS,'courseType');
1644  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1645 
1646  $field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS,'semester_hours');
1647  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1648 
1649  $field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS,'credits');
1650  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1651 
1652  $field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS,'room');
1653  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1654 
1655  $field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS,'cycle');
1656  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1657 
1658  $field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS,'begin');
1659  $writer->addColumn(isset($values[$field]) ? ilFormat::formatUnixTime($values[$field],true) : '');
1660 
1661  $field = $settings->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS,'end');
1662  $writer->addColumn(isset($values[$field]) ? ilFormat::formatUnixTime($values[$field],true) : '');
1663 
1664  $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1665  }
1666  ilUtil::deliverData($writer->getCSVString(), date("Y_m_d")."_ecs_import.csv", "text/csv");
1667  }
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
Helper class to generate CSV files.
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.
static _lookupTitle($a_id)
lookup object title
static _getValuesByObjId($a_obj_id)
Get all values of an object.
static _lookupMID($a_obj_id)
static _lookupDescription($a_id)
lookup object description
formatUnixTime($ut, $with_time=false)
global $ilUser
Definition: imgupload.php:15
static _getInstance()
Get Singleton instance.
+ Here is the call graph for this function:

◆ exportMappings()

ilECSSettingsGUI::exportMappings ( )
protected

Show mapping settings (EContent-Data <-> (Remote)Course.

protected

Definition at line 959 of file class.ilECSSettingsGUI.php.

References $_REQUEST, $_SESSION, $options, $server, ilAdvancedMDFieldDefinition\_getActiveDefinitionsByObjType(), ilECSServerSettings\getInstance(), initMappingsForm(), ilUtil\sendInfo(), and setMappingTabs().

960  {
961  global $ilToolbar;
962 
963  include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
964 
965  $this->setMappingTabs(self::MAPPING_EXPORT);
966 
968  if(!count($fields))
969  {
970  ilUtil::sendInfo($this->lng->txt('ecs_no_adv_md'));
971  return true;
972  }
973 
974  include_once './Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
975  $settings = ilECSServerSettings::getInstance();
976  $settings->readInactiveServers();
977 
978  $sel_srv = (int)$_REQUEST["ecs_mapping_server"];
979  if(!$sel_srv)
980  {
981  $sel_srv = $_SESSION["ecs_sel_srv"];
982  }
983  else
984  {
985  $_SESSION["ecs_sel_srv"] = $sel_srv;
986  }
987 
988  // Iterate all servers
989  $options = array(0 => $this->lng->txt("please_choose"));
990  foreach($settings->getServers() as $server)
991  {
992  $title = $server->getTitle();
993  if(!$title)
994  {
995  $title = "ECS (".$server->getServerId().")";
996  }
997  $options[$server->getServerId()] = $title;
998  }
999 
1000  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1001  $sel = new ilSelectInputGUI("", "ecs_mapping_server");
1002  $sel->setOptions($options);
1003  $sel->setValue($sel_srv);
1004  $ilToolbar->addInputItem($sel);
1005 
1006  $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "exportMappings"));
1007  $ilToolbar->addFormButton($this->lng->txt("submit"), "exportMappings");
1008 
1009  if($sel_srv)
1010  {
1011  $form = $this->initMappingsForm($sel_srv,self::MAPPING_EXPORT);
1012  $this->tpl->setContent($form->getHTML());
1013  }
1014 
1015  return true;
1016  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setMappingTabs($a_active)
Handle tabs for ECS data mapping.
This class represents a selection list property in a property form.
static getInstance()
Get singleton instance.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!is_array($argv)) $options
initMappingsForm($a_server_id, $mapping_type)
init mapping form
static _getActiveDefinitionsByObjType($a_type)
get active definitions by obj type
$server
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ exportReleased()

ilECSSettingsGUI::exportReleased ( )
protected

export released

protected

Returns

Definition at line 1736 of file class.ilECSSettingsGUI.php.

References ilECSDataMappingSettings\_getInstance(), ilAdvancedMDValues\_getValuesByObjId(), ilObject\_lookupDescription(), ilObject\_lookupTitle(), ilUtil\deliverData(), ilFormat\formatUnixTime(), and ilECSExport\getExportedIds().

1737  {
1738  global $ilObjDataCache;
1739 
1740  include_once('./Services/WebServices/ECS/classes/class.ilECSExport.php');
1741  $exported = ilECSExport::getExportedIds();
1742  $ilObjDataCache->preloadObjectCache($exported);
1743 
1744  include_once('Services/Utilities/classes/class.ilCSVWriter.php');
1745  $writer = new ilCSVWriter();
1746 
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'));
1760 
1761  include_once('./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1763 
1764  foreach($exported as $obj_id)
1765  {
1766  include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
1767  $values = ilAdvancedMDValues::_getValuesByObjId($obj_id);
1768 
1769  $writer->addRow();
1770  $writer->addColumn(ilObject::_lookupTitle($obj_id));
1771  $writer->addColumn(ilObject::_lookupDescription($obj_id));
1772 
1773  $field = $settings->getMappingByECSName('courseID');
1774  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1775 
1776  $field = $settings->getMappingByECSName('term');
1777  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1778 
1779  $field = $settings->getMappingByECSName('lecturer');
1780  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1781 
1782  $field = $settings->getMappingByECSName('courseType');
1783  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1784 
1785  $field = $settings->getMappingByECSName('semester_hours');
1786  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1787 
1788  $field = $settings->getMappingByECSName('credits');
1789  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1790 
1791  $field = $settings->getMappingByECSName('room');
1792  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1793 
1794  $field = $settings->getMappingByECSName('cycle');
1795  $writer->addColumn(isset($values[$field]) ? $values[$field] : '');
1796 
1797  $field = $settings->getMappingByECSName('begin');
1798  $writer->addColumn(isset($values[$field]) ? ilFormat::formatUnixTime($values[$field],true) : '');
1799 
1800  $field = $settings->getMappingByECSName('end');
1801  $writer->addColumn(isset($values[$field]) ? ilFormat::formatUnixTime($values[$field],true) : '');
1802 
1803  $writer->addColumn($ilObjDataCache->lookupLastUpdate($obj_id));
1804  }
1805 
1806  ilUtil::deliverData($writer->getCSVString(), date("Y_m_d")."_ecs_export.csv", "text/csv");
1807  }
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
Helper class to generate CSV files.
static _lookupTitle($a_id)
lookup object title
static _getValuesByObjId($a_obj_id)
Get all values of an object.
static getExportedIds()
Get exported ids ilDB $ilDB.
static _lookupDescription($a_id)
lookup object description
formatUnixTime($ut, $with_time=false)
static _getInstance()
Get Singleton instance.
+ Here is the call graph for this function:

◆ imported()

ilECSSettingsGUI::imported ( )
protected

Show imported materials.

protected

Definition at line 1508 of file class.ilECSSettingsGUI.php.

References $_REQUEST, $ilUser, $options, ilUtil\_getObjectsByOperations(), ilECSServerSettings\getInstance(), and ilECSUtils\getPossibleRemoteTypes().

Referenced by readAll().

1509  {
1510  global $ilUser, $ilToolbar;
1511 
1512  $this->tabs_gui->setSubTabActive('ecs_import');
1513 
1514  include_once './Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
1515  if(ilECSServerSettings::getInstance()->activeServerExists())
1516  {
1517  $ilToolbar->addButton(
1518  $this->lng->txt('ecs_read_remote_links'),
1519  $this->ctrl->getLinkTarget($this,'readAll')
1520  );
1521 
1522  $ilToolbar->addSeparator();
1523  }
1524 
1525 
1526  $sel_type = $_REQUEST["otype"];
1527  if(!$sel_type)
1528  {
1529  $sel_type = "rcrs";
1530  }
1531 
1532  include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
1534 
1535  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1536  $sel = new ilSelectInputGUI("", "otype");
1537  $sel->setOptions($options);
1538  $sel->setValue($sel_type);
1539  $ilToolbar->addInputItem($sel);
1540 
1541  $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "imported"));
1542  $ilToolbar->addFormButton($this->lng->txt("submit"), "imported");
1543 
1544  $robjs = ilUtil::_getObjectsByOperations($sel_type,'visible',$ilUser->getId(),-1);
1545  if(count($robjs))
1546  {
1547  $ilToolbar->addSeparator();
1548 
1549  $ilToolbar->addButton(
1550  $this->lng->txt('csv_export'),
1551  $this->ctrl->getLinkTarget($this,'exportImported')
1552  );
1553  }
1554 
1555  include_once('Services/WebServices/ECS/classes/class.ilECSImportedContentTableGUI.php');
1556  $table_gui = new ilECSImportedContentTableGUI($this,'imported');
1557  $table_gui->setTitle($this->lng->txt('ecs_imported_content'));
1558  $table_gui->parse($robjs);
1559  $this->tpl->setContent($table_gui->getHTML());
1560 
1561  return true;
1562  }
static getPossibleRemoteTypes($a_with_captions=false)
Get all possible remote object types.
This class represents a selection list property in a property form.
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.
if(!is_array($argv)) $options
global $ilUser
Definition: imgupload.php:15
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importMappings()

ilECSSettingsGUI::importMappings ( )

Show mapping settings (EContent-Data <-> (Remote)Course.

protected

Definition at line 895 of file class.ilECSSettingsGUI.php.

References $_REQUEST, $_SESSION, $options, $server, ilAdvancedMDFieldDefinition\_getActiveDefinitionsByObjType(), ilECSServerSettings\getInstance(), initMappingsForm(), ilUtil\sendInfo(), and setMappingTabs().

896  {
897  global $ilToolbar;
898 
899  include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
900 
901  $this->setMappingTabs(self::MAPPING_IMPORT);
902 
904  if(!count($fields))
905  {
906  ilUtil::sendInfo($this->lng->txt('ecs_no_adv_md'));
907  return true;
908  }
909 
910  include_once './Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
911  $settings = ilECSServerSettings::getInstance();
912  $settings->readInactiveServers();
913 
914  $sel_srv = (int)$_REQUEST["ecs_mapping_server"];
915  if(!$sel_srv)
916  {
917  $sel_srv = $_SESSION["ecs_sel_srv"];
918  }
919  else
920  {
921  $_SESSION["ecs_sel_srv"] = $sel_srv;
922  }
923 
924  // Iterate all servers
925  $options = array(0 => $this->lng->txt("please_choose"));
926  foreach($settings->getServers() as $server)
927  {
928  $title = $server->getTitle();
929  if(!$title)
930  {
931  $title = "ECS (".$server->getServerId().")";
932  }
933  $options[$server->getServerId()] = $title;
934  }
935 
936  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
937  $sel = new ilSelectInputGUI("", "ecs_mapping_server");
938  $sel->setOptions($options);
939  $sel->setValue($sel_srv);
940  $ilToolbar->addInputItem($sel);
941 
942  $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "importMappings"));
943  $ilToolbar->addFormButton($this->lng->txt("submit"), "importMappings");
944 
945  if($sel_srv)
946  {
947  $form = $this->initMappingsForm($sel_srv, self::MAPPING_IMPORT);
948  $this->tpl->setContent($form->getHTML());
949  }
950 
951  return true;
952  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
setMappingTabs($a_active)
Handle tabs for ECS data mapping.
This class represents a selection list property in a property form.
static getInstance()
Get singleton instance.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(!is_array($argv)) $options
initMappingsForm($a_server_id, $mapping_type)
init mapping form
static _getActiveDefinitionsByObjType($a_type)
get active definitions by obj type
$server
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ initCategoryMappingForm()

ilECSSettingsGUI::initCategoryMappingForm (   $a_mode = 'add')
protected

Init category mapping form.

Returns

Definition at line 1401 of file class.ilECSSettingsGUI.php.

References $options, $tpl, buildPath(), ilECSCategoryMapping\getPossibleFields(), ilECSUtils\getPossibleRemoteTypes(), ilDateTimeInputGUI\setDate(), ilRadioOption\setInfo(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), settings(), ilTextInputGUI\setValue(), ilSelectInputGUI\setValue(), ilRadioGroupInputGUI\setValue(), ilECSCategoryMappingRule\TYPE_BY_TYPE, ilECSCategoryMappingRule\TYPE_DURATION, and ilECSCategoryMappingRule\TYPE_FIXED.

Referenced by addCategoryMapping(), categoryMapping(), editCategoryMapping(), and updateCategoryMapping().

1402  {
1403  global $ilDB;
1404 
1405  if(is_object($this->form))
1406  {
1407  return true;
1408  }
1409 
1410  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
1411  include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1412 
1413  $this->form = new ilPropertyFormGUI();
1414 
1415  if($a_mode == 'add')
1416  {
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'));
1421  }
1422  else
1423  {
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'));
1428  }
1429 
1430  $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'),'import_id');
1431  $imp->setRequired(true);
1432 
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());
1438 
1439  if($this->settings->getImportId())
1440  {
1441  $tpl->setVariable('COMPLETE_PATH',$this->buildPath($this->rule->getContainerId()));
1442  }
1443 
1444  $imp->setHTML($tpl->get());
1445  $imp->setInfo($this->lng->txt('ecs_import_id_info'));
1446  $this->form->addItem($imp);
1447 
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);
1452  $select->setOptions(ilECSCategoryMapping::getPossibleFields());
1453  $this->form->addItem($select);
1454 
1455  // Value
1456  $value = new ilRadioGroupInputGUI($this->lng->txt('ecs_cat_mapping_type'),'type');
1457  $value->setValue($this->rule->getMappingType());
1458  $value->setRequired(true);
1459 
1460  $fixed = new ilRadioOption($this->lng->txt('ecs_cat_mapping_fixed'),ilECSCategoryMappingRule::TYPE_FIXED);
1461  $fixed->setInfo($this->lng->txt('ecs_cat_mapping_fixed_info'));
1462 
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);
1469 
1470  $value->addOption($fixed);
1471 
1472  $duration = new ilRadioOption($this->lng->txt('ecs_cat_mapping_duration'),ilECSCategoryMappingRule::TYPE_DURATION);
1473  $duration->setInfo($this->lng->txt('ecs_cat_mapping_duration_info'));
1474 
1475  $dur_start = new ilDateTimeInputGUI($this->lng->txt('from'),'dur_begin');
1476  $dur_start->setDate($this->rule->getDateRangeStart());
1477  $duration->addSubItem($dur_start);
1478 
1479  $dur_end = new ilDateTimeInputGUI($this->lng->txt('to'),'dur_end');
1480  $dur_end->setDate($this->rule->getDateRangeEnd());
1481  $duration->addSubItem($dur_end);
1482 
1483  $value->addOption($duration);
1484 
1485  $type = new ilRadioOption($this->lng->txt('ecs_cat_mapping_by_type'),ilECSCategoryMappingRule::TYPE_BY_TYPE);
1486  $type->setInfo($this->lng->txt('ecs_cat_mapping_by_type_info'));
1487 
1489 
1490  $types = new ilSelectInputGUI($this->lng->txt('type'), 'by_type');
1491  $types->setOptions($options);
1492  $types->setValue($this->rule->getByType());
1493  $types->setRequired(true);
1494  $type->addSubitem($types);
1495 
1496  $value->addOption($type);
1497 
1498  $this->form->addItem($value);
1499 
1500  }
This class represents an option in a radio group.
static getPossibleRemoteTypes($a_with_captions=false)
Get all possible remote object types.
This class represents a selection list property in a property form.
This class represents a property form user interface.
setDate(ilDateTime $a_date=NULL)
set date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTim...
setInfo($a_info)
Set Info.
This class represents a date/time property in a property form.
This class represents a property in a property form.
if(!is_array($argv)) $options
setValue($a_value)
Set Value.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
setOptions($a_options)
Set Options.
This class represents a custom property in a property form.
setValue($a_value)
Set Value.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMappingsForm()

ilECSSettingsGUI::initMappingsForm (   $a_server_id,
  $mapping_type 
)
protected

init mapping form

Parameters
int$a_server_id
Returns
ilPropertyFormGUI $form

protected

Definition at line 1084 of file class.ilECSSettingsGUI.php.

References $options, $server, ilAdvancedMDFieldDefinition\_getActiveDefinitionsByObjType(), ilECSUtils\_getOptionalEContentFields(), ilECSUtils\_getOptionalECourseFields(), ilECSDataMappingSettings\getInstanceByServerId(), ilECSDataMappingSetting\MAPPING_EXPORT, ilECSDataMappingSetting\MAPPING_IMPORT_CRS, ilECSDataMappingSetting\MAPPING_IMPORT_RCRS, prepareFieldSelection(), and ilSelectInputGUI\setValue().

Referenced by exportMappings(), and importMappings().

1085  {
1086  include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
1087 
1088  include_once('./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
1089  $mapping_settings = ilECSDataMappingSettings::getInstanceByServerId($a_server_id);
1090 
1091  $form = new ilPropertyFormGUI();
1092 
1093  if($mapping_type == self::MAPPING_IMPORT)
1094  {
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'));
1098  }
1099  else
1100  {
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'));
1104  }
1105 
1106  $form->setFormAction($this->ctrl->getFormAction($this,'saveMappings'));
1107 
1108  if($mapping_type == self::MAPPING_IMPORT)
1109  {
1110  $assignments = new ilCustomInputGUI($this->lng->txt('ecs_mapping_crs'));
1111  $form->addItem($assignments);
1112  }
1113 
1114  include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1116  $options = $this->prepareFieldSelection($fields);
1117 
1118  // get all optional ecourse fields
1119  include_once('./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1121  foreach($optional as $field_name)
1122  {
1123  if($mapping_type == self::MAPPING_IMPORT)
1124  {
1125  $select = new ilSelectInputGUI(
1126  $this->lng->txt('ecs_field_'.$field_name),
1127  'mapping'.'['.ilECSDataMappingSetting::MAPPING_IMPORT_CRS.']['.$field_name.']'
1128  );
1129 
1130  $select->setValue(
1131  $mapping_settings->getMappingByECSName(
1133  $field_name)
1134  );
1135  $select->setOptions($options);
1136  $assignments->addSubItem($select);
1137  }
1138  else
1139  {
1140  $select = new ilSelectInputGUI(
1141  $this->lng->txt('ecs_field_'.$field_name),
1142  'mapping'.'['.ilECSDataMappingSetting::MAPPING_EXPORT.']['.$field_name.']'
1143  );
1144  $select->setValue(
1145  $mapping_settings->getMappingByECSName(
1147  $field_name)
1148  );
1149  $select->setOptions($options);
1150  $form->addItem($select);
1151  }
1152  }
1153 
1154  $server = new ilHiddenInputGUI('ecs_mapping_server');
1155  $server->setValue($a_server_id);
1156  $form->addItem($server);
1157 
1158  // Remote courses
1159  // no remote course settings for export
1160  if($mapping_type == self::MAPPING_EXPORT)
1161  {
1162  return $form;
1163  }
1164 
1165  $rcrs = new ilCustomInputGUI($this->lng->txt('ecs_mapping_rcrs'));
1166  $form->addItem($rcrs);
1167 
1168  include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
1170  $options = $this->prepareFieldSelection($fields);
1171 
1172  // get all optional econtent fields
1173  include_once('./Services/WebServices/ECS/classes/class.ilECSUtils.php');
1175  foreach($optional as $field_name)
1176  {
1177  $select = new ilSelectInputGUI(
1178  $this->lng->txt('ecs_field_'.$field_name),
1179  'mapping['.ilECSDataMappingSetting::MAPPING_IMPORT_RCRS.']['.$field_name.']');
1180  $select->setValue(
1181  $mapping_settings->getMappingByECSName(
1183  $field_name)
1184  );
1185  $select->setOptions($options);
1186  $rcrs->addSubItem($select);
1187  }
1188  return $form;
1189  }
static getInstanceByServerId($a_server_id)
Get singleton instance.
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a hidden form property in a property form.
if(!is_array($argv)) $options
setValue($a_value)
Set Value.
static _getActiveDefinitionsByObjType($a_type)
get active definitions by obj type
static _getOptionalEContentFields()
get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions ...
$server
This class represents a custom property in a property form.
prepareFieldSelection($fields)
get options for field selection
static _getOptionalECourseFields()
get optional econtent fields These fields might be mapped against AdvancedMetaData field definitions ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initRule()

ilECSSettingsGUI::initRule (   $a_rule_id = 0)
protected

Init rule.

Parameters
int$rule_idrule id
Returns

Definition at line 1386 of file class.ilECSSettingsGUI.php.

Referenced by addCategoryMapping(), categoryMapping(), editCategoryMapping(), and updateCategoryMapping().

1387  {
1388  if(is_object($this->rule))
1389  {
1390  return $this->rule;
1391  }
1392 
1393  include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
1394  $this->rule = new ilECSCategoryMappingRule($a_rule_id);
1395  }
Defines a rule for the assignment of ECS remote courses to categories.
+ Here is the caller graph for this function:

◆ initSettings()

ilECSSettingsGUI::initSettings (   $a_server_id = 1)
protected

Init settings.

protected

Definition at line 1836 of file class.ilECSSettingsGUI.php.

References ilECSSetting\getInstanceByServerId(), and settings().

Referenced by __construct(), activate(), cp(), create(), deactivate(), delete(), doDelete(), edit(), save(), and update().

1837  {
1838  include_once('Services/WebServices/ECS/classes/class.ilECSSetting.php');
1839  $this->settings = ilECSSetting::getInstanceByServerId($a_server_id);
1840  }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilECSSettingsGUI::initSettingsForm (   $a_mode = 'update')
protected

init settings form

protected

Definition at line 320 of file class.ilECSSettingsGUI.php.

References $pass, $tpl, ilECSSetting\AUTH_APACHE, ilECSSetting\AUTH_CERTIFICATE, buildPath(), prepareRoleSelect(), ilECSSetting\PROTOCOL_HTTPS, ilCheckboxInputGUI\setChecked(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilDurationInputGUI\setShowDays(), ilTextInputGUI\setSize(), settings(), ilTextInputGUI\setValue(), ilRadioGroupInputGUI\setValue(), and ilNonEditableValueGUI\setValue().

Referenced by create(), edit(), and settings().

321  {
322  if(is_object($this->form))
323  {
324  return true;
325  }
326  include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
327 
328  $this->form = new ilPropertyFormGUI();
329  $this->form->setFormAction($this->ctrl->getFormAction($this,'settings'));
330  $this->form->setTitle($this->lng->txt('ecs_connection_settings'));
331 
332  $ena = new ilCheckboxInputGUI($this->lng->txt('ecs_active'),'active');
333  $ena->setChecked($this->settings->isEnabled());
334  $ena->setValue(1);
335  $this->form->addItem($ena);
336 
337  $server_title = new ilTextInputGUI($this->lng->txt('ecs_server_title'),'title');
338  $server_title->setValue($this->settings->getTitle());
339  $server_title->setSize(80);
340  $server_title->setMaxLength(128);
341  $server_title->setRequired(true);
342  $this->form->addItem($server_title);
343 
344  $ser = new ilTextInputGUI($this->lng->txt('ecs_server_url'),'server');
345  $ser->setValue((string) $this->settings->getServer());
346  $ser->setRequired(true);
347  $this->form->addItem($ser);
348 
349  $pro = new ilSelectInputGUI($this->lng->txt('ecs_protocol'),'protocol');
350  // fixed to https
351  #$pro->setOptions(array(ilECSSetting::PROTOCOL_HTTP => $this->lng->txt('http'),
352  # ilECSSetting::PROTOCOL_HTTPS => $this->lng->txt('https')));
353  $pro->setOptions(array(ilECSSetting::PROTOCOL_HTTPS => 'HTTPS'));
354  $pro->setValue($this->settings->getProtocol());
355  $pro->setRequired(true);
356  $this->form->addItem($pro);
357 
358  $por = new ilTextInputGUI($this->lng->txt('ecs_port'),'port');
359  $por->setSize(5);
360  $por->setMaxLength(5);
361  $por->setValue((string) $this->settings->getPort());
362  $por->setRequired(true);
363  $this->form->addItem($por);
364 
365  $tcer = new ilRadioGroupInputGUI($this->lng->txt('ecs_auth_type'),'auth_type');
366  $tcer->setValue($this->settings->getAuthType());
367  $this->form->addItem($tcer);
368 
369  // Certificate based authentication
370  $cert_based = new ilRadioOption($this->lng->txt('ecs_auth_type_cert'), ilECSSetting::AUTH_CERTIFICATE);
371  $tcer->addOption($cert_based);
372 
373  $cli = new ilTextInputGUI($this->lng->txt('ecs_client_cert'),'client_cert');
374  $cli->setSize(60);
375  $cli->setValue((string) $this->settings->getClientCertPath());
376  $cli->setRequired(true);
377  $cert_based->addSubItem($cli);
378 
379  $key = new ilTextInputGUI($this->lng->txt('ecs_cert_key'),'key_path');
380  $key->setSize(60);
381  $key->setValue((string) $this->settings->getKeyPath());
382  $key->setRequired(true);
383  $cert_based->addSubItem($key);
384 
385  $cerp = new ilTextInputGUI($this->lng->txt('ecs_key_password'),'key_password');
386  $cerp->setSize(12);
387  $cerp->setValue((string) $this->settings->getKeyPassword());
388  $cerp->setInputType('password');
389  $cerp->setRequired(true);
390  $cert_based->addSubItem($cerp);
391 
392  $cer = new ilTextInputGUI($this->lng->txt('ecs_ca_cert'),'ca_cert');
393  $cer->setSize(60);
394  $cer->setValue((string) $this->settings->getCACertPath());
395  $cer->setRequired(true);
396  $cert_based->addSubItem($cer);
397 
398  // Apache auth
399  $apa_based = new ilRadioOption($this->lng->txt('ecs_auth_type_apache'), ilECSSetting::AUTH_APACHE);
400  $tcer->addOption($apa_based);
401 
402  $user = new ilTextInputGUI($this->lng->txt('ecs_apache_user'),'auth_user');
403  $user->setSize(32);
404  $user->setValue((string) $this->settings->getAuthUser());
405  $user->setRequired(true);
406  $apa_based->addSubItem($user);
407 
408  $pass = new ilPasswordInputGUI($this->lng->txt('ecs_apache_pass'), 'auth_pass');
409  $pass->setRetype(false);
410  $pass->setSize(32);
411  $pass->setMaxLength(128);
412  $pass->setValue((string) $this->settings->getAuthPass());
413  $pass->setRequired(true);
414  $pass->setSkipSyntaxCheck(TRUE);
415  $apa_based->addSubItem($pass);
416 
417 
418  $ser = new ilNonEditableValueGUI($this->lng->txt('cert_serial'));
419  $ser->setValue($this->settings->getCertSerialNumber() ? $this->settings->getCertSerialNumber() : $this->lng->txt('ecs_no_value'));
420  $cert_based->addSubItem($ser);
421 
422  $loc = new ilFormSectionHeaderGUI();
423  $loc->setTitle($this->lng->txt('ecs_local_settings'));
424  $this->form->addItem($loc);
425 
426  $pol = new ilDurationInputGUI($this->lng->txt('ecs_polling'),'polling');
427  $pol->setShowDays(false);
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);
436 
437  $imp = new ilCustomInputGUI($this->lng->txt('ecs_import_id'));
438  $imp->setRequired(true);
439 
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());
445 
446  if($this->settings->getImportId())
447  {
448  $tpl->setVariable('COMPLETE_PATH',$this->buildPath($this->settings->getImportId()));
449  }
450 
451  $imp->setHTML($tpl->get());
452  $imp->setInfo($this->lng->txt('ecs_import_id_info'));
453  $this->form->addItem($imp);
454 
455  $loc = new ilFormSectionHeaderGUI();
456  $loc->setTitle($this->lng->txt('ecs_remote_user_settings'));
457  $this->form->addItem($loc);
458 
459  $role = new ilSelectInputGUI($this->lng->txt('ecs_role'),'global_role');
460  $role->setOptions($this->prepareRoleSelect());
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);
465 
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);
476 
477  // Email recipients
478  $loc = new ilFormSectionHeaderGUI();
479  $loc->setTitle($this->lng->txt('ecs_notifications'));
480  $this->form->addItem($loc);
481 
482  $rcp_user = new ilTextInputGUI($this->lng->txt('ecs_user_rcp'),'user_recipients');
483  $rcp_user->setValue((string) $this->settings->getUserRecipientsAsString());
484  $rcp_user->setInfo($this->lng->txt('ecs_user_rcp_info'));
485  $this->form->addItem($rcp_user);
486 
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);
491 
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);
496 
497  if($a_mode == 'update')
498  {
499  $this->form->addCommandButton('update',$this->lng->txt('save'));
500  }
501  else
502  {
503  $this->form->addCommandButton('save',$this->lng->txt('save'));
504  }
505  $this->form->addCommandButton('overview',$this->lng->txt('cancel'));
506  }
This class represents a duration (typical hh:mm:ss) property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
This class represents a property form user interface.
This class represents a section header in a property form.
This class represents a checkbox property in a property form.
setInfo($a_info)
Set Information Text.
setChecked($a_checked)
Set Checked.
This class represents a property in a property form.
special template class to simplify handling of ITX/PEAR
setShowDays($a_showdays)
Set Show Days.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
This class represents a password property in a property form.
setOptions($a_options)
Set Options.
This class represents a custom property in a property form.
This class represents a non editable value in a property form.
prepareRoleSelect()
get global role array
setValue($a_value)
Set Value.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTaskScheduler()

ilECSSettingsGUI::initTaskScheduler ( )
protected

Init next task execution <type> $ilDB <type> $ilSetting.

Definition at line 1917 of file class.ilECSSettingsGUI.php.

References $ilSetting, and settings().

Referenced by save(), and update().

1918  {
1919  global $ilDB,$ilSetting;
1920 
1921  #$ilDB->lockTables(array('name' => 'settings', 'type' => ilDB::LOCK_WRITE));
1922  $setting = new ilSetting('ecs');
1923  $setting->set(
1924  'next_execution_'.$this->settings->getServerId(),
1925  time() + (int) $this->settings->getPollingTime()
1926  );
1927  }
ILIAS Setting Class.
global $ilSetting
Definition: privfeed.php:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadFromPost()

ilECSSettingsGUI::loadFromPost ( )
protected

Load from post.

Definition at line 596 of file class.ilECSSettingsGUI.php.

References $_POST, settings(), and ilUtil\stripSlashes().

Referenced by save(), and update().

597  {
598  $this->settings->setEnabledStatus((int) $_POST['active']);
599  $this->settings->setTitle(ilUtil::stripSlashes($_POST['title']));
600  $this->settings->setServer(ilUtil::stripSlashes($_POST['server']));
601  $this->settings->setPort(ilUtil::stripSlashes($_POST['port']));
602  $this->settings->setProtocol(ilUtil::stripSlashes($_POST['protocol']));
603  $this->settings->setClientCertPath(ilUtil::stripSlashes($_POST['client_cert']));
604  $this->settings->setCACertPath(ilUtil::stripSlashes($_POST['ca_cert']));
605  $this->settings->setKeyPath(ilUtil::stripSlashes($_POST['key_path']));
606  $this->settings->setKeyPassword(ilUtil::stripSlashes($_POST['key_password']));
607  $this->settings->setImportId(ilUtil::stripSlashes($_POST['import_id']));
608  $this->settings->setPollingTimeMS((int) $_POST['polling']['mm'],(int) $_POST['polling']['ss']);
609  $this->settings->setServer(ilUtil::stripSlashes($_POST['server']));
610  $this->settings->setGlobalRole((int) $_POST['global_role']);
611  $this->settings->setDuration((int) $_POST['duration']['MM']);
612 
613  $this->settings->setUserRecipients(ilUtil::stripSlashes($_POST['user_recipients']));
614  $this->settings->setEContentRecipients(ilUtil::stripSlashes($_POST['econtent_recipients']));
615  $this->settings->setApprovalRecipients(ilUtil::stripSlashes($_POST['approval_recipients']));
616 
617  $this->settings->setAuthType((int) $_POST['auth_type']);
618  $this->settings->setAuthPass(ilUtil::stripSlashes($_POST['auth_pass']));
619  $this->settings->setAuthUser(ilUtil::stripSlashes($_POST['auth_user']));
620 
621  }
$_POST['username']
Definition: cron.php:12
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ overview()

ilECSSettingsGUI::overview ( )

List available servers.

Returns
void ilToolbar ilTabsGUI

Definition at line 104 of file class.ilECSSettingsGUI.php.

References ilECSServerSettings\getInstance().

Referenced by update().

105  {
106  global $ilToolbar,$ilTabs;
107 
108  include_once './Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
109 
110  $ilTabs->setSubTabActive('overview');
111  $ilToolbar->addButton(
112  $this->lng->txt('ecs_add_new_ecs'),
113  $this->ctrl->getLinkTarget($this,'create')
114  );
115 
117  $servers->readInactiveServers();
118 
119  include_once './Services/WebServices/ECS/classes/class.ilECSServerTableGUI.php';
120  $table = new ilECSServerTableGUI($this,'overview');
121  $table->initTable();
122  $table->parse($servers);
123  $this->tpl->setContent($table->getHTML());
124  return;
125  }
static getInstance()
Get singleton instance.
Description of ilECSServerTableGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareFieldSelection()

ilECSSettingsGUI::prepareFieldSelection (   $fields)
protected

get options for field selection

Parameters
arrayarray of field objects protected

Definition at line 1815 of file class.ilECSSettingsGUI.php.

References $options, ilAdvancedMDFieldDefinition\_getInstanceByFieldId(), and ilAdvancedMDRecord\_lookupTitle().

Referenced by initMappingsForm().

1816  {
1817  include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
1818 
1819  $options[0] = $this->lng->txt('ecs_ignore_field');
1820  foreach($fields as $field)
1821  {
1823  $title = ilAdvancedMDRecord::_lookupTitle($field->getRecordId());
1824  $options[$field->getFieldId()] = $title.': '.$field->getTitle();
1825  }
1826  return $options;
1827  }
static _getInstanceByFieldId($a_field_id)
Get instance by field_id.
if(!is_array($argv)) $options
static _lookupTitle($a_record_id)
Lookup title.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ prepareRoleSelect()

ilECSSettingsGUI::prepareRoleSelect ( )
private

get global role array

protected

Definition at line 1886 of file class.ilECSSettingsGUI.php.

References ilObject\_lookupTitle(), and ilUtil\_sortIds().

Referenced by initSettingsForm().

1887  {
1888  global $rbacreview,$ilObjDataCache;
1889 
1890  $global_roles = ilUtil::_sortIds($rbacreview->getGlobalRoles(),
1891  'object_data',
1892  'title',
1893  'obj_id');
1894 
1895  $select[0] = $this->lng->txt('links_select_one');
1896  foreach($global_roles as $role_id)
1897  {
1898  $select[$role_id] = ilObject::_lookupTitle($role_id);
1899  }
1900  return $select;
1901  }
static _lookupTitle($a_id)
lookup object title
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),&#39;usr_data&#39;,&#39;lastname&#39;,&#39;usr_id&#39;) => sorts by lastname.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readAll()

ilECSSettingsGUI::readAll ( )
protected

Read all importable econtent.

protected

Definition at line 156 of file class.ilECSSettingsGUI.php.

References $server, ilECSTaskScheduler\_getInstanceByServerId(), ilECSServerSettings\getInstance(), ilECSEventQueueReader\handleExportReset(), ilECSEventQueueReader\handleImportReset(), imported(), and ilUtil\sendInfo().

157  {
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';
162 
163  try
164  {
165  foreach(ilECSServerSettings::getInstance()->getServers() as $server)
166  {
169 
170  include_once('./Services/WebServices/ECS/classes/class.ilECSTaskScheduler.php');
171  ilECSTaskScheduler::_getInstanceByServerId($server->getServerId())->startTaskExecution();
172 
173  ilUtil::sendInfo($this->lng->txt('ecs_remote_imported'));
174  $this->imported();
175  return true;
176  }
177  }
178  catch(ilECSConnectorException $e1)
179  {
180  ilUtil::sendInfo('Cannot connect to ECS server: '.$e1->getMessage());
181  $this->imported();
182  return false;
183  }
184  catch(ilException $e2)
185  {
186  ilUtil::sendInfo('Update failed: '.$e1->getMessage());
187  $this->imported();
188  return false;
189  }
190  }
Base class for ILIAS Exception handling.
static handleImportReset(ilECSSetting $server)
Reread all imported econtent.
static getInstance()
Get singleton instance.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _getInstanceByServerId($a_server_id)
get singleton instance Private access use ilECSTaskScheduler::start() or ilECSTaskScheduler::startTas...
$server
imported()
Show imported materials.
static handleExportReset(ilECSSetting $server)
Handle export reset.
+ Here is the call graph for this function:

◆ refreshParticipants()

ilECSSettingsGUI::refreshParticipants ( )
protected

Refresh participants.

Definition at line 626 of file class.ilECSSettingsGUI.php.

References $GLOBALS, $server, ilECSParticipantSetting\delete(), ilECSParticipantSettings\getAvailabeMids(), ilECSServerSettings\getInstance(), ilECSCommunityReader\getInstanceByServerId(), and ilUtil\sendSuccess().

627  {
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';
632 
634  $servers->readInactiveServers();
635  foreach($servers->getServers() as $server)
636  {
637  $creader = ilECSCommunityReader::getInstanceByServerId($server->getServerId());
638 
639  // read community
640  foreach(ilECSParticipantSettings::getAvailabeMids($server->getServerId()) as $mid)
641  {
642  if(!$creader->getParticipantByMID($mid))
643  {
644  $GLOBALS['ilLog']->write(__METHOD__.': Deleting deprecated participant '. $server->getServerId().' '. $mid);
645 
646  $part = new ilECSParticipantSetting($server->getServerId(),$mid);
647  $part->delete();
648  }
649  }
650  }
651  ilUtil::sendSuccess($this->lng->txt('settings_saved'),TRUE);
652  $this->ctrl->redirect($this,'communities');
653  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getInstance()
Get singleton instance.
static getInstanceByServerId($a_server_id)
Get instance by server id.
$GLOBALS['ct_recipient']
$server
static getAvailabeMids($a_server_id)
Get all available mids $ilDB.
delete()
Delete one participant entry <type> $ilDB.
+ Here is the call graph for this function:

◆ released()

ilECSSettingsGUI::released ( )
protected

Show released materials.

protected

Returns

Definition at line 1675 of file class.ilECSSettingsGUI.php.

References $_REQUEST, $ilUser, $options, ilECSExport\getExportedIdsByType(), ilECSUtils\getPossibleReleaseTypes(), and settings().

1676  {
1677  global $ilUser, $ilToolbar;
1678 
1679  $this->tabs_gui->setSubTabActive('ecs_released');
1680 
1681  if($this->settings->isEnabled())
1682  {
1683  $ilToolbar->addButton(
1684  $this->lng->txt('ecs_read_remote_links'),
1685  $this->ctrl->getLinkTarget($this,'readAll')
1686  );
1687 
1688  $ilToolbar->addSeparator();
1689  }
1690 
1691  $sel_type = $_REQUEST["otype"];
1692  if(!$sel_type)
1693  {
1694  $sel_type = "rcrs";
1695  }
1696 
1697  include "Services/WebServices/ECS/classes/class.ilECSUtils.php";
1699 
1700  include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
1701  $sel = new ilSelectInputGUI("", "otype");
1702  $sel->setOptions($options);
1703  $sel->setValue($sel_type);
1704  $ilToolbar->addInputItem($sel);
1705 
1706  $ilToolbar->setFormAction($this->ctrl->getFormAction($this, "released"));
1707  $ilToolbar->addFormButton($this->lng->txt("submit"), "released");
1708 
1709  include_once('./Services/WebServices/ECS/classes/class.ilECSExport.php');
1710  $exported = ilECSExport::getExportedIdsByType($sel_type);
1711  if(count($exported))
1712  {
1713  $ilToolbar->addSeparator();
1714 
1715  $ilToolbar->addButton(
1716  $this->lng->txt('csv_export'),
1717  $this->ctrl->getLinkTarget($this,'exportReleased')
1718  );
1719  }
1720 
1721  include_once('Services/WebServices/ECS/classes/class.ilECSReleasedContentTableGUI.php');
1722  $table_gui = new ilECSReleasedContentTableGUI($this,'released');
1723  $table_gui->setTitle($this->lng->txt('ecs_released_content'));
1724  $table_gui->parse($exported);
1725  $this->tpl->setContent($table_gui->getHTML());
1726 
1727  return true;
1728  }
static getPossibleReleaseTypes($a_with_captions=false)
Get all possible release object types.
This class represents a selection list property in a property form.
if(!is_array($argv)) $options
static getExportedIdsByType($a_type)
Get exported ids by type ilDB $ilDB.
global $ilUser
Definition: imgupload.php:15
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ save()

ilECSSettingsGUI::save ( )
protected

Save settings.

Returns
<type>

Definition at line 539 of file class.ilECSSettingsGUI.php.

References $GLOBALS, create(), initSettings(), initTaskScheduler(), loadFromPost(), ilUtil\sendInfo(), and settings().

540  {
541  $this->initSettings(0);
542  $this->loadFromPost();
543 
544  if(!$error = $this->settings->validate())
545  {
546  $this->settings->save();
547  $this->initTaskScheduler();
548 
549  #$this->updateTitle();
550  ilUtil::sendInfo($this->lng->txt('settings_saved'),true);
551  }
552  else
553  {
554  ilUtil::sendInfo($this->lng->txt($error));
555  return $this->create();
556  }
557  $GLOBALS['ilCtrl']->redirect($this,'overview');
558  return true;
559  }
loadFromPost()
Load from post.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initTaskScheduler()
Init next task execution <type> $ilDB <type> $ilSetting.
$GLOBALS['ct_recipient']
initSettings($a_server_id=1)
Init settings.
create()
Create new settings ilTabs $ilTabs.
+ Here is the call graph for this function:

◆ saveExportMappings()

ilECSSettingsGUI::saveExportMappings ( )
protected

Save mappings.

protected

Definition at line 1053 of file class.ilECSSettingsGUI.php.

References $_POST, and ilUtil\sendInfo().

1054  {
1055  foreach((array) $_POST['mapping'] as $mtype => $mappings)
1056  {
1057  foreach((array) $mappings as $ecs_field => $advmd_id)
1058  {
1059  include_once './Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1060  $map = new ilECSDataMappingSetting(
1061  (int) $_POST['ecs_mapping_server'],
1062  (int) $mtype,
1063  $ecs_field
1064  );
1065  $map->setAdvMDId($advmd_id);
1066  $map->save();
1067  }
1068  }
1069 
1070  ilUtil::sendInfo($this->lng->txt('settings_saved'),true);
1071  $this->ctrl->setParameter($this, "ecs_mapping_server", (int)$_POST['ecs_mapping_server']);
1072  $this->ctrl->redirect($this,'exportMappings');
1073  return true;
1074  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ saveImportMappings()

ilECSSettingsGUI::saveImportMappings ( )
protected

Save mappings.

protected

Definition at line 1024 of file class.ilECSSettingsGUI.php.

References $_POST, $_REQUEST, and ilUtil\sendInfo().

1025  {
1026  foreach((array) $_POST['mapping'] as $mtype => $mappings)
1027  {
1028  foreach((array) $mappings as $ecs_field => $advmd_id)
1029  {
1030  include_once './Services/WebServices/ECS/classes/class.ilECSDataMappingSetting.php';
1031  $map = new ilECSDataMappingSetting(
1032  (int) $_REQUEST['ecs_mapping_server'],
1033  (int) $mtype,
1034  $ecs_field
1035  );
1036  $map->setAdvMDId($advmd_id);
1037  $map->save();
1038  }
1039  }
1040 
1041  ilUtil::sendInfo($this->lng->txt('settings_saved'),true);
1042  $this->ctrl->setParameter($this, "ecs_mapping_server", (int)$_POST['ecs_mapping_server']);
1043  $this->ctrl->redirect($this,'importMappings');
1044  return true;
1045  }
$_POST['username']
Definition: cron.php:12
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ setMappingTabs()

ilECSSettingsGUI::setMappingTabs (   $a_active)
protected

Handle tabs for ECS data mapping.

Parameters
int$a_activeilTabsGUI ilTabs

Definition at line 854 of file class.ilECSSettingsGUI.php.

Referenced by exportMappings(), and importMappings().

855  {
856  global $ilTabs;
857 
858  $ilTabs->clearTargets();
859  $ilTabs->clearSubTabs();
860 
861  $ilTabs->setBackTarget(
862  $this->lng->txt('ecs_settings'),
863  $this->ctrl->getLinkTarget($this,'overview')
864  );
865  $ilTabs->addTab(
866  'import',
867  $this->lng->txt('ecs_tab_import'),
868  $this->ctrl->getLinkTarget($this,'importMappings')
869  );
870  $ilTabs->addTab(
871  'export',
872  $this->lng->txt('ecs_tab_export'),
873  $this->ctrl->getLinkTarget($this,'exportMappings')
874  );
875 
876 
877  switch($a_active)
878  {
879  case self::MAPPING_IMPORT:
880  $ilTabs->activateTab('import');
881  break;
882 
883  case self::MAPPING_EXPORT:
884  $ilTabs->activateTab('export');
885  break;
886  }
887  return true;
888  }
+ Here is the caller graph for this function:

◆ setSubTabs()

ilECSSettingsGUI::setSubTabs ( )
protected

set sub tabs

protected

Definition at line 1847 of file class.ilECSSettingsGUI.php.

References ilECSServerSettings\getInstance().

Referenced by executeCommand().

1848  {
1849  $this->tabs_gui->clearSubTabs();
1850 
1851  $this->tabs_gui->addSubTabTarget("overview",
1852  $this->ctrl->getLinkTarget($this,'overview'),
1853  "overview",get_class($this));
1854 
1855  // Disable all other tabs, if server hasn't been configured.
1856  ilECSServerSettings::getInstance()->readInactiveServers();
1857  if(!ilECSServerSettings::getInstance()->serverExists())
1858  {
1859  return true;
1860  }
1861 
1862  $this->tabs_gui->addSubTabTarget("ecs_communities",
1863  $this->ctrl->getLinkTarget($this,'communities'),
1864  "communities",get_class($this));
1865 
1866  $this->tabs_gui->addSubTabTarget('ecs_mappings',
1867  $this->ctrl->getLinkTarget($this,'importMappings'),
1868  'importMappings',get_class($this));
1869 
1870  $this->tabs_gui->addSubTabTarget('ecs_category_mapping',
1871  $this->ctrl->getLinkTarget($this,'categoryMapping'));
1872 
1873  $this->tabs_gui->addSubTabTarget('ecs_import',
1874  $this->ctrl->getLinkTarget($this,'imported'));
1875 
1876  $this->tabs_gui->addSubTabTarget('ecs_released',
1877  $this->ctrl->getLinkTarget($this,'released'));
1878 
1879  }
static getInstance()
Get singleton instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ settings()

ilECSSettingsGUI::settings ( )
protected

show settings

protected

Definition at line 307 of file class.ilECSSettingsGUI.php.

References initSettingsForm().

Referenced by activate(), deactivate(), delete(), doDelete(), initCategoryMappingForm(), initSettings(), initSettingsForm(), initTaskScheduler(), loadFromPost(), released(), save(), update(), and updateTitle().

308  {
309  $this->initSettingsForm();
310  $this->tabs_gui->setSubTabActive('ecs_settings');
311 
312  $this->tpl->setContent($this->form->getHTML());
313  }
initSettingsForm($a_mode='update')
init settings form
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showRulesTable()

ilECSSettingsGUI::showRulesTable ( )
protected

Show rules table.

Returns

Definition at line 1367 of file class.ilECSSettingsGUI.php.

References ilECSCategoryMapping\getActiveRules().

Referenced by categoryMapping().

1368  {
1369  include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
1370 
1371  if(!$rules = ilECSCategoryMapping::getActiveRules())
1372  {
1373  return false;
1374  }
1375  include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMappingTableGUI.php';
1376  $rule_table = new ilECSCategoryMappingTableGUI($this,'categoryMapping');
1377  $rule_table->parse($rules);
1378  return $rule_table->getHTML();
1379  }
static getActiveRules()
get active rules
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilECSSettingsGUI::update ( )
protected

save settings

protected

Definition at line 513 of file class.ilECSSettingsGUI.php.

References $_REQUEST, edit(), initSettings(), initTaskScheduler(), loadFromPost(), overview(), ilUtil\sendInfo(), and settings().

514  {
515  $this->initSettings((int) $_REQUEST['server_id']);
516  $this->loadFromPost();
517 
518  if(!$error = $this->settings->validate())
519  {
520  $this->settings->update();
521  $this->initTaskScheduler();
522  #$this->updateTitle();
523  ilUtil::sendInfo($this->lng->txt('settings_saved'),true);
524  }
525  else
526  {
527  ilUtil::sendInfo($this->lng->txt($error));
528  $this->edit();
529  }
530 
531  $this->overview();
532  return true;
533  }
edit()
Edit server setting.
loadFromPost()
Load from post.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initTaskScheduler()
Init next task execution <type> $ilDB <type> $ilSetting.
overview()
List available servers.
initSettings($a_server_id=1)
Init settings.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ updateCategoryMapping()

ilECSSettingsGUI::updateCategoryMapping ( )
protected

update category mapping

Returns

Definition at line 1288 of file class.ilECSSettingsGUI.php.

References $_REQUEST, categoryMapping(), editCategoryMapping(), initCategoryMappingForm(), initRule(), ilUtil\sendInfo(), ilECSCategoryMappingRule\TYPE_BY_TYPE, ilECSCategoryMappingRule\TYPE_DURATION, and ilECSCategoryMappingRule\TYPE_FIXED.

1289  {
1290  if(!$_REQUEST['rule_id'])
1291  {
1292  ilUtil::sendInfo($this->lng->txt('select_one'));
1293  $this->categoryMapping();
1294  return false;
1295  }
1296  $this->ctrl->saveParameter($this,'rule_id');
1297  $this->initRule((int) $_REQUEST['rule_id']);
1298  $this->initCategoryMappingForm('edit');
1299  if($this->form->checkInput())
1300  {
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'));
1304 
1305  switch($this->form->getInput('type'))
1306  {
1308  $this->rule->setMappingValue($this->form->getInput('mapping_value'));
1309  break;
1310 
1312  $this->rule->setDateRangeStart($this->form->getItemByPostVar('dur_begin')->getDate());
1313  $this->rule->setDateRangeEnd($this->form->getItemByPostVar('dur_end')->getDate());
1314  break;
1315 
1317  $this->rule->setByType($this->form->getInput('by_type'));
1318  break;
1319  }
1320 
1321  if($err = $this->rule->validate())
1322  {
1323  ilUtil::sendInfo($this->lng->txt($err));
1324  $this->form->setValuesByPost();
1325  $this->editCategoryMapping();
1326  return false;
1327  }
1328 
1329  $this->rule->update();
1330  ilUtil::sendInfo($this->lng->txt('settings_saved'),true);
1331  $this->ctrl->redirect($this,'categoryMapping');
1332  return true;
1333  }
1334  ilUtil::sendInfo($this->lng->txt('err_check_input'));
1335  $this->form->setValuesByPost();
1336  $this->editCategoryMapping();
1337  return false;
1338 
1339  }
editCategoryMapping()
Edit category mapping.
categoryMapping()
Category mappings.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
initCategoryMappingForm($a_mode='add')
Init category mapping form.
initRule($a_rule_id=0)
Init rule.
if($_REQUEST['ilias_path']) define('ILIAS_HTTP_PATH' $_REQUEST['ilias_path']
Definition: index.php:7
+ Here is the call graph for this function:

◆ updateCommunities()

ilECSSettingsGUI::updateCommunities ( )
protected

update whitelist

protected

Definition at line 764 of file class.ilECSSettingsGUI.php.

References $_POST, $GLOBALS, $ilLog, $server, ilECSServerSettings\getInstance(), ilECSCommunityCache\getInstance(), ilECSCommunityReader\getInstanceByServerId(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and validateImportTypes().

765  {
766  global $ilLog;
767 
768  include_once './Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
769  include_once './Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
770 
771  // @TODO: Delete deprecated communities
772  $invalidImportTypes = false;
773  if(!$this->validateImportTypes($_POST['import_type']))
774  {
775  $invalidImportTypes = true;
776  }
777 
779  foreach($servers->getServers() as $server)
780  {
781  try {
782  // Read communities
783  $cReader = ilECSCommunityReader::getInstanceByServerId($server->getServerId());
784 
785  // Update community cache
786  foreach($cReader->getCommunities() as $community)
787  {
788  include_once './Services/WebServices/ECS/classes/class.ilECSCommunityCache.php';
789  $cCache = ilECSCommunityCache::getInstance($server->getServerId(), $community->getId());
790  $cCache->setCommunityName($community->getTitle());
791  $cCache->setMids($community->getMids());
792  $cCache->setOwnId($community->getOwnId());
793  $cCache->update();
794  }
795  }
796  catch(Exception $e)
797  {
798  $GLOBALS['ilLog']->write(__METHOD__.': Cannot read ecs communities: '.$e->getMessage());
799  }
800  }
801 
802  include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
803  foreach((array) $_POST['sci_mid'] as $sid => $tmp)
804  {
805  foreach((array) $_POST['sci_mid'][$sid] as $mid => $tmp)
806  {
807  $set = new ilECSParticipantSetting($sid, $mid);
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]);
811 
812  // update title/cname
813  try {
814  $part = ilECSCommunityReader::getInstanceByServerId($sid)->getParticipantByMID($mid);
815  if($part instanceof ilECSParticipant)
816  {
817  $set->setTitle($part->getParticipantName());
818  }
819  $com = ilECSCommunityReader::getInstanceByServerId($sid)->getCommunityByMID($mid);
820  if($com instanceof ilECSCommunity)
821  {
822  $set->setCommunityName($com->getTitle());
823  }
824  }
825  catch(Exception $e)
826  {
827  $GLOBALS['ilLog']->write(__METHOD__.': Cannot read ecs communities: '.$e->getMessage());
828  }
829 
830  $set->update();
831  }
832  }
833  if($invalidImportTypes)
834  {
835  ilUtil::sendFailure($this->lng->txt('ecs_invalid_import_type_cms'),true);
836  }
837  else
838  {
839  ilUtil::sendSuccess($this->lng->txt('settings_saved'),true);
840  }
841  $GLOBALS['ilCtrl']->redirect($this,'communities');
842 
843  // TODO: Do update of remote courses and ...
844 
845  return true;
846  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST['username']
Definition: cron.php:12
static getInstance()
Get singleton instance.
validateImportTypes(&$import_types)
Validate import types.
static getInstanceByServerId($a_server_id)
Get instance by server id.
$GLOBALS['ct_recipient']
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$server
static getInstance($a_sid, $a_cid)
Get instance.
+ Here is the call graph for this function:

◆ updateTitle()

ilECSSettingsGUI::updateTitle ( )
protected

Update configuration title.

Definition at line 564 of file class.ilECSSettingsGUI.php.

References $GLOBALS, $reader, ilECSCommunityReader\getInstanceByServerId(), ilUtil\sendFailure(), and settings().

565  {
566  try
567  {
568  include_once './Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
570 
571  foreach($reader->getCommunities() as $community)
572  {
573  foreach($community->getParticipants() as $part)
574  {
575  $GLOBALS['ilLog']->write(__METHOD__.': '.print_r($community,true));
576  if($part->isSelf())
577  {
578  $this->settings->setTitle($part->getParticipantName());
579  $this->settings->update();
580  return true;
581  }
582  }
583  }
584  }
585  catch(ilECSConnectorException $exc)
586  {
587  ilUtil::sendFailure($exc->getMessage());
588  }
589  $this->settings->setTitle('');
590  $this->settings->update();
591  }
static getInstanceByServerId($a_server_id)
Get instance by server id.
$GLOBALS['ct_recipient']
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ validateImportTypes()

ilECSSettingsGUI::validateImportTypes ( $import_types)
protected

Validate import types.

Parameters
array$import_types
Returns
bool

Definition at line 718 of file class.ilECSSettingsGUI.php.

References $server, ilECSParticipantSetting\IMPORT_CMS, and ilECSParticipantSetting\IMPORT_UNCHANGED.

Referenced by updateCommunities().

719  {
720  include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
721 
722  $num_cms = 0;
723  foreach((array) $import_types as $sid => $server)
724  {
725  foreach((array) $server as $mid => $import_type)
726  {
727  if($import_type == ilECSParticipantSetting::IMPORT_CMS)
728  {
729  ++$num_cms;
730  }
731  }
732  }
733 
734  if($num_cms <= 1)
735  {
736  return true;
737  }
738  // Change to import type "UNCHANGED"
739  $new_types = array();
740  foreach((array) $import_types as $sid => $server)
741  {
742  foreach((array) $server as $mid => $import_type)
743  {
744  if($import_type == ilECSParticipantSetting::IMPORT_CMS)
745  {
746  $new_types[$sid][$mid] = ilECSParticipantSetting::IMPORT_UNCHANGED;
747  }
748  else
749  {
750  $new_types[$sid][$mid] = $import_type;
751  }
752  }
753  }
754  $import_types = $new_types;
755  return false;
756  }
$server
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilECSSettingsGUI::$ctrl
protected

Definition at line 43 of file class.ilECSSettingsGUI.php.

◆ $lng

ilECSSettingsGUI::$lng
protected

Definition at line 42 of file class.ilECSSettingsGUI.php.

Referenced by __construct().

◆ $tabs_gui

ilECSSettingsGUI::$tabs_gui
protected

Definition at line 44 of file class.ilECSSettingsGUI.php.

◆ $tpl

ilECSSettingsGUI::$tpl
protected

◆ MAPPING_EXPORT

const ilECSSettingsGUI::MAPPING_EXPORT = 1

Definition at line 37 of file class.ilECSSettingsGUI.php.

◆ MAPPING_IMPORT

const ilECSSettingsGUI::MAPPING_IMPORT = 2

Definition at line 38 of file class.ilECSSettingsGUI.php.


The documentation for this class was generated from the following file: