* Merge for fixed code after tag in this release.

This commit is contained in:
王怡栋
2021-08-17 17:27:42 +08:00
parent 8864fffb70
commit bb8cf72b8b
33 changed files with 153 additions and 118 deletions
+11
View File
@@ -1445,6 +1445,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(1,'doc','edit'),
(1,'doc','editLib'),
(1,'doc','index'),
(1,'doc','tableContents'),
(1,'doc','objectLibs'),
(1,'doc','showFiles'),
(1,'doc','sort'),
@@ -1860,6 +1861,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(2,'doc','create'),
(2,'doc','edit'),
(2,'doc','index'),
(2,'doc','tableContents'),
(2,'doc','objectLibs'),
(2,'doc','showFiles'),
(2,'doc','view'),
@@ -2055,6 +2057,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(3,'doc','create'),
(3,'doc','edit'),
(3,'doc','index'),
(3,'doc','tableContents'),
(3,'doc','objectLibs'),
(3,'doc','showFiles'),
(3,'doc','view'),
@@ -2305,6 +2308,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(4,'doc','edit'),
(4,'doc','editLib'),
(4,'doc','index'),
(4,'doc','tableContents'),
(4,'doc','objectLibs'),
(4,'doc','showFiles'),
(4,'doc','view'),
@@ -2599,6 +2603,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(5,'doc','edit'),
(5,'doc','editLib'),
(5,'doc','index'),
(5,'doc','tableContents'),
(5,'doc','objectLibs'),
(5,'doc','showFiles'),
(5,'doc','view'),
@@ -2921,6 +2926,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(6,'doc','edit'),
(6,'doc','editLib'),
(6,'doc','index'),
(6,'doc','tableContents'),
(6,'doc','objectLibs'),
(6,'doc','showFiles'),
(6,'doc','view'),
@@ -3197,6 +3203,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(7,'doc','edit'),
(7,'doc','editLib'),
(7,'doc','index'),
(7,'doc','tableContents'),
(7,'doc','objectLibs'),
(7,'doc','showFiles'),
(7,'doc','view'),
@@ -3485,6 +3492,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(8,'doc','edit'),
(8,'doc','editLib'),
(8,'doc','index'),
(8,'doc','tableContents'),
(8,'doc','objectLibs'),
(8,'doc','showFiles'),
(8,'doc','view'),
@@ -3768,6 +3776,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(9,'doc','edit'),
(9,'doc','editLib'),
(9,'doc','index'),
(9,'doc','tableContents'),
(9,'doc','objectLibs'),
(9,'doc','showFiles'),
(9,'doc','view'),
@@ -3980,6 +3989,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(10,'doc','allLibs'),
(10,'doc','browse'),
(10,'doc','index'),
(10,'doc','tableContents'),
(10,'doc','objectLibs'),
(10,'doc','showFiles'),
(10,'doc','view'),
@@ -4101,6 +4111,7 @@ INSERT INTO `zt_grouppriv` (`group`, `module`, `method`) VALUES
(11,'doc','allLibs'),
(11,'doc','browse'),
(11,'doc','index'),
(11,'doc','tableContents'),
(11,'doc','objectLibs'),
(11,'doc','showFiles'),
(11,'doc','view'),
+2 -2
View File
@@ -36,7 +36,7 @@ class actionModel extends model
$actor = $actor ? $actor : $this->app->user->account;
$actionType = strtolower($actionType);
$actor = $actionType == 'openedbysystem' ? '' : $actor;
$actor = ($actionType == 'openedbysystem' or $actionType == 'closedbysystem') ? '' : $actor;
if($actor == 'guest' and $actionType == 'logout') return false;
$objectType = str_replace('`', '', $objectType);
@@ -965,7 +965,7 @@ class actionModel extends model
$objectName = array();
$objectProject = array();
if(strpos($this->config->action->needGetProjectType, $objectType) !== false)
if(strpos(",{$this->config->action->needGetProjectType},", ",{$objectType},") !== false)
{
$objectInfo = $this->dao->select("id, project, $field AS name")->from($table)->where('id')->in($objectIds)->fetchAll();
foreach($objectInfo as $object)
+1 -1
View File
@@ -475,7 +475,7 @@ class caselibModel extends model
}
else
{
$caseData->project = $this->session->project;
$caseData->project = (int)$this->session->project;
$caseData->version = 1;
$caseData->openedBy = $this->app->user->account;
$caseData->openedDate = $now;
+1 -1
View File
@@ -64,7 +64,7 @@
<?php $openApp = '';?>
<?php if($action->objectType == 'meeting') $openApp = $action->project ? "data-app='project'" : "data-app='my'";?>
<?php
if(isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false and empty($action->objectName))
if((isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false) or empty($action->objectName))
{
echo '#' . $action->objectID;
}
+1
View File
@@ -886,6 +886,7 @@ class doc extends control
$lib = $this->doc->getLibById($libID);
if(!empty($lib) and $lib->deleted == '1') $appendLib = $libID;
if($this->config->systemMode == 'classic' and $type == 'project') $type = 'execution';
list($libs, $libID, $object, $objectID) = $this->doc->setMenuByType($type, $objectID, $libID, $appendLib);
/* Set Custom. */
+9
View File
@@ -118,6 +118,15 @@ document.addEventListener('msfullscreenChange', function (e)
$(function()
{
$(document).keydown(function(event)
{
if($.cookie('isFullScreen') == 1)
{
if(event.keyCode == 37) $('#prevPage').click();
if(event.keyCode == 39) $('#nextPage').click();
}
});
$('.outline').height($('.article-content').height());
$('#content').on('click', '.outline .outline-toggle i.icon-angle-right', function()
+35 -1
View File
@@ -255,9 +255,38 @@ class docModel extends model
->fetchAll('id');
}
$projects = $this->dao->select('t1.id, t1.name')->from(TABLE_PROJECT)->alias('t1')
->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.project')
->where('t2.id')->in(array_keys($docs))
->andWhere('t2.execution')->eq(0)
->fetchPairs();
$executions = $this->dao->select('t1.id, t1.name')->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.execution')
->where('t2.id')->in(array_keys($docs))
->fetchPairs();
$products = $this->dao->select('t1.id, t1.name')->from(TABLE_PRODUCT)->alias('t1')
->leftJoin(TABLE_DOC)->alias('t2')->on('t1.id=t2.product')
->where('t2.id')->in(array_keys($docs))
->fetchPairs();
$docContents = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->in(array_keys($docs))->orderBy('version,doc')->fetchAll('doc');
$objects = array('product' => 'products', 'execution' => 'executions', 'project' => 'projects');
foreach($docs as $index => $doc)
{
foreach($objects as $type => $object)
{
if(!empty($doc->{$type}))
{
$doc->objectID = $doc->{$type};
$doc->objectName = ${$object}[$doc->{$type}];
$doc->objectType = $type;
break;
}
}
$docs[$index]->fileSize = 0;
if(isset($files[$index]))
{
@@ -1076,6 +1105,11 @@ class docModel extends model
->where('deleted')->eq(0)
->andWhere($type)->eq($objectID)
->beginIF(!empty($appendLib))->orWhere('id')->eq($appendLib)->fi()
->beginIF($type == 'project')
->andWhere('(execution')->eq(0)
->orWhere('main')->eq(0)
->markRight(1)
->fi()
->orderBy('`order`, id')
->fetchAll('id');
}
@@ -2242,7 +2276,7 @@ EOT;
/* Summary of each type. */
foreach($extensionCount as $extension => $count)
{
if(in_array($this->app->getClientLang(), ['zh-cn','zh-tw']))
if(in_array($this->app->getClientLang(), array('zh-cn','zh-tw')))
{
$extensionSummary .= $extension . ' ' . $count . $this->lang->doc->ge . $this->lang->doc->point;
}
+1 -1
View File
@@ -22,7 +22,7 @@
.board-title {padding-right: 20px;}
.board-actions {position: absolute; right: 3px; top: 3px;}
.board-actions.nav > li > a {padding: 3px 3px;}
#kanban {overflow-y: auto;}
#kanban {overflow-y: auto; min-height:350px;}
#kanban > .table {min-width: 1100px; table-layout: auto;}
#kanban.dragging .boards.dragging .board {background: #eee; opacity: .35; border-color: #f1f1f1;}
#kanban thead > tr > th {padding-left: 0; padding-right: 0;}
+2 -2
View File
@@ -2279,7 +2279,7 @@ class executionModel extends model
$projectID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('project');
$this->linkStory($executionID, $planStories, $planProducts);
$this->linkStory($projectID, $planStories, $planProducts);
if($this->config->systemMode == 'new') $this->linkStory($projectID, $planStories, $planProducts);
if($count != 0) echo js::alert(sprintf($this->lang->execution->haveDraft, $count)) . js::locate(helper::createLink('execution', 'create', "projectID=$projectID&executionID=$executionID"));
}
@@ -2434,7 +2434,7 @@ class executionModel extends model
return $this->dao->select('account, role, hours')
->from(TABLE_TEAM)
->where('root')->eq($execution)
->andWhere('type')->eq('execution')
->andWhere('type')->in('project,execution')
->andWhere('account')->notIN($currentMembers)
->fetchAll('account');
}
+1 -1
View File
@@ -87,7 +87,7 @@
<span class='label-action'><?php echo ' ' . $action->actionLabel;?></span>
<span class="text"><?php echo $action->objectLabel;?></span>
<span class="label label-id"><?php echo $action->objectID;?></span>
<?php echo html::a($action->objectLink, $action->objectName);?>
<?php if($action->objectName) echo html::a($action->objectLink, $action->objectName);?>
</span>
</div>
</li>
+2 -2
View File
@@ -10,9 +10,9 @@
<div class="btn-toolbar">
<?php
$vars = "story={$story->id}";
common::printIcon('story', 'change', $vars, $story, 'list', 'fork', '', 'btn btn-info btn-icon');
common::printIcon('story', 'change', $vars, $story, 'list', 'alter', '', 'btn btn-info btn-icon');
common::printIcon('story', 'delete', $vars, $story, 'list', 'trash', 'hiddenwin', 'btn btn-info btn-icon');
common::printIcon('story', 'review', $vars, $story, 'list', 'glasses', '', 'btn btn-info btn-icon');
common::printIcon('story', 'review', $vars, $story, 'list', 'search', '', 'btn btn-info btn-icon');
common::printIcon('story', 'close', $vars, $story, 'list', 'off', '', 'btn btn-info btn-icon iframe', true);
common::printIcon('story', 'edit', $vars, $story, 'list', '', '', 'btn btn-info btn-icon');
common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=&param=0&$vars", $story, 'list', 'sitemap', '', 'btn btn-info btn-icon');
+14 -14
View File
@@ -140,6 +140,20 @@ $lang->resource->todo->activate = 'activate';
$lang->resource->todo->close = 'close';
$lang->resource->todo->batchClose = 'batchClose';
/* Personnel . */
$lang->resource->personnel = new stdclass();
$lang->resource->personnel->accessible = 'accessible';
$lang->resource->personnel->invest = 'invest';
$lang->resource->personnel->whitelist = 'whitelist';
$lang->resource->personnel->addWhitelist = 'addWhitelist';
$lang->resource->personnel->unbindWhitelist = 'unbindWhitelist';
$lang->personnel->methodOrder[5] = 'accessible';
$lang->personnel->methodOrder[10] = 'invest';
$lang->personnel->methodOrder[15] = 'whitelist';
$lang->personnel->methodOrder[20] = 'addWhitelist';
$lang->personnel->methodOrder[25] = 'unbindWhitelist';
global $config;
if($config->systemMode == 'new')
{
@@ -267,20 +281,6 @@ if($config->systemMode == 'new')
$lang->projectbuild->methodOrder[5] = 'browse';
/* Personnel . */
$lang->resource->personnel = new stdclass();
$lang->resource->personnel->accessible = 'accessible';
$lang->resource->personnel->invest = 'invest';
$lang->resource->personnel->whitelist = 'whitelist';
$lang->resource->personnel->addWhitelist = 'addWhitelist';
$lang->resource->personnel->unbindWhitelist = 'unbindWhitelist';
$lang->personnel->methodOrder[5] = 'accessible';
$lang->personnel->methodOrder[10] = 'invest';
$lang->personnel->methodOrder[15] = 'whitelist';
$lang->personnel->methodOrder[20] = 'addWhitelist';
$lang->personnel->methodOrder[25] = 'unbindWhitelist';
/* Project Story. */
$lang->resource->projectstory = new stdclass();
$lang->resource->projectstory->story = 'story';
+2 -2
View File
@@ -71,7 +71,7 @@
if(code) return code;
var link = $.parseLink(urlOrModuleName);
if(!link.moduleName || link.isOnlyBody) return '';
if(!link.moduleName || link.isOnlyBody || (link.moduleName === 'index' && link.methodName === 'index')) return '';
if(link.hash && link.hash.indexOf('app=') === 0) return link.hash.substr(4);
@@ -463,7 +463,7 @@
{
var $item = $(this);
var isDivider = $item.hasClass('divider');
var height = isDivider ? 17 : 40;
var height = isDivider ? 17 : ($.cookie('hideMenu') ? 44 : 40);
currentHeight += height;
if(currentHeight > maxHeight)
{
+1 -1
View File
@@ -2,5 +2,5 @@
$config->job = new stdclass();
$config->job->create = new stdclass();
$config->job->edit = new stdclass();
$config->job->create->requiredFields = 'name,repo,server,pipeline,triggerType';
$config->job->create->requiredFields = 'name,repo,engine,server,pipeline,triggerType';
$config->job->edit->requiredFields = 'name,repo,server,pipeline,triggerType';
+1 -1
View File
@@ -60,7 +60,7 @@
<?php $openApp = '';?>
<?php if($action->objectType == 'meeting') $openApp = $action->project ? "data-app='project'" : "data-app='my'";?>
<?php
if(isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false and empty($action->objectName))
if((isset($config->maxVersion) and strpos($config->action->assetType, $action->objectType) !== false) or empty($action->objectName))
{
echo '#' . $action->objectID;
}
+2 -2
View File
@@ -1,7 +1,7 @@
<?php
$lang->personnel->common = '项目集人员';
$lang->personnel->common = '可访问人员';
$lang->personnel->accessible = '可访问人员列表';
$lang->personnel->invest = '投入人员列表';
$lang->personnel->invest = '投入人员列表';
$lang->personnel->department = '部门';
$lang->personnel->realName = '真实姓名';
$lang->personnel->userName = '用户名';
+15 -4
View File
@@ -473,6 +473,7 @@ class personnelModel extends model
->where('t1.objectID')->eq($objectID)
->andWhere('t1.type')->eq('whitelist')
->andWhere('t1.objectType')->eq($objectType)
->andWhere('t2.realname')->ne('')
->orderBy($orderBy)
->beginIF(!empty($pager))->page($pager)->fi()
->fetchAll();
@@ -488,7 +489,7 @@ class personnelModel extends model
*/
public function getWhitelistAccount($objectID = 0, $objectType = '')
{
return $this->dao->select('account')->from(TABLE_ACL)->where('objectID')->eq($objectID)->andWhere('objectType')->eq($objectType)->fetchPairs('account');
return $this->dao->select('account')->from(TABLE_ACL)->where('objectID')->eq($objectID)->andWhere('objectType')->eq($objectType)->fetchPairs('account', 'account');
}
/**
@@ -536,8 +537,18 @@ class personnelModel extends model
if($updateType == 'increase')
{
$oldWhitelist = $this->dao->select('whitelist')->from($objectTable)->where('id')->eq($objectID)->fetch('whitelist');
$oldWhitelist = explode(',', $oldWhitelist);
$accounts = array_unique(array_merge($accounts, $oldWhitelist));
$groups = $this->dao->select('id')->from(TABLE_GROUP)->where('id')->in($oldWhitelist)->fetchPairs('id', 'id');
if($groups)
{
$oldWhitelist = $this->dao->select('account')->from(TABLE_USERGROUP)->where('`group`')->in($groups)->fetchPairs('account', 'account');
if($oldWhitelist) $accounts = array_unique(array_merge($accounts, $oldWhitelist));
}
else
{
$oldWhitelist = $this->dao->select('account')->from(TABLE_USER)->where('account')->in($oldWhitelist)->fetchPairs('account', 'account');
if($oldWhitelist) $accounts = array_unique(array_merge($accounts, $oldWhitelist));
}
}
$whitelist = ',' . implode(',', $accounts);
$this->dao->update($objectTable)->set('whitelist')->eq($whitelist)->where('id')->eq($objectID)->exec();
@@ -575,7 +586,7 @@ class personnelModel extends model
$projectWhitelist = $this->getWhitelistAccount($sprint->project, 'project');
$newWhitelist = array_merge($projectWhitelist, $accounts);
$source = $source == 'upgrade' ? 'upgrade' : 'sync';
$this->updateWhitelist($newWhitelist, 'project', $sprint->project, 'whitelist', $source);
$this->updateWhitelist($newWhitelist, 'project', $sprint->project, 'whitelist', $source, $updateType);
/* Removal of whitelisted persons from projects. */
if($updateType == 'replace')
+1 -2
View File
@@ -58,8 +58,7 @@
<td title="<?php echo $user->email;?>"><?php echo $user->email;?></td>
<td class='c-actions'>
<?php
$deleteClass = common::hasPriv($module, 'unbindWhitelist') ? 'btn' : 'btn disabled';
echo html::a($this->createLink($module, 'unbindWhitelist', "id=$user->id&confirm=no"), '<i class="icon-unlink"></i>', 'hiddenwin', "title='{$lang->personnel->delete}' class='{$deleteClass}' $openApp");
if(common::hasPriv($module, 'unbindWhitelist')) echo html::a($this->createLink($module, 'unbindWhitelist', "id=$user->id&confirm=no"), '<i class="icon-unlink"></i>', 'hiddenwin', "title='{$lang->personnel->delete}' class='btn' $openApp");
?>
</td>
</tr>
+1 -1
View File
@@ -86,7 +86,7 @@
<span class='label-action'><?php echo ' ' . $action->actionLabel;?></span>
<span class="text"><?php echo $action->objectLabel;?></span>
<span class="label label-id"><?php echo $action->objectID;?></span>
<?php echo html::a($action->objectLink, $action->objectName);?>
<?php if($action->objectName) echo html::a($action->objectLink, $action->objectName);?>
</span>
</div>
</li>
+2 -2
View File
@@ -62,8 +62,8 @@
<td class='c-status'><span class="status-program status-<?php echo $program->status?>"><?php echo zget($lang->project->statusList, $program->status, '');?></span></td>
<td>
<?php if(!empty($program->PM)):?>
<div class='avatar bg-secondary avatar-circle'>
<?php echo !empty(zget($usersAvatar, $program->PM, '')) ? html::image(zget($usersAvatar, $program->PM)) : strtoupper($program->PM[0]);?>
<div class="avatar bg-secondary avatar-circle avatar-<?php echo $program->PM;?>">
<?php echo !empty($usersAvatar[$program->PM]) ? html::image($usersAvatar[$program->PM]) : strtoupper($program->PM[0]);?>
</div>
<?php $userID = isset($PMList[$program->PM]) ? $PMList[$program->PM]->id : '';?>
<?php $userName = zget($users, $program->PM);?>
+8 -6
View File
@@ -50,6 +50,7 @@
#cards .project-actions .open>.dropdown-menu ul {display: flex;}
#cards .menu-actions .btn.btn-action {margin-bottom: -3px !important; margin-right: 5px;}
#cards .icon-ellipsis-v {font-size: 13px;}
#cards .teamTitle {margin-bottom: 30px;}
</style>
<div id="mainMenu" class="clearfix table-row">
<div class="btn-toolBar pull-left">
@@ -113,6 +114,7 @@
$budgetTitle = $project->budget != 0 ? zget($lang->project->currencySymbol, $project->budgetUnit) . ' ' . $projectBudget : $lang->project->budget . $lang->project->future;
$project->end = $project->end == LONG_TIME ? $this->lang->project->longTime : $project->end;
$project->date = str_replace('-', '.', $project->begin) . ' - ' . str_replace('-', '.', $project->end);
$canActions = (common::hasPriv('project','edit') or common::hasPriv('project','start') or common::hasPriv('project','activate') or common::hasPriv('project','suspend') or common::hasPriv('project','close'));
?>
<span title="<?php echo $budgetTitle;?>" class='label label-outline budget'><?php echo $budgetTitle;?></span>
<span title="<?php echo $project->date;?>" class="label label-outline <?php echo $status == 'delay' ? 'text-red' : '';?>"><?php echo $project->date;?></span>
@@ -136,20 +138,21 @@
</div>
</div>
<div class='project-footer table-row'>
<div class='teamTitle'><?php echo $lang->project->teamMember;?></div>
<?php $titleClass = ($project->teamCount == 0 and !$canActions) ? 'teamTitle' : '';?>
<div class="<?php echo $titleClass?>"><?php echo $lang->project->teamMember;?></div>
<?php if(!empty($project->teamMembers)):?>
<div class='project-members table-col'>
<a href='<?php echo helper::createLink('project', 'manageMembers', "projectID=$projectID");?>'>
<?php foreach($project->teamMembers as $key => $member):?>
<?php if($key > 2) continue;?>
<div class='avatar bg-secondary avatar-circle'>
<?php echo !empty(zget($usersAvatar, $member, '')) ? html::image(zget($usersAvatar, $member)) : strtoupper($member[0]);?>
<div class="avatar bg-secondary avatar-circle avatar-<?php echo $member;?>">
<?php echo !empty($usersAvatar[$member]) ? html::image(zget($usersAvatar, $member)) : strtoupper($member[0]);?>
</div>
<?php endforeach;?>
<?php if($project->teamCount > 3):?>
<?php echo '...';?>
<div class='avatar bg-secondary avatar-circle'>
<?php echo !empty(zget($usersAvatar, end($project->teamMembers), '')) ? html::image(zget($usersAvatar, end($project->teamMembers))) : strtoupper($member[0]);?>
<div class="avatar bg-secondary avatar-circle avatar-<?php echo $member;?>">
<?php echo !empty($usersAvatar[end($project->teamMembers)]) ? html::image(zget($usersAvatar, end($project->teamMembers))) : strtoupper($member[0]);?>
</div>
<?php endif;?>
</a>
@@ -158,7 +161,6 @@
<span class='totalMembers'><?php echo html::a(helper::createLink('project', 'manageMembers', "projectID=$projectID"), sprintf($lang->project->teamSumCount, $project->teamCount));?></span>
<div class='project-actions table-col'>
<div class='menu-actions'>
<?php $canActions = (common::hasPriv('project','edit') or common::hasPriv('project','start') or common::hasPriv('project','activate') or common::hasPriv('project','suspend') or common::hasPriv('project','close'));?>
<?php if($canActions):?>
<?php echo html::a('javascript:;', "<i class='icon icon-ellipsis-v'></i>", '', "data-toggle='dropdown' class='btn btn-link'");?>
<ul class='dropdown-menu pull-right'>
+1 -1
View File
@@ -87,7 +87,7 @@
<span class='label-action'><?php echo ' ' . $action->actionLabel;?></span>
<span class="text"><?php echo $action->objectLabel;?></span>
<span class="label label-id"><?php echo $action->objectID;?></span>
<?php echo html::a($action->objectLink, $action->objectName);?>
<?php if($action->objectName) echo html::a($action->objectLink, $action->objectName);?>
</span>
</div>
</li>
+1 -3
View File
@@ -44,13 +44,11 @@ class projectreleaseModel extends model
* Get list of releases.
*
* @param int $projectID
* @param int $productID
* @param int $branch
* @param string $type
* @access public
* @return array
*/
public function getList($projectID, $productID, $branch = 0, $type = 'all')
public function getList($projectID, $type = 'all')
{
return $this->dao->select('t1.*, t2.name as productName, t3.id as buildID, t3.name as buildName, t3.execution, t4.name as executionName')
->from(TABLE_RELEASE)->alias('t1')
+1 -1
View File
@@ -701,7 +701,7 @@ class searchModel extends model
if(empty($savedDict)) $savedDict = $this->dao->select("`key`")->from(TABLE_SEARCHDICT)->fetchPairs('key', 'key');
foreach($dict as $key => $value)
{
if(!is_numeric($key) or empty($value) or strlen($key) != 5) continue;
if(!is_numeric($key) or empty($value) or strlen($key) != 5 or $key < 0 or $key > 65535) continue;
if(isset($savedDict[$key])) continue;
$this->dao->insert(TABLE_SEARCHDICT)->data(array('key' => $key, 'value' => $value))->exec();
+1
View File
@@ -44,6 +44,7 @@ class storyModel extends model
$story->executions = $this->dao->select('t1.project, t2.name, t2.status')->from(TABLE_PROJECTSTORY)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project = t2.id')
->where('t1.story')->eq($storyID)
->andWhere('t2.type')->in('sprint,stage')
->orderBy('t1.`order` DESC')
->fetchAll('project');
$story->tasks = $this->dao->select('id, name, assignedTo, execution, status, consumed, `left`')->from(TABLE_TASK)->where('story')->eq($storyID)->andWhere('deleted')->eq(0)->orderBy('id DESC')->fetchGroup('execution');
+6 -6
View File
@@ -20,29 +20,29 @@ $(function()
alert(selectExecution);
return false;
}
var onlybody = config.onlybody;
var onlybody = config.onlybody == 'yes';
var projectID = $('#project').val();
var link = createLink('task', 'create', 'executionID=' + executionID + '&storyID=0&moduleID=0&taskID=0&todoID=' + todoID, config.defaultView, 'no', projectID);
var link = createLink('task', 'create', 'executionID=' + executionID + '&storyID=0&moduleID=0&taskID=0&todoID=' + todoID, config.defaultView, onlybody);
location.href = link;
})
$('#toStoryButton').click(function()
{
var onlybody = config.onlybody;
var onlybody = config.onlybody == 'yes';
var programID = $('#productProgram').val();
var productID = $('#product').val();
var link = createLink('story', 'create', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&projectID=0&bugID=0&planID=0&todoID=' + todoID, config.defaultView, 'no', programID);
var link = createLink('story', 'create', 'productID=' + productID + '&branch=0&moduleID=0&storyID=0&projectID=0&bugID=0&planID=0&todoID=' + todoID, config.defaultView, onlybody);
location.href = link;
})
$('#toBugButton').click(function()
{
var onlybody = config.onlybody;
var onlybody = config.onlybody == 'yes';
var projectID = $('#bugProject').val();
var productID = $('#bugProduct').val();
var link = createLink('bug', 'create', 'productID=' + productID + '&branch=0&extras=todoID=' + todoID, config.defaultView, 'no', projectID);
var link = createLink('bug', 'create', 'productID=' + productID + '&branch=0&extras=todoID=' + todoID, config.defaultView, onlybody);
location.href = link;
})
+5 -4
View File
@@ -578,9 +578,9 @@ class upgrade extends control
die(js::locate($this->createLink('upgrade', 'mergeRepo'), 'parent'));
}
$repos = $this->dao->select('id, name')->from(TABLE_REPO)->where('deleted')->eq(0)->andWhere('product')->eq('')->fetchPairs();
if(empty($repos))
$repos = $this->dao->select('id, name')->from(TABLE_REPO)->where('deleted')->eq(0)->andWhere('product')->eq('')->fetchPairs();
$products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('deleted')->eq(0)->fetchPairs();
if(empty($repos) or empty($products))
{
$this->loadModel('setting')->deleteItems('owner=system&module=common&section=global&key=upgradeStep');
die(js::locate($this->createLink('upgrade', 'afterExec', "fromVersion=&processed=no")));
@@ -588,8 +588,9 @@ class upgrade extends control
$this->view->title = $this->lang->upgrade->mergeRepo;
$this->view->repos = $repos;
$this->view->products = $this->dao->select('id, name')->from(TABLE_PRODUCT)->where('deleted')->eq(0)->fetchPairs();
$this->view->products = $products;
$this->view->programs = $this->dao->select('id, name')->from(TABLE_PROGRAM)->where('deleted')->eq(0)->andWhere('type')->eq('program')->fetchPairs();
$this->display();
}
+17 -42
View File
@@ -4530,6 +4530,15 @@ class upgradeModel extends model
$this->dao->replace(TABLE_PROJECTSTORY)->data($projectStory)->exec();
}
/* Sync testcases of executions to projects when classic mode switched to new mode. */
$projectCases = $this->dao->select('`case`,product,project,count,version')->from(TABLE_PROJECTCASE)->where('project')->in($sprintIdList)->fetchAll();
foreach($projectCases as $projectCase)
{
$projectCase->project = $projectID;
$projectCase->order = $projectCase->case * 5;
$this->dao->insert(TABLE_PROJECTCASE)->data($projectCase)->exec();
}
/* Put sprint cases into project case table. */
$sprintCases = $this->dao->select('t2.case,t2.version,t1.product,t1.execution as project')
->from(TABLE_TESTTASK)->alias('t1')
@@ -4537,20 +4546,11 @@ class upgradeModel extends model
->where('t1.execution')->in($sprintIdList)
->fetchAll();
$sprintCases += $this->dao->select('`case`,product,project,count,version')->from(TABLE_PROJECTCASE)->where('project')->in($sprintIdList)->fetchAll();
foreach($sprintCases as $projectCase)
foreach($sprintCases as $sprintCase)
{
$caes = new stdClass();
$case->case = $projectCase->case;
$case->order = $projectCase->case * 5;
$case->project = $projectCase->project;
$case->product = $projectCase->product;
$this->dao->replace(TABLE_PROJECTCASE)->data($case)->exec();
$projectCase->order = $projectCase->case * 5;
$projectCase->project = $projectID;
$this->dao->replace(TABLE_PROJECTCASE)->data($projectCase)->exec();
$sprintCase->order = $sprintCase->case * 5;
$sprintCase->project = $projectID;
$this->dao->replace(TABLE_PROJECTCASE)->data($sprintCase)->exec();
}
/* Compute sprint path, grade and the minimum start date and end date of the project. */
@@ -4733,7 +4733,7 @@ class upgradeModel extends model
$whitelist += zget($whitelistACL, $productID, array());
$this->personnel->updateWhitelist($whitelist, 'product', $product->id, 'whitelist', 'upgrade');
$this->personnel->updateWhitelist($whitelist, 'product', $product->id, 'whitelist', 'upgrade', 'increase');
}
$customSprints = $this->dao->select('*')->from(TABLE_PROJECT)->where('whitelist')->ne('')->andWhere('type')->in('sprint,stage')->fetchAll('id');
@@ -4748,7 +4748,7 @@ class upgradeModel extends model
foreach(zget($groupAccounts, $group, array()) as $account => $userGroup) $whitelist[$account] = $account;
}
$this->personnel->updateWhitelist($whitelist, 'sprint', $sprint->id, 'whitelist', 'upgrade');
$this->personnel->updateWhitelist($whitelist, 'sprint', $sprint->id, 'whitelist', 'upgrade', 'increase');
}
}
@@ -4758,32 +4758,7 @@ class upgradeModel extends model
->join('products', ',')
->get();
foreach($data->repos as $repoID)
{
/* If have no products, add it. */
if(isset($data->name))
{
$product = new stdclass();
$product->program = $data->program;
$product->name = $data->name;
$product->acl = 'open';
$product->PO = isset($this->app->user->account) ? $this->app->user->account : '';
$product->createdBy = isset($this->app->user->account) ? $this->app->user->account : '';
$product->createdDate = helper::now();
$product->status = 'normal';
$product->createdVersion = $this->config->version;
$this->dao->insert(TABLE_PRODUCT)->data($product)->exec();
$productID = $this->dao->lastInsertID();
$this->loadModel('action')->create('product', $productID, 'openedbysystem');
$this->dao->update(TABLE_REPO)->set('product')->eq($productID)->where('id')->eq($repoID)->exec();
}
else
{
$this->dao->update(TABLE_REPO)->set('product')->eq($data->products)->where('id')->eq($repoID)->exec();
}
}
foreach($data->repos as $repoID) $this->dao->update(TABLE_REPO)->set('product')->eq($data->products)->where('id')->eq($repoID)->exec();
}
/**
@@ -5207,7 +5182,7 @@ class upgradeModel extends model
*/
public function adjustPriv15_3()
{
$groups = $this->dao->select('`group`')->from(TABLE_GROUPPRIV)->where('module')->eq('doc')->andWhere('method')->eq('view')->fetchPairs('group', 'group');
$groups = $this->dao->select('`group`')->from(TABLE_GROUPPRIV)->where('module')->eq('doc')->andWhere('method')->in('view,objectLibs')->fetchPairs('group', 'group');
foreach($groups as $groupID)
{
$groupPriv = new stdclass();
-11
View File
@@ -38,21 +38,10 @@
<div class='table-col pgmWidth' id='programBox'>
<div class='cell'>
<table class='table table-form'>
<?php if($products):?>
<tr>
<th class='w-70px'><?php echo $lang->upgrade->product;?></th>
<td><?php echo html::select("products[]", $products, '', "class='form-control chosen' multiple");?></td>
</tr>
<?php else:?>
<tr>
<th class='w-100px'><?php echo $lang->upgrade->existProgram;?></th>
<td><?php echo html::select("program", $programs, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->upgrade->product;?></th>
<td><?php echo html::input("name", '', "class='form-control'");?></td>
</tr>
<?php endif;?>
<tr>
<td colspan='2' class='text-center form-actions'><?php echo html::submitButton();?></td>
</tr>
+2
View File
@@ -719,6 +719,7 @@ class user extends control
}
$this->view->rand = $this->user->updateSessionRandom();
$this->view->user = $user;
$this->display();
}
@@ -1138,6 +1139,7 @@ class user extends control
$this->file->cropImage($image->realPath, $image->realPath, $size->left, $size->top, $size->right - $size->left, $size->bottom - $size->top, $size->scaled ? $size->scaleWidth : 0, $size->scaled ? $size->scaleHeight : 0);
$this->app->user->avatar = $image->webPath;
$this->session->set('user', $this->app->user);
exit('success');
}
+3 -1
View File
@@ -48,8 +48,10 @@ $imgCutter.imgCutter(
ready: function() {$.zui.ajustModalPosition(); $imgCutter.css('width', $imgCutter.closest('#mainContent').width());},
done: function(response)
{
var account = "<?php echo $this->app->user->account;?>";
window.parent.$('#main-avatar, #menu-avatar').html('<img src="<?php echo $user->avatar?>"/>');
window.parent.$('#mainContent .avatar').html('<img src="<?php echo $user->avatar?>"/>');
window.parent.$('#mainContent>.cell>.main-header>.avatar').html('<img src="<?php echo $user->avatar?>"/>');
window.parent.$('#mainContent .avatar-' + account).html('<img src="<?php echo $user->avatar?>"/>');
if(window.parent.$('#main-avatar, #menu-avatar').hasClass('with-text')) window.parent.$('#main-avatar, #menu-avatar').toggleClass('with-text').css('background', 'none');
location.href = createLink('my', 'profile');
},
+1 -1
View File
@@ -55,7 +55,7 @@
<span class='label-action'><?php echo ' ' . $action->actionLabel;?></span>
<span class="text-muted"><?php echo $action->objectLabel;?></span>
<span class="label label-id"><?php echo $action->objectID;?></span>
<?php echo html::a($action->objectLink, $action->objectName);?>
<?php if($action->objectName) echo html::a($action->objectLink, $action->objectName);?>
</span>
</div>
</li>
+2 -2
View File
File diff suppressed because one or more lines are too long