* adjust for fix first day.

This commit is contained in:
wangyidong
2017-05-11 14:30:28 +08:00
parent 6973cf1f39
commit c673bc92de
5 changed files with 11 additions and 20 deletions

View File

@@ -812,11 +812,11 @@ class project extends control
* @access public
* @return void
*/
public function fixFirst($projectID, $withLeft = false)
public function fixFirst($projectID)
{
if($_POST)
{
$this->project->fixFirst($projectID, $withLeft);
$this->project->fixFirst($projectID);
die(js::reload('parent.parent'));
}

View File

@@ -207,7 +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->fixFirstWithLeft = 'Modify the left time';
/* 统计。*/
$lang->project->charts = new stdclass();

View File

@@ -207,7 +207,7 @@ $lang->project->goback = "返回任务列表";
$lang->project->noweekend = '去除周末';
$lang->project->withweekend = '显示周末';
$lang->project->interval = '间隔';
$lang->project->fixFirstWithLeft = '是否将首天剩余工时也设置为该值?';
$lang->project->fixFirstWithLeft = '修改剩余工时';
/* 统计。*/
$lang->project->charts = new stdclass();

View File

@@ -1557,16 +1557,18 @@ class projectModel extends model
* @access public
* @return void
*/
public function fixFirst($projectID, $withLeft = false)
public function fixFirst($projectID)
{
$project = $this->getById($projectID);
$burn = $this->dao->select('*')->from(TABLE_BURN)->where('project')->eq($projectID)->andWhere('date')->eq($project->begin)->fetch();
$project = $this->getById($projectID);
$burn = $this->dao->select('*')->from(TABLE_BURN)->where('project')->eq($projectID)->andWhere('date')->eq($project->begin)->fetch();
$withLeft = $this->post->withLeft ? $this->post->withLeft : 0;
$data = fixer::input('post')
->add('project', $projectID)
->add('date', $project->begin)
->add('left', $withLeft ? $this->post->estimate : $burn->left)
->add('consumed', empty($burn) ? 0 : $burn->consumed)
->remove('withLeft')
->get();
if(!is_numeric($data->estimate)) return false;

View File

@@ -18,23 +18,12 @@
<div class='input-group'>
<span class='input-group-addon'><?php echo $project->begin?></span>
<?php echo html::input('estimate', !empty($firstBurn->estimate) ? $firstBurn->estimate : (!empty($firstBurn->left) ? $firstBurn->left : ''), "class='form-control' placeholder='{$lang->project->placeholder->totalLeft}' autocomplete='off'")?>
<span class='input-group-addon fix-border'><?php echo '(' . $lang->project->totalEstimate . $project->totalEstimate . $lang->project->workHour. ')'?></span>
<span class='input-group-addon fix-border'><input id='withLeft' type='checkbox' checked name='withLeft' value='1' /> <label for='withLeft'><?php echo $lang->project->fixFirstWithLeft?></label></span>
<span class='input-group-btn'><?php echo html::submitButton();?></span>
</div>
<div class='alert alert-info'><?php echo $lang->project->totalEstimate . $project->totalEstimate . $lang->project->workHour;?></div>
</td>
</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';?>