Merge branch 'sprint/181_zhengrunyu_Fixbug' into 'master'

*Code edit and batchedit.

See merge request easycorp/zentaopms!1309
This commit is contained in:
孙广明
2022-01-07 01:29:44 +00:00
6 changed files with 12 additions and 81 deletions
+4 -5
View File
@@ -154,10 +154,9 @@ class my extends control
$reviewCount = 0;
$ncCount = 0;
$meetingCount = 0;
$isMaxVersion = isset($this->config->maxVersion) ? 1 : 0;
if($isMaxVersion)
$isMax = isset($this->config->maxVersion) ? 1 : 0;
if($isMax)
{
$this->loadModel('issue');
$this->loadModel('risk');
$this->loadModel('review');
@@ -195,8 +194,8 @@ var testTaskCount = $testTaskCount;
var isOpenedURAndSR = $isOpenedURAndSR;
if(isOpenedURAndSR !== 0) var requirementCount = $requirementCount;
var isMaxVersion = $isMaxVersion;
if(isMaxVersion !== 0)
var isMax = $isMax;
if(isMax !== 0)
{
var issueCount = $issueCount;
var riskCount = $riskCount;
+1 -1
View File
@@ -13,7 +13,7 @@ $(function()
if(isOpenedURAndSR !== 0) $("#subNavbar li[data-id='requirement'] a").append('<span class="label label-light label-badge">' + requirementCount + '</span>');
if(isMaxVersion !== 0)
if(isMax !== 0)
{
$("#subNavbar li[data-id='issue'] a").append('<span class="label label-light label-badge">' + issueCount + '</span>');
$("#subNavbar li[data-id='risk'] a").append('<span class="label label-light label-badge">' + riskCount + '</span>');
-32
View File
@@ -20,38 +20,6 @@ function changeDate(planID)
}
};
/**
* Set plan status.
*
* @param int $planID
* @param $status
* @access public
* @return void
*/
function setPlanStatus(planID, status)
{
if(status != 'wait')
{
$('#future' + planID).closest('div').addClass('hidden');
$("input[name='begin[" + planID + "]']").removeAttr('disabled');
$("input[name='end[" + planID + "]']").removeAttr('disabled');
$('.form-date').datetimepicker('update');
}
else
{
var isFuture = $('#future' + planID).prop('checked');
$('#future' + planID).closest('div').removeClass('hidden');
if(isFuture)
{
$("input[name='begin[" + planID + "]']").attr('disabled', 'disabled');
$("input[name='end[" + planID + "]']").attr('disabled', 'disabled');
}
}
}
/**
* Get conflict stories.
*
-29
View File
@@ -59,35 +59,6 @@ function computeEndDate(delta)
$('#end').val(endDate).datetimepicker('update');
}
/**
* Set plan status.
*
* @access public
* @return void
*/
function setPlanStatus()
{
var status = $('#status').val();
if(status != 'wait')
{
$('#checkBox').closest('div').addClass('hidden');
$('#future').val(0);
$('#begin').removeAttr('disabled');
$('#end').parents('tr').show();
}
else
{
var isFuture = $('#future').prop('checked');
$('#checkBox').closest('div').removeClass('hidden');
if(isFuture)
{
$('#begin').attr('disabled', 'disabled');
$('#end').parents('tr').hide();
}
}
}
$('#future').on('change', function()
{
if($(this).prop('checked'))
+4 -5
View File
@@ -49,18 +49,17 @@
<?php endif;?>
<td title='<?php echo $plan->title?>'><?php echo html::input("title[$plan->id]", $plan->title, "class='form-control'")?></td>
<?php if($plan->parent != -1):?>
<td><?php echo html::select("status[$plan->id]", array_slice($lang->productplan->statusList,($plan->status == 'wait' ? 0 : 1)), $plan->status, "class='form-control chosen' onchange='setPlanStatus($plan->id, this.value, $plan->parent)'");?></td>
<td><?php echo html::select("status[$plan->id]", array_slice($lang->productplan->statusList,($plan->status == 'wait' ? 0 : 1)), $plan->status, "class='form-control chosen'");?></td>
<?php else:?>
<td><?php echo html::select("status[$plan->id]", array_slice($lang->productplan->statusList,($plan->status == 'wait' ? 0 : 1)), $plan->status, "class='form-control chosen' disabled onchange='setPlanStatus($plan->id, this.value, $plan->parent)'");?></td>
<td><?php echo html::select("status[$plan->id]", array_slice($lang->productplan->statusList,($plan->status == 'wait' ? 0 : 1)), $plan->status, "class='form-control chosen' disabled ");?></td>
<?php endif;?>
<?php $disabled = (($plan->begin == $config->productplan->future and $plan->end == $config->productplan->future) and $plan->status == 'wait') ? 'disabled="disabled"' : '';?>
<?php $disabled = (($plan->begin == $config->productplan->future and $plan->end == $config->productplan->future)) ? 'disabled="disabled"' : '';?>
<?php if($plan->parent == -1 and ($plan->begin == $config->productplan->future and $plan->end == $config->productplan->future)) $disabled = 'disabled="disabled"';?>
<?php if($plan->begin == $config->productplan->future) $plan->begin = '';?>
<?php if($plan->end == $config->productplan->future) $plan->end = '';?>
<td><?php echo html::input("begin[$plan->id]", $plan->begin, "class='form-control form-date' $disabled");?></td>
<td><?php echo html::input("end[$plan->id]", $plan->end, "class='form-control form-date' $disabled");?></td>
<?php $hidden = ($plan->status != 'wait' and $plan->parent != -1) ? 'hidden' : '';?>
<td><div class='checkbox-primary <?php echo $hidden;?>'><input type='checkbox' id="future<?php echo $plan->id; ?>" name='future[<?php echo $plan->id; ?>]' <?php echo $isChecked;?> onclick="changeDate(<?php echo $plan->id;?>);"/><label for='future<?php echo $plan->id; ?>'><?php echo $lang->productplan->future;?></label></div></td>
<td><div class='checkbox-primary'><input type='checkbox' id="future<?php echo $plan->id; ?>" name='future[<?php echo $plan->id; ?>]' <?php echo $isChecked;?> onclick="changeDate(<?php echo $plan->id;?>);"/><label for='future<?php echo $plan->id; ?>'><?php echo $lang->productplan->future;?></label></div></td>
<?php foreach($extendFields as $extendField) echo "<td" . (($extendField->control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->loadModel('flow')->getFieldControl($extendField, $plan, $extendField->field . "[{$plan->id}]") . "</td>";?>
</tr>
<?php endforeach;?>
+3 -9
View File
@@ -40,24 +40,18 @@
</tr>
<tr>
<th><?php echo $lang->productplan->status;?></th>
<?php if($plan->parent != -1):?>
<td><?php echo html::select('status', array_slice($lang->productplan->statusList,($plan->status == 'wait' ? 0 : 1)), $plan->status, "class='form-control chosen' onchange='setPlanStatus()'");?></td>
<?php else:?>
<td><?php echo html::select('status', array_slice($lang->productplan->statusList,($plan->status == 'wait' ? 0 : 1)), $plan->status, "class='form-control chosen' disabled onchange='setPlanStatus()'");?></td>
<?php endif;?>
<?php $disabled = $plan->parent == -1 ? "disabled='disabled'" : '' ;?>
<td><?php echo html::select('status', array_slice($lang->productplan->statusList,($plan->status == 'wait' ? 0 : 1)), $plan->status, "class='form-control chosen' $disabled");?></td>
</tr>
<tr>
<?php $hidden = $plan->status != 'wait' ? 'hidden' : '';?>
<?php $checked = $plan->begin == $config->productplan->future and $plan->end == $config->productplan->future ? "checked='checked'" : '';?>
<th><?php echo $lang->productplan->begin;?></th>
<td><?php echo html::input('begin', $plan->begin != $config->productplan->future ? formatTime($plan->begin) : '', "class='form-control form-date'");?></td>
<td>
<?php if($plan->status == 'wait'):?>
<div class='checkbox-primary <?php echo $hidden;?>' id='checkBox'>
<div class='checkbox-primary' id='checkBox'>
<input type='checkbox' id='future' name='future' value='1' <?php echo $checked;?> />
<label for='future'><?php echo $lang->productplan->future;?></label>
</div>
<?php endif;?>
</td>
</tr>
<tr>