*Adjust code.

This commit is contained in:
zhengrunyu
2022-01-06 14:03:25 +08:00
parent 3c4b34dc9c
commit 133316ba45
8 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ class productplan extends control
}
$this->loadModel('score')->create('ajax', 'batchOther');
die(js::locate(inlink('browse', "productID=$productID&branch=$branch"), 'parent'));
die(js::locate($this->session->productPlanList, 'parent'));
}
$planIDList = $this->post->planIDList ? $this->post->planIDList : die(js::locate($this->session->productPlanList, 'parent'));
+2 -2
View File
@@ -9,8 +9,8 @@ function changeDate(planID)
{
if($("#future"+planID).prop('checked'))
{
$("input[name='begin[" + planID + "]']").attr('disabled', 'disabled');
$("input[name='end[" + planID + "]']").attr('disabled', 'disabled');
$("input[name='begin[" + planID + "]']").attr('disabled', 'disabled').val('');
$("input[name='end[" + planID + "]']").attr('disabled', 'disabled').val('');
}
else
{
+1 -1
View File
@@ -92,7 +92,7 @@ $('#future').on('change', function()
{
if($(this).prop('checked'))
{
$('#begin').attr('disabled', 'disabled');
$('#begin').attr('disabled', 'disabled').val('');
$('#end').parents('tr').hide();
}
else
+5 -5
View File
@@ -38,7 +38,7 @@
</thead>
<tbody>
<?php foreach($plans as $plan):?>
<?php $isChecked = ($plan->begin == '2030-01-01' or $plan->end == '2030-01-01') ? 'checked="checked"' : '';?>
<?php $isChecked = ($plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future) ? 'checked="checked"' : '';?>
<tr>
<td class='text-center'><?php echo $plan->id . html::hidden("id[$plan->id]", $plan->id);?></td>
<?php if($product->type != 'normal'):?>
@@ -53,10 +53,10 @@
<?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>
<?php endif;?>
<?php $disabled = (($plan->begin == '2030-01-01' or $plan->end == '2030-01-01') and $plan->status == 'wait') ? 'disabled="disabled"' : '';?>
<?php if($plan->parent == -1 and ($plan->begin == '2030-01-01' or $plan->end == '2030-01-01')) $disabled = 'disabled="disabled"';?>
<?php if($plan->begin == '2030-01-01') $plan->begin = '';?>
<?php if($plan->end == '2030-01-01') $plan->end = '';?>
<?php $disabled = (($plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future) and $plan->status == 'wait') ? 'disabled="disabled"' : '';?>
<?php if($plan->parent == -1 and ($plan->begin == $this->config->productplan->future or $plan->end == $this->config->productplan->future)) $disabled = 'disabled="disabled"';?>
<?php if($plan->begin == $this->config->productplan->future) $plan->begin = '';?>
<?php if($plan->end == $this->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' : '';?>
@@ -134,8 +134,8 @@
<?php if($this->session->currentProductType != 'normal'):?>
<td class='c-branch' title='<?php echo $branchOption[$plan->branch];?>'><?php if($plan->parent != '-1') echo $branchOption[$plan->branch];?></td>
<?php endif;?>
<td><?php echo $plan->begin == '2030-01-01' ? $lang->productplan->future : $plan->begin;?></td>
<td><?php echo $plan->end == '2030-01-01' ? $lang->productplan->future : $plan->end;?></td>
<td><?php echo $plan->begin == $this->config->productplan->future ? $lang->productplan->future : $plan->begin;?></td>
<td><?php echo $plan->end == $this->config->productplan->future ? $lang->productplan->future : $plan->end;?></td>
<td class='text-center'><?php echo $plan->stories;?></td>
<td class='text-center'><?php echo $plan->bugs;?></td>
<td class='text-center'><?php echo $plan->hour;?></td>
@@ -152,7 +152,7 @@
$attr = "target='hiddenwin'";
$isOnlyBody = false;
$class = '';
if($plan->begin == '2030-01-01' or $plan->end == '2030-01-01')
if($plan->begin == $this->config->productplan->future or $plan->end == $this->config->productplan->future)
{
$class = 'iframe';
$attr = "data-id='{$plan->id}' data-width='70%'";
+4 -4
View File
@@ -48,9 +48,9 @@
</tr>
<tr>
<?php $hidden = $plan->status != 'wait' ? 'hidden' : '';?>
<?php $checked = $plan->begin == '2030-01-01' || $plan->end == '2030-01-01' ? "checked='checked'" : '';?>
<?php $checked = $plan->begin == $this->config->productplan->future and $plan->end == $this->config->productplan->future ? "checked='checked'" : '';?>
<th><?php echo $lang->productplan->begin;?></th>
<td><?php echo html::input('begin', $plan->begin != '2030-01-01' ? formatTime($plan->begin) : '', "class='form-control form-date'");?></td>
<td><?php echo html::input('begin', $plan->begin != $this->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'>
@@ -62,8 +62,8 @@
</tr>
<tr>
<th><?php echo $lang->productplan->end;?></th>
<td><?php echo html::input('end', $plan->end != '2030-01-01' ? formatTime($plan->end) : '', "class='form-control form-date'");?></td>
<?php $deltaValue = $plan->end == '2030-01-01' ? 0 : (strtotime($plan->end) - strtotime($plan->begin)) / 3600 / 24 + 1;?>
<td><?php echo html::input('end', $plan->end != $this->config->productplan->future ? formatTime($plan->end) : '', "class='form-control form-date'");?></td>
<?php $deltaValue = $plan->end == $this->config->productplan->future ? 0 : (strtotime($plan->end) - strtotime($plan->begin)) / 3600 / 24 + 1;?>
<td colspan='2'><?php echo html::radio('delta', $lang->productplan->endList , $deltaValue, "onclick='computeEndDate(this.value)'");?></td>
</tr>
<?php $this->printExtendFields($plan, 'table', 'columns=3');?>
+2 -2
View File
@@ -21,11 +21,11 @@
<table class='table table-form'>
<tr>
<th><?php echo $lang->productplan->begin;?></th>
<td colspan='2'><?php echo html::input('begin', $plan->begin != '2030-01-01' ? formatTime($plan->begin) : '', "class='form-control form-date'");?></td>
<td colspan='2'><?php echo html::input('begin', $plan->begin != $this->config->productplan->future ? formatTime($plan->begin) : '', "class='form-control form-date'");?></td>
</tr>
<tr>
<th><?php echo $lang->productplan->end;?></th>
<td colspan='2'><?php echo html::input('end', $plan->end != '2030-01-01' ? formatTime($plan->end) : '', 'class="form-control form-date"');?></td>
<td colspan='2'><?php echo html::input('end', $plan->end != $this->config->productplan->future ? formatTime($plan->end) : '', 'class="form-control form-date"');?></td>
</tr>
<tr>
<th><?php echo $lang->productplan->desc;?></th>
+4 -4
View File
@@ -29,7 +29,7 @@
<span title='<?php echo $plan->title;?>' class='text'><?php echo $plan->title;?></span>
<?php if($product->type !== 'normal') echo "<span title='{$lang->product->branchName[$product->type]}' class='label label-branch label-badge'>" . $branchOption[$branch] . '</span>';?>
<span class='label label-info label-badge'>
<?php echo ($plan->begin == '2030-01-01' || $plan->end == '2030-01-01') ? $lang->productplan->future : $plan->begin . '~' . $plan->end;?>
<?php echo ($plan->begin == $this->config->productplan->future || $plan->end == $this->config->productplan->future) ? $lang->productplan->future : $plan->begin . '~' . $plan->end;?>
</span>
<?php if($plan->deleted):?>
<span class='label label-danger'><?php echo $lang->product->deleted;?></span>
@@ -47,7 +47,7 @@
$attr = "target='hiddenwin'";
$isOnlyBody = false;
$class = '';
if($plan->begin == '2030-01-01' or $plan->end == '2030-01-01')
if($plan->begin == $this->config->productplan->future or $plan->end == $this->config->productplan->future)
{
$class = 'iframe';
$attr = "data-toggle='modal' data-id='{$plan->id}' data-width='550px'";
@@ -596,11 +596,11 @@
<?php endif;?>
<tr>
<th><?php echo $lang->productplan->begin;?></th>
<td><?php echo $plan->begin == '2030-01-01' ? $lang->productplan->future : $plan->begin;?></td>
<td><?php echo $plan->begin == $this->config->productplan->future ? $lang->productplan->future : $plan->begin;?></td>
</tr>
<tr>
<th><?php echo $lang->productplan->end;?></th>
<td><?php echo $plan->end == '2030-01-01' ? $lang->productplan->future : $plan->end;?></td>
<td><?php echo $plan->end == $this->config->productplan->future ? $lang->productplan->future : $plan->end;?></td>
</tr>
<?php if($plan->parent == '-1'):?>
<tr>