ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 215 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().

216  {
217  global $DIC;
218  global $ilSetting;
219 
220  $lng = $DIC->language();
221 
222 
223  $options[0] = $GLOBALS['lng']->txt('select_one');
224  $options['local'] = $GLOBALS['lng']->txt('auth_local');
225 
226  include_once './Services/LDAP/classes/class.ilLDAPServer.php';
227  foreach(ilLDAPServer::getServerIds() as $sid)
228  {
230  $options['ldap_'.$server->getServerId()] = 'LDAP (' . $server->getName().')';
231  }
232 
233  if($ilSetting->get('shib_active', 0))
234  {
236  $lng->txt('auth_shibboleth');
237  }
238 
239  return $options;
240  }
$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.
if(!is_array($argv)) $options
$server
global $ilSetting
Definition: privfeed.php:17
global $lng
Definition: privfeed.php:17
global $DIC
+ 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.

References $counter, $lng, and array.

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

◆ getCourseMappingFieldSelectOptions()

static ilECSMappingUtils::getCourseMappingFieldSelectOptions ( )
static

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

References $info, $lng, and $options.

Referenced by ilECSMappingSettingsGUI\initFormCSettings().

81  {
82  global $lng;
83 
84  $options[''] = $lng->txt('select_one');
85  foreach(self::getCourseMappingFieldInfo() as $info)
86  {
87  $options[$info['name']] = $info['translation'];
88  }
89  return $options;
90  }
$info
Definition: example_052.php:80
if(!is_array($argv)) $options
global $lng
Definition: privfeed.php:17
+ 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 98 of file class.ilECSMappingUtils.php.

References array, and string.

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

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

168  {
169  include_once './Services/Membership/classes/class.ilParticipants.php';
170  $roles = array(
171  IL_CRS_ADMIN => array(
172  'role' => IL_CRS_ADMIN,
173  'lang' => 'il_crs_admin',
174  'create' => true,
175  'required' => true,
176  'type' => 'crs'),
177  IL_CRS_TUTOR => array(
178  'role' => IL_CRS_TUTOR,
179  'lang' => 'il_crs_tutor',
180  'create' => true,
181  'required' => false,
182  'type' => 'crs'),
183  IL_CRS_MEMBER => array(
184  'role' => IL_CRS_MEMBER,
185  'lang' => 'il_crs_member',
186  'create' => false,
187  'required' => true,
188  'type' => 'crs'),
189  IL_GRP_ADMIN => array(
190  'role' => IL_GRP_ADMIN,
191  'lang' => 'il_grp_admin',
192  'create' => true,
193  'required' => false,
194  'type' => 'grp'),
195  IL_GRP_MEMBER => array(
196  'role' => IL_GRP_MEMBER,
197  'lang' => 'il_grp_member',
198  'create' => false,
199  'required' => false,
200  'type' => 'grp')
201  );
202  if(!$a_role_type_info)
203  {
204  return $roles;
205  }
206  else
207  {
208  return $roles[$a_role_type_info];
209  }
210  }
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  {
33  if(ilECSNodeMappingAssignments::isWholeTreeMapped($a_server_id, $a_mid, $a_tree_id))
34  {
35  return self::MAPPED_WHOLE_TREE;
36  }
37  return self::MAPPED_MANUAL;
38  }
39  return self::MAPPED_UNMAPPED;
40  }
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 46 of file class.ilECSMappingUtils.php.

References $lng.

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

47  {
48  global $lng;
49 
50  return $lng->txt('ecs_node_mapping_status_'.$a_status);
51  }
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: