Documentation

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, if emailUsers=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 — gets true when user has the "invited" status.
    • isOnVacation: boolean — gets true when user is on a vacation.

    Additionally you can select the following:

    • lastLogin: string or LAST_LOGIN: string — Date of last entry.
    • dateRegister: string or DATE_REGISTER: string — Date of registration.
    • lastActivityDate: string or LAST_ACTIVITY_DATE: string — Date of last activity.
    • online: boolean or IS_ONLINE: boolean — Online status.
    • name: string or NAME: string — Name.
    • lastName: string or LAST_NAME: string — Last name.
    • secondName: string or SECOND_NAME: string — Middle name.
    • email: string or EMAIL: string — E-mail.
    • login: string or LOGIN: string — Login.
    • profession: string or personalProfession: string or PERSONAL_PROFESSION: string — Profession.
    • www: string or personalWww: string or PERSONAL_WWW: string — WWW-page.
    • birthday: string or personalBirthday: string or PERSONAL_BIRTHDAY: string — Birthday.
    • gender: 'M' | 'F' or personalGender: string or PERSONAL_GENDER: string — Gender.
    • icq: string or personalIcq: string or PERSONAL_ICQ: string — ICQ.
    • phone: string or personalPhone: string or PERSONAL_PHONE: string — Phone number.
    • fax: string or personalFax: string or PERSONAL_FAX: string — Fax.
    • mobile: string or personalMobile: string or PERSONAL_MOBILE: string — Mobile phone.
    • pager: string or personalPager: string or PERSONAL_PAGER: string — Pager.
    • street: string or personalStreet: string or PERSONAL_STREET: string — Street, house.
    • city: string or personalCity: string or PERSONAL_CITY: string — City.
    • state: string or personalState: string or PERSONAL_STATE: string — District / state.
    • zip: string or personalZip: string or PERSONAL_ZIP: string — Zip code.
    • mailbox: string or personalMailbox: string or PERSONAL_MAILBOX: string — Mailbox.
    • country: string or personalCountry: string or PERSONAL_COUNTRY: string — Country.
    • timeZoneOffset: number or TIME_ZONE_OFFSET: number — Timezone offset.
    • company: string or WORK_COMPANY: string — Company.
    • position: string or WORK_POSITION: string — Position.
    • workPhone: string or WORK_PHONE: string — Work phone.
    • workCity: string or WORK_CITY: string — Company city.
    • workCountry: string or WORK_COUNTRY: string — Company country.
    • workDepartment: string or WORK_DEPARTMENT: string — Department.
    • workMailbox: string or WORK_MAILBOX: string — Mailbox
    • workCity: string or WORK_CITY: string — Company city.
    • workCountry: string or WORK_COUNTRY: string — Company country.
    • workStreet: string or WORK_STREET: string — Street, company building.
    • workState: string or WORK_STATE: string — company region / state.
    • workZip: string or WORK_ZIP: string — Company zip code.
    • workMailbox: string or WORK_MAILBOX: string — Company mailbox.
    • ufPhoneInner: string or UF_PHONE_INNER: string — Internal phone number.
    • ufDistrict: string or UF_DISTRICT: string — District.
    • ufSkype: string or UF_SKYPE: string — Skype login.
    • ufSkypeLink: string or UF_SKYPE_LINK: string — Skype chat link.
    • ufZoom: string or UF_ZOOM: string — Zoom.
    • ufTwitter: string or UF_TWITTER: string — Twitter.
    • ufFacebook: string or UF_FACEBOOK: string — Facebook.
    • ufLinkedin: string or UF_LINKEDIN: string — LinkedIn.
    • ufXing: string or UF_XING: string — Xing.
    • ufWebSites: string or UF_WEBSITES: string — Other sites.
    • ufSkills: string or UF_SKILLS: string — Skills.
    • ufInterests: string or UF_INTERESTS: string — Interests.
    • ufEmploymentDate: string or UF_EMPLOYMENT_DATE: string — Date of employment.

© «Bitrix24», 2001-2024
Up