Merge branch '15.0.beta3' of https://gitlab.zcorp.cc/easycorp/zentaopms into 15.0.beta3
This commit is contained in:
+7
-17
@@ -502,14 +502,12 @@ class bug extends control
|
||||
$moduleOwner = $this->bug->getModuleOwner($moduleID, $productID);
|
||||
|
||||
/* Set team members of the latest execution as assignedTo list. */
|
||||
$latestExecution = $this->product->getLatestProject($productID);
|
||||
$executionMembers = array();
|
||||
if(!empty($latestExecution)) $executionMembers = $this->loadModel('user')->getTeamMemberPairs($latestExecution->id, 'execution', 'nodeleted', $moduleOwner);
|
||||
if(empty($executionMembers)) $executionMembers = $this->view->users;
|
||||
if($assignedTo and !isset($executionMembers[$assignedTo]))
|
||||
$productMembers = $this->bug->getProductMemberPairs($productID);
|
||||
if(empty($productMembers)) $productMembers = $this->view->users;
|
||||
if($assignedTo and !isset($productMembers[$assignedTo]))
|
||||
{
|
||||
$user = $this->loadModel('user')->getById($assignedTo);
|
||||
if($user) $executionMembers[$assignedTo] = $user->realname;
|
||||
if($user) $productMembers[$assignedTo] = $user->realname;
|
||||
}
|
||||
|
||||
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch);
|
||||
@@ -583,7 +581,7 @@ class bug extends control
|
||||
$this->view->steps = htmlspecialchars($steps);
|
||||
$this->view->os = $os;
|
||||
$this->view->browser = $browser;
|
||||
$this->view->executionMembers = $executionMembers;
|
||||
$this->view->productMembers = $productMembers;
|
||||
$this->view->assignedTo = $assignedTo;
|
||||
$this->view->deadline = $deadline;
|
||||
$this->view->mailto = $mailto;
|
||||
@@ -1613,17 +1611,9 @@ class bug extends control
|
||||
*/
|
||||
public function ajaxLoadExecutionTeamMembers($productID, $selectedUser = '')
|
||||
{
|
||||
$latestExecution = $this->product->getLatestProject($productID);
|
||||
if(!empty($latestExecution))
|
||||
{
|
||||
$executionMembers = $this->user->getTeamMemberPairs($latestExecution->id, 'execution', 'nodeleted', $selectedUser);
|
||||
}
|
||||
else
|
||||
{
|
||||
$executionMembers = $this->user->getPairs('devfirst|noclosed|nodeleted');
|
||||
}
|
||||
$productMembers = $this->bug->getProductMemberPairs($productID);
|
||||
|
||||
die(html::select('assignedTo', $executionMembers, $selectedUser, 'class="form-control"'));
|
||||
die(html::select('assignedTo', $productMembers, $selectedUser, 'class="form-control"'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,7 +60,7 @@ function loadAll(productID)
|
||||
loadProductBuilds(productID);
|
||||
loadProductplans(productID);
|
||||
loadProductStories(productID);
|
||||
loadTestTasks(productID);
|
||||
//loadTestTasks(productID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,12 @@ function loadAllUsers()
|
||||
function loadExecutionTeamMembers(productID)
|
||||
{
|
||||
var link = createLink('bug', 'ajaxLoadExecutionTeamMembers', 'productID=' + productID + '&selectedUser=' + $('#assignedTo').val());
|
||||
$('#assignedToBox').load(link, function(){$('#assignedTo').chosen();});
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#assignedTo').replaceWith(data);
|
||||
$('#assignedTo_chosen').remove();
|
||||
$('#assignedTo').chosen();
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1592,6 +1592,29 @@ class bugModel extends model
|
||||
return $bugs;
|
||||
}
|
||||
|
||||
public function getProductMemberPairs($productID)
|
||||
{
|
||||
$projects = $this->loadModel('product')->getProjectPairsByProduct($productID);
|
||||
|
||||
$users = $this->dao->select("t2.id, t2.account, t2.realname")->from(TABLE_TEAM)->alias('t1')
|
||||
->leftJoin(TABLE_USER)->alias('t2')->on('t1.account = t2.account')
|
||||
->where('t1.root')->in(array_keys($projects))
|
||||
->andWhere('t1.type')->eq('project')
|
||||
->andWhere('t2.deleted')->eq(0)
|
||||
->fi()
|
||||
->fetchAll('account');
|
||||
|
||||
if(!$users) return array('' => '');
|
||||
|
||||
foreach($users as $account => $user)
|
||||
{
|
||||
$firstLetter = ucfirst(substr($user->account, 0, 1)) . ':';
|
||||
if(!empty($this->config->isINT)) $firstLetter = '';
|
||||
$users[$account] = $firstLetter . ($user->realname ? $user->realname : $user->account);
|
||||
}
|
||||
return array('' => '') + $users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get bugs according to buildID and productID.
|
||||
*
|
||||
|
||||
@@ -129,7 +129,7 @@ js::set('blockID', $blockID);
|
||||
<th><nobr><?php echo $lang->bug->lblAssignedTo;?></nobr></th>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('assignedTo', $executionMembers, $assignedTo, "class='form-control chosen'");?>
|
||||
<?php echo html::select('assignedTo', $productMembers, $assignedTo, "class='form-control chosen'");?>
|
||||
<span class='input-group-btn'><?php echo html::commonButton($lang->bug->allUsers, "class='btn btn-default' onclick='loadAllUsers()' data-toggle='tooltip'");?></span>
|
||||
</div>
|
||||
</td>
|
||||
@@ -325,7 +325,7 @@ js::set('blockID', $blockID);
|
||||
<tr>
|
||||
<td colspan="3" class="text-center form-actions">
|
||||
<?php echo html::submitButton();?>
|
||||
<?php if($caseID == 0) echo html::backButton();?>
|
||||
<?php echo html::backButton();?>
|
||||
<?php echo html::hidden('case', (int)$caseID) . html::hidden('caseVersion', (int)$version);?>
|
||||
<?php echo html::hidden('result', (int)$runID) . html::hidden('testtask', empty($testtask) ? 0 : $testtask->id);?>
|
||||
</td>
|
||||
|
||||
@@ -295,7 +295,7 @@ class commonModel extends model
|
||||
|
||||
echo "<a class='dropdown-toggle' data-toggle='dropdown'>";
|
||||
echo "<div id='main-avatar' class='avatar avatar bg-secondary avatar-circle'>";
|
||||
echo $app->user->avatar ? html::image($app->user->avatar) : strtoupper($app->user->account[0]);
|
||||
echo !empty($app->user->avatar) ? html::image($app->user->avatar) : strtoupper($app->user->account[0]);
|
||||
echo "</div>\n";
|
||||
echo '</a>';
|
||||
echo "<ul class='dropdown-menu pull-right'>";
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
}
|
||||
if(moduleName === 'user')
|
||||
{
|
||||
if(['todo', 'todocalendar', 'effortcalendar', 'effort', 'task', 'todo', 'story', 'bug', 'testtask', 'testcase', 'execution', 'dynamic', 'profile', 'view'].includes(methodLowerCase)) return 'system';
|
||||
if(['todo', 'todocalendar', 'effortcalendar', 'effort', 'task', 'todo', 'story', 'bug', 'testtask', 'testcase', 'execution', 'dynamic', 'profile', 'view', 'issue', 'risk'].includes(methodLowerCase)) return 'system';
|
||||
}
|
||||
if(moduleName === 'my')
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
<td><?php echo $case->stepNumber;?></td>
|
||||
<td class='c-actions'>
|
||||
<?php common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list');?>
|
||||
<?php common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'list', '', 'hiddenwin');?>
|
||||
<?php common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'list', 'trash', 'hiddenwin');?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $i++;?>
|
||||
|
||||
@@ -203,7 +203,7 @@ class todoModel extends model
|
||||
->setIF($this->post->end == false, 'end', '2400')
|
||||
->setDefault('private', 0)
|
||||
->stripTags($this->config->todo->editor->edit['id'], $this->config->allowedTags)
|
||||
->remove(implode(',', $this->config->todo->moduleList) . 'uid')
|
||||
->remove(implode(',', $this->config->todo->moduleList) . ',uid')
|
||||
->get();
|
||||
|
||||
if($todo->end < $todo->begin)
|
||||
|
||||
@@ -49,11 +49,11 @@
|
||||
if(isset($this->config->maxVersion))
|
||||
{
|
||||
$label = "<span class='text'>{$lang->user->issue}</span>";
|
||||
$active = ($methodName == 'issue' or $methodName == 'issue')? ' btn-active-text' : '';
|
||||
$active = $methodName == 'issue' ? ' btn-active-text' : '';
|
||||
common::printLink('user', 'issue', "userID={$user->id}", $label, '', "class='btn btn-link $active'");
|
||||
|
||||
$label = "<span class='text'>{$lang->user->risk}</span>";
|
||||
$active = ($methodName == 'risk' or $methodName == 'risk')? ' btn-active-text' : '';
|
||||
$active = $methodName == 'risk' ? ' btn-active-text' : '';
|
||||
common::printLink('user', 'risk', "userID={$user->id}", $label, '', "class='btn btn-link $active'");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user