ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 213 of file class.ilECSMappingUtils.php.

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

Referenced by ilECSMappingSettingsGUI\initFormCSettings().

213  : array
214  {
215  global $DIC;
216 
217  $lng = $DIC->language();
218  $active_auth_modes = ilAuthUtils::_getActiveAuthModes();
219  $options = [];
220  $options["0"] = $lng->txt('select_one');
221  foreach ($active_auth_modes as $auth_string => $auth_int) {
222  if (
223  $auth_string === 'default' ||
224  $auth_string === 'ecs' ||
225  substr($auth_string, 0, 3) === 'lti'
226  ) {
227  continue;
228  }
229  $options[$auth_string] = ilAuthUtils::getAuthModeTranslation((string) $auth_int);
230  }
231  return $options;
232  }
static getAuthModeTranslation(string $a_auth_key, string $auth_name='')
static _getActiveAuthModes()
global $DIC
Definition: shib_login.php:25
global $lng
Definition: privfeed.php:32
+ 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  }
global $DIC
Definition: shib_login.php:25
global $lng
Definition: privfeed.php:32

◆ 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  }
global $DIC
Definition: shib_login.php:25
global $lng
Definition: privfeed.php:32
+ 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  if (property_exists($course, "term")) {
112  return array((string) $course->term);
113  }
114  return [];
115 
116  case 'title':
117  return array((string) $course->title);
118 
119  case 'orgunit':
120  $units = array();
121  foreach ((array) $course->organisationalUnits as $unit) {
122  $units[] = (string) $unit->title;
123  }
124  return $units;
125 
126  case 'lecturer':
127  $lecturers = array();
128  foreach ((array) $course->groups as $group) {
129  foreach ((array) $group->lecturers as $lecturer) {
130  $lecturers[] = $lecturer->lastName . ', ' . $lecturer->firstName;
131  }
132  }
133  return $lecturers;
134 
135  case 'courseType':
136  return array((string) $course->lectureType);
137 
138  case 'degreeProgramme':
139  $degree_programmes = array();
140  foreach ((array) $course->degreeProgrammes as $prog) {
141  $degree_programmes[] = (string) $prog->title;
142  }
143  return $degree_programmes;
144 
145  case 'module':
146  $modules = array();
147  foreach ((array) $course->modules as $mod) {
148  $modules[] = (string) $mod->title;
149  }
150  return $modules;
151 
152  case 'venue':
153  $venues = [];
154  foreach ((array) $course->groups as $group) {
155  foreach ((array) $group->datesAndVenues as $venue) {
156  $venues[] = (string) $venue->venue;
157  }
158  }
159  return $venues;
160  }
161  return array();
162  }
+ 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 168 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().

168  : array
169  {
170  //KEEP!!! until the defines are turned into proper constants
171  $roles = array(
174  'lang' => 'il_crs_admin',
175  'create' => true,
176  'required' => true,
177  'type' => 'crs'),
180  'lang' => 'il_crs_tutor',
181  'create' => true,
182  'required' => false,
183  'type' => 'crs'),
186  'lang' => 'il_crs_member',
187  'create' => false,
188  'required' => true,
189  'type' => 'crs'),
192  'lang' => 'il_grp_admin',
193  'create' => true,
194  'required' => false,
195  'type' => 'grp'),
198  'lang' => 'il_grp_member',
199  'create' => false,
200  'required' => false,
201  'type' => 'grp')
202  );
203  if (!$a_role_type_info) {
204  return $roles;
205  }
206  return $roles[$a_role_type_info];
207  }
+ 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: shib_login.php:25
+ 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: