- Remove unuse code.
This commit is contained in:
@@ -5198,133 +5198,6 @@ class executionModel extends model
|
||||
return $treeData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Print execution nested list.
|
||||
*
|
||||
* @param object $execution
|
||||
* @param bool $isChild
|
||||
* @param array $users
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function printNestedList($execution, $isChild, $users, $productID)
|
||||
{
|
||||
$this->loadModel('task');
|
||||
$this->loadModel('execution');
|
||||
$this->loadModel('programplan');
|
||||
|
||||
$today = helper::today();
|
||||
|
||||
if(!$isChild)
|
||||
{
|
||||
$trClass = 'is-top-level table-nest-child-hide';
|
||||
$trAttrs = "data-id='$execution->id' data-order='$execution->order' data-nested='true' data-status={$execution->status}";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(strpos($execution->path, ",$execution->project,") !== false)
|
||||
{
|
||||
$path = explode(',', trim($execution->path, ','));
|
||||
$path = array_slice($path, array_search($execution->project, $path) + 1);
|
||||
$path = implode(',', $path);
|
||||
}
|
||||
|
||||
$trClass = 'table-nest-hide';
|
||||
$trAttrs = "data-id={$execution->id} data-parent={$execution->parent} data-status={$execution->status}";
|
||||
$trAttrs .= " data-nest-parent='$execution->parent' data-order='$execution->order' data-nest-path='$path'";
|
||||
}
|
||||
|
||||
$burns = implode(',', $execution->burns);
|
||||
echo "<tr $trAttrs class='$trClass'>";
|
||||
echo "<td class='c-name text-left flex sort-handler'>";
|
||||
if(common::hasPriv('execution', 'batchEdit')) echo "<span id=$execution->id class='table-nest-icon icon table-nest-toggle'></span>";
|
||||
$spanClass = $execution->type == 'stage' ? 'label-warning' : 'label-info';
|
||||
echo "<span class='project-type-label label label-outline $spanClass'>{$this->lang->execution->typeList[$execution->type]}</span> ";
|
||||
if(empty($execution->children))
|
||||
{
|
||||
echo html::a(helper::createLink('execution', 'view', "executionID=$execution->id"), $execution->name, '', "class='text-ellipsis' title='{$execution->name}'");
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<span class='text-ellipsis'>" . $execution->name . '</span>';
|
||||
}
|
||||
|
||||
if(!helper::isZeroDate($execution->end) && $execution->status != 'closed')
|
||||
{
|
||||
echo strtotime($today) > strtotime($execution->end) ? '<span class="label label-danger label-badge">' . $this->lang->execution->delayed . '</span>' : '';
|
||||
}
|
||||
|
||||
if(($execution->stageBy == 'project') and $execution->hasProduct) echo "<td class='text-left' title='{$execution->productName}'>{$execution->productName}</td>";
|
||||
echo "<td class='status-{$execution->status} text-center'>" . zget($this->lang->project->statusList, $execution->status) . '</td>';
|
||||
echo '<td>' . zget($users, $execution->PM) . '</td>';
|
||||
echo helper::isZeroDate($execution->begin) ? '<td class="c-date"></td>' : '<td class="c-date">' . $execution->begin . '</td>';
|
||||
echo helper::isZeroDate($execution->end) ? '<td class="c-date"></td>' : '<td class="c-date">' . $execution->end . '</td>';
|
||||
echo "<td class='hours text-right' title='{$execution->hours->totalEstimate}{$this->lang->execution->workHour}'>" . $execution->hours->totalEstimate . $this->lang->execution->workHourUnit . '</td>';
|
||||
echo "<td class='hours text-right' title='{$execution->hours->totalConsumed}{$this->lang->execution->workHour}'>" . $execution->hours->totalConsumed . $this->lang->execution->workHourUnit . '</td>';
|
||||
echo "<td class='hours text-right' title='{$execution->hours->totalLeft}{$this->lang->execution->workHour}'>" . $execution->hours->totalLeft . $this->lang->execution->workHourUnit . '</td>';
|
||||
echo '<td>' . html::ring($execution->hours->progress) . '</td>';
|
||||
echo "<td id='spark-{$execution->id}' class='sparkline text-left no-padding' values='$burns'></td>";
|
||||
echo '<td class="c-actions text-center">';
|
||||
common::printIcon('execution', 'start', "executionID={$execution->id}", $execution, 'list', '', '', 'iframe', true);
|
||||
$class = !empty($execution->children) ? 'disabled' : '';
|
||||
common::printIcon('task', 'create', "executionID={$execution->id}", '', 'list', '', '', $class, false, "data-app='execution'");
|
||||
|
||||
$project = $this->loadModel('project')->getByID($execution->project);
|
||||
if($execution->type == 'stage' or ($this->app->tab == 'project' and !empty($project->model) and $project->model == 'waterfallplus'))
|
||||
{
|
||||
$isCreateTask = $this->loadModel('programplan')->isCreateTask($execution->id);
|
||||
$disabled = ($isCreateTask and $execution->type == 'stage') ? '' : ' disabled';
|
||||
$title = !$isCreateTask ? $this->lang->programplan->error->createdTask : $this->lang->programplan->createSubPlan;
|
||||
$title = (!empty($disabled) and $execution->type != 'stage') ? $this->lang->programplan->error->notStage : $title;
|
||||
common::printIcon('programplan', 'create', "program={$execution->project}&productID=$productID&planID=$execution->id", $execution, 'list', 'split', '', $disabled, '', '', $title);
|
||||
}
|
||||
|
||||
if($execution->type == 'stage')
|
||||
{
|
||||
common::printIcon('programplan', 'edit', "stageID=$execution->id&projectID=$execution->project", $execution, 'list', '', '', 'iframe', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
common::printIcon('execution', 'edit', "executionID=$execution->id", $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->execution->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->execution->activate);
|
||||
}
|
||||
|
||||
if(common::hasPriv('execution', 'delete', $execution))
|
||||
{
|
||||
common::printIcon('execution', 'delete', "stageID=$execution->id&confirm=no", $execution, 'list', 'trash', 'hiddenwin' , $disabled, '', '', $this->lang->delete);
|
||||
}
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
|
||||
if(!empty($execution->children))
|
||||
{
|
||||
foreach($execution->children as $child)
|
||||
{
|
||||
$child->stageBy = $execution->stageBy;
|
||||
$this->printNestedList($child, true, $users, $productID);
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($execution->tasks))
|
||||
{
|
||||
foreach($execution->tasks as $task)
|
||||
{
|
||||
$showmore = (count($execution->tasks) == 50) && ($task == end($execution->tasks));
|
||||
echo $this->task->buildNestedList($execution, $task, false, $showmore, $users);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update user view of execution and it's product.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user