M
M
Michael2015-03-22 21:19:18
1C-Bitrix
Michael, 2015-03-22 21:19:18

How to display related data from custom field?

I added a custom field for users, some data from other tables is written to it during registration,
how can I display the name of the record from another table using this added field in the admin panel in the user's view? at the moment only the ID of this record is displayed, the data type of the field is number

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Emelyanov, 2015-03-23
@xmentor

No way. But if you really want to, then
Open /modules/main/admin/user_edit.php , at the very end there is a code:

//Add user fields tab only when there is fields defined or user has rights for adding new field
if(
  (count($USER_FIELD_MANAGER->GetUserFields($PROPERTY_ID)) > 0) ||
  ($USER_FIELD_MANAGER->GetRights($PROPERTY_ID) >= "W")
)
{
  $tabControl->BeginNextFormTab();
  $tabControl->ShowUserFields($PROPERTY_ID, $ID, ($strError <> '' || !$res));
}

- this is the output of custom sv-in. Then study the CAdminForm::ShowUserFields method . Well, display everything you need on this tab.
ps of course the update will overwrite all this. Also, checking the site will swear at the customization of the core. And of course, you will not see this data in the user list, only on the user's detailed page.
Create another custom field in which you will write the desired values ​​​​of the linked tables.
This results in data redundancy. You need to constantly monitor their correctness, i.e. catch all events that may affect their connectivity. But do not interfere with the kernel and the field values ​​can be displayed in the list of all users.

N
Nikita Samokhvalov, 2015-03-23
@niksamokhvalov

Use the OnAdminTabControlBegin event hook to change the display of the user edit page.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question