This commit is contained in:
tianshujie98
2020-12-14 10:30:27 +08:00
parent e168ba7313
commit 6db741c5da
3 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -446,7 +446,7 @@ class project extends control
$toProject = $project->id;
$branches = $this->project->getExecutionBranches($toProject);
$tasks = $this->project->getTasks2Imported($toProject, $branches);
$projects = $this->project->getExecutionsToImport(array_keys($tasks));
$projects = $this->project->getExecutionsToImport(array_keys($tasks), $project->type);
unset($projects[$toProject]);
unset($tasks[$toProject]);
+4 -2
View File
@@ -1710,21 +1710,23 @@ class projectModel extends model
* Get executions to import
*
* @param array $executionIds
* @param string $type sprint|stage
* @access public
* @return array
*/
public function getExecutionsToImport($executionIds)
public function getExecutionsToImport($executionIds, $type)
{
$executions = $this->dao->select('*')->from(TABLE_EXECUTION)
->where('id')->in($executionIds)
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
->andWhere('type')->eq($type)
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->fetchAll('id');
$pairs = array();
$now = date('Y-m-d');
foreach($executions as $id => $execution) $pairs[$id] = ucfirst(substr($execution->code, 0, 1)) . ':' . $execution->name;
foreach($executions as $id => $execution) $pairs[$id] = $execution->name;
return $pairs;
}
+1 -1
View File
@@ -53,7 +53,7 @@
</div>
<?php printf('%03d', $task->id);?>
</td>
<td><?php echo substr($projects[$task->project], 2);?></td>
<td><?php echo substr($projects[$task->project], 0);?></td>
<td><span class='label-pri label-pri-<?php echo $task->pri;?>' title='<?php echo zget($lang->task->priList, $task->pri, $task->pri);?>'><?php echo $task->pri == '0' ? '' : zget($lang->task->priList, $task->pri, $task->pri);?></span></td>
<td class='text-left nobr'><?php if(!common::printLink('task', 'view', "task=$task->id", $task->name)) echo $task->name;?></td>
<td <?php echo $class;?>><?php echo $task->assignedToRealName;?></td>