ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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.
static mappingStatusToString ($a_status)
 Get mapping status as string.
static getCourseMappingFieldInfo ()
static getCourseMappingFieldSelectOptions ()
static getCourseValueByMappingAttribute ($course, $a_field)
 Get course value by mapping.
static getRoleMappingInfo ($a_role_type_info=0)
 Get role mapping info.

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:
class.ilECSMappingUtils.php 43547 2013-07-22 14:39:46Z smeyer

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

Member Function Documentation

static ilECSMappingUtils::getCourseMappingFieldInfo ( )
static

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

References $lng.

{
global $lng;
$field_info = array();
$counter = 0;
foreach(
array(
'organisation',
'term',
'title',
'lecturer',
'courseType',
'degreeProgramme',
'module',
'venue'
) as $field)
{
$field_info[$counter]['name'] = $field;
$field_info[$counter]['translation'] = $lng->txt('ecs_cmap_att_'.$field);
$counter++;
}
return $field_info;
}
static ilECSMappingUtils::getCourseMappingFieldSelectOptions ( )
static

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

References $lng, and $options.

Referenced by ilECSMappingSettingsGUI\initFormCSettings().

{
global $lng;
$options[''] = $lng->txt('select_one');
foreach(self::getCourseMappingFieldInfo() as $info)
{
$options[$info['name']] = $info['translation'];
}
return $options;
}

+ Here is the caller graph for this function:

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.

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

{
switch($a_field)
{
case 'organisation':
return (string) $course->organisation;
case 'term':
return (string) $course->term;
case 'title':
return (string) $course->title;
case 'lecturer':
foreach((array) $course->groups as $group)
{
foreach((array) $group->lecturers as $lecturer)
{
return (string) ($lecturer->lastName.', '. $lecturer->firstName);
}
}
return '';
case 'courseType':
return (string) $course->lectureType;
case 'degreeProgramme':
foreach((array) $course->degreeProgrammes as $prog)
{
return (string) $prog->title;
}
return '';
case 'module':
foreach((array) $course->modules as $mod)
{
return (string) $mod->title;
}
return '';
case 'venue':
foreach((array) $course->groups as $group)
{
foreach((array) $group->datesAndVenues as $venue)
{
return (string) $venue->venue;
}
}
return '';
}
return '';
}

+ Here is the caller graph for this function:

static ilECSMappingUtils::getRoleMappingInfo (   $a_role_type_info = 0)
static

Get role mapping info.

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

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

{
include_once './Services/Membership/classes/class.ilParticipants.php';
$roles = array(
IL_CRS_ADMIN => array(
'role' => IL_CRS_ADMIN,
'lang' => 'il_crs_admin',
'create' => true,
'required' => true,
'type' => 'crs'),
IL_CRS_TUTOR => array(
'role' => IL_CRS_TUTOR,
'lang' => 'il_crs_tutor',
'create' => true,
'required' => false,
'type' => 'crs'),
IL_CRS_MEMBER => array(
'role' => IL_CRS_MEMBER,
'lang' => 'il_crs_member',
'create' => false,
'required' => true,
'type' => 'crs'),
IL_GRP_ADMIN => array(
'role' => IL_GRP_ADMIN,
'lang' => 'il_grp_admin',
'create' => true,
'required' => false,
'type' => 'grp'),
IL_GRP_MEMBER => array(
'role' => IL_GRP_MEMBER,
'lang' => 'il_grp_member',
'create' => false,
'required' => false,
'type' => 'grp')
);
if(!$a_role_type_info)
{
return $roles;
}
else
{
return $roles[$a_role_type_info];
}
}

+ Here is the caller graph for this function:

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.

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

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

{
include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
if(ilECSNodeMappingAssignments::hasAssignments($a_server_id, $a_mid, $a_tree_id))
{
if(ilECSNodeMappingAssignments::isWholeTreeMapped($a_server_id, $a_mid, $a_tree_id))
{
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static ilECSMappingUtils::mappingStatusToString (   $a_status)
static

Get mapping status as string.

Parameters
int$a_status

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

References $lng.

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

{
global $lng;
return $lng->txt('ecs_node_mapping_status_'.$a_status);
}

+ Here is the caller graph for this function:

Field Documentation

const ilECSMappingUtils::MAPPED_MANUAL = 2
const ilECSMappingUtils::MAPPED_UNMAPPED = 3
const ilECSMappingUtils::MAPPED_WHOLE_TREE = 1

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

Referenced by lookupMappingStatus().

const ilECSMappingUtils::PARALLEL_ALL_COURSES = 3
const ilECSMappingUtils::PARALLEL_COURSES_FOR_LECTURERS = 4

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

Referenced by ilECSCourseCreationHandler\doSync().

const ilECSMappingUtils::PARALLEL_GROUPS_IN_COURSE = 2
const ilECSMappingUtils::PARALLEL_ONE_COURSE = 1
const ilECSMappingUtils::PARALLEL_UNDEFINED = 0

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