ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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.

Returns
array

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

208 {
209 global $DIC;
210
211 $lng = $DIC->language();
212 $ilSetting = $DIC->settings();
213
214
215 $options[0] = $lng->txt('select_one');
216 $options['local'] = $lng->txt('auth_local');
217
218 include_once './Services/LDAP/classes/class.ilLDAPServer.php';
219 foreach (ilLDAPServer::getServerIds() as $sid) {
221 $options['ldap_' . $server->getServerId()] = 'LDAP (' . $server->getName() . ')';
222 }
223
224 if ($ilSetting->get('shib_active', 0)) {
226 $lng->txt('auth_shibboleth');
227 }
228
229 return $options;
230 }
const AUTH_SHIBBOLETH
static _getAuthModeName($a_auth_key)
static getInstanceByServerId($a_server_id)
Get instance by server id.
static getServerIds()
Get all server ids @global ilDB $ilDB.
global $ilSetting
Definition: privfeed.php:17
$server
Definition: sabredav.php:48
global $DIC
Definition: saml.php:7
$lng

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

Referenced by ilECSMappingSettingsGUI\initFormCSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCourseMappingFieldInfo()

static ilECSMappingUtils::getCourseMappingFieldInfo ( )
static

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

55 {
56 global $DIC;
57
58 $lng = $DIC['lng'];
59
60 $field_info = array();
61 $counter = 0;
62 foreach (
63 array(
64 'organisation',
65 'orgunit',
66 'term',
67 'title',
68 'lecturer',
69 'courseType',
70 'degreeProgramme',
71 'module',
72 'venue'
73 ) as $field) {
74 $field_info[$counter]['name'] = $field;
75 $field_info[$counter]['translation'] = $lng->txt('ecs_cmap_att_' . $field);
76 $counter++;
77 }
78 return $field_info;
79 }

References $DIC, and $lng.

◆ getCourseMappingFieldSelectOptions()

static ilECSMappingUtils::getCourseMappingFieldSelectOptions ( )
static

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

82 {
83 global $DIC;
84
85 $lng = $DIC['lng'];
86
87 $options[''] = $lng->txt('select_one');
88 foreach (self::getCourseMappingFieldInfo() as $info) {
89 $options[$info['name']] = $info['translation'];
90 }
91 return $options;
92 }
$info
Definition: index.php:5

References $DIC, $info, $lng, and PHPMailer\PHPMailer\$options.

Referenced by ilECSMappingSettingsGUI\initFormCSettings().

+ 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 100 of file class.ilECSMappingUtils.php.

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

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

+ 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 161 of file class.ilECSMappingUtils.php.

162 {
163 include_once './Services/Membership/classes/class.ilParticipants.php';
164 $roles = array(
165 IL_CRS_ADMIN => array(
166 'role' => IL_CRS_ADMIN,
167 'lang' => 'il_crs_admin',
168 'create' => true,
169 'required' => true,
170 'type' => 'crs'),
171 IL_CRS_TUTOR => array(
172 'role' => IL_CRS_TUTOR,
173 'lang' => 'il_crs_tutor',
174 'create' => true,
175 'required' => false,
176 'type' => 'crs'),
177 IL_CRS_MEMBER => array(
178 'role' => IL_CRS_MEMBER,
179 'lang' => 'il_crs_member',
180 'create' => false,
181 'required' => true,
182 'type' => 'crs'),
183 IL_GRP_ADMIN => array(
184 'role' => IL_GRP_ADMIN,
185 'lang' => 'il_grp_admin',
186 'create' => true,
187 'required' => false,
188 'type' => 'grp'),
189 IL_GRP_MEMBER => array(
190 'role' => IL_GRP_MEMBER,
191 'lang' => 'il_grp_member',
192 'create' => false,
193 'required' => false,
194 'type' => 'grp')
195 );
196 if (!$a_role_type_info) {
197 return $roles;
198 } else {
199 return $roles[$a_role_type_info];
200 }
201 }
const IL_CRS_ADMIN
Base class for course and group participants.
const IL_CRS_MEMBER
const IL_GRP_MEMBER
const IL_CRS_TUTOR
const IL_GRP_ADMIN

References 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().

+ 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.

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)) {
34 }
36 }
38 }
static hasAssignments($a_server_id, $a_mid, $a_tree_id)
Check if there is any assignment for a cms tree.
static isWholeTreeMapped($a_server_id, $a_mid, $a_tree_id)
Check if whole tree is mapped.

References ilECSNodeMappingAssignments\hasAssignments(), ilECSNodeMappingAssignments\isWholeTreeMapped(), MAPPED_MANUAL, MAPPED_UNMAPPED, and MAPPED_WHOLE_TREE.

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

+ 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.

45 {
46 global $DIC;
47
48 $lng = $DIC['lng'];
49
50 return $lng->txt('ecs_node_mapping_status_' . $a_status);
51 }

References $DIC, and $lng.

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

+ Here is the caller graph for this function:

Field Documentation

◆ MAPPED_MANUAL

const ilECSMappingUtils::MAPPED_MANUAL = 2

◆ MAPPED_UNMAPPED

const ilECSMappingUtils::MAPPED_UNMAPPED = 3

◆ MAPPED_WHOLE_TREE

const ilECSMappingUtils::MAPPED_WHOLE_TREE = 1

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

Referenced by lookupMappingStatus().

◆ 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: