ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilECSMappingUtils Class Reference

Mapping utils. More...

+ Collaboration diagram for ilECSMappingUtils:

Static Public Member Functions

static lookupMappingStatus ($a_server_id, $a_mid, $a_tree_id)
 Lookup mapping status. More...
 
static mappingStatusToString ($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. 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 $Id$

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

Member Function Documentation

◆ getAuthModeSelection()

static ilECSMappingUtils::getAuthModeSelection ( )
static

Get auth mode selection.

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

References $DIC, $GLOBALS, $ilSetting, $lng, $options, $server, ilAuthUtils\_getAuthModeName(), AUTH_SHIBBOLETH, ilLDAPServer\getInstanceByServerId(), and ilLDAPServer\getServerIds().

Referenced by ilECSMappingSettingsGUI\initFormCSettings().

201  {
202  global $DIC;
203  global $ilSetting;
204 
205  $lng = $DIC->language();
206 
207 
208  $options[0] = $GLOBALS['lng']->txt('select_one');
209  $options['local'] = $GLOBALS['lng']->txt('auth_local');
210 
211  include_once './Services/LDAP/classes/class.ilLDAPServer.php';
212  foreach (ilLDAPServer::getServerIds() as $sid) {
214  $options['ldap_' . $server->getServerId()] = 'LDAP (' . $server->getName() . ')';
215  }
216 
217  if ($ilSetting->get('shib_active', 0)) {
219  $lng->txt('auth_shibboleth');
220  }
221 
222  return $options;
223  }
global $DIC
Definition: saml.php:7
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
const AUTH_SHIBBOLETH
static _getAuthModeName($a_auth_key)
static getInstanceByServerId($a_server_id)
Get instance by server id.
static getServerIds()
Get all server ids ilDB $ilDB.
$server
Definition: getUserInfo.php:12
global $ilSetting
Definition: privfeed.php:17
global $lng
Definition: privfeed.php:17
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCourseMappingFieldInfo()

static ilECSMappingUtils::getCourseMappingFieldInfo ( )
static

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

References $counter, $lng, and array.

53  {
54  global $lng;
55 
56  $field_info = array();
57  $counter = 0;
58  foreach (
59  array(
60  'organisation',
61  'orgunit',
62  'term',
63  'title',
64  'lecturer',
65  'courseType',
66  'degreeProgramme',
67  'module',
68  'venue'
69  ) as $field) {
70  $field_info[$counter]['name'] = $field;
71  $field_info[$counter]['translation'] = $lng->txt('ecs_cmap_att_' . $field);
72  $counter++;
73  }
74  return $field_info;
75  }
$counter
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17

◆ getCourseMappingFieldSelectOptions()

static ilECSMappingUtils::getCourseMappingFieldSelectOptions ( )
static

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

References $info, $lng, and $options.

Referenced by ilECSMappingSettingsGUI\initFormCSettings().

78  {
79  global $lng;
80 
81  $options[''] = $lng->txt('select_one');
82  foreach (self::getCourseMappingFieldInfo() as $info) {
83  $options[$info['name']] = $info['translation'];
84  }
85  return $options;
86  }
global $lng
Definition: privfeed.php:17
$info
Definition: index.php:5
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the caller graph for this function:

◆ getCourseValueByMappingAttribute()

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

Get course value by mapping.

Parameters
type$course
type$a_field
Returns
array

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

References array, and string.

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

95  {
96  switch ($a_field) {
97  case 'organisation':
98  return array((string) $course->organisation);
99 
100  case 'term':
101  return array((string) $course->term);
102 
103  case 'title':
104  return array((string) $course->title);
105 
106  case 'orgunit':
107  $units = array();
108  foreach ((array) $course->organisationalUnits as $unit) {
109  $units[] = (string) $unit->title;
110  }
111  return $units;
112 
113  case 'lecturer':
114  $lecturers = array();
115  foreach ((array) $course->groups as $group) {
116  foreach ((array) $group->lecturers as $lecturer) {
117  $lecturers[] = (string) ($lecturer->lastName . ', ' . $lecturer->firstName);
118  }
119  }
120  return $lecturers;
121 
122  case 'courseType':
123  return array((string) $course->lectureType);
124 
125  case 'degreeProgramme':
126  $degree_programmes = array();
127  foreach ((array) $course->degreeProgrammes as $prog) {
128  $degree_programmes[] = (string) $prog->title;
129  }
130  return $degree_programmes;
131 
132  case 'module':
133  $modules = array();
134  foreach ((array) $course->modules as $mod) {
135  $modules[] = (string) $mod->title;
136  }
137  return $modules;
138 
139  case 'venue':
140  $venues[] = array();
141  foreach ((array) $course->groups as $group) {
142  foreach ((array) $group->datesAndVenues as $venue) {
143  $venues[] = (string) $venue->venue;
144  }
145  }
146  return $venues;
147  }
148  return array();
149  }
Add rich text string
Create styles array
The data for the language used.
+ 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 155 of file class.ilECSMappingUtils.php.

References array, IL_CRS_ADMIN, IL_CRS_MEMBER, IL_CRS_TUTOR, IL_GRP_ADMIN, and IL_GRP_MEMBER.

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

156  {
157  include_once './Services/Membership/classes/class.ilParticipants.php';
158  $roles = array(
159  IL_CRS_ADMIN => array(
160  'role' => IL_CRS_ADMIN,
161  'lang' => 'il_crs_admin',
162  'create' => true,
163  'required' => true,
164  'type' => 'crs'),
165  IL_CRS_TUTOR => array(
166  'role' => IL_CRS_TUTOR,
167  'lang' => 'il_crs_tutor',
168  'create' => true,
169  'required' => false,
170  'type' => 'crs'),
171  IL_CRS_MEMBER => array(
172  'role' => IL_CRS_MEMBER,
173  'lang' => 'il_crs_member',
174  'create' => false,
175  'required' => true,
176  'type' => 'crs'),
177  IL_GRP_ADMIN => array(
178  'role' => IL_GRP_ADMIN,
179  'lang' => 'il_grp_admin',
180  'create' => true,
181  'required' => false,
182  'type' => 'grp'),
183  IL_GRP_MEMBER => array(
184  'role' => IL_GRP_MEMBER,
185  'lang' => 'il_grp_member',
186  'create' => false,
187  'required' => false,
188  'type' => 'grp')
189  );
190  if (!$a_role_type_info) {
191  return $roles;
192  } else {
193  return $roles[$a_role_type_info];
194  }
195  }
const IL_GRP_ADMIN
const IL_CRS_TUTOR
const IL_GRP_MEMBER
const IL_CRS_MEMBER
const IL_CRS_ADMIN
Base class for course and group participants.
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ lookupMappingStatus()

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

Lookup mapping status.

Parameters
int$a_server_id
int$a_tree_id
Returns
int

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

References ilECSNodeMappingAssignments\hasAssignments(), and ilECSNodeMappingAssignments\isWholeTreeMapped().

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

28  {
29  include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
30 
31  if (ilECSNodeMappingAssignments::hasAssignments($a_server_id, $a_mid, $a_tree_id)) {
32  if (ilECSNodeMappingAssignments::isWholeTreeMapped($a_server_id, $a_mid, $a_tree_id)) {
33  return self::MAPPED_WHOLE_TREE;
34  }
35  return self::MAPPED_MANUAL;
36  }
37  return self::MAPPED_UNMAPPED;
38  }
static isWholeTreeMapped($a_server_id, $a_mid, $a_tree_id)
Check if whole tree is mapped.
static hasAssignments($a_server_id, $a_mid, $a_tree_id)
Check if there is any assignment for a cms tree.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mappingStatusToString()

static ilECSMappingUtils::mappingStatusToString (   $a_status)
static

Get mapping status as string.

Parameters
int$a_status

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

References $lng.

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

45  {
46  global $lng;
47 
48  return $lng->txt('ecs_node_mapping_status_' . $a_status);
49  }
global $lng
Definition: privfeed.php:17
+ 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 14 of file class.ilECSMappingUtils.php.

Referenced by ilECSNodeMappingTreeTableGUI\fillRow().

◆ MAPPED_WHOLE_TREE

const ilECSMappingUtils::MAPPED_WHOLE_TREE = 1

Definition at line 12 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 19 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: