* Fix bug #3397,3398,3399.

This commit is contained in:
holan20180123
2020-08-26 10:20:32 +08:00
parent 2942519ed8
commit c8e660380a
3 changed files with 30 additions and 4 deletions
+26
View File
@@ -0,0 +1,26 @@
$(function()
{
$('#riskindex').attr('readonly', true);
$('#pri').attr('disabled', true);
computeIndex();
function computeIndex()
{
var impact = $('#impact').val();
var probability = $('#probability').val();
var riskindex = parseInt(impact * probability);
var pri = '';
if(0 < riskindex && riskindex <= 5) pri = 'low';
if(5 < riskindex && riskindex <= 12) pri = 'middle';
if(15 <= riskindex && riskindex <= 25) pri = 'high';
$('#riskindex').val(riskindex);
$('#pri').val(pri);
$('#pri').trigger("chosen:updated")
$('#pri').chosen();
$('#pri').attr('disabled', true);
$('input[name="pri"]').remove();
$('#pri').after("<input type='hidden' name='pri' value='" + pri + "'/>");
}
$('#impact, #probability').change(function(){computeIndex()});
})
+1 -1
View File
@@ -8,7 +8,7 @@
<thead>
<tr>
<th class='w-50px'><?php echo $lang->risk->id;?></th>
<th><?php echo $lang->risk->name;?></th>
<th class='required'><?php echo $lang->risk->name;?></th>
<th class='w-200px'><?php echo $lang->risk->source;?></th>
<th class='w-200px'><?php echo $lang->risk->category;?></th>
<th class='w-200px'><?php echo $lang->risk->strategy;?></th>
+3 -3
View File
@@ -78,7 +78,7 @@
</tr>
<tr>
<th><?php echo $lang->risk->strategy;?></th>
<td><?php echo zget($lang->risk->strategy, $risk->strategy);?></td>
<td><?php echo zget($lang->risk->strategyList, $risk->strategy);?></td>
</tr>
<tr>
<th><?php echo $lang->risk->status;?></th>
@@ -86,11 +86,11 @@
</tr>
<tr>
<th><?php echo $lang->risk->impact;?></th>
<td><?php echo zget($lang->risk->impact, $risk->impact);?></td>
<td><?php echo zget($lang->risk->impactList, $risk->impact);?></td>
</tr>
<tr>
<th><?php echo $lang->risk->probability;?></th>
<td><?php echo zget($lang->risk->probability, $risk->probability);?></td>
<td><?php echo zget($lang->risk->probabilityList, $risk->probability);?></td>
</tr>
<tr>
<th><?php echo $lang->risk->riskindex;?></th>