Merge branch 'sprint/204_tianshujie_57095'
This commit is contained in:
@@ -24,6 +24,12 @@ $(function()
|
||||
{
|
||||
$dropmenu.append("<li><a href='<?php echo $this->createLink('datatable', 'ajaxCustom', 'id=' . $this->moduleName . '&method=' . $this->methodName . '&extra=requirement')?>' data-toggle='modal' data-type='ajax'><?php echo $lang->datatable->custom?></a></li>");
|
||||
}
|
||||
else if(typeof(from) != 'undefined')
|
||||
{
|
||||
<?php $from = isset($from) ? $from : '';?>
|
||||
<?php $from = ($from == 'project' and isset($isStage) and $isStage) ? 'stage' : $from;?>
|
||||
$dropmenu.append("<li><a href='<?php echo $this->createLink('datatable', 'ajaxCustom', 'id=' . $this->moduleName . '&method=' . $this->methodName . "&extra=$from")?>' data-toggle='modal' data-type='ajax'><?php echo $lang->datatable->custom?></a></li>");
|
||||
}
|
||||
else
|
||||
{
|
||||
$dropmenu.append("<li><a href='<?php echo $this->createLink('datatable', 'ajaxCustom', 'id=' . $this->moduleName . '&method=' . $this->methodName)?>' data-toggle='modal' data-type='ajax'><?php echo $lang->datatable->custom?></a></li>");
|
||||
|
||||
@@ -97,6 +97,18 @@ class datatable extends control
|
||||
unset($cols['caseCount']);
|
||||
}
|
||||
|
||||
if($module == 'execution' and $method == 'all')
|
||||
{
|
||||
if($extra == 'execution' or $extra == 'project')
|
||||
{
|
||||
unset($cols['percent']);
|
||||
unset($cols['attribute']);
|
||||
unset($cols['actions']);
|
||||
}
|
||||
|
||||
if($extra == 'project' or $extra == 'stage') unset($cols['project']);
|
||||
}
|
||||
|
||||
$this->view->cols = $cols;
|
||||
$this->view->setting = $setting;
|
||||
$this->display();
|
||||
|
||||
@@ -158,7 +158,7 @@ class datatableModel extends model
|
||||
$title = (isset($col->name) and $col->name) ? "title='$col->name'" : $title;
|
||||
if($id == 'id' and (int)$width < 90) $width = '90px';
|
||||
$align = $id == 'actions' ? 'text-center' : '';
|
||||
$align = in_array($id, array('budget', 'teamCount', 'estimate', 'consume')) ? 'text-right' : $align;
|
||||
$align = in_array($id, array('budget', 'teamCount', 'estimate', 'consume', 'consumed', 'left')) ? 'text-right' : $align;
|
||||
|
||||
$style = '';
|
||||
$data = '';
|
||||
|
||||
@@ -137,3 +137,111 @@ $config->execution->gantt->linkType['end']['begin'] = 0;
|
||||
$config->execution->gantt->linkType['begin']['begin'] = 1;
|
||||
$config->execution->gantt->linkType['end']['end'] = 2;
|
||||
$config->execution->gantt->linkType['begin']['end'] = 3;
|
||||
|
||||
$config->execution->datatable = new stdclass();
|
||||
$config->execution->datatable->defaultField = array('id', 'name', 'code', 'project', 'PM', 'status', 'progress', 'begin', 'end', 'estimate', 'consumed', 'left', 'burn');
|
||||
|
||||
$config->execution->datatable->fieldList['id']['title'] = 'idAB';
|
||||
$config->execution->datatable->fieldList['id']['fixed'] = 'left';
|
||||
$config->execution->datatable->fieldList['id']['width'] = '70';
|
||||
$config->execution->datatable->fieldList['id']['required'] = 'yes';
|
||||
|
||||
$config->execution->datatable->fieldList['name']['title'] = 'name';
|
||||
$config->execution->datatable->fieldList['name']['fixed'] = 'left';
|
||||
$config->execution->datatable->fieldList['name']['width'] = 'auto';
|
||||
$config->execution->datatable->fieldList['name']['required'] = 'yes';
|
||||
|
||||
$config->execution->datatable->fieldList['code']['title'] = 'code';
|
||||
$config->execution->datatable->fieldList['code']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['code']['width'] = '90';
|
||||
$config->execution->datatable->fieldList['code']['required'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['project']['title'] = 'project';
|
||||
$config->execution->datatable->fieldList['project']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['project']['width'] = '100';
|
||||
$config->execution->datatable->fieldList['project']['required'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['PM']['title'] = 'owner';
|
||||
$config->execution->datatable->fieldList['PM']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['PM']['width'] = '70';
|
||||
$config->execution->datatable->fieldList['PM']['required'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['status']['title'] = 'status';
|
||||
$config->execution->datatable->fieldList['status']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['status']['width'] = '80';
|
||||
$config->execution->datatable->fieldList['status']['required'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['progress']['title'] = 'progress';
|
||||
$config->execution->datatable->fieldList['progress']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['progress']['width'] = '40';
|
||||
$config->execution->datatable->fieldList['progress']['required'] = 'no';
|
||||
$config->execution->datatable->fieldList['progress']['sort'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['percent']['title'] = 'percent';
|
||||
$config->execution->datatable->fieldList['percent']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['percent']['width'] = '80';
|
||||
$config->execution->datatable->fieldList['percent']['required'] = 'no';
|
||||
$config->execution->datatable->fieldList['percent']['sort'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['attribute']['title'] = 'attribute';
|
||||
$config->execution->datatable->fieldList['attribute']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['attribute']['width'] = '80';
|
||||
$config->execution->datatable->fieldList['attribute']['required'] = 'no';
|
||||
$config->execution->datatable->fieldList['attribute']['sort'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['openedDate']['title'] = 'openedDate';
|
||||
$config->execution->datatable->fieldList['openedDate']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['openedDate']['width'] = '85';
|
||||
$config->execution->datatable->fieldList['openedDate']['required'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['begin']['title'] = 'begin';
|
||||
$config->execution->datatable->fieldList['begin']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['begin']['width'] = '85';
|
||||
$config->execution->datatable->fieldList['begin']['required'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['end']['title'] = 'end';
|
||||
$config->execution->datatable->fieldList['end']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['end']['width'] = '85';
|
||||
$config->execution->datatable->fieldList['end']['required'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['realBegan']['title'] = 'realBegan';
|
||||
$config->execution->datatable->fieldList['realBegan']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['realBegan']['width'] = '90';
|
||||
$config->execution->datatable->fieldList['realBegan']['required'] = 'no';
|
||||
$config->execution->datatable->fieldList['realBegan']['sort'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['realEnd']['title'] = 'realEnd';
|
||||
$config->execution->datatable->fieldList['realEnd']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['realEnd']['width'] = '90';
|
||||
$config->execution->datatable->fieldList['realEnd']['required'] = 'no';
|
||||
$config->execution->datatable->fieldList['realEnd']['sort'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['estimate']['title'] = 'estimate';
|
||||
$config->execution->datatable->fieldList['estimate']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['estimate']['width'] = '70';
|
||||
$config->execution->datatable->fieldList['estimate']['required'] = 'no';
|
||||
$config->execution->datatable->fieldList['estimate']['sort'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['consumed']['title'] = 'consumed';
|
||||
$config->execution->datatable->fieldList['consumed']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['consumed']['width'] = '70';
|
||||
$config->execution->datatable->fieldList['consumed']['required'] = 'no';
|
||||
$config->execution->datatable->fieldList['consumed']['sort'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['left']['title'] = 'left';
|
||||
$config->execution->datatable->fieldList['left']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['left']['width'] = '70';
|
||||
$config->execution->datatable->fieldList['left']['required'] = 'no';
|
||||
$config->execution->datatable->fieldList['left']['sort'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['burn']['title'] = 'burn';
|
||||
$config->execution->datatable->fieldList['burn']['fixed'] = 'no';
|
||||
$config->execution->datatable->fieldList['burn']['width'] = '80';
|
||||
$config->execution->datatable->fieldList['burn']['required'] = 'no';
|
||||
$config->execution->datatable->fieldList['burn']['sort'] = 'no';
|
||||
|
||||
$config->execution->datatable->fieldList['actions']['title'] = 'actions';
|
||||
$config->execution->datatable->fieldList['actions']['fixed'] = 'right';
|
||||
$config->execution->datatable->fieldList['actions']['width'] = '180';
|
||||
$config->execution->datatable->fieldList['actions']['required'] = 'yes';
|
||||
$config->execution->datatable->fieldList['actions']['sort'] = 'no';
|
||||
|
||||
@@ -3426,6 +3426,7 @@ class execution extends control
|
||||
$this->app->loadLang('product');
|
||||
$this->app->loadLang('stage');
|
||||
$this->app->loadLang('programplan');
|
||||
$this->loadModel('datatable');
|
||||
|
||||
$from = $this->app->tab;
|
||||
if($from == 'execution') $this->session->set('executionList', $this->app->getURI(true), 'execution');
|
||||
@@ -3475,6 +3476,16 @@ class execution extends control
|
||||
$parents = array();
|
||||
if($parentIdList) $parents = $this->execution->getByIdList($parentIdList);
|
||||
|
||||
$isStage = (isset($project->model) and $project->model == 'waterfall') ? true : false;
|
||||
if($isStage)
|
||||
{
|
||||
$this->config->execution->datatable->defaultField = array('id', 'name', 'PM', 'status', 'progress', 'percent', 'attribute', 'begin', 'end', 'realBegan', 'realEnd', 'actions');
|
||||
}
|
||||
elseif($this->app->tab == 'project')
|
||||
{
|
||||
$this->config->execution->datatable->defaultField = array('id', 'name', 'code', 'PM', 'status', 'progress', 'begin', 'end', 'estimate', 'consumed', 'left', 'burn');
|
||||
}
|
||||
|
||||
$this->view->executionStats = $executionStats;
|
||||
$this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID);
|
||||
$this->view->productID = $productID;
|
||||
@@ -3486,7 +3497,7 @@ class execution extends control
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->status = $status;
|
||||
$this->view->from = $from;
|
||||
$this->view->isStage = (isset($project->model) and $project->model == 'waterfall') ? true : false;
|
||||
$this->view->isStage = $isStage;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
body {margin-bottom: 25px;}
|
||||
#product_chosen .chosen-single {width: 180px;}
|
||||
|
||||
.table-children {border-left: 2px solid #cbd0db; border-right: 2px solid #cbd0db;}
|
||||
@@ -12,22 +13,21 @@
|
||||
.table th.hours {padding-right: 8px !important;}
|
||||
.main-table tbody > tr.table-children > td:first-child::before {width: 3px;}
|
||||
td.hours {text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
|
||||
td.flex {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center;}
|
||||
td.flex {display: flex; flex-flow: row nowrap; justify-content: flex-start; align-items: center; margin-bottom: -2px;}
|
||||
td.flex span.label-badge {margin-left: 5px; min-width: 50px;}
|
||||
td.flex span.label-badge.label-light {min-width: 22px;}
|
||||
td.flex span.project-type-label {margin-left: 5px; min-width: 36px;}
|
||||
@-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;}}
|
||||
|
||||
.c-status, .c-date, .c-percent, .c-attribute, .c-end, .c-begin {width: 80px;}
|
||||
.c-estimate, .c-consumed, .c-left, .c-pm {width: 70px;}
|
||||
.c-progress {width: 40px;}
|
||||
.c-burn {width: 60px;}
|
||||
.c-percent, .c-realBegan, .c-realEnd{width: 90px;}
|
||||
.c-code {width: 140px;}
|
||||
.c-name > span {margin-right: 2px;}
|
||||
td.flex span.project-type-label {min-width: 40px;}
|
||||
|
||||
.label-children {min-width:22px !important;}
|
||||
.c-name > a, .table-children .text-left > a {padding-left: 5px;}
|
||||
.has-child > span {margin-right: 5px;}
|
||||
.c-name > .text-ellipsis {text-overflow: clip}
|
||||
.c-name > .text-ellipsis {text-overflow: clip;}
|
||||
.c-code, .c-project {overflow: hidden; white-space: nowrap;}
|
||||
|
||||
.c-project{text-overflow: unset !important;}
|
||||
canvas {height: 28px;}
|
||||
.parent.has-child.c-name.flex, .table-child-bottom > .c-name.flex {border-bottom: 1px solid #cbd0db;}
|
||||
|
||||
@@ -6,6 +6,43 @@ $(function()
|
||||
for(i = 0; i < data.list.length; i++) list += $(data.list[i].item).attr('data-id') + ',';
|
||||
$.post(createLink('execution', 'updateOrder'), {'executions' : list, 'orderBy' : orderBy});
|
||||
});
|
||||
|
||||
var nameWidth = $('#executionsForm thead th.c-name').width();
|
||||
if(nameWidth < 150 && !useDatatable) $('#executionsForm thead th.c-name').css('width', '150px');
|
||||
|
||||
toggleFold('#executionsForm', unfoldExecutions, projectID, 'execution');
|
||||
|
||||
$('.table td.has-child > .plan-toggle').each(function()
|
||||
{
|
||||
var fold = $(this).hasClass('collapsed');
|
||||
var parentID = $(this).closest('tr').attr('data-id');
|
||||
if(fold)
|
||||
{
|
||||
$('.parent-' + parentID).hide();
|
||||
$(this).closest('td').removeClass('parent');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('.parent-' + parentID).show();
|
||||
$(this).closest('td').addClass('parent');
|
||||
}
|
||||
});
|
||||
|
||||
/* Expand and fold substages. */
|
||||
$('.table td.has-child > .plan-toggle').click(function()
|
||||
{
|
||||
var parentID = $(this).closest('tr').attr('data-id');
|
||||
$('.parent-' + parentID).toggle();
|
||||
|
||||
if($('.parent-' + parentID).css('display') == 'none')
|
||||
{
|
||||
$(this).closest('td').removeClass('parent');
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).closest('td').addClass('parent');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function byProduct(productID, projectID, status)
|
||||
|
||||
@@ -4147,4 +4147,170 @@ class executionModel extends model
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
/**
|
||||
* printCell
|
||||
*
|
||||
* @param object $col
|
||||
* @param object $execution
|
||||
* @param array $users
|
||||
* @param string $mode
|
||||
* @param bool $isStage
|
||||
* @param int $productID
|
||||
* @param bool $child
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function printCell($col, $execution, $users, $mode = 'datatable', $isStage = false, $productID = 0, $child = false)
|
||||
{
|
||||
$canBatchEdit = common::hasPriv('execution', 'batchEdit');
|
||||
$id = $col->id;
|
||||
$onlyChildStage = ($execution->grade == 2 and $execution->project != $execution->parent);
|
||||
|
||||
if(!$isStage and $col->id == 'actions') return;
|
||||
if(($this->config->systemMode == 'classic' or ($this->config->systemMode == 'new' and $this->app->tab != 'execution')) and $col->id == 'project') return;
|
||||
|
||||
if($col->show)
|
||||
{
|
||||
$class = "c-{$id}";
|
||||
|
||||
if($id == 'id') $class .= ' cell-id';
|
||||
if($id == 'name') $class .= ' text-left flex';
|
||||
if($id == 'code') $class .= ' text-left';
|
||||
if($id == 'project') $class .= ' text-left c-name';
|
||||
if($id == 'status') $class .= ' text-center';
|
||||
if($id == 'actions') $class .= ' text-center';
|
||||
|
||||
if($id == 'name' and !$child) $class .= ' sort-handler';
|
||||
if($id == 'name' and !empty($execution->children)) $class .= ' parent';
|
||||
if(in_array($id, array('estimate', 'consumed', 'left'))) $class .= ' hours';
|
||||
|
||||
$title = '';
|
||||
if($id == 'name')
|
||||
{
|
||||
$title = " title='{$execution->name}'";
|
||||
if(!empty($execution->children)) $class .= ' has-child';
|
||||
}
|
||||
|
||||
if($id == 'project') $title = " title='{$execution->projectName}'";
|
||||
if($id == 'code') $title = " title='{$execution->code}'";
|
||||
|
||||
if($id == 'status')
|
||||
{
|
||||
$executionStatus = $this->processStatus('execution', $execution);
|
||||
$title = " title='{$executionStatus}'";
|
||||
}
|
||||
|
||||
if(in_array($id, array('estimate', 'consumed', 'left')))
|
||||
{
|
||||
$totalTitle = 'total' . ucfirst($id);
|
||||
$title .= $execution->hours->{$totalTitle} . $this->lang->execution->workHour;
|
||||
}
|
||||
|
||||
echo "<td class='" . $class . "'" . $title . ">";
|
||||
if($id == 'burn')
|
||||
{
|
||||
$burnValue = join(',', $execution->burns);
|
||||
echo "<span id='spark-{$execution->id}' class='sparkline text-left no-padding' values='$burnValue'></span>";
|
||||
}
|
||||
|
||||
switch($id)
|
||||
{
|
||||
case 'id':
|
||||
if($canBatchEdit)
|
||||
{
|
||||
echo "<div class='checkbox-primary'><input type='checkbox' name='executionIDList[$execution->id]' value='$execution->id' autocomplete='off'/><label></label></div>";
|
||||
}
|
||||
echo printf('%03d', $execution->id);
|
||||
break;
|
||||
case 'name':
|
||||
$label = $execution->type == 'stage' ? 'label-warning' : 'label-info';
|
||||
$executionLink = $execution->projectModel == 'kanban' ? html::a(helper::createLink('execution', 'kanban', 'executionID=' . $execution->id), $execution->name, '', "class='text-ellipsis'") : html::a(helper::createLink('execution', 'task', 'execution=' . $execution->id), $execution->name, '', "class='text-ellipsis'");
|
||||
if(!$onlyChildStage) echo "<span class='project-type-label label label-outline $label'>{$this->lang->execution->typeList[$execution->type]}</span>";
|
||||
if($onlyChildStage) echo "<span class='label label-badge label-light label-children'>{$this->lang->programplan->childrenAB}</span> ";
|
||||
echo !empty($execution->children) ? "<span class='text-ellipsis'>$execution->name</span>" : $executionLink;
|
||||
if(isset($execution->delay)) echo "<span class='label label-danger label-badge'>{$this->lang->execution->delayed}</span> ";
|
||||
if(!empty($execution->children))
|
||||
{
|
||||
echo "<a class='plan-toggle' data-id='$execution->id'><i class='icon icon-angle-double-right'></i></a>";
|
||||
}
|
||||
break;
|
||||
case 'code':
|
||||
echo $execution->code;
|
||||
break;
|
||||
case 'project':
|
||||
echo "<span class='status-execution status-{$execution->projectName}'>{$execution->projectName}</span>";
|
||||
break;
|
||||
case 'PM':
|
||||
echo zget($users, $execution->PM);
|
||||
break;
|
||||
case 'status':
|
||||
echo "<span class='status-execution status-{$execution->status}'>$executionStatus</span>";
|
||||
break;
|
||||
case 'progress':
|
||||
echo html::ring($execution->hours->progress);
|
||||
break;
|
||||
case 'percent':
|
||||
echo $execution->percent . '%';
|
||||
break;
|
||||
case 'attribute':
|
||||
echo zget($this->lang->stage->typeList, $execution->attribute, '');
|
||||
break;
|
||||
case 'begin':
|
||||
echo helper::isZeroDate($execution->begin) ? '' : $execution->begin;
|
||||
break;
|
||||
case 'end':
|
||||
echo helper::isZeroDate($execution->end) ? '' : $execution->end;
|
||||
break;
|
||||
case 'realBegan':
|
||||
echo helper::isZeroDate($execution->realBegan) ? '' : $execution->realBegan;
|
||||
break;
|
||||
case 'realEnd':
|
||||
echo helper::isZeroDate($execution->realEnd) ? '' : $execution->realEnd;
|
||||
break;
|
||||
case 'estimate':
|
||||
echo $execution->hours->totalEstimate . $this->lang->execution->workHourUnit;
|
||||
break;
|
||||
case 'consumed':
|
||||
echo $execution->hours->totalConsumed . $this->lang->execution->workHourUnit;
|
||||
break;
|
||||
case 'left':
|
||||
echo $execution->hours->totalLeft . $this->lang->execution->workHourUnit;
|
||||
break;
|
||||
case 'actions':
|
||||
common::printIcon('execution', 'start', "executionID={$execution->id}", $execution, 'list', '', '', 'iframe', true);
|
||||
$class = !empty($execution->children) ? 'disabled' : '';
|
||||
common::printIcon('task', 'create', "executionID={$execution->id}", $execution, 'list', '', '', $class, false, "data-app='execution'");
|
||||
|
||||
if($execution->grade == 1 && $this->loadModel('programplan')->isCreateTask($execution->id))
|
||||
{
|
||||
common::printIcon('programplan', 'create', "program={$execution->parent}&productID=$productID&planID=$execution->id", $execution, 'list', 'split', '', '', '', '', $this->lang->programplan->createSubPlan);
|
||||
}
|
||||
else
|
||||
{
|
||||
$disabled = ($execution->grade == 2) ? ' disabled' : '';
|
||||
echo common::hasPriv('programplan', 'create') ? html::a('javascript:alert("' . $this->lang->programplan->error->createdTask . '");', '<i class="icon-programplan-create icon-split"></i>', '', 'class="btn ' . $disabled . '"') : '';
|
||||
}
|
||||
|
||||
common::printIcon('programplan', 'edit', "stageID=$execution->id&projectID=$execution->project", $execution, 'list', '', '', 'iframe', true);
|
||||
|
||||
$disabled = !empty($execution->children) ? ' disabled' : '';
|
||||
if($execution->status != 'closed' and common::hasPriv('execution', 'close', $execution))
|
||||
{
|
||||
common::printIcon('execution', 'close', "stageID=$execution->id", $execution, 'list', 'off', 'hiddenwin' , $disabled . ' iframe', true, '', $this->lang->programplan->close);
|
||||
}
|
||||
elseif($execution->status == 'closed' and common::hasPriv('execution', 'activate', $execution))
|
||||
{
|
||||
common::printIcon('execution', 'activate', "stageID=$execution->id", $execution, 'list', 'magic', 'hiddenwin' , $disabled . ' iframe', true, '', $this->lang->programplan->activate);
|
||||
}
|
||||
|
||||
if(common::hasPriv('execution', 'delete', $execution))
|
||||
{
|
||||
common::printIcon('execution', 'delete', "stageID=$execution->id&confirm=no", $execution, 'list', 'trash', 'hiddenwin' , $disabled, '', '', $this->lang->programplan->delete);
|
||||
}
|
||||
break;
|
||||
}
|
||||
echo '</td>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,22 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/sortable.html.php';?>
|
||||
<?php include '../../common/view/datatable.fix.html.php';?>
|
||||
<?php
|
||||
$datatableId = $this->moduleName . ucfirst($this->methodName);
|
||||
$useDatatable = (isset($config->datatable->$datatableId->mode) and $config->datatable->$datatableId->mode == 'datatable');
|
||||
?>
|
||||
<?php js::set('useDatatable', $useDatatable);?>
|
||||
<?php js::set('from', $from);?>
|
||||
<?php js::set('projectID', $projectID);?>
|
||||
<?php
|
||||
/* Set unfold parent executionID. */
|
||||
$unfoldExecutions = isset($config->execution->all->unfoldExecutions) ? json_decode($config->execution->all->unfoldExecutions, true) : array();
|
||||
$unfoldExecutions = zget($unfoldExecutions, $projectID, array());
|
||||
js::set('unfoldExecutions', $unfoldExecutions);
|
||||
js::set('unfoldAll', $lang->execution->treeLevel['all']);
|
||||
js::set('foldAll', $lang->execution->treeLevel['root']);
|
||||
?>
|
||||
<div id='mainMenu' class='clearfix'>
|
||||
<div class='btn-toolbar pull-left'>
|
||||
<?php if($from == 'project'):?>
|
||||
@@ -67,247 +83,81 @@
|
||||
</div>
|
||||
<?php else:?>
|
||||
<?php $canBatchEdit = common::hasPriv('execution', 'batchEdit'); ?>
|
||||
<form class='main-table' id='executionsForm' method='post' action='<?php echo inLink('batchEdit');?>' data-ride='table'>
|
||||
<table class='table has-sort-head table-fixed' id='executionList'>
|
||||
<?php $vars = "status=$status&projectID=$projectID&orderBy=%s&productID=$productID&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";?>
|
||||
<form class='main-table' id='executionsForm' method='post' action='<?php echo inLink('batchEdit');?>' <?php if(!$useDatatable) echo "data-ride='table'";?>>
|
||||
<div class="table-header fixed-right">
|
||||
<nav class="btn-toolbar pull-right setting"></nav>
|
||||
</div>
|
||||
<?php
|
||||
$vars = "status=$status&projectID=$projectID&orderBy=%s&productID=$productID&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}&pageID={$pager->pageID}";
|
||||
if($useDatatable) include '../../common/view/datatable.html.php';
|
||||
else include '../../common/view/tablesorter.html.php';
|
||||
|
||||
$setting = $this->datatable->getSetting('execution');
|
||||
$widths = $this->datatable->setFixedFieldWidth($setting);
|
||||
$columns = 0;
|
||||
?>
|
||||
<?php if(!$useDatatable) echo '<div class="table-responsive">';?>
|
||||
<table class='table has-sort-head<?php if($useDatatable) echo ' datatable';?>' id='executionList' data-fixed-left-width='<?php echo $widths['leftWidth']?>' data-fixed-right-width='<?php echo $widths['rightWidth']?>'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='c-id'>
|
||||
<?php if($canBatchEdit):?>
|
||||
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
|
||||
<label></label>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
|
||||
</th>
|
||||
<th><?php common::printOrderLink('name', $orderBy, $vars, ($from == 'execution' and $config->systemMode == 'new') ? $lang->execution->execName : $lang->execution->name);?></th>
|
||||
<?php if(!$isStage):?>
|
||||
<th class='c-code'><?php common::printOrderLink('code', $orderBy, $vars, ($from == 'execution' and $config->systemMode == 'new') ? $lang->execution->execCode : $lang->execution->code);?></th>
|
||||
<?php endif;?>
|
||||
<?php if($config->systemMode == 'new' and $this->app->tab == 'execution'):?>
|
||||
<th class='c-begin'><?php common::printOrderLink('projectName', $orderBy, $vars, $lang->execution->projectName);?></th></th>
|
||||
<?php endif;?>
|
||||
<th class='c-pm'><?php common::printOrderLink('PM', $orderBy, $vars, $lang->execution->owner);?></th>
|
||||
<th class='c-status'><?php common::printOrderLink('status', $orderBy, $vars, $from == 'execution' ? $lang->execution->execStatus : $lang->execution->status);?></th>
|
||||
<th class='c-progress'><?php echo $lang->execution->progress;?></th>
|
||||
<?php if($isStage):?>
|
||||
<th class='c-percent'><?php common::printOrderLink('percent', $orderBy, $vars, $lang->programplan->percent);?></th>
|
||||
<th class='c-attribute'><?php common::printOrderLink('attribute', $orderBy, $vars, $lang->programplan->attribute);?></th>
|
||||
<th class='c-begin'><?php common::printOrderLink('begin', $orderBy, $vars, $lang->execution->begin);?></th>
|
||||
<th class='c-end'><?php common::printOrderLink('end', $orderBy, $vars, $lang->execution->end);?></th>
|
||||
<th class='c-realBegan'><?php common::printOrderLink('realBegan', $orderBy, $vars, $lang->execution->realBegan);?></th>
|
||||
<th class='c-realEnd'><?php common::printOrderLink('realEnd', $orderBy, $vars, $lang->execution->realEnd);?></th>
|
||||
<th class='c-actions-6 text-center'><?php echo $lang->actions;?></th>
|
||||
<?php else:;?>
|
||||
<th class='c-begin'><?php common::printOrderLink('begin', $orderBy, $vars, $lang->execution->begin);?></th>
|
||||
<th class='c-end'><?php common::printOrderLink('end', $orderBy, $vars, $lang->execution->end);?></th>
|
||||
<th class='c-estimate text-right hours'><?php echo $lang->execution->totalEstimate;?></th>
|
||||
<th class='c-consumed text-right hours'><?php echo $lang->execution->totalConsumed;?></th>
|
||||
<th class='c-left text-right hours'><?php echo $lang->execution->totalLeft;?></th>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if(!$isStage):?>
|
||||
<th class='c-burn'><?php echo $lang->execution->burn;?></th>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
$extendFields = $this->execution->getFlowExtendFields();
|
||||
foreach($extendFields as $extendField) echo "<th rowspan='2'>{$extendField->name}</th>";
|
||||
if($isStage)
|
||||
{
|
||||
$hasActions = false;
|
||||
foreach($setting as $key => $value)
|
||||
{
|
||||
if($value->id == 'actions') $hasActions = true;
|
||||
}
|
||||
|
||||
if(!$hasActions)
|
||||
{
|
||||
$data = new stdclass();
|
||||
$data->id = 'actions';
|
||||
$data->order = $value->order + 1;
|
||||
$data->show = true;
|
||||
$data->width = '180px';
|
||||
$data->fixed = 'right';
|
||||
$data->title = $lang->actions;
|
||||
$data->sort = 'no';
|
||||
|
||||
$setting[] = $data;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($setting as $key => $value)
|
||||
{
|
||||
if($value->show || $value->id == 'actions')
|
||||
{
|
||||
if($isStage and $value->id == 'actions') $value->show = true;
|
||||
if(($config->systemMode == 'classic' or ($config->systemMode == 'new' and $this->app->tab != 'execution')) and $value->id == 'project') continue;
|
||||
|
||||
$this->datatable->printHead($value, $orderBy, $vars, $canBatchEdit);
|
||||
$columns ++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class='sortable' id='executionTableList'>
|
||||
<?php foreach($executionStats as $execution):?>
|
||||
<tr data-id='<?php echo $execution->id ?>' data-order='<?php echo $execution->order ?>'>
|
||||
<td class='c-id'>
|
||||
<?php if($canBatchEdit):?>
|
||||
<div class="checkbox-primary">
|
||||
<input type='checkbox' name='executionIDList[<?php echo $execution->id;?>]' value='<?php echo $execution->id;?>' autocomplete='off' />
|
||||
<label></label>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php printf('%03d', $execution->id);?>
|
||||
</td>
|
||||
<?php
|
||||
$executionName = $execution->name;
|
||||
$onlyChildStage = ($execution->grade == 2 and $execution->project != $execution->parent);
|
||||
if($onlyChildStage and isset($parents[$execution->parent])) $executionName = $parents[$execution->parent]->name . '/' . $executionName;
|
||||
?>
|
||||
<td class='text-left c-name sort-handler <?php if(!empty($execution->children)) echo 'has-child';?> flex' title='<?php echo $executionName?>'>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<span class='project-type-label label label-outline <?php echo $execution->type == 'stage' ? 'label-warning' : 'label-info';?>'><?php echo $lang->execution->typeList[$execution->type]?></span>
|
||||
<?php endif;?>
|
||||
<?php
|
||||
$executionLink = $execution->projectModel == 'kanban' ? html::a($this->createLink('execution', 'kanban', 'executionID=' . $execution->id), $executionName, '', "class='text-ellipsis'") : html::a($this->createLink('execution', 'task', 'execution=' . $execution->id), $executionName, '', "class='text-ellipsis'");
|
||||
if($onlyChildStage) echo "<span class='label label-badge label-light label-children'>{$lang->programplan->childrenAB}</span> ";
|
||||
echo !empty($execution->children) ? "<span class='text-ellipsis'>$execution->name</span>" : $executionLink;
|
||||
if(isset($execution->delay)) echo "<span class='label label-danger label-badge'>{$lang->execution->delayed}</span> ";
|
||||
?>
|
||||
<?php if(!empty($execution->children)):?>
|
||||
<a class="plan-toggle" data-id="<?php echo $execution->id;?>"><i class="icon icon-angle-double-right"></i></a>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<?php if(!$isStage):?>
|
||||
<td title='<?php echo $execution->code;?>'><?php echo $execution->code;?></td>
|
||||
<?php endif;?>
|
||||
<?php if($config->systemMode == 'new' and $this->app->tab == 'execution'):?>
|
||||
<td class='c-begin' title='<?php echo $execution->projectName;?>'>
|
||||
<span class="status-execution status-<?php echo $execution->projectName?>"><?php echo $execution->projectName;?></span>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
<td><?php echo zget($users, $execution->PM);?></td>
|
||||
<?php $executionStatus = $this->processStatus('execution', $execution);?>
|
||||
<td class='c-status text-center' title='<?php echo $executionStatus;?>'>
|
||||
<span class="status-execution status-<?php echo $execution->status?>"><?php echo $executionStatus;?></span>
|
||||
</td>
|
||||
<td class="c-progress">
|
||||
<?php echo html::ring($execution->hours->progress); ?>
|
||||
</td>
|
||||
<?php if($isStage):?>
|
||||
<td><?php echo $execution->percent . '%';?></td>
|
||||
<td><?php echo zget($lang->stage->typeList, $execution->attribute, '');?></td>
|
||||
<td><?php echo helper::isZeroDate($execution->begin) ? '' : $execution->begin;?></td>
|
||||
<td><?php echo helper::isZeroDate($execution->end) ? '' : $execution->end;?></td>
|
||||
<td><?php echo helper::isZeroDate($execution->realBegan) ? '' : $execution->realBegan;?></td>
|
||||
<td><?php echo helper::isZeroDate($execution->realEnd) ? '' : $execution->realEnd;?></td>
|
||||
<td class="c-actions text-center">
|
||||
<?php
|
||||
common::printIcon('execution', 'start', "executionID={$execution->id}", $execution, 'list', '', '', 'iframe', true);
|
||||
$class = !empty($execution->children) ? 'disabled' : '';
|
||||
common::printIcon('task', 'create', "executionID={$execution->id}", $execution, 'list', '', '', $class, false, "data-app='execution'");
|
||||
|
||||
if($execution->grade == 1 && $this->loadModel('programplan')->isCreateTask($execution->id))
|
||||
{
|
||||
common::printIcon('programplan', 'create', "program={$execution->parent}&productID=$productID&planID=$execution->id", $execution, 'list', 'split', '', '', '', '', $this->lang->programplan->createSubPlan);
|
||||
}
|
||||
else
|
||||
{
|
||||
$disabled = ($execution->grade == 2) ? ' disabled' : '';
|
||||
echo common::hasPriv('programplan', 'create') ? html::a('javascript:alert("' . $this->lang->programplan->error->createdTask . '");', '<i class="icon-programplan-create icon-split"></i>', '', 'class="btn ' . $disabled . '"') : '';
|
||||
}
|
||||
|
||||
common::printIcon('programplan', 'edit', "stageID=$execution->id&projectID=$projectID", $execution, 'list', '', '', 'iframe', true);
|
||||
|
||||
$disabled = !empty($execution->children) ? ' disabled' : '';
|
||||
if($execution->status != 'closed' and common::hasPriv('execution', 'close', $execution))
|
||||
{
|
||||
common::printIcon('execution', 'close', "stageID=$execution->id", $execution, 'list', 'off', 'hiddenwin' , $disabled . ' iframe', true, '', $this->lang->programplan->close);
|
||||
}
|
||||
elseif($execution->status == 'closed' and common::hasPriv('execution', 'activate', $execution))
|
||||
{
|
||||
common::printIcon('execution', 'activate', "stageID=$execution->id", $execution, 'list', 'magic', 'hiddenwin' , $disabled . ' iframe', true, '', $this->lang->programplan->activate);
|
||||
}
|
||||
|
||||
if(common::hasPriv('execution', 'delete', $execution))
|
||||
{
|
||||
common::printIcon('execution', 'delete', "stageID=$execution->id&confirm=no", $execution, 'list', 'trash', 'hiddenwin' , $disabled, '', '', $this->lang->programplan->delete);
|
||||
}
|
||||
?></td>
|
||||
<?php else:?>
|
||||
<td><?php echo helper::isZeroDate($execution->begin) ? '' : $execution->begin;?></td>
|
||||
<td><?php echo helper::isZeroDate($execution->end) ? '' : $execution->end;?></td>
|
||||
<td class='hours' title='<?php echo $execution->hours->totalEstimate . ' ' . $this->lang->execution->workHour;?>'><?php echo $execution->hours->totalEstimate . $this->lang->execution->workHourUnit;?></td>
|
||||
<td class='hours' title='<?php echo $execution->hours->totalConsumed . ' ' . $this->lang->execution->workHour;?>'><?php echo $execution->hours->totalConsumed . $this->lang->execution->workHourUnit;?></td>
|
||||
<td class='hours' title='<?php echo $execution->hours->totalLeft . ' ' . $this->lang->execution->workHour;?>'><?php echo $execution->hours->totalLeft . $this->lang->execution->workHourUnit;?></td>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if(!$isStage):?>
|
||||
<td id='spark-<?php echo $execution->id?>' class='sparkline text-left no-padding' values='<?php echo join(',', $execution->burns);?>'></td>
|
||||
<?php endif;?>
|
||||
<?php foreach($extendFields as $extendField) echo "<td>" . $this->loadModel('flow')->getFieldValue($extendField, $execution) . "</td>";?>
|
||||
<?php foreach($setting as $key => $value) $this->execution->printCell($value, $execution, $users, $useDatatable ? 'datatable' : 'table', $isStage, $productID);?>
|
||||
</tr>
|
||||
<?php if(!empty($execution->children)):?>
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($execution->children as $key => $child):?>
|
||||
<?php $class = $i == 0 ? ' table-child-top' : '';?>
|
||||
<?php $class .= ($i + 1 == count($execution->children)) ? ' table-child-bottom' : '';?>
|
||||
<tr class='table-children<?php echo $class;?> parent-<?php echo $execution->id;?>' data-id='<?php echo $child->id?>'>
|
||||
<td class='c-id'>
|
||||
<?php if($canBatchEdit):?>
|
||||
<div class="checkbox-primary">
|
||||
<input type='checkbox' name='executionIDList[<?php echo $child->id;?>]' value='<?php echo $child->id;?>' />
|
||||
<label></label>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php printf('%03d', $child->id);?>
|
||||
</td>
|
||||
<td class='text-left c-name flex' title='<?php echo $child->name?>'>
|
||||
<?php
|
||||
echo "<span class='label label-badge label-light' title='{$lang->programplan->children}'>{$lang->programplan->childrenAB}</span>";
|
||||
echo html::a($this->createLink('execution', 'task', 'execution=' . $child->id), $child->name, '', "class='text-ellipsis'");
|
||||
if(isset($child->delay)) echo "<span class='label label-danger label-badge'>{$lang->execution->delayed}</span> ";
|
||||
?>
|
||||
</td>
|
||||
<?php if($from == 'execution'): ?>
|
||||
<td title = '<?php echo $child->code;?>'><?php echo $child->code;?>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<td title = '<?php echo $child->projectName?>'><?php echo $child->projectName;?>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<td><?php echo zget($users, $child->PM);?></td>
|
||||
<?php $executionStatus = $this->processStatus('execution', $child);?>
|
||||
<td class='c-status text-center' title='<?php echo $executionStatus;?>'>
|
||||
<span class="status-execution status-<?php echo $child->status?>"><?php echo $executionStatus;?></span>
|
||||
</td>
|
||||
<td class="c-progress">
|
||||
<?php echo html::ring($child->hours->progress); ?>
|
||||
</td>
|
||||
<?php if($from == 'project' and $isStage):?>
|
||||
<td><?php echo $child->percent . '%';?></td>
|
||||
<td><?php echo zget($lang->stage->typeList, $child->attribute, '');?></td>
|
||||
<td><?php echo helper::isZeroDate($child->begin) ? '' : $child->begin;?></td>
|
||||
<td><?php echo helper::isZeroDate($child->end) ? '' : $child->end;?></td>
|
||||
<td><?php echo helper::isZeroDate($child->realBegan) ? '' : $child->realBegan;?></td>
|
||||
<td><?php echo helper::isZeroDate($child->realEnd) ? '' : $child->realEnd;?></td>
|
||||
<td class="c-actions text-center c-actions">
|
||||
<?php
|
||||
common::printIcon('execution', 'start', "executionID={$child->id}", $child, 'list', '', '', 'iframe', true);
|
||||
$class = !empty($child->children) ? 'disabled' : '';
|
||||
common::printIcon('task', 'create', "executionID={$child->id}", $child, 'list', '', '', $class, false, "data-app='execution'");
|
||||
|
||||
if($child->grade == 1 && $this->loadModel('programplan')->isCreateTask($child->id))
|
||||
{
|
||||
common::printIcon('programplan', 'create', "program={$child->parent}&productID=$productID&stageID=$child->id", $child, 'list', 'split', '', '', '', '', $this->lang->programplan->createSubPlan);
|
||||
}
|
||||
else
|
||||
{
|
||||
$disabled = ($child->grade == 2) ? ' disabled' : '';
|
||||
echo html::a('javascript:alert("' . $this->lang->programplan->error->createdTask . '");', '<i class="icon-programplan-create icon-split"></i>', '', 'class="btn ' . $disabled . '"');
|
||||
}
|
||||
|
||||
common::printIcon('programplan', 'edit', "stageID=$child->id&projectID=$projectID", $child, 'list', '', '', 'iframe', true);
|
||||
|
||||
$disabled = !empty($child->children) ? ' disabled' : '';
|
||||
if(common::hasPriv('execution', 'close', $child) and $child->status != 'closed')
|
||||
{
|
||||
common::printIcon('execution', 'close', "stageID=$child->id", $child, 'list', 'off', '' , $disabled . ' iframe', true, '', $this->lang->programplan->close);
|
||||
}
|
||||
elseif(common::hasPriv('execution', 'activate', $child) and $child->status == 'closed')
|
||||
{
|
||||
common::printIcon('execution', 'activate', "stageID=$child->id", $child, 'list', 'magic', '' , $disabled . ' iframe', true, '', $this->lang->programplan->activate);
|
||||
}
|
||||
|
||||
if(common::hasPriv('execution', 'delete', $child))
|
||||
{
|
||||
common::printIcon('execution', 'delete', "stageID=$child->id&confirm=no", $child, 'list', 'trash', 'hiddenwin' , $disabled, '', '', $this->lang->programplan->delete);
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php else:?>
|
||||
<td class='c-begin' title='<?php echo helper::isZeroDate($child->begin) ? '' : $child->begin;?>'><?php echo helper::isZeroDate($child->begin) ? '' : $child->begin;?></td>
|
||||
<td class='c-begin' title='<?php echo helper::isZeroDate($child->end) ? '' : $child->end;?>'><?php echo helper::isZeroDate($child->end) ? '' : $child->end;?></td>
|
||||
<td class='hours' title='<?php echo $child->hours->totalEstimate . ' ' . $this->lang->execution->workHour;?>'><?php echo $child->hours->totalEstimate . ' ' . $this->lang->execution->workHourUnit;?></td>
|
||||
<td class='hours' title='<?php echo $child->hours->totalConsumed . ' ' . $this->lang->execution->workHour;?>'><?php echo $child->hours->totalConsumed . ' ' . $this->lang->execution->workHourUnit;?></td>
|
||||
<td class='hours' title='<?php echo $child->hours->totalLeft . ' ' . $this->lang->execution->workHour;?>'><?php echo $child->hours->totalLeft . ' ' . $this->lang->execution->workHourUnit;?></td>
|
||||
<td id='spark-<?php echo $child->id?>' class='sparkline text-left no-padding' values='<?php echo join(',', $child->burns);?>'></td>
|
||||
<?php endif;?>
|
||||
<?php foreach($extendFields as $extendField) echo "<td>" . $this->loadModel('flow')->getFieldValue($extendField, $child) . "</td>";?>
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
<?php endforeach;?>
|
||||
<?php $i = 0;?>
|
||||
<?php foreach($execution->children as $key => $child):?>
|
||||
<?php $class = $i == 0 ? ' table-child-top' : '';?>
|
||||
<?php $class .= ($i + 1 == count($execution->children)) ? ' table-child-bottom' : '';?>
|
||||
<tr class='table-children<?php echo $class;?> parent-<?php echo $execution->id;?>' data-id='<?php echo $child->id?>'>
|
||||
<?php foreach($setting as $key => $value) $this->execution->printCell($value, $child, $users, $useDatatable ? 'datatable' : 'table', $isStage, $productID, true);?>
|
||||
</tr>
|
||||
<?php $i ++;?>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if(!$useDatatable) echo '</div>';?>
|
||||
<?php if($executionStats):?>
|
||||
<div class='table-footer'>
|
||||
<?php if($canBatchEdit):?>
|
||||
|
||||
Reference in New Issue
Block a user