19declare(strict_types=1);
48 $this->
lng = $DIC->language();
50 $this->
profile = $DIC[
'user']->getProfile();
51 $this->obj_type = $a_type;
61 if (!isset(self::$instances[$a_type])) {
62 self::$instances[$a_type] =
new self($a_type);
64 return self::$instances[$a_type];
77 return array_key_exists($a_field_name, $this->possible_fields);
95 foreach ($this->possible_fields as $field => $exportable) {
110 $user =
$DIC->user();
121 $fields[
'login'][
'txt'] = $this->
lng->txt(
'login');
122 $fields[
'login'][
'default'] = 1;
127 $caption = ($field ==
"title")
130 $fields[$field][
'txt'] = $this->
lng->txt($caption);
131 $fields[$field][
'default'] = 0;
137 $this->
lng->loadLanguageModule(
'dateplaner');
138 $fields[
'consultation_hour'][
'txt'] = $this->
lng->txt(
'cal_ch_field_ch');
139 $fields[
'consultation_hour'][
'default'] = 0;
144 foreach ($udf as $field_id => $field) {
145 $fields[
'udf_' . $field_id][
'txt'] = $field->getLabel($this->
lng);
146 $fields[
'udf_' . $field_id][
'default'] = 0;
152 foreach ($cdf as $def) {
153 $fields[
'odf_' . $def->getId()][
'txt'] = $def->getName();
154 $fields[
'odf_' . $def->getId()][
'default'] = 0;
158 $fields[
'odf_last_update'][
'txt'] = $this->
lng->txt($this->
getType() .
'_cdf_tbl_last_edit');
159 $fields[
'odf_last_update'][
'default'] = 0;
173 $fields[] = $this->
lng->txt($field);
175 return implode(
'<br />', $fields);
184 $this->possible_fields = array_reduce(
186 function (array
$c, ProfileField $v) use ($type): array {
187 if ($v->isCustom()) {
190 if ($type ===
'crs') {
191 $c[$v->getIdentifier()] = $v->isVisibleInCourses();
194 if ($type ===
'grp') {
195 $c[$v->getIdentifier()] = $v->isVisibleInGroups();
198 if ($type ===
'prg') {
199 $c[$v->getIdentifier()] = $v->isVisibleInStudyProgrammes();
213 $start_order = [
'lastname' => [],
'firstname' => [],
'username' => []];
215 foreach (array_keys($start_order) as $key) {
216 if (isset($this->possible_fields[$key])) {
217 $start_order[$key] = $this->possible_fields[$key];
218 unset($this->possible_fields[$key]);
220 unset($start_order[$key]);
224 if (count($start_order) > 0) {
225 $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.
getFieldsInfo()
Get informations (exportable) about user data profile fields @access public.
sortExportFields()
sort Exports fields User for Name Presentation Guideline
static _getInstanceByType(string $a_type)
Get Singleton Instance.
isExportable($a_field_name)
Check if field is exportable.
getExportableFields()
Get Exportable Fields.
read()
Read info about exportable fields.
exportableFieldsToInfoString()
Get exportable fields as info string.
__construct(string $a_type)
Private Singleton Constructor.
getSelectableFieldsInfo(?int $a_obj_id=null)
Get selectable fields.
getVisibleUserDefinedFields(Context $context)
if(!file_exists('../ilias.ini.php'))