Commit 4f6e3e7a authored by Elizaveta Kakhovskaya's avatar Elizaveta Kakhovskaya

Update Incident_structure.rst

parent 8c19f871
......@@ -176,47 +176,6 @@
Рис.
Поле Приоритет ``itsm_form_incident_priority`` не доступно пользователю на редактирование и вычисляется исходя из значений
полей Срочность ``itsm_form_incident_urgency`` и Воздействие ``itsm_form_incident_influence`` в основном скрипте scipt.js формы обращения:
::
// вычисление приоритета
(function calculatePriority() {
var CRITICAL_INCIDENT = 1;
var itsm_form_incident_urgency = "itsm_form_incident_urgency";
var itsm_form_incident_influence = "itsm_form_incident_influence";
var itsm_form_incident_major = "itsm_form_incident_major";
var itsm_form_incident_status = "itsm_form_incident_status";
var itsm_form_incident_priority = "itsm_form_incident_priority";
var urgencyModel = playerModel.getModelWithId(itsm_form_incident_urgency);
var influenceModel = playerModel.getModelWithId(itsm_form_incident_influence);
var majorModel = playerModel.getModelWithId(itsm_form_incident_major);
var priorityModel = playerModel.getModelWithId(itsm_form_incident_priority);
function calcPriority(){
var urgencyValue = parseInt(urgencyModel.getValue()[0]);
var influenceValue = parseInt(influenceModel.getValue()[0]);
var isMajor = majorModel.getValue() !== null && majorModel.getValue().length > 0 && majorModel.getValue()[0] == '1';
var priorityValue = urgencyValue + influenceValue - 1;
if(isMajor) {
priorityValue = CRITICAL_INCIDENT;
}
priorityModel.setValue(priorityValue+"");
}
on(urgencyModel, "valueChange", "calcPriority", calcPriority);
on(influenceModel, "valueChange", "calcPriority", calcPriority);
on(majorModel, "valueChange", "calcPriority", calcPriority);
}());
7. Связанные сущности
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment