ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilExportFieldsInfo Class Reference
+ Collaboration diagram for ilExportFieldsInfo:

Public Member Functions

 getType ()
 Get object type.
 isExportable ($a_field_name)
 Check if field is exportable.
 getFieldsInfo ()
 Get informations (exportable) about user data profile fields.
 getExportableFields ()
 Get Exportable Fields.
 getSelectableFieldsInfo ($a_obj_id)
 Get selectable fields.
 exportableFieldsToInfoString ()
 Get exportable fields as info string.

Static Public Member Functions

static _getInstanceByType ($a_type)
 Get Singleton Instance.

Private Member Functions

 __construct ($a_type)
 Private Singleton Constructor.
 read ()
 Read info about exportable fields.

Private Attributes

 $settings
 $db
 $lng
 $obj_type = ''
 $possible_fields = array()

Static Private Attributes

static $instance = null

Detailed Description

Definition at line 33 of file class.ilExportFieldsInfo.php.

Constructor & Destructor Documentation

ilExportFieldsInfo::__construct (   $a_type)
private

Private Singleton Constructor.

Use getInstance

private

Definition at line 51 of file class.ilExportFieldsInfo.php.

References $ilSetting, $lng, and read().

{
global $ilDB,$ilSetting,$lng;
$this->db = $ilDB;
$this->lng = $lng;
$this->settings = $ilSetting;
$this->obj_type = $a_type;
$this->read();
}

+ Here is the call graph for this function:

Member Function Documentation

static ilExportFieldsInfo::_getInstanceByType (   $a_type)
static
ilExportFieldsInfo::exportableFieldsToInfoString ( )

Get exportable fields as info string.

public

Returns
string info page string

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

References getExportableFields().

{
$fields = array();
foreach($this->getExportableFields() as $field)
{
$fields[] = $this->lng->txt($field);
}
return implode('<br />',$fields);
}

+ Here is the call graph for this function:

ilExportFieldsInfo::getExportableFields ( )

Get Exportable Fields.

public

Definition at line 117 of file class.ilExportFieldsInfo.php.

Referenced by exportableFieldsToInfoString(), and getSelectableFieldsInfo().

{
foreach($this->possible_fields as $field => $exportable)
{
if($exportable)
{
$fields[] = $field;
}
}
return $fields ? $fields : array();
}

+ Here is the caller graph for this function:

ilExportFieldsInfo::getFieldsInfo ( )

Get informations (exportable) about user data profile fields.

public

Definition at line 107 of file class.ilExportFieldsInfo.php.

References $possible_fields.

ilExportFieldsInfo::getSelectableFieldsInfo (   $a_obj_id)

Get selectable fields.

Returns

Definition at line 133 of file class.ilExportFieldsInfo.php.

References $GLOBALS, $lng, ilCourseDefinedFieldDefinition\_getFields(), ilUserDefinedFields\_getInstance(), getExportableFields(), getType(), and ilBookingEntry\hasObjectBookingEntries().

{
global $lng;
$fields = array();
foreach($this->getExportableFields() as $field)
{
switch($field)
{
case 'lastname':
case 'firstname':
break;
case 'username':
$fields['login']['txt'] = $lng->txt('username');
$fields['login']['default'] = 1;
break;
default:
$fields[$field]['txt'] = $lng->txt($field);
$fields[$field]['default'] = 0;
break;
}
}
include_once './Services/Booking/classes/class.ilBookingEntry.php';
if(ilBookingEntry::hasObjectBookingEntries($a_obj_id, $GLOBALS['ilUser']->getId()))
{
$GLOBALS['lng']->loadLanguageModule('dateplaner');
$fields['consultation_hour']['txt'] = $GLOBALS['lng']->txt('cal_ch_field_ch');
$fields['consultation_hour']['default'] = 0;
}
include_once './Services/User/classes/class.ilUserDefinedFields.php';
if($this->getType() == 'crs')
{
$udf = ilUserDefinedFields::_getInstance()->getCourseExportableFields();
}
elseif($this->getType() == 'grp')
{
$udf = ilUserDefinedFields::_getInstance()->getGroupExportableFields();
}
if($udf)
{
foreach($udf as $field_id => $field)
{
$fields['udf_'.$field_id]['txt'] = $field['field_name'];
$fields['udf_'.$field_id]['default'] = 0;
}
}
include_once './Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php';
foreach($cdf as $def)
{
$fields['odf_'.$def->getId()]['txt'] = $def->getName();
$fields['odf_'.$def->getId()]['default'] = 0;
}
return $fields;
}

+ Here is the call graph for this function:

ilExportFieldsInfo::getType ( )

Get object type.

Returns

Definition at line 83 of file class.ilExportFieldsInfo.php.

References $obj_type.

Referenced by getSelectableFieldsInfo(), and read().

{
}

+ Here is the caller graph for this function:

ilExportFieldsInfo::isExportable (   $a_field_name)

Check if field is exportable.

public

Parameters
stringfield name
Returns
bool

Definition at line 96 of file class.ilExportFieldsInfo.php.

{
return array_key_exists($a_field_name,$this->possible_fields);
}
ilExportFieldsInfo::read ( )
private

Read info about exportable fields.

private

Definition at line 216 of file class.ilExportFieldsInfo.php.

References getType().

Referenced by __construct().

{
include_once './Services/User/classes/class.ilUserProfile.php';
$profile = new ilUserProfile();
$profile->skipGroup('settings');
foreach($profile->getStandardFields() as $key => $data)
{
if($this->getType() == 'crs')
{
if(!$data['course_export_hide'])
{
if(isset($data['course_export_fix_value']) and $data['course_export_fix_value'])
{
$this->possible_fields[$key] = $data['course_export_fix_value'];
}
else
{
$this->possible_fields[$key] = 0;
}
}
}
elseif($this->getType() == 'grp')
{
if(!$data['group_export_hide'])
{
if(isset($data['group_export_fix_value']) and $data['group_export_fix_value'])
{
$this->possible_fields[$key] = $data['group_export_fix_value'];
}
else
{
$this->possible_fields[$key] = 0;
}
}
}
}
$settings_all = $this->settings->getAll();
$field_part_limit = 5;
switch($this->getType())
{
case 'crs':
$field_prefix = 'usr_settings_course_export_';
$field_part_limit = 5;
break;
case 'grp':
$field_prefix = 'usr_settings_group_export_';
$field_part_limit = 5;
break;
}
foreach($settings_all as $key => $value)
{
if(stristr($key,$field_prefix) and $value)
{
// added limit for mantis 11096
$field_parts = explode('_',$key,$field_part_limit);
$field = $field_parts[count($field_parts) - 1];
if(array_key_exists($field,$this->possible_fields))
{
$this->possible_fields[$field] = 1;
}
}
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilExportFieldsInfo::$db
private

Definition at line 38 of file class.ilExportFieldsInfo.php.

ilExportFieldsInfo::$instance = null
staticprivate

Definition at line 35 of file class.ilExportFieldsInfo.php.

ilExportFieldsInfo::$lng
private

Definition at line 39 of file class.ilExportFieldsInfo.php.

Referenced by __construct(), and getSelectableFieldsInfo().

ilExportFieldsInfo::$obj_type = ''
private

Definition at line 41 of file class.ilExportFieldsInfo.php.

Referenced by getType().

ilExportFieldsInfo::$possible_fields = array()
private

Definition at line 43 of file class.ilExportFieldsInfo.php.

Referenced by getFieldsInfo().

ilExportFieldsInfo::$settings
private

Definition at line 37 of file class.ilExportFieldsInfo.php.


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