3 declare(strict_types=1);
39 $this->
lng = $DIC->language();
41 $this->obj_type = $a_type;
51 if (!isset(self::$instances[$a_type])) {
52 self::$instances[$a_type] =
new self($a_type);
54 return self::$instances[$a_type];
67 return array_key_exists($a_field_name, $this->possible_fields);
85 foreach ($this->possible_fields as $field => $exportable) {
100 $user = $DIC->user();
110 $fields[
'login'][
'txt'] = $this->
lng->txt(
'login');
111 $fields[
'login'][
'default'] = 1;
116 $caption = ($field ==
"title")
119 $fields[$field][
'txt'] = $this->
lng->txt($caption);
120 $fields[$field][
'default'] = 0;
126 $this->
lng->loadLanguageModule(
'dateplaner');
127 $fields[
'consultation_hour'][
'txt'] = $this->
lng->txt(
'cal_ch_field_ch');
128 $fields[
'consultation_hour'][
'default'] = 0;
132 if ($this->
getType() ==
'crs') {
134 } elseif ($this->
getType() ==
'grp') {
138 foreach ($udf as $field_id => $field) {
139 $fields[
'udf_' . $field_id][
'txt'] = $field[
'field_name'];
140 $fields[
'udf_' . $field_id][
'default'] = 0;
145 foreach ($cdf as $def) {
146 $fields[
'odf_' . $def->getId()][
'txt'] = $def->getName();
147 $fields[
'odf_' . $def->getId()][
'default'] = 0;
152 $fields[
'odf_last_update'][
'txt'] = $this->
lng->txt($this->
getType() .
'_cdf_tbl_last_edit');
153 $fields[
'odf_last_update'][
'default'] = 0;
166 $fields[] = $this->
lng->txt($field);
168 return implode(
'<br />', $fields);
177 $profile->skipGroup(
'settings');
179 foreach ($profile->getStandardFields() as
$key =>
$data) {
180 if ($this->
getType() ==
'crs') {
181 if (!array_key_exists(
'course_export_hide',
$data) || !
$data[
'course_export_hide']) {
182 if (isset(
$data[
'course_export_fix_value']) &&
$data[
'course_export_fix_value']) {
183 $this->possible_fields[
$key] =
$data[
'course_export_fix_value'];
185 $this->possible_fields[
$key] = 0;
188 } elseif ($this->
getType() ==
'grp') {
189 if (!array_key_exists(
'group_export_hide',
$data) || !
$data[
'group_export_hide']) {
190 if (isset(
$data[
'group_export_fix_value']) and
$data[
'group_export_fix_value']) {
191 $this->possible_fields[
$key] = $data[
'group_export_fix_value'];
193 $this->possible_fields[
$key] = 0;
198 $settings_all = $this->
settings->getAll();
200 $field_part_limit = 5;
204 $field_prefix =
'usr_settings_course_export_';
205 $field_part_limit = 5;
209 $field_prefix =
'usr_settings_group_export_';
210 $field_part_limit = 5;
214 foreach ($settings_all as $key => $value) {
215 if ($field_prefix && stristr($key, $field_prefix) and $value) {
217 $field_parts = explode(
'_', $key, $field_part_limit);
218 $field = $field_parts[count($field_parts) - 1];
219 if (array_key_exists($field, $this->possible_fields)) {
220 $this->possible_fields[$field] = 1;
231 $start_order = array(
"lastname" => array(),
"firstname" => array(),
"username" => array());
233 foreach ($start_order as
$key => $value) {
234 if (isset($this->possible_fields[
$key])) {
235 $start_order[
$key] = $this->possible_fields[
$key];
236 unset($this->possible_fields[$key]);
238 unset($start_order[$key]);
242 if (count($start_order) > 0) {
243 $this->possible_fields = array_merge($start_order, $this->possible_fields);
static hasObjectBookingEntries(int $a_obj_id, int $a_usr_id)
Check if object has assigned consultation hour appointments.
static _getFields(int $a_container_id, $a_sort=self::IL_CDF_SORT_NAME)
Get all fields of a container.
exportableFieldsToInfoString()
Get exportable fields as info string.
getFieldsInfo()
Get informations (exportable) about user data profile fields public.
sortExportFields()
sort Exports fields User for Name Presentation Guideline
isExportable($a_field_name)
Check if field is exportable.
static _getInstanceByType(string $a_type)
Get Singleton Instance.
getExportableFields()
Get Exportable Fields.
__construct(string $a_type)
Private Singleton Constructor.
read()
Read info about exportable fields.
getSelectableFieldsInfo(int $a_obj_id)
Get selectable fields.