Merge branch 'master' of https://gitlab.zcorp.cc/easycorp/zentaopms
This commit is contained in:
@@ -742,6 +742,11 @@ class bug extends control
|
||||
$this->repo->setMenu($repos);
|
||||
$this->lang->navGroup->bug = 'devops';
|
||||
}
|
||||
if($this->app->openApp == 'product')
|
||||
{
|
||||
$this->loadModel('product')->setMenu($bug->product);
|
||||
$this->lang->product->menu->plan['subModule'] .= ',bug';
|
||||
}
|
||||
}
|
||||
|
||||
/* Get product info. */
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php if(common::canModify('product', $product)):?>
|
||||
<?php $openApp = strpos('|execution|project|qa|', $this->app->openApp) !== false ? $this->app->openApp : 'qa';?>
|
||||
<?php common::printLink('bug', 'create', "productID={$bug->product}&branch={$bug->branch}&extra=moduleID={$bug->module},projectID={$bug->project},executionID={$bug->execution}", "<i class='icon icon-plus'></i> " . $lang->bug->create, '', "class='btn btn-primary' data-app='$openApp'"); ?>
|
||||
<?php if($this->app->openApp != 'product') common::printLink('bug', 'create', "productID={$bug->product}&branch={$bug->branch}&extra=moduleID={$bug->module},projectID={$bug->project},executionID={$bug->execution}", "<i class='icon icon-plus'></i> " . $lang->bug->create, '', "class='btn btn-primary' data-app='$openApp'"); ?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
@@ -86,14 +86,20 @@
|
||||
common::printIcon('bug', 'close', $params, $bug, 'button', '', '', 'text-danger iframe showinonlybody', true);
|
||||
common::printIcon('bug', 'activate', $params, $bug, 'button', '', '', 'text-success iframe showinonlybody', true);
|
||||
|
||||
common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&execution=0&bugID=$bug->id", $bug, 'button', $lang->icons['story'], '', '', '', "data-app='" . ($this->app->openApp == 'project' ? 'project' : 'product') . "'", $lang->bug->toStory);
|
||||
common::printIcon('bug', 'createCase', $convertParams, $bug, 'button', 'sitemap');
|
||||
if($this->app->openApp != 'product')
|
||||
{
|
||||
common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&execution=0&bugID=$bug->id", $bug, 'button', $lang->icons['story'], '', '', '', "data-app='" . ($this->app->openApp == 'project' ? 'project' : 'product') . "'", $lang->bug->toStory);
|
||||
common::printIcon('bug', 'createCase', $convertParams, $bug, 'button', 'sitemap');
|
||||
}
|
||||
|
||||
echo $this->buildOperateMenu($bug, 'view');
|
||||
|
||||
echo "<div class='divider'></div>";
|
||||
common::printIcon('bug', 'edit', $params, $bug);
|
||||
common::printIcon('bug', 'create', $copyParams, $bug, 'button', 'copy', '', '', false, "data-app='qa'");
|
||||
if($this->app->openApp != 'product')
|
||||
{
|
||||
common::printIcon('bug', 'create', $copyParams, $bug, 'button', 'copy', '', '', false, "data-app='qa'");
|
||||
}
|
||||
common::printIcon('bug', 'delete', $params, $bug, 'button', 'trash', 'hiddenwin');
|
||||
?>
|
||||
<?php endif;?>
|
||||
|
||||
Binary file not shown.
@@ -50,7 +50,9 @@
|
||||
</th>
|
||||
<th class='c-pri w-40px'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
|
||||
<th class='c-name'> <?php common::printOrderLink('name', $orderBy, $vars, $lang->task->name);?></th>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<th class='c-project w-120px'> <?php common::printOrderLink('project', $orderBy, $vars, $lang->my->projects);?></th>
|
||||
<?php endif;?>
|
||||
<th class='c-project w-120px'> <?php common::printOrderLink('execution', $orderBy, $vars, $lang->my->executions);?></th>
|
||||
<?php if($type != 'openedBy'): ?>
|
||||
<th class='c-user w-90px'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
|
||||
@@ -91,7 +93,9 @@
|
||||
<?php echo html::a($this->createLink('task', 'view', "taskID=$task->id", '', '', $task->project), $task->name, null, "style='color: $task->color' data-group='execution'");?>
|
||||
<?php if(!empty($task->children)) echo '<a class="task-toggle" data-id="' . $task->id . '"><i class="icon icon-angle-double-right"></i></a>';?>
|
||||
</td>
|
||||
<td class='c-project' title="<?php echo zget($projects, $task->project);?>"><?php echo html::a($this->createLink('project', 'view', "projectID=$task->project"), zget($projects, $task->project));?></td>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<td class='c-project' title="<?php echo $task->projectName;?>"><?php echo html::a($this->createLink('project', 'view', "projectID=$task->project"), $task->projectName);?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-project' title="<?php echo $task->executionName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$task->execution"), $task->executionName, '', "data-group='execution'");?></td>
|
||||
<?php if($type != 'openedBy'): ?>
|
||||
<td class='c-user'><?php echo zget($users, $task->openedBy);?></td>
|
||||
@@ -156,7 +160,9 @@
|
||||
<?php if($child->parent > 0) echo '<span class="label label-badge label-light">' . $this->lang->task->childrenAB . '</span> ';?>
|
||||
<?php echo html::a($this->createLink('task', 'view', "taskID=$child->id", '', '', $child->project), $child->name, null, "style='color: $child->color' data-group='project'");?>
|
||||
</td>
|
||||
<td class='c-project' title="<?php echo zget($projects, $child->project);?>"><?php echo html::a($this->createLink('project', 'view', "projectID=$child->project"), zget($projects, $child->project));?></td>
|
||||
<?php if($config->systemMode == 'new'):?>
|
||||
<td class='c-project' title="<?php echo $child->projectName;?>"><?php echo html::a($this->createLink('project', 'view', "projectID=$child->project"), $child->projectName);?></td>
|
||||
<?php endif;?>
|
||||
<td class='c-project' title="<?php echo $child->projectName;?>"><?php echo html::a($this->createLink('execution', 'task', "executionID=$child->project"), $child->executionName, '', "data-group='execution'");?></td>
|
||||
<?php if($type != 'openedBy'): ?>
|
||||
<td class='c-user'><?php echo zget($users, $child->openedBy);?></td>
|
||||
|
||||
Binary file not shown.
@@ -392,7 +392,7 @@
|
||||
<?php endif;?>
|
||||
</td>
|
||||
<td><span class='label-pri label-pri-<?php echo $bug->pri;?>' title='<?php echo zget($lang->bug->priList, $bug->pri, $bug->pri);?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri);?></span></td>
|
||||
<td class='text-left nobr' title='<?php echo $bug->title?>'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?></td>
|
||||
<td class='text-left nobr' title='<?php echo $bug->title?>'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title, '', 'data-app="product"');?></td>
|
||||
<td><?php echo zget($users, $bug->openedBy);?></td>
|
||||
<td><?php echo zget($users, $bug->assignedTo);?></td>
|
||||
<td>
|
||||
|
||||
@@ -773,7 +773,7 @@ class programModel extends model
|
||||
$treeMenu = array();
|
||||
foreach($modules as $module)
|
||||
{
|
||||
if(strpos($this->app->user->view->programs, $module->id) === false and (!$this->app->user->admin)) continue;
|
||||
if(strpos($this->app->user->view->programs, (string)$module->id) === false and (!$this->app->user->admin)) continue;
|
||||
|
||||
$moduleName = '/';
|
||||
$parentModules = explode(',', $module->path);
|
||||
|
||||
@@ -572,6 +572,9 @@ class story extends control
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$actionID = $this->action->create('story', $storyID, $action, $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
|
||||
$story = $this->dao->findById($storyID)->from(TABLE_STORY)->fetch();
|
||||
$this->story->recordReviewAction($story);
|
||||
}
|
||||
|
||||
$this->executeHooks($storyID);
|
||||
@@ -603,11 +606,11 @@ class story extends control
|
||||
/* Get users. */
|
||||
$users = $this->user->getPairs('pofirst|nodeleted|noclosed', "$story->assignedTo,$story->openedBy,$story->closedBy");
|
||||
|
||||
$isShowReviewer = true;
|
||||
$isShowReviewer = false;
|
||||
$reviewerList = $this->story->getReviewerPairs($story->id, $story->version);
|
||||
$reviewerList = array_keys($reviewerList);
|
||||
$reviewedBy = explode(',', trim($story->reviewedBy, ','));
|
||||
if(!array_diff($reviewerList, $reviewedBy)) $isShowReviewer = false;
|
||||
if(array_diff($reviewerList, $reviewedBy) and strpos('draft,changed', $story->status) !== false) $isShowReviewer = true;
|
||||
|
||||
$reviewedReviewer = array();
|
||||
foreach($reviewedBy as $reviewer) $reviewedReviewer[] = zget($users, $reviewer);
|
||||
|
||||
+41
-24
@@ -720,7 +720,7 @@ class storyModel extends model
|
||||
*
|
||||
* @param int $storyID
|
||||
* @access public
|
||||
* @return array the changes of the story.
|
||||
* @return array the changes of the story.
|
||||
*/
|
||||
public function update($storyID)
|
||||
{
|
||||
@@ -791,6 +791,44 @@ class storyModel extends model
|
||||
|
||||
if(isset($story->stage) and $oldStory->stage != $story->stage) $story->stagedBy = (strpos('tested|verified|released|closed', $story->stage) !== false) ? $this->app->user->account : '';
|
||||
|
||||
if(isset($_POST['reviewer']))
|
||||
{
|
||||
$_POST['reviewer'] = array_filter($_POST['reviewer']);
|
||||
$oldReviewer = $this->getReviewerPairs($storyID, $oldStory->version);
|
||||
|
||||
/* Update story reviewer. */
|
||||
$this->dao->delete()->from(TABLE_STORYREVIEW)->where('story')->eq($storyID)->andWhere('version')->eq($oldStory->version)->andWhere('reviewer')->notin(implode(',', $_POST['reviewer']))->exec();
|
||||
foreach($_POST['reviewer'] as $reviewer)
|
||||
{
|
||||
if(in_array($reviewer, array_keys($oldReviewer))) continue;
|
||||
|
||||
$reviewData = new stdclass();
|
||||
$reviewData->story = $storyID;
|
||||
$reviewData->version = $oldStory->version;
|
||||
$reviewData->reviewer = $reviewer;
|
||||
$this->dao->insert(TABLE_STORYREVIEW)->data($reviewData)->exec();
|
||||
}
|
||||
|
||||
/* Update the story status by review rules. */
|
||||
$reviewerList = $this->getReviewerPairs($storyID, $oldStory->version);
|
||||
$reviewedBy = explode(',', trim($oldStory->reviewedBy, ','));
|
||||
if(!array_diff(array_keys($reviewerList), $reviewedBy))
|
||||
{
|
||||
$status = $this->setStatusByReviewRules($reviewerList);
|
||||
$story->status = $status ? $status : $oldStory->status;
|
||||
if($story->status == 'closed')
|
||||
{
|
||||
$story->closedBy = $this->app->user->account;
|
||||
$story->closedDate = $now;
|
||||
$story->assignedTo = 'closed';
|
||||
$story->assignedDate = $now;
|
||||
$story->stage = 'closed';
|
||||
if($this->post->closedReason == 'done') $story->stage = 'released';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_STORY)
|
||||
->data($story)
|
||||
->autoCheck()
|
||||
@@ -869,27 +907,6 @@ class storyModel extends model
|
||||
if(empty($oldStory->plan) or empty($story->plan)) $this->setStage($storyID); // Set new stage for this story.
|
||||
}
|
||||
|
||||
if(isset($_POST['reviewer']))
|
||||
{
|
||||
$_POST['reviewer'] = array_filter($_POST['reviewer']);
|
||||
$oldReviewer = $this->getReviewerPairs($storyID, $oldStory->version);
|
||||
$oldStory->reviewers = implode(',', array_keys($oldReviewer));
|
||||
$story->reviewers = implode(',', $_POST['reviewer']);
|
||||
|
||||
/* Update story reviewer. */
|
||||
$this->dao->delete()->from(TABLE_STORYREVIEW)->where('story')->eq($storyID)->andWhere('version')->eq($oldStory->version)->andWhere('reviewer')->notin(implode(',', $_POST['reviewer']))->exec();
|
||||
foreach($_POST['reviewer'] as $reviewer)
|
||||
{
|
||||
if(in_array($reviewer, array_keys($oldReviewer))) continue;
|
||||
|
||||
$reviewData = new stdclass();
|
||||
$reviewData->story = $storyID;
|
||||
$reviewData->version = $oldStory->version;
|
||||
$reviewData->reviewer = $reviewer;
|
||||
$this->dao->insert(TABLE_STORYREVIEW)->data($reviewData)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
unset($oldStory->parent);
|
||||
unset($story->parent);
|
||||
return common::createChanges($oldStory, $story);
|
||||
@@ -4467,14 +4484,14 @@ class storyModel extends model
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function recordReviewAction($story, $result, $reason)
|
||||
public function recordReviewAction($story, $result = '', $reason = '')
|
||||
{
|
||||
$reasonParam = $result == 'reject' ? ',' . $reason : '';
|
||||
$reviewers = $this->getReviewerPairs($story->id, $story->version);
|
||||
$reviewedBy = explode(',', trim($story->reviewedBy, ','));
|
||||
|
||||
$comment = isset($_POST['comment']) ? $this->post->comment : '';
|
||||
$actionID = $this->loadModel('action')->create('story', $story->id, 'Reviewed', $comment, ucfirst($result) . $reasonParam);
|
||||
$actionID = !empty($result) ? $this->loadModel('action')->create('story', $story->id, 'Reviewed', $comment, ucfirst($result) . $reasonParam) : '';
|
||||
|
||||
if($story->status == 'closed') $this->action->create('story', $story->id, 'ReviewClosed');
|
||||
if($story->status == 'active') $this->action->create('story', $story->id, 'PassReviewed');
|
||||
|
||||
@@ -2142,6 +2142,11 @@ class taskModel extends model
|
||||
foreach($taskTeam as $taskID => $team) $tasks[$taskID]->team = $team;
|
||||
}
|
||||
|
||||
$projectList = '';
|
||||
foreach($tasks as $task) $projectList[] = $task->project;
|
||||
$projectPairs = $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->in($projectList)->fetchPairs('id');
|
||||
foreach($tasks as $task) $task->projectName = zget($projectPairs, $task->project);
|
||||
|
||||
if($tasks) return $this->processTasks($tasks);
|
||||
return array();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user