Merge branch 'sprint/182_liumengyi_fixbug' into 'master'
* Fix bug #18638, #18644. See merge request easycorp/zentaopms!1461
This commit is contained in:
@@ -352,14 +352,18 @@ class actionModel extends model
|
||||
}
|
||||
elseif($actionName == 'linked2execution')
|
||||
{
|
||||
$name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name');
|
||||
if($name) $action->extra = common::hasPriv('execution', 'view') ? html::a(helper::createLink('execution', 'view', "executionID=$action->execution"), $name) : $name;
|
||||
$execution = $this->dao->select('name,type')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch();
|
||||
$name = $execution->name;
|
||||
$method = $execution->type == 'kanban' ? 'kanban' : 'view';
|
||||
if($name) $action->extra = common::hasPriv('execution', $method) ? html::a(helper::createLink('execution', $method, "executionID=$action->execution"), $name) : $name;
|
||||
}
|
||||
elseif($actionName == 'linked2project')
|
||||
{
|
||||
$name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name');
|
||||
$project = $this->dao->select('name,model')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch();
|
||||
$productID = trim($action->product, ',');
|
||||
if($name) $action->extra = common::hasPriv('project', 'view') ? html::a(helper::createLink('project', 'view', "projectID=$action->project"), $name) : $name;
|
||||
$name = $project->name;
|
||||
$method = $project->model == 'kanban' ? 'index' : 'view';
|
||||
if($name) $action->extra = common::hasPriv('project', $method) ? html::a(helper::createLink('project', $method, "projectID=$action->project"), $name) : $name;
|
||||
}
|
||||
elseif($actionName == 'linked2plan')
|
||||
{
|
||||
|
||||
@@ -1978,7 +1978,7 @@ class execution extends control
|
||||
|
||||
$userList = array();
|
||||
$users = $this->loadModel('user')->getPairs('noletter|nodeleted');
|
||||
$avatarPairs = $this->dao->select('account, avatar')->from(TABLE_USER)->where('deleted')->eq(0)->fetchPairs();
|
||||
$avatarPairs = $this->user->getAvatarPairs();
|
||||
foreach($avatarPairs as $account => $avatar)
|
||||
{
|
||||
if(!$avatar) continue;
|
||||
|
||||
@@ -338,7 +338,7 @@ function renderUserAvatar(user, objectType, objectID, size)
|
||||
if(!user) return $('<a class="avatar has-text ' + avatarSizeClass + ' avatar-circle iframe" title="' + noAssigned + '" style="background: #ccc" href="' + link + '" data-toggle="modal" data-width="80%"><i class="icon icon-person"></i></a>');
|
||||
|
||||
if(typeof user === 'string') user = {account: user};
|
||||
if(!user.avatar && window.users && window.users[user.account]) user = {avatar: users[user.account].avatar, account: user.account, realname: users[user.account]};
|
||||
if(!user.avatar && window.userList && window.userList[user.account]) user = {avatar: userList[user.account].avatar, account: user.account, realname: userList[user.account]};
|
||||
|
||||
var $noPrivAvatar = $('<div class="avatar has-text ' + avatarSizeClass + ' avatar-circle" />').avatar({user: user});
|
||||
if(objectType == 'task' && !priv.canAssignTask) return $noPrivAvatar;
|
||||
|
||||
Reference in New Issue
Block a user