string(2) "22"
Automatic distribution of new users by working groups for Self-Hosted Bitrix24
11.16.2017 11:27:00
Articles
22
The solution distributes new portal users to workgroups, based on the specified field.

This module will be convenient for automatically joining new users to workgroups. Let's say your employees are working in different cities and when adding a new user to the portal, the module will check — if there is already a working group for such a city or not. If there is no group, the module will create it and put a new user there, as well as the creator of the group, which is set in the module settings (it can be your administrator, etc.). The group will be named the same as the city in the specified field. If the working group for a given city already exists, the module will include a new employee to it.

row1.png

You determine the field, by which the module should check groups.

After installing the solution, you have to create/select a custom field, by which the module will perform a check for the presence of a workgroup (create — if you don’t use any of the available fields).

For example, this will be the "City" field. Consider the mechanism for adding a custom field to the user's card:

Note that the field by which the module will check the group can only be a string type (that is, contain only text)!

1. Go to the administrative part of the portal, Settings — System settings — Custom fields.

2. Click Add.

en01.jpg

3. In the "Data type" field, specify the type — text.

4. In the "Entity" field, specify USER.

5. In the field "Field ID" — the code should start with UF_, then write down your code (in this example it's CITY).

6. At the bottom of the window, fill in the field name in English.

7. Click Save.

en02.jpg

en03.jpg

8. Now you have to enable the display of this field in the user list settings. Go to Settings – Manage users — User List.

9. Open the card of any user.

10. In the right part of the window, click Settings.

en04.jpg

11. In the Settings window, select "Form fields" —"Custom fields". In the "Tabs" section, select "User". Next from the "Available fields" select the field you created (in this example, "City") and click the right arrow to appear it in the "Selected fields" section. Click Save.

en05.jpg

en06.jpg

Next, you have to specify the created field in the module settings. Go to Settings —System Settings —Module Settings —Autogroups.

On the Settings tab, select the creator of the user group that will be specified as the owner of newly created groups and will be included automatically in all these groups.

Next, select your custom field, by which the module will check (in this example —"City").

Select a subject for the group, in the Site ID field specify your work site.

Check the box "Delete a user from the old group in case of a change" if you want the user to be deleted from the old group and add to the new one, when changing the group name.

en07.jpg

The module works this way: when the new user is created, the text of the specified field is checked for a match with the existing workgroup. If such a group already exists, module adds the user to it. If not, creates a workgroup based on the settings of the module and attaches the user, as well as the group's creator, to it.

Consider two examples of adding new users to the portal:

1. If there is no workgroup on the portal for this city (or any other field you specify) specified in the user's card:

en11.jpg

en09.jpg

en10.jpg

On the portal was created a new group "Omsk", the newly created user and the group's creator were included into the group.

2. If a workgroup exists on the portal for the city, indicated in the user's card.

Let’s add one more user to the newly created group:

en08.jpg

en12.jpg

A new user with the city Omsk was added to the corresponding group:

 

Installation.

1. Download the solution on the Marketplace, specify the path to install.

2. In the administrative part of Bitrix, click Install Updates. In the next window, under the license agreement, tick two boxes and click Apply.

3. Then click Install.

4. After installing the solution, you have to create a custom field, through which the module will perform a check for the presence of a workgroup (if you don’t use any of the available fields). In the module settings, select the field from which you get the name of the group, as well as the subject and the creator of the group.

5. Tick the box "Delete a user from the old group in case of a change" if you want the user to be deleted from the old group and add to the new one when changing the group name.

6. In the Common settings you can set the ID of the common group to which all newly created users will be placed.


comments powered by Disqus