ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilECSMappingUtils Class Reference

Mapping utils. More...

+ Collaboration diagram for ilECSMappingUtils:

Static Public Member Functions

static lookupMappingStatus (int $a_server_id, int $a_mid, int $a_tree_id)
 Lookup mapping status. More...
 
static mappingStatusToString (int $a_status)
 Get mapping status as string. More...
 
static getCourseMappingFieldInfo ()
 
static getCourseMappingFieldSelectOptions ()
 
static getCourseValueByMappingAttribute ($course, $a_field)
 Get course value by mapping. More...
 
static getRoleMappingInfo ($a_role_type_info=0)
 Get role mapping info. More...
 
static getAuthModeSelection ()
 Get auth mode selection with active authentication modes. More...
 

Data Fields

const MAPPED_WHOLE_TREE = 1
 
const MAPPED_MANUAL = 2
 
const MAPPED_UNMAPPED = 3
 
const PARALLEL_ONE_COURSE = 0
 
const PARALLEL_GROUPS_IN_COURSE = 1
 
const PARALLEL_ALL_COURSES = 2
 
const PARALLEL_COURSES_FOR_LECTURERS = 3
 

Detailed Description

Mapping utils.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 25 of file class.ilECSMappingUtils.php.

Member Function Documentation

◆ getAuthModeSelection()

static ilECSMappingUtils::getAuthModeSelection ( )
static

Get auth mode selection with active authentication modes.

Returns
array<string, string>

Definition at line 211 of file class.ilECSMappingUtils.php.

References $DIC, $lng, ilAuthUtils\_getActiveAuthModes(), and ilAuthUtils\getAuthModeTranslation().

Referenced by ilECSMappingSettingsGUI\initFormCSettings().

211  : array
212  {
213  global $DIC;
214 
215  $lng = $DIC->language();
216  $active_auth_modes = ilAuthUtils::_getActiveAuthModes();
217  $options = [];
218  $options["0"] = $lng->txt('select_one');
219  foreach ($active_auth_modes as $auth_string => $auth_int) {
220  if (
221  $auth_string === 'default' ||
222  $auth_string === 'ecs' ||
223  substr($auth_string, 0, 3) === 'lti'
224  ) {
225  continue;
226  }
227  $options[$auth_string] = ilAuthUtils::getAuthModeTranslation((string) $auth_int);
228  }
229  return $options;
230  }
static getAuthModeTranslation(string $a_auth_key, string $auth_name='')
$lng
static _getActiveAuthModes()
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCourseMappingFieldInfo()

static ilECSMappingUtils::getCourseMappingFieldInfo ( )
static

Definition at line 61 of file class.ilECSMappingUtils.php.

References $DIC, and $lng.

61  : array
62  {
63  global $DIC;
64 
65  $lng = $DIC['lng'];
66 
67  $field_info = array();
68  $counter = 0;
69  foreach (
70  array(
71  'organisation',
72  'orgunit',
73  'term',
74  'title',
75  'lecturer',
76  'courseType',
77  'degreeProgramme',
78  'module',
79  'venue'
80  ) as $field) {
81  $field_info[$counter]['name'] = $field;
82  $field_info[$counter]['translation'] = $lng->txt('ecs_cmap_att_' . $field);
83  $counter++;
84  }
85  return $field_info;
86  }
$lng
global $DIC
Definition: feed.php:28

◆ getCourseMappingFieldSelectOptions()

static ilECSMappingUtils::getCourseMappingFieldSelectOptions ( )
static

Definition at line 88 of file class.ilECSMappingUtils.php.

References $DIC, and $lng.

Referenced by ilECSMappingSettingsGUI\initFormCSettings().

88  : array
89  {
90  global $DIC;
91 
92  $lng = $DIC['lng'];
93 
94  $options[''] = $lng->txt('select_one');
95  foreach (self::getCourseMappingFieldInfo() as $info) {
96  $options[$info['name']] = $info['translation'];
97  }
98  return $options;
99  }
$lng
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ getCourseValueByMappingAttribute()

static ilECSMappingUtils::getCourseValueByMappingAttribute (   $course,
  $a_field 
)
static

Get course value by mapping.

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

Referenced by ilECSCourseMappingRule\doMapping(), and ilECSCourseMappingRule\matches().

104  : array
105  {
106  switch ($a_field) {
107  case 'organisation':
108  return array((string) $course->organisation);
109 
110  case 'term':
111  return array((string) $course->term);
112 
113  case 'title':
114  return array((string) $course->title);
115 
116  case 'orgunit':
117  $units = array();
118  foreach ((array) $course->organisationalUnits as $unit) {
119  $units[] = (string) $unit->title;
120  }
121  return $units;
122 
123  case 'lecturer':
124  $lecturers = array();
125  foreach ((array) $course->groups as $group) {
126  foreach ((array) $group->lecturers as $lecturer) {
127  $lecturers[] = $lecturer->lastName . ', ' . $lecturer->firstName;
128  }
129  }
130  return $lecturers;
131 
132  case 'courseType':
133  return array((string) $course->lectureType);
134 
135  case 'degreeProgramme':
136  $degree_programmes = array();
137  foreach ((array) $course->degreeProgrammes as $prog) {
138  $degree_programmes[] = (string) $prog->title;
139  }
140  return $degree_programmes;
141 
142  case 'module':
143  $modules = array();
144  foreach ((array) $course->modules as $mod) {
145  $modules[] = (string) $mod->title;
146  }
147  return $modules;
148 
149  case 'venue':
150  $venues = [];
151  foreach ((array) $course->groups as $group) {
152  foreach ((array) $group->datesAndVenues as $venue) {
153  $venues[] = (string) $venue->venue;
154  }
155  }
156  return $venues;
157  }
158  return array();
159  }
+ Here is the caller graph for this function:

