* Code for finish task #84576.
This commit is contained in:
@@ -1101,7 +1101,7 @@ class block extends control
|
||||
|
||||
/* Get projects. */
|
||||
$projectID = $this->view->block->module == 'my' ? 0 : (int)$this->session->project;
|
||||
$executions = $this->loadModel('execution')->getOrderedExecutions($projectID, $status, $count);
|
||||
$executions = $this->loadModel('execution')->getOrderedExecutions($projectID, $status, $count, 'skipparent');
|
||||
if(empty($executions))
|
||||
{
|
||||
$this->view->executions = $executions;
|
||||
|
||||
@@ -96,7 +96,7 @@ $(function()
|
||||
<?php $selected = !isset($executions[$selected]) ? key($executions) : $selected;?>
|
||||
<?php foreach($executions as $execution):?>
|
||||
<li <?php if($execution->id == $selected) echo "class='active' id='activeExecution'";?> executionID='<?php echo $execution->id;?>'>
|
||||
<a href="###" data-target="#tab3Content<?php echo $execution->id;?>" data-toggle="tab" title='<?php echo $execution->name;?>'><?php echo $execution->name;?></a>
|
||||
<a href="###" data-target="#tab3Content<?php echo $blockNavId . $execution->id;?>" data-toggle="tab" title='<?php echo $execution->name;?>'><?php echo $execution->name;?></a>
|
||||
<?php echo html::a(helper::createLink('execution', 'task', "executionID=$execution->id"), "<i class='icon-arrow-right text-primary'></i>", '', "class='btn-view' title={$lang->execution->task}");?>
|
||||
</li>
|
||||
<?php endforeach;?>
|
||||
@@ -105,7 +105,7 @@ $(function()
|
||||
</div>
|
||||
<div class="col tab-content">
|
||||
<?php foreach($executions as $execution):?>
|
||||
<div class="tab-pane fade<?php if($execution->id == $selected) echo ' active in';?>" id="tab3Content<?php echo $execution->id;?>">
|
||||
<div class="tab-pane fade<?php if($execution->id == $selected) echo ' active in';?>" id="tab3Content<?php echo $blockNavId . $execution->id;?>">
|
||||
<div class="table-row">
|
||||
<div class="col-5 text-middle text-center">
|
||||
<div class="progress-pie inline-block space" data-value="<?php echo $execution->progress;?>" data-doughnut-size="84">
|
||||
|
||||
@@ -2298,19 +2298,28 @@ class executionModel extends model
|
||||
* @param int $executionID
|
||||
* @param string $status
|
||||
* @param int $num
|
||||
* @param string $param
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getOrderedExecutions($executionID, $status, $num = 0)
|
||||
public function getOrderedExecutions($executionID, $status, $num = 0, $param = '')
|
||||
{
|
||||
$executionList = $this->getList($executionID, 'all', $status);
|
||||
if(empty($executionList)) return $executionList;
|
||||
|
||||
$executions = $mineExecutions = $otherExecutions = $closedExecutions = array();
|
||||
$executions = $mineExecutions = $otherExecutions = $closedExecutions = array();
|
||||
$param = strtolower($param);
|
||||
if($param == 'skipparent')
|
||||
{
|
||||
$parentExecutions = array();
|
||||
foreach($executionList as $execution) $parentExecutions[$execution->parent] = $execution->parent;
|
||||
}
|
||||
|
||||
foreach($executionList as $execution)
|
||||
{
|
||||
if(empty($execution->multiple)) continue;
|
||||
if(!$this->app->user->admin and !$this->checkPriv($execution->id)) continue;
|
||||
if($param == 'skipparent' and isset($parentExecutions[$execution->id])) continue;
|
||||
|
||||
if($execution->status != 'done' and $execution->status != 'closed' and $execution->PM == $this->app->user->account)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user