ILIAS  trunk Revision v11.0_alpha-1862-g4e205cb56d4
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 26 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 214 of file class.ilECSMappingUtils.php.

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

Referenced by ilECSMappingSettingsGUI\initFormCSettings().

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

◆ getCourseMappingFieldInfo()

static ilECSMappingUtils::getCourseMappingFieldInfo ( )
static

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

References $DIC, and $lng.

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

◆ getCourseMappingFieldSelectOptions()

static ilECSMappingUtils::getCourseMappingFieldSelectOptions ( )
static

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

References $DIC, and $lng.

Referenced by ilECSMappingSettingsGUI\initFormCSettings().

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

◆ getCourseValueByMappingAttribute()

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

Get course value by mapping.

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

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

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

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

References ilECSNodeMappingAssignments\isWholeTreeMapped().

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

40  : int
41  {
42  if (ilECSNodeMappingAssignments::hasAssignments($a_server_id, $a_mid, $a_tree_id)) {
43  if (ilECSNodeMappingAssignments::isWholeTreeMapped($a_server_id, $a_mid, $a_tree_id)) {
44  return self::MAPPED_WHOLE_TREE;
45  }
46  return self::MAPPED_MANUAL;
47  }
48  return self::MAPPED_UNMAPPED;
49  }
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 54 of file class.ilECSMappingUtils.php.

References $DIC.

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

54  : string
55  {
56  global $DIC;
57 
58  return $DIC->language()->txt('ecs_node_mapping_status_' . $a_status);
59  }
global $DIC
Definition: shib_login.php:22
+ 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 30 of file class.ilECSMappingUtils.php.

Referenced by ilECSNodeMappingTreeTableGUI\fillRow().

◆ MAPPED_WHOLE_TREE

const ilECSMappingUtils::MAPPED_WHOLE_TREE = 1

Definition at line 28 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 35 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: