Finish task#2992 燃尽图修改首天工时时将那一天的剩余工时也修改了,cost:1 left:0
This commit is contained in:
@@ -810,11 +810,11 @@ class project extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function fixFirst($projectID)
|
||||
public function fixFirst($projectID, $withLeft = false)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->project->fixFirst($projectID);
|
||||
$this->project->fixFirst($projectID, $withLeft);
|
||||
die(js::reload('parent.parent'));
|
||||
}
|
||||
|
||||
|
||||
@@ -207,6 +207,7 @@ $lang->project->goback = "Go Back";
|
||||
$lang->project->noweekend = 'Without Weekend';
|
||||
$lang->project->withweekend = 'With Weekend';
|
||||
$lang->project->interval = 'Intervals';
|
||||
$lang->project->fixFirstWithLeft = 'Do you want to set the left of the day to this value?';
|
||||
|
||||
/* 统计。*/
|
||||
$lang->project->charts = new stdclass();
|
||||
|
||||
@@ -207,6 +207,7 @@ $lang->project->goback = "返回任务列表";
|
||||
$lang->project->noweekend = '去除周末';
|
||||
$lang->project->withweekend = '显示周末';
|
||||
$lang->project->interval = '间隔';
|
||||
$lang->project->fixFirstWithLeft = '是否将该天剩余工时也设置为该值?';
|
||||
|
||||
/* 统计。*/
|
||||
$lang->project->charts = new stdclass();
|
||||
|
||||
@@ -1553,7 +1553,7 @@ class projectModel extends model
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function fixFirst($projectID)
|
||||
public function fixFirst($projectID, $withLeft = false)
|
||||
{
|
||||
$project = $this->getById($projectID);
|
||||
$burn = $this->dao->select('*')->from(TABLE_BURN)->where('project')->eq($projectID)->andWhere('date')->eq($project->begin)->fetch();
|
||||
@@ -1561,7 +1561,7 @@ class projectModel extends model
|
||||
$data = fixer::input('post')
|
||||
->add('project', $projectID)
|
||||
->add('date', $project->begin)
|
||||
->add('left', empty($burn) ? $this->post->estimate : $burn->left)
|
||||
->add('left', (empty($burn) or $withLeft) ? $this->post->estimate : $burn->left)
|
||||
->add('consumed', empty($burn) ? 0 : $burn->consumed)
|
||||
->get();
|
||||
if(!is_numeric($data->estimate)) return false;
|
||||
|
||||
@@ -25,4 +25,16 @@
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<script>
|
||||
$(function()
|
||||
{
|
||||
$('#submit').click(function()
|
||||
{
|
||||
if(confirm('<?php echo $lang->project->fixFirstWithLeft?>'))
|
||||
{
|
||||
$(this).closest('form').attr('action', '<?php echo inlink('fixFirst', "projectID={$project->id}&withLeft=1")?>');
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user