* finish task #2864.

This commit is contained in:
chenfeiCF
2017-01-09 13:07:11 +08:00
parent 2664c32f28
commit 7261dc6c54
8 changed files with 29 additions and 5 deletions
+1
View File
@@ -21,6 +21,7 @@ class productplan extends control
public function commonAction($productID, $branch = 0)
{
$this->loadModel('product');
$this->app->loadConfig('project');
$product = $this->product->getById($productID);
$this->view->product = $product;
$this->view->branch = $branch;
+8 -1
View File
@@ -25,6 +25,13 @@ function computeEndDate(delta)
beginDate = $('#begin').val();
if(!beginDate) return;
endDate = convertStringToDate(beginDate).addDays(parseInt(delta)).toString('yyyy-MM-dd');
delta = parseInt(delta);
beginDate = convertStringToDate(beginDate);
if((delta == 7 || delta == 14) && (beginDate.getDay() == 1))
{
delta = (weekend == 2) ? (delta - 2) : (delta - 1);
}
endDate = beginDate.addDays(delta - 1).toString('yyyy-MM-dd');
$('#end').val(endDate);
}
+8 -1
View File
@@ -25,6 +25,13 @@ function computeEndDate(delta)
beginDate = $('#begin').val();
if(!beginDate) return;
endDate = convertStringToDate(beginDate).addDays(parseInt(delta)).toString('yyyy-MM-dd');
delta = parseInt(delta);
beginDate = convertStringToDate(beginDate);
if((delta == 7 || delta == 14) && (beginDate.getDay() == 1))
{
delta = (weekend == 2) ? (delta - 2) : (delta - 1);
}
endDate = beginDate.addDays(delta - 1).toString('yyyy-MM-dd');
$('#end').val(endDate);
}
+1
View File
@@ -13,6 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('weekend', $config->project->weekend);?>
<?php js::import($jsRoot . 'misc/date.js');?>
<div class='container mw-1400px'>
<div id='titlebar'>
+1
View File
@@ -13,6 +13,7 @@
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::set('weekend', $config->project->weekend);?>
<?php js::import($jsRoot . 'misc/date.js');?>
<div class='container mw-1400px'>
<div id='titlebar'>
+8 -2
View File
@@ -103,8 +103,14 @@ function computeEndDate(delta)
beginDate = $('#begin').val();
if(!beginDate) return;
endDate = convertStringToDate(beginDate).addDays(parseInt(delta));
endDate = endDate.toString('yyyy-MM-dd');
delta = parseInt(delta);
beginDate = convertStringToDate(beginDate);
if((delta == 7 || delta == 14) && (beginDate.getDay() == 1))
{
delta = (weekend == 2) ? (delta - 2) : (delta - 1);
}
endDate = beginDate.addDays(delta - 1).toString('yyyy-MM-dd');
$('#end').val(endDate);
computeWorkDays();
}
+1
View File
@@ -31,6 +31,7 @@
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php js::import($jsRoot . 'misc/date.js');?>
<?php js::set('weekend', $config->project->weekend);?>
<?php js::set('holders', $lang->project->placeholder);?>
<div class='container mw-1400px'>
<div id='titlebar'>
+1 -1
View File
@@ -37,7 +37,7 @@
<td>
<div class='input-group'>
<?php echo html::input('begin', $project->begin, "class='form-control form-date' onchange='computeWorkDays()' placeholder='" . $lang->project->begin . "'");?>
<span class='input-group-addon'><?php echo $lang->project->to;?></span>
<span class='input-group-addon fix-border'><?php echo $lang->project->to;?></span>
<?php echo html::input('end', $project->end, "class='form-control form-date' onchange='computeWorkDays()' placeholder='" . $lang->project->end . "'");?>
<div class='input-group-btn'>
<button type='button' class='btn dropdown-toggle' data-toggle='dropdown'><?php echo $lang->project->byPeriod;?> <span class='caret'></span></button>