* merge current 18.x into ai.
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
</div>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='main-header'>
|
||||
<?php if(!empty($planID) and $project->model == 'waterfallplus'):?>
|
||||
<?php if(!empty($planID) and in_array($project->model, array('waterfallplus', 'ipd'))):?>
|
||||
<div class="pull-left">
|
||||
<div class='methodTitle'><strong><?php echo $lang->programplan->subPlanManage . ':'?></strong></div>
|
||||
<div class='type-list-radio'>
|
||||
@@ -94,16 +94,15 @@
|
||||
</th>
|
||||
<th class='c-attribute <?php echo $hideAttribute . zget($requiredFields, 'attribute', '', ' required');?>'><?php echo $lang->programplan->attribute;?></th>
|
||||
<th class='c-acl <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>'><?php echo $lang->programplan->acl;?></th>
|
||||
<th class='w-110px <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>'><?php echo $lang->programplan->milestone;?></th>
|
||||
<th class='c-date required'><?php echo $lang->programplan->begin;?></th>
|
||||
<th class='c-date required'><?php echo $lang->programplan->end;?></th>
|
||||
<th class='c-date <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>'><?php echo $lang->programplan->realBegan;?></th>
|
||||
<th class='c-date <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>'><?php echo $lang->programplan->realEnd;?></th>
|
||||
<th class='w-110px <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>'><?php echo $lang->programplan->milestone;?></th>
|
||||
<th class='c-desc <?php echo zget($visibleFields, 'desc', ' hidden') . zget($requiredFields, 'desc', '', ' required');?>'><?php echo $lang->programplan->desc;?></th>
|
||||
<?php if($this->config->edition == 'max' and $executionType == 'stage'):?>
|
||||
<th class='w-110px'><?php echo $lang->programplan->output;?></th>
|
||||
<?php endif;?>
|
||||
<?php if($project->model != 'ipd'):?>
|
||||
<th class="c-action text-center w-110px"> <?php echo $lang->actions;?></th>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class='sortable'>
|
||||
@@ -122,21 +121,33 @@
|
||||
<span class='input-group-addon'>%</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class='<?php echo $hideAttribute . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $attrAlign;?>'><?php echo $enableOptionalAttr ? html::select("attributes[$i]", $lang->stage->typeList, $stage->type, "class='form-control'") : zget($lang->stage->typeList, $programPlan->attribute);?></td>
|
||||
<td class='<?php echo $hideAttribute . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $attrAlign;?>'>
|
||||
<?php
|
||||
if($enableOptionalAttr)
|
||||
{
|
||||
$disabled = $project->model == 'ipd' ? 'disabled' : '';
|
||||
echo html::select("attributes[$i]", $project->model == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList, $stage->type, "class='form-control' $disabled");
|
||||
if($project->model == 'ipd') echo html::hidden("attributes[$i]", $stage->type);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $project->model == 'ipd' ? zget($lang->stage->ipdTypeList, $programPlan->attribute) : zget($lang->stage->typeList, $programPlan->attribute);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class='<?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>'><?php echo html::select("acl[$i]", $lang->execution->aclList, 'open', "class='form-control' $class");?></td>
|
||||
<td class='text-center' <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
|
||||
<td><input type='text' name='begin[<?php echo $i;?>]' id='begin<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<td><input type='text' name='end[<?php echo $i;?>]' id='end<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='realBegan[<?php echo $i;?>]' id='realBegan<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<?php if($this->config->edition == 'max' and $executionType == 'stage'):?>
|
||||
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control picker-select' data-drop-width='auto' multiple");?></td>
|
||||
<?php endif;?>
|
||||
<td class='text-center' <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
|
||||
<?php if($project->model != 'ipd'):?>
|
||||
<td class='c-actions text-center'>
|
||||
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
|
||||
<button type="button" class='btn btn-link btn-sm btn-icon btn-move'><i class='icon-move'></i></button>
|
||||
<a href='javascript:;' onclick='deleteItem(this)' class='btn btn-link'><i class='icon icon-close'></i></a>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
<?php endforeach;?>
|
||||
@@ -158,28 +169,40 @@
|
||||
<span class='input-group-addon'>%</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class='<?php echo $hideAttribute . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $attrAlign;?>'><?php echo $enableOptionalAttr ? html::select("attributes[$i]", $lang->stage->typeList, $plan->attribute, "class='form-control'") : zget($lang->stage->typeList, $programPlan->attribute);?></td>
|
||||
<td class='<?php echo $hideAttribute . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $attrAlign;?>'>
|
||||
<?php
|
||||
if($enableOptionalAttr)
|
||||
{
|
||||
$disabled = $project->model == 'ipd' ? 'disabled' : '';
|
||||
echo html::select("attributes[$i]", $project->model == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList, $plan->attribute, "class='form-control' $disabled");
|
||||
if($project->model == 'ipd') echo html::hidden("attributes[$i]", $plan->attribute);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $project->model == 'ipd' ? zget($lang->stage->ipdTypeList, $programPlan->attribute) : zget($lang->stage->typeList, $programPlan->attribute);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>><?php echo html::select("acl[$i]", $lang->execution->aclList, $plan->acl, "class='form-control' $class");?></td>
|
||||
<td class='text-center' <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, $plan->milestone, $disabled);?></td>
|
||||
<td><input type='text' name='begin[<?php echo $i;?>] ' id='begin<?php echo $i;?>' value='<?php echo $plan->begin;?>' class='form-control form-date' /></td>
|
||||
<td><input type='text' name='end[<?php echo $i;?>]' id='end<?php echo $i;?>' value='<?php echo $plan->end;?>' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='realBegan[<?php echo $i;?>] ' id='realBegan<?php echo $i;?>' value='<?php echo $plan->realBegan;?>' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='<?php echo $plan->realEnd;?>' class='form-control form-date' /></td>
|
||||
<td class='text-center' <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, $plan->milestone, $disabled);?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'desc', 'hidden')?>'><?php echo html::textarea("desc[$i]", $plan->desc, "rows='1' class='form-control autosize'");?></td>
|
||||
<?php if($this->config->edition == 'max' and $executionType == 'stage'):?>
|
||||
<?php $option = empty($plan->output) ? 0 : explode(',', $plan->output);?>
|
||||
<td><?php echo html::select("output[$i][]", $documentList, $option, "class='form-control picker-select' data-drop-width='auto' multiple");?></td>
|
||||
<?php endif;?>
|
||||
<?php if($project->model != 'ipd'):?>
|
||||
<td class='c-actions text-center'>
|
||||
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
|
||||
<button type="button" class='btn btn-link btn-sm btn-icon btn-move'><i class='icon-move'></i></button>
|
||||
<a href='javascript:;' onclick='deleteItem(this)' class='invisible btn btn-link'><i class='icon icon-close'></i></a>
|
||||
<?php echo html::hidden('orders[]', $plan->order);?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
<?php if($project->model != 'ipd' or $planID):?>
|
||||
<?php for($j = 0; $j < 5; $j ++):?>
|
||||
<tr class='addedItem'>
|
||||
<td class='<?php echo $typeClass;?>'><?php echo html::select("type[$i]", $lang->execution->typeList, '', "class='form-control chosen'");?></td>
|
||||
@@ -194,17 +217,14 @@
|
||||
<span class='input-group-addon'>%</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class='<?php echo $hideAttribute . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $attrAlign;?>'><?php echo $enableOptionalAttr ? html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'") : zget($lang->stage->typeList, $programPlan->attribute);?></td>
|
||||
<td class='<?php echo $hideAttribute . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $attrAlign;?>'><?php echo $enableOptionalAttr ? html::select("attributes[$i]", $project->model == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList, '', "class='form-control'") : ($project->model == 'ipd' ? zget($lang->stage->ipdTypeList, $programPlan->attribute) : zget($lang->stage->typeList, $programPlan->attribute));?></td>
|
||||
<td <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>><?php echo html::select("acl[$i]", $lang->execution->aclList, empty($programPlan) ? 'open' : $programPlan->acl, "class='form-control' $class");?></td>
|
||||
<td class='text-center' <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
|
||||
<td><input type='text' name='begin[<?php echo $i;?>] ' id='begin<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<td><input type='text' name='end[<?php echo $i;?>]' id='end<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='realBegan[<?php echo $i;?>] ' id='realBegan<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='realEnd[<?php echo $i;?>]' id='realEnd<?php echo $i;?>' value='' class='form-control form-date' /></td>
|
||||
<td class='text-center' <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'desc', 'hidden')?>'><?php echo html::textarea("desc[$i]", '', "rows='1' class='form-control autosize'");?></td>
|
||||
<?php if($this->config->edition == 'max' and $executionType == 'stage'):?>
|
||||
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control picker-select' data-drop-width='auto' multiple");?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-actions text-center'>
|
||||
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
|
||||
<button type="button" class='btn btn-link btn-sm btn-icon btn-move'><i class='icon-move'></i></button>
|
||||
@@ -213,6 +233,7 @@
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
<?php endfor;?>
|
||||
<?php endif;?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
@@ -244,17 +265,14 @@
|
||||
<span class='input-group-addon'>%</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class='<?php echo $hideAttribute . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $attrAlign;?>'><?php echo $enableOptionalAttr ? html::select("attributes[$i]", $lang->stage->typeList, '', "class='form-control'") : zget($lang->stage->typeList, $programPlan->attribute);?></td>
|
||||
<td class='<?php echo $hideAttribute . zget($requiredFields, 'attribute', '', ' required');?> <?php echo $attrAlign;?>'><?php echo $enableOptionalAttr ? html::select("attributes[$i]", $project->model == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList, '', "class='form-control'") : ($project->model == 'ipd' ? zget($lang->stage->ipdTypeList, $programPlan->attribute) : zget($lang->stage->typeList, $programPlan->attribute));?></td>
|
||||
<td <?php echo zget($visibleFields, 'acl', ' hidden') . zget($requiredFields, 'acl', '', ' required');?>><?php echo html::select("acl[$i]", $lang->execution->aclList, empty($programPlan) ? 'open' : $programPlan->acl, "class='form-control' $class");?></td>
|
||||
<td class='text-center' <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
|
||||
<td><input type='text' name='<?php echo "begin[$i]";?>' id='begin<?php echo $i;?>' class='form-control form-date' /></td>
|
||||
<td><input type='text' name='<?php echo "end[$i]";?>' id='end<?php echo $i;?>' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realBegan', ' hidden') . zget($requiredFields, 'realBegan', '', ' required');?>><input type='text' name='<?php echo "realBegan[$i]";?>' id='realBegan<?php echo $i;?>' class='form-control form-date' /></td>
|
||||
<td <?php echo zget($visibleFields, 'realEnd', ' hidden') . zget($requiredFields, 'realEnd', '', ' required');?>><input type='text' name='<?php echo "realEnd[$i]";?>' id='realEnd<?php echo $i;?>' class='form-control form-date' /></td>
|
||||
<td class='text-center' <?php echo zget($visibleFields, 'milestone', ' hidden') . zget($requiredFields, 'milestone', '', ' required');?>><?php echo html::radio("milestone[$i]", $lang->programplan->milestoneList, 0);?></td>
|
||||
<td class='<?php echo zget($visibleFields, 'desc', 'hidden')?>'><?php echo html::textarea("desc[$i]", '', "rows='1' class='form-control autosize'");?></td>
|
||||
<?php if($this->config->edition == 'max' and $executionType == 'stage'):?>
|
||||
<td><?php echo html::select("output[$i][]", $documentList, '', "class='form-control' data-drop-width='auto' multiple");?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-actions text-center'>
|
||||
<a href='javascript:;' onclick='addItem(this)' class='btn btn-link'><i class='icon-plus'></i></a>
|
||||
<button type="button" class='btn btn-link btn-sm btn-icon btn-move'><i class='icon-move'></i></button>
|
||||
|
||||
@@ -13,10 +13,11 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php js::set('plan', $plan);?>
|
||||
<?php js::set('stageTypeList', $lang->stage->typeList);?>
|
||||
<?php js::set('stageTypeList', $project->model == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList);?>
|
||||
<?php js::set('changeAttrLang', $lang->programplan->confirmChangeAttr);?>
|
||||
<?php js::set('isTopStage', $isTopStage);?>
|
||||
<?php js::set('isLeafStage', $isLeafStage);?>
|
||||
<?php js::set('projectModel', $project->model);?>
|
||||
<div id="mainContent" class="main-content fade">
|
||||
<div class="center-block">
|
||||
<div class="main-header">
|
||||
@@ -60,10 +61,25 @@
|
||||
<tr id="attributeType">
|
||||
<th><?php echo $lang->programplan->attribute;?></th>
|
||||
<td colspan='2'>
|
||||
<?php echo $enableOptionalAttr ? html::select('attribute', $lang->stage->typeList, $plan->attribute, "class='form-control'") : zget($lang->stage->typeList, $plan->attribute);?>
|
||||
<?php
|
||||
if($project->model == 'ipd')
|
||||
{
|
||||
echo zget($lang->stage->ipdTypeList, $plan->attribute);
|
||||
}
|
||||
elseif($enableOptionalAttr)
|
||||
{
|
||||
echo html::select('attribute', $lang->stage->typeList, $plan->attribute, "class='form-control'");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo zget($lang->stage->typeList, $plan->attribute);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if($project->model != 'ipd'):?>
|
||||
<icon class='icon icon-help' data-toggle='popover' data-trigger='focus hover' data-placement='right' data-tip-class='text-muted popover-sm' data-content="<?php echo $lang->execution->typeTip;?>"></icon>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php if($plan->setMilestone):?>
|
||||
|
||||
@@ -12,16 +12,27 @@
|
||||
?>
|
||||
<?php chdir(__DIR__);?>
|
||||
<?php include '../../common/view/gantt.html.php';?>
|
||||
<?php if(isset($project) and $project->model == 'ipd') js::set('reviewPoints', json_encode($reviewPoints));?>
|
||||
<?php js::set('projectID', $projectID);?>
|
||||
<style>
|
||||
.submitBtn{display:none}
|
||||
.gantt_row_task:hover .submitBtn{ display: inline-block;}
|
||||
.editDeadline {display: none; line-height: normal !important; padding: 2px 6px; color: #fff !important;}
|
||||
td:hover > .editDeadline {display: inline-block !important;}
|
||||
.gantt_tree_content table {width: 100%;}
|
||||
.gantt_tree_content table td {padding: 0 !important;}
|
||||
#ganttView {height: 600px;}
|
||||
#mainContent:before {background: #fff;}
|
||||
.checkbox-primary {margin-top: 0px; margin-left: 10px;}
|
||||
form {display: block; margin-top: 0em; margin-block-end: 1em;}
|
||||
.gantt_task_content span.task-label, .gantt_task_content span.label-pri{display: none;}
|
||||
.gantt_task_content .icon-seal{display: none;}
|
||||
#ganttPris > span {display: inline-block; line-height: 20px; min-width: 20px; border-radius: 2px;}
|
||||
.gantt_task_line.gantt_selected {box-shadow: 0 1px 1px rgba(0,0,0,.05), 0 2px 6px 0 rgba(0,0,0,.045)}
|
||||
.gantt_link_arrow_right {border-left-color: #2196F3;}
|
||||
.gantt_link_arrow_left {border-right-color: #2196F3;}
|
||||
.icon-confirm {color: #18a6fd; font-size: 18px;}
|
||||
.icon-seal{font-size: 18px;}
|
||||
.gantt_task_link .gantt_line_wrapper div{background-color: #2196F3;}
|
||||
.gantt_critical_link .gantt_line_wrapper>div {background-color: #e63030 !important;}
|
||||
.gantt_critical_link.start_to_start .gantt_link_arrow_right {border-left-color: #e63030 !important;}
|
||||
@@ -40,9 +51,10 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
|
||||
.gantt_task_link.start_to_finish .gantt_line_wrapper div { background-color: #975000; }
|
||||
.gantt_task_link.start_to_finish:hover .gantt_line_wrapper div { box-shadow: 0 0 5px 0px #975000; }
|
||||
.gantt_task_link.start_to_finish .gantt_link_arrow_left { border-right-color: #975000; }
|
||||
.gantt_grid_head_owner_id {text-align: left}
|
||||
.gantt_critical_task{background:#e63030 !important; border-color:#9d3a3a !important;}
|
||||
.gantt_marker .gantt_marker_content {left: -15px; background-color: #f51e1e;}
|
||||
.gantt_row.task-item{cursor: pointer;}
|
||||
.gantt_row{cursor: pointer;}
|
||||
|
||||
#ganttDownload, #ganttHeader {display: none;}
|
||||
#ganttContainer {margin-top: 40px;}
|
||||
@@ -82,6 +94,7 @@ form {display: block; margin-top: 0em; margin-block-end: 1em;}
|
||||
<?php js::set('showFields', $this->config->programplan->ganttCustom->ganttFields);?>
|
||||
<?php js::set('canGanttEdit', common::hasPriv('programplan', 'ganttEdit'));?>
|
||||
<?php js::set('zooming', isset($zooming) ? $zooming : 'day');?>
|
||||
<?php js::set('canEditDeadline', common::hasPriv('review', 'edit'));?>
|
||||
<div id='mainContent' class='main-content load-indicator' data-loading='<?php echo $lang->programplan->exporting;?>'>
|
||||
<?php if($this->app->getModuleName() == 'programplan'):?>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
@@ -484,7 +497,7 @@ function validateResources(id)
|
||||
flag = true;
|
||||
|
||||
/* Check status. */
|
||||
if(status !== statusLang)
|
||||
if(status !== statusLang && type != 'point')
|
||||
{
|
||||
if(type == 'task')
|
||||
{
|
||||
@@ -502,9 +515,27 @@ function validateResources(id)
|
||||
return false;
|
||||
}
|
||||
|
||||
task.begin = from;
|
||||
task.deadline = (new Date(to.valueOf() - 1));;
|
||||
|
||||
gantt.updateTask(task.id);
|
||||
var itemID;
|
||||
if(type == 'task')
|
||||
{
|
||||
itemID = task.id.split("-")[1];
|
||||
}
|
||||
else if(type == 'plan')
|
||||
{
|
||||
itemID = task.id;
|
||||
}
|
||||
else if(type == 'point')
|
||||
{
|
||||
itemID = task.id.split("-")[2];
|
||||
}
|
||||
|
||||
/* Check data. */
|
||||
var postData = {
|
||||
'id' : type == 'task' ? task.id.split("-")[1] : task.id,
|
||||
'id' : itemID,
|
||||
'startDate' : from.toLocaleDateString('en-CA'),
|
||||
'endDate' : to.toLocaleDateString('en-CA'),
|
||||
'type' : type
|
||||
@@ -583,10 +614,11 @@ $(function()
|
||||
|
||||
gantt.config.columns = [];
|
||||
gantt.config.columns.push({name: 'text', width: '*', tree: true, resize: true, min_width:120, width:200});
|
||||
if(showFields.indexOf('PM') != -1) gantt.config.columns.push({name: 'owner_id', align: 'center', resize: true, width: 80, template: function(task){return getByIdForGantt(gantt.serverList('userList'), task.owner_id)}})
|
||||
gantt.config.columns.push({name:"custom", label:"", align: "left", width: 40, template: getSubmitBtn});
|
||||
if(showFields.indexOf('PM') != -1) gantt.config.columns.push({name: 'owner_id', align: 'left', resize: true, width: 80, template: function(task){return getByIdForGantt(gantt.serverList('userList'), task.owner_id)}})
|
||||
if(showFields.indexOf('status') != -1) gantt.config.columns.push({name: 'status', align: 'center', resize: true, width: 80});
|
||||
gantt.config.columns.push({name: 'start_date', align: 'center', resize: true, width: 80});
|
||||
if(showFields.indexOf('deadline') != -1) gantt.config.columns.push({name: 'end_date', align: 'center', resize: true, width: 80});
|
||||
gantt.config.columns.push({name: 'begin', align: 'center', resize: true, width: 80});
|
||||
if(showFields.indexOf('deadline') != -1) gantt.config.columns.push({name: 'deadline', align: 'center', resize: true, width: 140, template: getDeadlineBtn});
|
||||
gantt.config.columns.push({name: 'duration', align: 'center', resize: true, width: 60});
|
||||
if(showFields.indexOf('estimate') != -1) gantt.config.columns.push({name: 'estimate', align: 'center', resize: true, width: 60});
|
||||
if(showFields.indexOf('progress') != -1) gantt.config.columns.push({name: 'percent', align: 'center', resize: true, width:70, template: function(plan){ if(plan.percent) return Math.round(plan.percent) + '%';}});
|
||||
@@ -597,10 +629,24 @@ $(function()
|
||||
if(showFields.indexOf('delay') != -1) gantt.config.columns.push({name: 'delay', align: 'center', resize: true, width: 60});
|
||||
if(showFields.indexOf('delayDays') != -1) gantt.config.columns.push({name: 'delayDays', align: 'center', resize: false, width: 60});
|
||||
|
||||
function getDeadlineBtn(task)
|
||||
{
|
||||
console.log(task);
|
||||
var date = task.deadline;
|
||||
if(task.type == 'point' && canEditDeadline && (!task.rawStatus || task.rawStatus == 'fail' || task.rawStatus == 'draft')) return "<table><tr><td><span class='deadline'>" + gridDateToStr(new Date(date.valueOf() - 1)) + '</span> <a class="btn btn-primary editDeadline" title="<?php echo $lang->programplan->edit;?>"><i class="icon-common-edit icon-edit"></i> <?php echo $lang->programplan->edit;?></a></td></tr></table>';
|
||||
return date;
|
||||
}
|
||||
|
||||
function getSubmitBtn(task)
|
||||
{
|
||||
if(task.type == 'point' && !task.rawStatus) return '<button class="btn btn-link submitBtn" title="<?php echo $lang->programplan->submit;?>"><i class="icon-confirm"></i></button>';
|
||||
}
|
||||
|
||||
gantt.templates.task_end_date = function(data)
|
||||
{
|
||||
return gantt.templates.task_date(new Date(date.valueOf() - 1));
|
||||
}
|
||||
|
||||
var gridDateToStr = gantt.date.date_to_str("%Y-%m-%d");
|
||||
gantt.templates.grid_date_format = function(date, column)
|
||||
{
|
||||
@@ -623,7 +669,9 @@ $(function()
|
||||
gantt.locale.labels.column_status = "<?php echo $lang->statusAB;?>";
|
||||
gantt.locale.labels.column_percent = "<?php echo $lang->programplan->percentAB;?>";
|
||||
gantt.locale.labels.column_taskProgress = "<?php echo $lang->programplan->taskProgress;?>";
|
||||
gantt.locale.labels.column_begin = "<?php echo $lang->programplan->begin;?>";
|
||||
gantt.locale.labels.column_start_date = "<?php echo $lang->programplan->begin;?>";
|
||||
gantt.locale.labels.column_deadline = "<?php echo $lang->programplan->end;?>";
|
||||
gantt.locale.labels.column_end_date = "<?php echo $lang->programplan->end;?>";
|
||||
gantt.locale.labels.column_realBegan = "<?php echo $lang->programplan->realBegan;?>";
|
||||
gantt.locale.labels.column_realEnd = "<?php echo $lang->programplan->realEnd;?>";
|
||||
@@ -649,12 +697,10 @@ $(function()
|
||||
gantt.templates.rightside_text = function(start, end, task)
|
||||
{
|
||||
if(typeof task.owner_id == 'undefined') return;
|
||||
if(task.type == 'point') return "<span class='status-" + task.rawStatus + "'>" + task.status + '</span>';
|
||||
return getByIdForGantt(gantt.serverList('userList'), task.owner_id);
|
||||
};
|
||||
gantt.templates.grid_row_class = function (start, end, task)
|
||||
{
|
||||
if(task.type == 'task') return 'task-item';
|
||||
};
|
||||
|
||||
gantt.templates.link_class = function(link)
|
||||
{
|
||||
var types = gantt.config.links;
|
||||
@@ -663,9 +709,10 @@ $(function()
|
||||
if(link.type == types.finish_to_finish) return 'finish_to_finish';
|
||||
if(link.type == types.start_to_finish) return 'start_to_finish';
|
||||
};
|
||||
|
||||
gantt.templates.tooltip_text = function (start, end, task)
|
||||
{
|
||||
return task.text;
|
||||
if(task.type != 'point') return task.text;
|
||||
};
|
||||
|
||||
gantt.attachEvent('onTemplatesReady', function()
|
||||
@@ -681,6 +728,12 @@ $(function()
|
||||
});
|
||||
});
|
||||
|
||||
gantt.attachEvent("onBeforeTaskMove", function(id, mode, e)
|
||||
{
|
||||
task = gantt.getTask(id);
|
||||
if(task.type == 'point') return false;
|
||||
});
|
||||
|
||||
var isGanttExpand = false;
|
||||
var delayTimer = null;
|
||||
var handleFullscreen = function()
|
||||
@@ -737,7 +790,79 @@ $(function()
|
||||
var taskModalTrigger = new $.zui.ModalTrigger({type: 'iframe', width: '95%'});
|
||||
gantt.attachEvent('onTaskClick', function(id, e)
|
||||
{
|
||||
if($(e.srcElement).hasClass('gantt_close') || $(e.srcElement).hasClass('gantt_open')) return false;
|
||||
var editBtn = $(e.srcElement);
|
||||
if(editBtn.hasClass('icon-common-edit'))
|
||||
{
|
||||
editBtn = editBtn.parent();
|
||||
}
|
||||
if(editBtn.hasClass('editDeadline'))
|
||||
{
|
||||
var parentID = id.split("-")[0];
|
||||
var stageEndDate = $("div[data-task-id='" + parentID + "']").find('div[data-column-name="end_date"] > .gantt_tree_content').text();
|
||||
var reviewID = id;
|
||||
var deadlineDate = editBtn.prev().text();
|
||||
|
||||
editBtn.datetimepicker(
|
||||
{
|
||||
weekStart: 1,
|
||||
todayBtn: 1,
|
||||
autoclose: 1,
|
||||
todayHighlight: 1,
|
||||
startView: 2,
|
||||
minView: 2,
|
||||
forceParse: 0,
|
||||
format: "yyyy-mm-dd",
|
||||
startDate: new Date(),
|
||||
endDate: new Date(stageEndDate),
|
||||
initialDate: new Date(deadlineDate),
|
||||
})
|
||||
.on('changeDate', function(ev){
|
||||
var year = ev.date.getFullYear();
|
||||
var month = ev.date.getMonth() + 1;
|
||||
var day = ev.date.getUTCDate();
|
||||
var formattedDate = year + '-' + (month < 10 ? '0' : '') + month + '-' + (day < 10 ? '0' : '') + day;
|
||||
|
||||
$.post(createLink('review', 'ajaxChangeTRDeadline'), {'deadline' : formattedDate, 'id' : reviewID , 'projectID' : projectID}, function()
|
||||
{
|
||||
location.reload();
|
||||
});
|
||||
|
||||
})
|
||||
.on('show', function(){
|
||||
editBtn.css('display', 'inline-block');
|
||||
})
|
||||
.on('hide', function(){
|
||||
editBtn.css('display', 'none');
|
||||
});
|
||||
editBtn.datetimepicker('show');
|
||||
return false;
|
||||
}
|
||||
|
||||
if(editBtn.hasClass('gantt_close') || editBtn.hasClass('gantt_open')) return false;
|
||||
|
||||
var task = gantt.getTask(id);
|
||||
if(task.type == 'point' && task.rawStatus) location.href = createLink('review', 'view', 'reviewID=' + task.reviewID);
|
||||
if(task.type == 'plan' && !task.isParent) window.parent.$.apps.open(createLink('execution', 'task', 'id=' + task.id), 'execution');
|
||||
|
||||
if(editBtn.hasClass('icon-confirm'))
|
||||
{
|
||||
var pointAttr = JSON.parse(reviewPoints);
|
||||
var category = id.split("-")[1];
|
||||
|
||||
if(pointAttr[category]['disabled'])
|
||||
{
|
||||
new $.zui.Messager(pointAttr[category]['message'], {
|
||||
type: 'danger',
|
||||
icon: 'exclamation-sign'
|
||||
}).show();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
location.href = createLink('review', 'create', 'projectID=' + projectID);
|
||||
}
|
||||
}
|
||||
|
||||
if(ganttType == 'assignedTo')
|
||||
{
|
||||
taskID = id;
|
||||
|
||||
Reference in New Issue
Block a user