User provider
User provider
"User" and "employee" entity has the user
ID and is implemented by the class Bitrix\Socialnetwork\Integration\UI\EntitySelector\UserProvider
.
This provider implements search and selection of users as well as completes the tab "Recent" with data to avoid it being empty.
User selector dialog
const button = document.getElementById('responsible-button'); const dialog = new Dialog({ targetNode: button, enableSearch: true, context: 'MY_MODULE_CONTEXT', entities: [ { id: 'user', // users options: { inviteEmployeeLink: false // no do show "Invite user" link } }, { id: 'department', // company structure: user only selection }, ], }); button.addEventListener('click', function() { dialog.show(); });
Provider settings
extranetUsersOnly: bool
Show extranet users only.
intranetUsersOnly: bool
Show intranet users only.
emailUsers: bool
Show "email users". Default value:
false
— email users are not shown.myEmailUsers: bool
Show email users, invited by current user. Default value:
true
. Option is applicable, ifemailUsers=true
.emailUsersOnly: bool
Show "email" users only.
inviteEmployeeLink: bool
Show "Invite user" link. Default value:
true
.inviteGuestLink: bool
Show "Invite guest" link. Default value:
false
.userId: string | int | string[] | int[]
User identifier(-s) that must be selected (whitelist).
!userId: string | int | string[] | int[]
User identifier(-s) that must be excluded (blacklist).
nameTemplate: string
User name template. Available macroses:
-
#NAME#
- name. -
#LAST_NAME#
- last name. -
#SECOND_NAME#
- middle name. -
#NAME_SHORT#
- abbreviated name. -
#SECOND_NAME_SHORT#
- abbreviated last name.
-
onlyWithEmail: bool
Show users having indicated names.
selectFields: string[]
List of additional user profile fields, selected by provider in customData.
By default, provider selects the following fields:
-
name: string
— First name. -
lastName: string
— Last name. -
secondName: string
— Middle name. -
email: string
— E-mail. -
login: string
— Login. -
gender: 'M' | 'F'
— Gender. -
position: string
— Position. -
invited: boolean
— getstrue
when user has the "invited" status. -
isOnVacation: boolean
— getstrue
when user is on a vacation.
Additionally you can select the following:
-
lastLogin: string
orLAST_LOGIN: string
— Date of last entry. -
dateRegister: string
orDATE_REGISTER: string
— Date of registration. -
lastActivityDate: string
orLAST_ACTIVITY_DATE: string
— Date of last activity. -
online: boolean
orIS_ONLINE: boolean
— Online status. -
name: string
orNAME: string
— Name. -
lastName: string
orLAST_NAME: string
— Last name. -
secondName: string
orSECOND_NAME: string
— Middle name. -
email: string
orEMAIL: string
— E-mail. -
login: string
orLOGIN: string
— Login. -
profession: string
orpersonalProfession: string
orPERSONAL_PROFESSION: string
— Profession. -
www: string
orpersonalWww: string
orPERSONAL_WWW: string
— WWW-page. -
birthday: string
orpersonalBirthday: string
orPERSONAL_BIRTHDAY: string
— Birthday. -
gender: 'M' | 'F'
orpersonalGender: string
orPERSONAL_GENDER: string
— Gender. -
icq: string
orpersonalIcq: string
orPERSONAL_ICQ: string
— ICQ. -
phone: string
orpersonalPhone: string
orPERSONAL_PHONE: string
— Phone number. -
fax: string
orpersonalFax: string
orPERSONAL_FAX: string
— Fax. -
mobile: string
orpersonalMobile: string
orPERSONAL_MOBILE: string
— Mobile phone. -
pager: string
orpersonalPager: string
orPERSONAL_PAGER: string
— Pager. -
street: string
orpersonalStreet: string
orPERSONAL_STREET: string
— Street, house. -
city: string
orpersonalCity: string
orPERSONAL_CITY: string
— City. -
state: string
orpersonalState: string
orPERSONAL_STATE: string
— District / state. -
zip: string
orpersonalZip: string
orPERSONAL_ZIP: string
— Zip code. -
mailbox: string
orpersonalMailbox: string
orPERSONAL_MAILBOX: string
— Mailbox. -
country: string
orpersonalCountry: string
orPERSONAL_COUNTRY: string
— Country. -
timeZoneOffset: number
orTIME_ZONE_OFFSET: number
— Timezone offset. -
company: string
orWORK_COMPANY: string
— Company. -
position: string
orWORK_POSITION: string
— Position. -
workPhone: string
orWORK_PHONE: string
— Work phone. -
workCity: string
orWORK_CITY: string
— Company city. -
workCountry: string
orWORK_COUNTRY: string
— Company country. -
workDepartment: string
orWORK_DEPARTMENT: string
— Department. -
workMailbox: string
orWORK_MAILBOX: string
— Mailbox -
workCity: string
orWORK_CITY: string
— Company city. -
workCountry: string
orWORK_COUNTRY: string
— Company country. -
workStreet: string
orWORK_STREET: string
— Street, company building. -
workState: string
orWORK_STATE: string
— company region / state. -
workZip: string
orWORK_ZIP: string
— Company zip code. -
workMailbox: string
orWORK_MAILBOX: string
— Company mailbox. -
ufPhoneInner: string
orUF_PHONE_INNER: string
— Internal phone number. -
ufDistrict: string
orUF_DISTRICT: string
— District. -
ufSkype: string
orUF_SKYPE: string
— Skype login. -
ufSkypeLink: string
orUF_SKYPE_LINK: string
— Skype chat link. -
ufZoom: string
orUF_ZOOM: string
— Zoom. -
ufTwitter: string
orUF_TWITTER: string
— Twitter. -
ufFacebook: string
orUF_FACEBOOK: string
— Facebook. -
ufLinkedin: string
orUF_LINKEDIN: string
— LinkedIn. -
ufXing: string
orUF_XING: string
— Xing. -
ufWebSites: string
orUF_WEBSITES: string
— Other sites. -
ufSkills: string
orUF_SKILLS: string
— Skills. -
ufInterests: string
orUF_INTERESTS: string
— Interests. -
ufEmploymentDate: string
orUF_EMPLOYMENT_DATE: string
— Date of employment.
-