ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 

Data Fields

const MAPPED_WHOLE_TREE = 1
 
const MAPPED_MANUAL = 2
 
const MAPPED_UNMAPPED = 3
 
const PARALLEL_UNDEFINED = 0
 
const PARALLEL_ONE_COURSE = 1
 
const PARALLEL_GROUPS_IN_COURSE = 2
 
const PARALLEL_ALL_COURSES = 3
 
const PARALLEL_COURSES_FOR_LECTURERS = 4
 

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

◆ getCourseMappingFieldInfo()

static ilECSMappingUtils::getCourseMappingFieldInfo ( )
static

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

56 {
57 global $lng;
58
59 $field_info = array();
60 $counter = 0;
61 foreach(
62 array(
63 'organisation',
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 }
global $lng
Definition: privfeed.php:40

References $lng.

◆ getCourseMappingFieldSelectOptions()

static ilECSMappingUtils::getCourseMappingFieldSelectOptions ( )
static

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

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

References $info, $lng, and $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

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

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

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

155 {
156 include_once './Services/Membership/classes/class.ilParticipants.php';
157 $roles = array(
158 IL_CRS_ADMIN => array(
159 'role' => IL_CRS_ADMIN,
160 'lang' => 'il_crs_admin',
161 'create' => true,
162 'required' => true,
163 'type' => 'crs'),
164 IL_CRS_TUTOR => array(
165 'role' => IL_CRS_TUTOR,
166 'lang' => 'il_crs_tutor',
167 'create' => true,
168 'required' => false,
169 'type' => 'crs'),
170 IL_CRS_MEMBER => array(
171 'role' => IL_CRS_MEMBER,
172 'lang' => 'il_crs_member',
173 'create' => false,
174 'required' => true,
175 'type' => 'crs'),
176 IL_GRP_ADMIN => array(
177 'role' => IL_GRP_ADMIN,
178 'lang' => 'il_grp_admin',
179 'create' => true,
180 'required' => false,
181 'type' => 'grp'),
182 IL_GRP_MEMBER => array(
183 'role' => IL_GRP_MEMBER,
184 'lang' => 'il_grp_member',
185 'create' => false,
186 'required' => false,
187 'type' => 'grp')
188 );
189 if(!$a_role_type_info)
190 {
191 return $roles;
192 }
193 else
194 {
195 return $roles[$a_role_type_info];
196 }
197
198
199
200 }
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 28 of file class.ilECSMappingUtils.php.

29 {
30 include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
31
32 if(ilECSNodeMappingAssignments::hasAssignments($a_server_id, $a_mid, $a_tree_id))
33 {
34 if(ilECSNodeMappingAssignments::isWholeTreeMapped($a_server_id, $a_mid, $a_tree_id))
35 {
37 }
39 }
41 }
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 47 of file class.ilECSMappingUtils.php.

48 {
49 global $lng;
50
51 return $lng->txt('ecs_node_mapping_status_'.$a_status);
52 }

References $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 = 3

◆ PARALLEL_COURSES_FOR_LECTURERS

const ilECSMappingUtils::PARALLEL_COURSES_FOR_LECTURERS = 4

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

Referenced by ilECSCourseCreationHandler\doSync().

◆ PARALLEL_GROUPS_IN_COURSE

const ilECSMappingUtils::PARALLEL_GROUPS_IN_COURSE = 2

◆ PARALLEL_ONE_COURSE

const ilECSMappingUtils::PARALLEL_ONE_COURSE = 1

◆ PARALLEL_UNDEFINED

const ilECSMappingUtils::PARALLEL_UNDEFINED = 0

The documentation for this class was generated from the following file: