* finish task #2864.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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'>
|
||||
|
||||
@@ -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'>
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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'>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user