A dynamic field is a special kind of field in OTRS, created to extend the information stored on a ticket or article. These fields are not fixed in the system and they can appear only in specific screens, they can be mandatory or not, and their representation in the screens depends on the field type defined at their creation time according to the data to be held by the field. For example, there are fields to hold a text, a date, a selection of items, etc.
Dynamic fields are the evolution of TicketFreeText TicketFreeKey TicketFreeTime, ArticleFreeText and ArticleFreeKey fields that where commonly used in OTRS 3.0 and before. The limitation of these "Free Fields" was that they can be defined up to 16 (text or dropdown) fields and 6 time fields for a ticket and 3 (text or dropdown) fields for each article only, not more.
Now with dynamic fields the limitation in the number of fields per ticket or article is removed, you can create as many dynamic fields you like either for ticket or articles. And beyond that, the framework behind the dynamic fields is prepared to handle custom fields for other objects rather than just ticket and articles.
This new framework that handles the dynamic fields is build using a modular approach, where each kind of dynamic field can be seen as a plug-in module for the framework. This means that the variety of dynamic fields can be easily extended by public OTRS modules, OTRS Feature Add-ons, OTRS custom developments, and other custom developments.
В этом релизе доступны следующие типы динамических полей:
Text (одна строка текста)
Textarea (несколько строк текста)
Checkbox
Выпадающий список (единственный выбор, несколько значений)
Multiselect (множественный выбор, несколько значений)
Date
Date / Time
By default, a clean installation of OTRS does not include any dynamic fields. If you plan to use such fields in tickets or articles you need to create dynamic fields.
The configuration of a dynamic field is split in two parts, to add a new dynamic field or manage an existing one you need to navigate into the "Admin" panel in the "Dynamic Fields" link. To show, show as mandatory or hide a dynamic field in one screen you need to change the OTRS settings in the "SysConfig" screen.
Click on the "Admin" button located in the navigation bar, then click on the "Dynamic Field" link inside "Ticket Settings" box located in the lower center of the screen. The dynamic fields overview will display as follows:
Рисунок: Страница просмотра Динамических полей, пустая
Notice that this screen will change as you add more dynamic fields to list all created dynamic fields. This screen might already have some fields if the installation was updated from an older version of OTRS.
The Actions in the side bar at the left of the screen describes two possibilities: Article and Ticket, each one has it's own dropdown selection of dynamic fields.
The installation of an OTRS package could add more objects to the Action side bar.
Общая процедура для создания динамического поля:
Кликните на объект выбраного вами динамического поля в выпадающем списке на боковой панели действий.
Выберите в списке и нажмите на тип динамического поля, которое вы хотите добавить.
Настройка
Сохранить.
Диалог настройки динамических полей разделен на две части, верхняя часть является общей для всех полей, а нижняя часть может различаться в зависимости от типа динамического поля.
Общие настройки динамического поля:
Название: Обязательное поле, уникальное, только буквы и числа в качестве допустимых символов.
This is the internal name of the field, used for example to show or hide a field in one screen. Any modification of a field name (not recommended) requires a manual update of the "SysConfig" settings where the field is referenciated.
Метка: Обязательное.
This is the field name to be displayed on the screens, it supports translations.
Перевод метки должен быть добавлен в файл перевода вручную.
Порядок Полей: Обязательно.
Defines the relative order in which the field will be displayed on the screen, by default each new field has the last position, a change in this setting will affect the order of the other created dynamic fields.
Срок действия: Обязательный.
Не действительное динамическое поле не будет отображаться на любом экране, независимо от того какое значение установлено в конфигурации.
Тип поля: Обязательное, Только для чтения.
Показывает текущий выбранный тип поля.
Тип Объекта: Обязательный, Только для чтения.
Отображает область действия для поля.
Для иллюстрации каждого конкретного параметра настройки в нашем примере будет добавлено несколько полей. Ссылки на эти поля будут упоминаться в последующих разделах.
В следующих примерах все динамические поля будут созданы для объекта Заявка, если необходимо создать динамическое поле для объекта Статья, просто выберите поле из выпадающего списка.
Таблица 4.6. В систему будут добавлены следующие поля:
Название | Метка | Type |
Поле1 | Мое Поле 1 | Text |
Поле2 | Мое Поле 2 | Textarea |
Поле3 | Мое Поле 3 | Checkbox |
Поле4 | Мое Поле 4 | Dropdown |
Поле5 | Мое Поле 5 | Multiselect (множественный выбор) |
Field6 | Мое Поле 5 | Date |
Поле7 | Мое Поле 6 | Date / Time |
Динамические текстовые поля используются для хранения простой строки.
Настройки динамического поля Text:
Значение по умолчанию: Необязательное.
This is the value to be shown by default on the edit screens (like New Phone Ticket or Ticket Compose).
Показать ссылку: Необязательное.
Если установлено, то значение поля будет преобразовано в кликабельную ссылку, которая будет отображаться на экране.
Например, если "Показать ссылку" установленно в "http://www.otrs.com", нажатие на заполненное значение приведет к открытию веб-страницы OTRS.
The use of $LQData{"NameX"} in the Set link value, where NameX is the name of the field will add the field value as part of the link reference.
Рисунок: Диалоговое окно настройки Динамического поля Text.
Динамическое поле Textarea используется для хранения строк, состоящих из нескольких линий.
Настройки динамического поля Textarea:
Количество строк: Необязательное, Целое.
Используется для определения высоты поля на странице редактирования.
Количество столбцов: Необязательное, Целое.
This value is used to define the width of the field in the edit screens.
Значение по умолчанию: Необязательное.
Это значение будет отображаться по умолчанию (может быть текстом, состоящим из нескольких строк).
Рисунок: Окно настройки Динамического Поля Textarea.
Динамическое поле Checkbox используется для хранения значений true или false, изображено как выбранныи или не выбранный флажок.
Настройки динамического поля Checkbox:
Значение по умолчанию: Обязательное.
This is the value to be shown by default on the edit screens (like New Phone Ticket or Ticket Compose), the default value for this field is closed selection which can be Checked or Unchecked.
Рисунок: Окно настройки Динамического Поля Checkbox.
Динамическое поле Выпадающий Список (Dropdown) используется для хранения одного значения, которое выбирается из закрытого списка.
Настройки динамического поля Dropdown:
Возможные значения: Обязательное.
List of values to choose. If used, a new value is necessary to specify the Key (internal value) and the Value (display value).
Значение по умолчанию: Необязательное.
This is the value to be show by default on the edit screens (like New Phone Ticket or Ticket Compose), the default value for this field is closed selection defined by the Possible values.
Добавить пустое значени: Обязательное, (Да / Нет).
Если эта опция включена, дополнительная стоимость определяется для отображения "-" в списке возможных значений, это специально значение пустоне внутри.
Переводимые значения: Обязательное, (Да / Нет).
This setting is used mark the possible values of this field to be translated. Only the display values are translated, internal values are not affected, the translation of the values needs to be manually added to the language files.
Показать ссылку: Необязательное.
Если установлено, то значение поля будет установлено в кликабельные ссылки.
Например, если ссылка Показать установлена в значение "http://www.otrs.com", нажатие на значение поля приведет к открытию веб-страницы OTRS.
The use of $LQData{"NameX"} in the Set link value, where NameX is the name of the field, will add the field value as part of the link reference.
Рисунок: Окно настройки динамического поля Dropdown.
Multiselect dynamic field is used to store multiple values, from a closed list.
Настройка Динамического Поля Multiselect (множественный выбор):
Возможные значения: Обязательное.
List of values to choose from. When adding additional list items, it is necessary to specify the Key (internal value) and the Value (display value).
Значение по умолчанию: Необязательное.
This is the value to be shown by default on the edit screens (like New Phone Ticket or Ticket Compose), the default value for this field is closed selection as defined by the Possible values.
Добавить пустое значени: Обязательное, (Да / Нет).
If this option is activated an extra value is defined to show as a "-" in the list of possible values. This special value is empty internally.
Переводимые значения: Обязательное, (Да / Нет).
This setting is used mark the possible values of this field to be translated. Only the display values are translated, internal values are not affected, the translation of the values needs to be manually added to the language files.
Рисунок: Окно настройки динамического поля Multiselect.
Динамическое поле Date используется для хранения значения (День, Месяць и Год).
Настройки динамического поля Date (Дата):
Разница дат по умолчанию: Опционально, Целое.
Количество секунд (положительное или отрицательное значение) между текущей датой и выбраной дантой, которое будет отображаться на страницах редактирования по умолчанию (например на странице Новая Заявка на основе телефонного звонка или Создать Заявку).
Определить период лет: Обязательно (Да / Нет).
Used to set a defined number of years in the past and the future based on the current date of the year select for this field, If set to Yes the following options are available:
Лет в прошлом: Опционально, положительное целое число.
Define the number of years in the past from the current day to display in the year selection for this dynamic field in edit screens.
Лет в будущем: Опционально, Положительное целое.
Define the number of years in the future from the current day to display in the year selection for this dynamic field in edit screens.
Показать ссылку: Необязательное.
Если установлено, то значение поля будет установлено в кликабельные ссылки.
Например, если ссылка Показать установлена в значение "http://www.otrs.com", нажатие на значение поля приведет к открытию веб-страницы OTRS.
The use of $LQData{"NameX"} in the Set link value, where NameX is the name of the field will add the field value as part of the link reference.
Рисунок: Окно настройки динамического поля Date.
Динамическое поле Date / Time используется для хранения значения даты и времени (Минута, Час, День, Месяц и Год).
Настройки динамического поля Date / Time:
Разница дат по умолчанию: Опционально, Целое.
Number of seconds (positive or negative) between the current date and the selected date to be shown by default in the edit screens (like New Phone Ticket or Ticket Compose).
Определить период лет: Обязательно (Да / Нет).
Used to set a defined number of years in the past and the future from thee current date in the year select of this field, If set to Yes the following options are available:
Лет в прошлом: Опционально, положительное целое число.
Define the number of years in the past from the current day to display in the year selection for this dynamic field in edit screens.
Лет в будущем: Опционально, Положительное целое.
Define the number of years in the future from the current day to display in the year selection for this dynamic field in edit screens.
Показать ссылку: Необязательное.
Если установлено, то значение поля будет установлено в кликабельные ссылки.
Например, если ссылка Показать установлена в значение "http://www.otrs.com", нажатие на значение поля приведет к открытию веб-страницы OTRS.
The use of $LQData{"NameX"} in the Set link value, where NameX is the name of the field will add the field value as part of the link reference.
Рисунок: Окно настройки динамического поля Date / Time.
Страница просмотра заполненого динамического поля (с предыдущими примерами) должна выглядеть так:
Рисунок: Окно просмотра Динамического поля заполненного тестовыми данными.
To change or edit a dynamic field you must have at least one field defined, select an already added field from the dynamic fields overview screen and update its settings.
Не все настройки динамического поля могут быть изменены, тип Поля и тип Объекта не могут быть изменены.
It is not recommended to change the field internal name, but the label can be changed at any time. If internal name is changed all "SysConfig" settings that have a reference to that particular field needs to be updated as well as user preferences (if defined).
Есть два обязательных условия, которые необходимо выполнить, чтобы отобразить динамическое поле на определенных страницах:
Динамическое поле должно быть действительным
Динамическое поле должно быть установлено в 1 или 2 на странице с настройками.
Follow these steps to show a dynamic field in a screen
Убедитесь что значение динамического поля установлено правильно. Убедится в правильности значения можно посмотрев на страницу просмотра. Немедленно отредактируйте значение, чтобы сделать его правильным.
Open the "sysconfig" and select "Ticket" from the dropdown list in the Actions side bar located in the left part of the screen.
You can also search for "DynamicField" in the search box above or the "sysconfig" key directly if you already know it.
Locate the setting sub-group for the screen that you are looking for and click on it. For example "Frontend::Agent::Ticket::ViewPhoneNew".
Search for the setting that ends with "###DynamicField". For example "Ticket::Frontend::AgentTicketPhone###DynamicField".
If the setting is empty or does not have the required dynamic field name, click on the "+" button to add a new entry. For example Key: Field1, Content: 1.
If the setting already has the dynamic field name listed be sure that is set to "1" to display the field or to "2" to display it as mandatory.
Save the configuration by clicking in the "Update" button and the bottom of the screen and navigate to the screen where you want the field to be displayed.
The following are "sysconfig" configurations examples to show or hide dynamic fields on different screens.
Пример 4.21. Активировать Field1 на странице Новая Заявка на основе телефонного звонка.
Групировать: Заявку
Подгруппа: Frontend::Agent::Ticket::ViewPhoneNew
Настройка: Ticket::Frontend::AgentTicketPhone###DynamicField
Значение:
Ключ | Content |
Поле1 | 1 |
Рисунок:. Экран приветствия.
Пример 4.22. Сделать Field1 на странице просмотра Заявки созданной на базе телефонного звонка New Phone Ticket Screen as mandatory.
Групировать: Заявку
Подгруппа: Frontend::Agent::Ticket::ViewPhoneNew
Настройка: Ticket::Frontend::AgentTicketPhone###DynamicField
Значение:
Ключ | Content |
Поле1 | 2 |
Рисунок: поле Field1 на странице Новая Заявка на основе телефонного звонка объязательное.
Пример 4.23. Активировать несколько полей на странице просмомра Новых Телефонных Заявко.
Групировать: Заявку
Подгруппа: Frontend::Agent::Ticket::ViewPhoneNew
Настройка: Ticket::Frontend::AgentTicketPhone###DynamicField
Значение:
Ключ | Content |
Поле1 | 1 |
Поле2 | 1 |
Поле3 | 1 |
Поле4 | 1 |
Поле5 | 1 |
Field6 | 1 |
Поле7 | 1 |
Рисунок: Несколько полей на странице Заявки созданной на основе телефонного звонка обязательны
Пример 4.24. Отключить некоторые поля на странице Новой Заявки, созданной на основе телефонного звонка.
Групировать: Заявку
Подгруппа: Frontend::Agent::Ticket::ViewPhoneNew
Настройка: Ticket::Frontend::AgentTicketPhone###DynamicField
Значение:
Ключ | Content |
Поле1 | 1 |
Поле2 | 0 |
Поле3 | 1 |
Поле4 | 0 |
Поле5 | 1 |
Field6 | 0 |
Поле7 | 1 |
Figure: Some deactivated fields in New Phone Ticket Screen as mandatory.
Пример 4.25. Активировать поле Field1 на странице просмотра подробной информации о Заявке.
Групировать: Заявку
Подгруппа: Frontend::Agent::Ticket::ViewZoom
Установка: Ticket::Frontend::AgentTicketZoom###DynamicField
Значение:
Ключ | Content |
Поле1 | 1 |
Figure: Field1 in Ticket Zoom Screen.
Пример 4.26. Активировать поле Field1 на странице просмотра обобщенной информации о Заявке.
Групировать: Заявку
Подгруппа: Frontend::Agent::TicketOverview
Настройка: Ticket::Frontend::OverviewSmall###DynamicField
Значение:
Ключ | Content |
Поле1 | 1 |
Figure: Field1 in Ticket Overview Small Screen.
Этот параметр влияет на шаблоны: Эскалации, Заблокированные, Очереди, Ответственные, Статус и Watch-шаблон.
Событие Заявки (например TicketCreate) может вызывать множество значений для определенного поля, если его значение еще до сих пор не установлено.
By using this method this default value, is not seen in the edit screen (e.g. New Phone Ticket) since the value is set after the creation of the ticket.
To activate this feature it is necessary to enable the following setting: "Ticket::EventModulePost###TicketDynamicFieldDefault".
Пример 4.27. Активировать Field1 в событии TicketCreate.
Групировать: Заявку
Подгруппа: Core::TicketDynamicFieldDefault
Настройка: Ticket::TicketDynamicFieldDefault###Element1
Эта настройка может быть установлена в любую из 16 Ticket::TicketDynamicFieldDefault###Element.
If more that 16 fields needs to be set up a custom XML file must be places in $OTRS_HOME/Kernel/Config/files directory to extend this feature.
Значение:
Ключ | Content |
Событие | TicketCreate |
Название | Поле1 |
Значение | новое значение |
Значение по умолчанию для динамического поля может быть перезаписано значением, определенным пользователем, которое хранится в пользовательских настройках.
Using this method, the default value of the field will be shown on any screen where the field is activated (if the field does not have already a different value).
The "sysconfig" setting "PreferencesGroups###DynamicField" located in the "Frontend::Agent::Preferences" Sub-group. This setting is an example of how to create an entry in the User Preferences screen to set an exclusive dynamic field default value for the selected user. The limitation of this setting is that it only permits the use of one dynamic field. If two or more fields will use this feature, it is necessary to create a custom XML configuration file to add more settings similar to this one.
Remember, if more settings are added in a new XML each setting name needs to be unique in the system and different than "PreferencesGroups###DynamicField". for example: PreferencesGroups###101-DynamicField-Field1, PreferencesGroups###102-DynamicField-Field2, PreferencesGroups###My-Field1, PreferencesGroups###My-Field2, etc.
Пример 4.28. Активировать поле Field1 на странице Пользовательские Настройки.
Групировать: Заявку
Подгрупа: Frontend::Agent::Preferences
Настройка: PreferencesGroups###101-DynamicField-Field1
Значение:
Ключ | Content |
Событие | TicketCreate |
Активный | 1 |
Block | Input |
Поле | Другие настройки |
Data: | $Env{"UserDynamicField_Field1"} |
Ключ: | Мое Поле 1 |
Метка: | Значение по умолчанию для: My Field 1 |
Module: | Kernel::Output::HTML::PreferencesGeneric |
PrefKey: | UserDynamicField_Field1 |
Prio: | 7000 |
Рисунок: Field1 в окне с пользовательских настроек агентов.