* Finish task#3553
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
$config->productplan = new stdclass();
|
||||
$config->productplan->create = new stdclass();
|
||||
$config->productplan->edit = new stdclass();
|
||||
$config->productplan->create->requiredFields = 'title,begin,end';
|
||||
$config->productplan->edit->requiredFields = 'title,begin,end';
|
||||
$config->productplan->create->requiredFields = 'title,begin';
|
||||
$config->productplan->edit->requiredFields = 'title,begin';
|
||||
|
||||
$config->productplan->editor = new stdclass();
|
||||
$config->productplan->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
|
||||
@@ -33,7 +33,15 @@ function computeEndDate(delta)
|
||||
}
|
||||
|
||||
endDate = beginDate.addDays(delta - 1).toString('yyyy-MM-dd');
|
||||
$('#end').val(endDate);
|
||||
|
||||
if(delta == 9999)
|
||||
{
|
||||
$('#end').val('').attr("disabled","disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#end').val(endDate).removeAttr('disabled');
|
||||
}
|
||||
}
|
||||
|
||||
$('#begin').on('change', function()
|
||||
|
||||
@@ -33,5 +33,12 @@ function computeEndDate(delta)
|
||||
}
|
||||
|
||||
endDate = beginDate.addDays(delta - 1).toString('yyyy-MM-dd');
|
||||
$('#end').val(endDate).datetimepicker('update')
|
||||
if(delta == 9999)
|
||||
{
|
||||
$('#end').val('').attr("disabled","disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#end').val(endDate).removeAttr('disabled').datetimepicker('update');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ $lang->productplan->desc = 'Description';
|
||||
$lang->productplan->begin = 'Begin';
|
||||
$lang->productplan->end = 'End';
|
||||
$lang->productplan->last = 'Last plan';
|
||||
$lang->productplan->future = 'Future';
|
||||
|
||||
$lang->productplan->endList[7] = '1 Week';
|
||||
$lang->productplan->endList[14] = '2 Weeks';
|
||||
@@ -54,6 +55,7 @@ $lang->productplan->endList[62] = '2 Months';
|
||||
$lang->productplan->endList[93] = '3 Months';
|
||||
$lang->productplan->endList[186] = '6 Months';
|
||||
$lang->productplan->endList[365] = '1 Year';
|
||||
$lang->productplan->endList[9999] = 'Future';
|
||||
|
||||
$lang->productplan->errorNoTitle = 'ID %s title should not be empty.';
|
||||
$lang->productplan->errorNoBegin = 'ID %s begin time should not be empty.';
|
||||
|
||||
@@ -46,6 +46,7 @@ $lang->productplan->desc = '描述';
|
||||
$lang->productplan->begin = '开始日期';
|
||||
$lang->productplan->end = '结束日期';
|
||||
$lang->productplan->last = '上次计划';
|
||||
$lang->productplan->future = '待定';
|
||||
|
||||
$lang->productplan->endList[7] = '一星期';
|
||||
$lang->productplan->endList[14] = '两星期';
|
||||
@@ -54,6 +55,7 @@ $lang->productplan->endList[62] = '两个月';
|
||||
$lang->productplan->endList[93] = '三个月';
|
||||
$lang->productplan->endList[186] = '半年';
|
||||
$lang->productplan->endList[365] = '一年';
|
||||
$lang->productplan->endList[9999] = '待定';
|
||||
|
||||
$lang->productplan->errorNoTitle = 'ID %s 标题不能为空';
|
||||
$lang->productplan->errorNoBegin = 'ID %s 开始时间不能为空';
|
||||
|
||||
@@ -139,7 +139,10 @@ class productplanModel extends model
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$plan = fixer::input('post')->stripTags($this->config->productplan->editor->create['id'], $this->config->allowedTags)->remove('delta,uid')->get();
|
||||
$plan = fixer::input('post')->stripTags($this->config->productplan->editor->create['id'], $this->config->allowedTags)
|
||||
->setIF($this->post->delta == 9999 || empty($this->post->end), 'end', '2030-01-01')
|
||||
->remove('delta,uid')
|
||||
->get();
|
||||
$plan = $this->loadModel('file')->processImgURL($plan, $this->config->productplan->editor->create['id'], $this->post->uid);
|
||||
$this->dao->insert(TABLE_PRODUCTPLAN)
|
||||
->data($plan)
|
||||
@@ -166,7 +169,10 @@ class productplanModel extends model
|
||||
public function update($planID)
|
||||
{
|
||||
$oldPlan = $this->dao->findByID((int)$planID)->from(TABLE_PRODUCTPLAN)->fetch();
|
||||
$plan = fixer::input('post')->stripTags($this->config->productplan->editor->edit['id'], $this->config->allowedTags)->remove('delta,uid')->get();
|
||||
$plan = fixer::input('post')->stripTags($this->config->productplan->editor->edit['id'], $this->config->allowedTags)
|
||||
->setIF($this->post->delta == 9999 || empty($this->post->end), 'end', '2030-01-01')
|
||||
->remove('delta,uid')
|
||||
->get();
|
||||
$plan = $this->loadModel('file')->processImgURL($plan, $this->config->productplan->editor->edit['id'], $this->post->uid);
|
||||
$this->dao->update(TABLE_PRODUCTPLAN)
|
||||
->data($plan)
|
||||
|
||||
@@ -45,7 +45,10 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->productplan->end;?></th>
|
||||
<td><?php echo html::input('end', $plan->end, 'class="form-control form-date"');?></td>
|
||||
<td>
|
||||
<?php $disabled = $plan->end == '2030-01-01' ? ' disabled="disabled"' : '';?>
|
||||
<?php echo html::input('end', empty($disabled) ? $plan->end : '', 'class="form-control form-date"' . $disabled);?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo html::radio('delta', $lang->productplan->endList , '', "onclick='computeEndDate(this.value)'");?>
|
||||
</td>
|
||||
|
||||
@@ -413,7 +413,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->productplan->end;?></th>
|
||||
<td><?php echo $plan->end;?></td>
|
||||
<td><?php echo $plan->end == '2030-01-01' ? $lang->productplan->future : $plan->end;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->productplan->desc;?></th>
|
||||
|
||||
Reference in New Issue
Block a user