*code begin and end
This commit is contained in:
@@ -48,8 +48,8 @@ function setPlanStatus(planID, status)
|
||||
$('#future' + planID).closest('div').removeClass('hidden');
|
||||
$("input[name='begin[" + planID + "]']").closest('td').removeClass('required');
|
||||
$("input[name='end[" + planID + "]']").closest('td').removeClass('required');
|
||||
$("input[name='begin" + planID + "']").attr('disabled', 'disabled');
|
||||
$("input[name='end" + planID + "']").attr('disabled', 'disabled');
|
||||
$("input[name='begin" + planID + "']").attr('disabled', 'disabled').val('');
|
||||
$("input[name='end" + planID + "']").attr('disabled', 'disabled').val('');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ $('#future').on('change', function()
|
||||
{
|
||||
if($(this).prop('checked'))
|
||||
{
|
||||
$('#begin').attr('disabled', 'disabled');
|
||||
$('#begin').attr('disabled', 'disabled').val('');
|
||||
$('#end').val('').parents('tr').hide();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -393,11 +393,11 @@ class productplanModel extends model
|
||||
->remove('delta,uid,future')
|
||||
->get();
|
||||
|
||||
if(!empty($plan->parentBegin))
|
||||
if($plan->parentBegin != '2030-01-01')
|
||||
{
|
||||
if($plan->begin < $plan->parentBegin) dao::$errors['begin'] = sprintf($this->lang->productplan->beginLetterParent, $plan->parentBegin);
|
||||
}
|
||||
if(!empty($plan->parentEnd))
|
||||
if($plan->parentEnd != '2030-01-01')
|
||||
{
|
||||
if($plan->end !=='2030-01-01' and $plan->end > $plan->parentEnd) dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $plan->parentEnd);
|
||||
}
|
||||
@@ -465,14 +465,17 @@ class productplanModel extends model
|
||||
->remove('delta,uid,future')
|
||||
->get();
|
||||
|
||||
if($oldPlan->parent > 0) $parentPlan = $this->getByID($oldPlan->parent);
|
||||
if(!empty($parentPlan->begin))
|
||||
{
|
||||
if($plan->begin < $parentPlan->begin) dao::$errors['begin'] = sprintf($this->lang->productplan->beginLetterParent, $parentPlan->begin);
|
||||
}
|
||||
if(!empty($parentPlan->end))
|
||||
if($oldPlan->parent > 0)
|
||||
{
|
||||
if($plan->end !=='2030-01-01' and $plan->end > $parentPlan->end) dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $parentPlan->end);
|
||||
$parentPlan = $this->getByID($oldPlan->parent);
|
||||
if($parentPlan->begin != '2030-01-01')
|
||||
{
|
||||
if($plan->begin < $parentPlan->begin) dao::$errors['begin'] = sprintf($this->lang->productplan->beginLetterParent, $parentPlan->begin);
|
||||
}
|
||||
if($parentPlan->end != '2030-01-01')
|
||||
{
|
||||
if($plan->end !=='2030-01-01' and $plan->end > $parentPlan->end) dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $parentPlan->end);
|
||||
}
|
||||
}
|
||||
|
||||
$requiredFields = $plan->status == 'wait' ? $this->config->productplan->edit->requiredFields : 'title, begin, end';
|
||||
@@ -618,14 +621,17 @@ class productplanModel extends model
|
||||
$plan->end = $data->end[$planID] == '' ? '2030-01-01' : $data->end[$planID];
|
||||
$plan->status = $data->status[$planID];
|
||||
|
||||
if($oldPlans[$planID]->parent > 0) $parentPlan = $this->getByID($oldPlans[$planID]->parent);
|
||||
if(!empty($parentPlan->begin))
|
||||
if($oldPlans[$planID]->parent > 0)
|
||||
{
|
||||
if($plan->begin < $parentPlan->begin) dao::$errors['begin'] = sprintf($this->lang->productplan->beginLetterParent, $parentPlan->begin);
|
||||
}
|
||||
if(!empty($parentPlan->end))
|
||||
{
|
||||
if($plan->end !=='2030-01-01' and $plan->end > $parentPlan->end) dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $parentPlan->end);
|
||||
$parentPlan = $this->getByID($oldPlans[$planID]->parent);
|
||||
if($parentPlan->begin != '2030-01-01')
|
||||
{
|
||||
if($plan->begin < $parentPlan->begin) dao::$errors['begin'] = sprintf($this->lang->productplan->beginLetterParent, $parentPlan->begin);
|
||||
}
|
||||
if($parentPlan->end != '2030-01-01')
|
||||
{
|
||||
if($plan->end !='2030-01-01' and $plan->end > $parentPlan->end) dao::$errors['end'] = sprintf($this->lang->productplan->endGreaterParent, $parentPlan->end);
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($plan->title))die(js::alert(sprintf($this->lang->productplan->errorNoTitle, $planID)));
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
<?php echo html::hidden("status[$plan->id]", $plan->status);?>
|
||||
<?php endif;?>
|
||||
<?php $required = $plan->status != 'wait' ? 'required' : '' ;?>
|
||||
<td class=<?php echo $required;?>><?php echo html::input("begin[$plan->id]", $plan->begin, "class='form-control form-date $hiddenInput'");echo html::input("begin$plan->id", '', "class='form-control $showInput' disabled='disabled'");?></td>
|
||||
<td class=<?php echo $required;?>><?php echo html::input("end[$plan->id]", $plan->end, "class='form-control form-date $hiddenInput'");echo html::input("end$plan->id", '', "class='form-control $showInput' disabled='disabled'");?></td>
|
||||
<td class=<?php echo $required;?>><?php echo html::input("begin[$plan->id]", $plan->begin, "class='form-control form-date $hiddenInput'");echo html::input("begin$plan->id", '', "class='form-control form-date $showInput' disabled='disabled'");?></td>
|
||||
<td class=<?php echo $required;?>><?php echo html::input("end[$plan->id]", $plan->end, "class='form-control form-date $hiddenInput'");echo html::input("end$plan->id", '', "class='form-control form-date $showInput' disabled='disabled'");?></td>
|
||||
<?php $hidden = $plan->status != 'wait' ? 'hidden' : '';?>
|
||||
<td><div class='checkbox-primary <?php echo $hidden;?>'><input type='checkbox' id="future<?php echo $plan->id; ?>" name='future<?php echo $plan->id; ?>' <?php echo $isChecked;?> onclick="changeDate(<?php echo $plan->id;?>);"/><label for='future<?php echo $plan->id; ?>'><?php echo $lang->productplan->future;?></label></div></td>
|
||||
<?php foreach($extendFields as $extendField) echo "<td" . (($extendField->control == 'select' or $extendField->control == 'multi-select') ? " style='overflow:visible'" : '') . ">" . $this->loadModel('flow')->getFieldControl($extendField, $plan, $extendField->field . "[{$plan->id}]") . "</td>";?>
|
||||
|
||||
@@ -155,7 +155,7 @@
|
||||
common::printIcon('productplan', 'close', "planID=$plan->id", $plan, 'list', 'off', '', $class, false, $attr, $lang->productplan->close);
|
||||
}
|
||||
|
||||
$attr = ($plan->expired or $plan->status ==='done' or $plan->status ==='closed') ? "disabled='disabled'" : '';
|
||||
$attr = $plan->expired ? "disabled='disabled'" : '';
|
||||
if(common::hasPriv('execution', 'create', $plan) and $plan->parent >= 0)
|
||||
{
|
||||
$disabled = '';
|
||||
|
||||
Reference in New Issue
Block a user