◆ getRoleMappingInfo()

static ilECSMappingUtils::getRoleMappingInfo (   $a_role_type_info = 0)
static

Get role mapping info.

Definition at line 165 of file class.ilECSMappingUtils.php.

References ilParticipants\IL_CRS_ADMIN, ilParticipants\IL_CRS_MEMBER, ilParticipants\IL_CRS_TUTOR, ilParticipants\IL_GRP_ADMIN, and ilParticipants\IL_GRP_MEMBER.

Referenced by ilECSMappingSettingsGUI\cUpdateSettings(), ilECSMappingSettingsGUI\initFormCSettings(), and ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus().

165  : array
166  {
167  //KEEP!!! until the defines are turned into proper constants
168  include_once './Services/Membership/classes/class.ilParticipants.php';
169  $roles = array(
172  'lang' => 'il_crs_admin',
173  'create' => true,
174  'required' => true,
175  'type' => 'crs'),
178  'lang' => 'il_crs_tutor',
179  'create' => true,
180  'required' => false,
181  'type' => 'crs'),
184  'lang' => 'il_crs_member',
185  'create' => false,
186  'required' => true,
187  'type' => 'crs'),
190  'lang' => 'il_grp_admin',
191  'create' => true,
192  'required' => false,
193  'type' => 'grp'),
196  'lang' => 'il_grp_member',
197  'create' => false,
198  'required' => false,
199  'type' => 'grp')
200  );
201  if (!$a_role_type_info) {
202  return $roles;
203  }
204  return $roles[$a_role_type_info];
205  }
+ Here is the caller graph for this function:

◆ lookupMappingStatus()

static ilECSMappingUtils::lookupMappingStatus ( int  $a_server_id,
int  $a_mid,
int  $a_tree_id 
)
static

Lookup mapping status.

Definition at line 39 of file class.ilECSMappingUtils.php.

References ilECSNodeMappingAssignments\isWholeTreeMapped().

Referenced by ilECSMappingSettingsGUI\dInitFormTreeSettings(), and ilECSNodeMappingTreeTableGUI\parse().

39  : int
40  {
41  if (ilECSNodeMappingAssignments::hasAssignments($a_server_id, $a_mid, $a_tree_id)) {
42  if (ilECSNodeMappingAssignments::isWholeTreeMapped($a_server_id, $a_mid, $a_tree_id)) {
43  return self::MAPPED_WHOLE_TREE;
44  }
45  return self::MAPPED_MANUAL;
46  }
47  return self::MAPPED_UNMAPPED;
48  }
static isWholeTreeMapped(int $a_server_id, int $a_mid, int $a_tree_id)
Check if whole tree is mapped.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mappingStatusToString()

static ilECSMappingUtils::mappingStatusToString ( int  $a_status)
static

Get mapping status as string.

Definition at line 53 of file class.ilECSMappingUtils.php.

References $DIC.

Referenced by ilECSMappingSettingsGUI\dInitFormTreeSettings(), and ilECSNodeMappingTreeTableGUI\fillRow().

53  : string
54  {
55  global $DIC;
56 
57  return $DIC->language()->txt('ecs_node_mapping_status_' . $a_status);
58  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

Field Documentation

◆ MAPPED_MANUAL

const ilECSMappingUtils::MAPPED_MANUAL = 2

◆ MAPPED_UNMAPPED

const ilECSMappingUtils::MAPPED_UNMAPPED = 3

Definition at line 29 of file class.ilECSMappingUtils.php.

Referenced by ilECSNodeMappingTreeTableGUI\fillRow().

◆ MAPPED_WHOLE_TREE

const ilECSMappingUtils::MAPPED_WHOLE_TREE = 1

Definition at line 27 of file class.ilECSMappingUtils.php.

◆ PARALLEL_ALL_COURSES

const ilECSMappingUtils::PARALLEL_ALL_COURSES = 2

◆ PARALLEL_COURSES_FOR_LECTURERS

const ilECSMappingUtils::PARALLEL_COURSES_FOR_LECTURERS = 3

Definition at line 34 of file class.ilECSMappingUtils.php.

Referenced by ilECSCourseCreationHandler\doSync().

◆ PARALLEL_GROUPS_IN_COURSE

const ilECSMappingUtils::PARALLEL_GROUPS_IN_COURSE = 1

◆ PARALLEL_ONE_COURSE

const ilECSMappingUtils::PARALLEL_ONE_COURSE = 0

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