This commit is contained in:
liuhong
2022-08-19 08:30:20 +00:00
parent 6d74ea8acc
commit 650d491c44
10 changed files with 38 additions and 36 deletions
+1 -1
View File
@@ -96,7 +96,7 @@
else
{
$class = ($task->executionType == 'kanban') ? 'iframe' : '';
echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true, $task->project), $task->name, null,"class={$class} data-width='80%' style='color: $task->color'");
echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true, $task->project), $task->name, null, "class='$class' data-width='80%' style='color: $task->color'");
}
?>
<?php if(!empty($task->children)) echo '<a class="task-toggle" data-id="' . $task->id . '"><i class="icon icon-angle-double-right"></i></a>';?>
+1 -1
View File
@@ -45,7 +45,7 @@
<td class='c-id-xs'><?php echo sprintf('%03d', $task->id);?></td>
<td class='c-pri <?php if($longBlock) echo "c-pri-long"?>'><span class='label-pri label-pri-<?php echo $task->pri;?>' title='<?php echo zget($lang->task->priList, $task->pri, $task->pri)?>'><?php echo zget($lang->task->priList, $task->pri, $task->pri)?></span></td>
<?php $class = ($task->executionType == 'kanban') ? 'iframe' : '';?>
<td class='c-name' style='color: <?php echo $task->color?>' title='<?php echo $task->name?>'><?php echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true, $task->project), $task->name, null, "class={$class} data-width='80%' data-toggle='modal'")?></td>
<td class='c-name' style='color: <?php echo $task->color?>' title='<?php echo $task->name?>'><?php echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true, $task->project), $task->name, null, "class='$class' data-width='80%' data-toggle='modal'")?></td>
<?php if($longBlock):?>
<td class='c-estimate text-center' title="<?php echo $task->estimate . ' ' . $lang->execution->workHour;?>"><?php echo $task->estimate . $lang->execution->workHourUnit;?></td>
<td class='c-deadline'><?php if(substr($task->deadline, 0, 4) > 0) echo $task->deadline;?></td>
+1 -1
View File
@@ -109,7 +109,7 @@
else
{
$class = ($task->executionType == 'kanban') ? 'iframe' : '';
echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true, $task->project), $task->name, null,"class={$class} data-width='80%' style='color: $task->color'");
echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true, $task->project), $task->name, null, "class='$class' data-width='80%' style='color: $task->color'");
}
?>
<?php if(!empty($task->children)) echo '<a class="task-toggle" data-id="' . $task->id . '"><i class="icon icon-angle-double-right"></i></a>';?>
+2 -1
View File
@@ -1156,10 +1156,11 @@ class productModel extends model
* @param int $productID
* @param int $branch
* @param int $appendProject
* @param string $status all|closed|unclosed
* @access public
* @return array
*/
public function getProjectPairsByProduct($productID, $branch = 0, $appendProject = 0, $status)
public function getProjectPairsByProduct($productID, $branch = 0, $appendProject = 0, $status = '')
{
$product = $this->getById($productID);
+2 -2
View File
@@ -362,7 +362,7 @@ class productplan extends control
$this->view->orderBy = $orderBy;
$this->view->plans = $this->productplan->getList($productID, $branch, $browseType, $pager, $sort, "", $queryID);
$this->view->pager = $pager;
$this->view->projects = $this->product->getProjectPairsByProduct($productID, $branch,'',$status='closed');
$this->view->projects = $this->product->getProjectPairsByProduct($productID, $branch, '', $status = 'closed');
$this->view->statusList = $this->lang->productplan->featureBar['browse'];
$this->view->queryID = $queryID;
$this->display();
@@ -615,7 +615,7 @@ class productplan extends control
*/
public function ajaxGetProjects($productID, $branch = 0)
{
$projects = $this->loadModel('product')->getProjectPairsByProduct($productID, $branch,'',$status='closed');
$projects = $this->loadModel('product')->getProjectPairsByProduct($productID, $branch, '', $status = 'closed');
echo html::select('project', $projects, key($projects), "class='form-control chosen'");
}
+1 -1
View File
@@ -99,7 +99,7 @@
?>
</td>
<td><?php echo zget($users, $story->openedBy);?></td>
<td class='text-right'style='padding-right:25px' title="<?php echo $story->estimate . ' ' . $lang->hourCommon;?>"><?php echo $story->estimate . $config->hourUnit;?></td>
<td class='text-right' style='padding-right:25px' title="<?php echo $story->estimate . ' ' . $lang->hourCommon;?>"><?php echo $story->estimate . $config->hourUnit;?></td>
<td>
<span class='status-story status-<?php echo $story->status;?>'><?php echo $this->processStatus('story', $story);?></span>
</td>
+27 -26
View File
@@ -2973,6 +2973,26 @@ class storyModel extends model
return $this->getBySQL($queryProductID, $storyQuery, $orderBy, $pager, $type);
}
/**
* Get Story changed Revert ObjectID.
*
* @param int $productID
* @access public
* @return array
*/
public function getRevertStoryIDList($productID)
{
$review = $this->dao->select('objectID')->from(TABLE_ACTION)
->where('product')->like("%,$productID,%")
->andWhere('action')->eq('reviewed')
->andWhere('objectType')->eq('story')
->andWhere('extra')->eq('Revert')
->groupBy('objectID')
->orderBy('id_desc')
->fetchPairs();
return $review;
}
/**
* Get stories by a sql.
*
@@ -2992,24 +3012,14 @@ class storyModel extends model
->beginIF($productID != 'all' and $productID != '')->andWhere('product')->eq((int)$productID)->fi()
->fetchPairs();
/* From action Get reviews. */
$review = $this->dao->select('objectID')->from(TABLE_ACTION)
->where('product')->like("%,$productID,%")
->andWhere('action')->eq('reviewed')
->andWhere('objectType')->eq('story')
->andWhere('extra')->eq('Revert')
->groupBy('objectID')
->orderBy('id_desc')
->fetchAll();
$review = $this->getRevertStoryIDList($productID);
$sql = str_replace(array('`product`', '`version`', '`branch`'), array('t1.`product`', 't1.`version`', 't1.`branch`'), $sql);
if(strpos($sql,'result')!== false)
{
if(strpos($sql,'revert')!== false)
{
$sql = str_replace("AND `result` = 'revert'",'',$sql);
$review = implode('\',\'',array_column($review,'objectID'));
$sql.=" AND t1.`id` in ('{$review}')";
$sql = str_replace("AND `result` = 'revert'", '', $sql);
$sql .= " AND t1.`id` " . helper::dbIN($review);
}
else
{
@@ -3039,6 +3049,7 @@ class storyModel extends model
foreach($storyPlans as $planID) $story->planTitle .= zget($plans, $planID, '') . ' ';
$stories[$story->id] = $story;
}
return $stories;
}
@@ -3099,26 +3110,16 @@ class storyModel extends model
}
$storyQuery = preg_replace('/`(\w+)`/', 't2.`$1`', $storyQuery);
/* Get productID*/
$products = $this->loadModel('product')->getProducts($executionID);
if($products) $productID = key($products);
/* From action Get reviews. */
$review = $this->dao->select('objectID')->from(TABLE_ACTION)
->where('product')->like("%,$productID,%")
->andWhere('action')->eq('reviewed')
->andWhere('objectType')->eq('story')
->andWhere('extra')->eq('Revert')
->groupBy('objectID')
->orderBy('id_desc')
->fetchAll();
$review = $this->getRevertStoryIDList($productID);
if(strpos($storyQuery,'result')!== false)
{
if(strpos($storyQuery,'revert')!== false)
{
$storyQuery = str_replace("AND t2.`result` = 'revert'",'',$storyQuery);
$review = implode('\',\'',array_column($review,'objectID'));
$storyQuery.=" AND t2.`id` in ('{$review}')";
$storyQuery = str_replace("AND t2.`result` = 'revert'", '', $storyQuery);
$storyQuery .= " AND t2.`id` " . helper::dbIN($review);
}
else
{
+1 -1
View File
@@ -291,7 +291,7 @@ class task extends control
/* Set Custom*/
foreach(explode(',', $this->config->task->customCreateFields) as $field) $customFields[$field] = $this->lang->task->$field;
$executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject($projectID,'noclosed', 0, true);
$executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject($projectID, 'noclosed', 0, true);
$this->view->customFields = $customFields;
$this->view->showFields = $this->config->task->custom->createFields;
+1 -1
View File
@@ -3475,7 +3475,7 @@ class taskModel extends model
if($id == 'name')
{
$title = " title='{$task->name}'";
if(!empty($task->children)) $class .= 'has-child';
if(!empty($task->children)) $class .= ' has-child';
}
if($id == 'story') $title = " title='{$task->storyTitle}'";
if($id == 'estimate' || $id == 'consumed' || $id == 'left')
+1 -1
View File
@@ -62,7 +62,7 @@
<?php if(!empty($task->team)) echo '<span class="label label-badge label-light">' . $this->lang->task->multipleAB . '</span> ';?>
<?php if($task->parent > 0) echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ';?>
<?php $class = ($task->executionType == 'kanban') ? 'iframe' : '';?>
<?php echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true, $task->project), $task->name, null,"class={$class} data-width='80%' style='color: $task->color'");?>
<?php echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', true, $task->project), $task->name, null, "class='$class' data-width='80%' style='color: $task->color'");?>
</td>
<td class='hours' title="<?php echo $task->estimate . ' ' . $lang->execution->workHour;?>"><?php echo $task->estimate . $lang->execution->workHourUnit;?></td>
<td class='hours' title="<?php echo $task->consumed . ' ' . $lang->execution->workHour;?>"><?php echo $task->consumed . $lang->execution->workHourUnit;?></td>