Merge branch '15.0.beta3' of https://gitlab.zcorp.cc/easycorp/zentaopms into 15.0.beta3

This commit is contained in:
wangyidong
2021-04-12 10:31:20 +08:00
19 changed files with 72 additions and 85 deletions

View File

@@ -1 +1 @@
15.0.rc1
15.0.rc2

View File

@@ -32,6 +32,7 @@ $filter->bug = new stdclass();
$filter->caselib = new stdclass();
$filter->doc = new stdclass();
$filter->product = new stdclass();
$filter->branch = new stdclass();
$filter->qa = new stdclass();
$filter->story = new stdclass();
$filter->task = new stdclass();
@@ -78,6 +79,7 @@ $filter->product->default = new stdclass();
$filter->product->index = new stdclass();
$filter->product->export = new stdclass();
$filter->product->project = new stdclass();
$filter->branch->default = new stdclass();
$filter->program->default = new stdclass();
$filter->program->pgmproject = new stdclass();
$filter->program->prjbrowse = new stdclass();
@@ -166,6 +168,8 @@ $filter->product->index->cookie['preBranch'] = 'int';
$filter->product->export->cookie['checkedItem'] = 'reg::checked';
$filter->product->project->cookie['involved'] = 'code';
$filter->branch->default->cookie['preBranch'] = 'int';
$filter->program->default->cookie['lastPGM'] = 'int';
$filter->program->default->cookie['lastPRJ'] = 'int';
$filter->program->prjbrowse->cookie['programType'] = 'code';

View File

@@ -69,8 +69,9 @@ class branch extends control
$this->view->extra = $extra;
$branches = $this->branch->getPairs($productID);
$this->view->branches = $branches;
$this->view->branchesPinyin = common::convert2Pinyin($branches);
$this->view->branches = $branches;
$this->view->currentBranchID = $this->cookie->preBranch;
$this->view->branchesPinyin = common::convert2Pinyin($branches);
$this->display();
}

View File

@@ -2,12 +2,14 @@
<?php js::set('module', $module);?>
<?php js::set('method', $method);?>
<?php js::set('extra', $extra);?>
<style> #mainHeader #dropMenu>.list-group {padding: 5px 0 0 10px;} </style>
<div class="list-group">
<?php
foreach($branches as $branchID => $branch)
{
$selected = $branchID == $currentBranchID ? 'selected' : '';
$linkHtml = $this->branch->setParamsForLink($module, $link, $projectID, $productID, $branchID);
echo html::a($linkHtml, "<i class='icon-cube'></i> " . $branch, '', "data-key='{$branchesPinyin[$branch]}'");
echo html::a($linkHtml, $branch, '', "class='$selected' data-key='{$branchesPinyin[$branch]}'");
}
?>
</div>

View File

@@ -1545,7 +1545,7 @@ class bugModel extends model
$execution = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->eq($build->execution)->fetch();
$beforeBuilds = $this->dao->select('t1.id')->from(TABLE_BUILD)->alias('t1')
->leftJoin(TABLE_EXECTUION)->alias('t2')->on('t1.execution=t2.id')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution=t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.status')->ne('done')
->andWhere('t2.deleted')->eq(0)

View File

@@ -188,10 +188,6 @@ class build extends control
if(!$build) die(js::error($this->lang->notFound) . js::locate('back'));
$this->session->project = $build->project;
/* Set session and load modules. */
if($type == 'story')$this->session->set('storyList', $this->app->getURI(true), 'product');
if($type == 'bug') $this->session->set('bugList', $this->app->getURI(true), 'qa');
$this->loadModel('story');
$this->loadModel('bug');
@@ -404,7 +400,7 @@ class build extends control
}
/**
* Link stories
* Link stories.
*
* @param int $buildID
* @param string $browseType
@@ -423,7 +419,7 @@ class build extends control
die(js::locate(inlink('view', "buildID=$buildID&type=story"), 'parent'));
}
$this->session->set('storyList', inlink('view', "buildID=$buildID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'product');
$this->session->set('storyList', inlink('view', "buildID=$buildID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), $this->app->openApp);
$build = $this->build->getById($buildID);
$product = $this->loadModel('product')->getById($build->product);

View File

@@ -501,7 +501,7 @@ class doc extends control
$this->app->rawMethod = $objectType;
/* High light menu. */
if($objectType)
if(strpos(',product,project,execution,custom,book,', ",$objectType,") !== false)
{
$menu = $this->lang->doc->menu->$objectType;
$menu['alias'] .= ',edit';
@@ -982,7 +982,7 @@ class doc extends control
*/
public function objectLibs($type, $objectID = 0, $libID = 0, $docID = 0, $version = 0)
{
$this->session->set('docList', $this->app->getURI(true), 'doc');
$this->session->set('docList', $this->app->getURI(true), $this->app->openApp);
$objects = $this->doc->getOrderedObjects($type);

View File

@@ -258,6 +258,7 @@ class execution extends control
*
* @param int $executionID
* @param string $groupBy the field to group by
* @param string $filter
* @access public
* @return void
*/
@@ -268,7 +269,6 @@ class execution extends control
/* Save session. */
$this->app->session->set('taskList', $this->app->getURI(true), 'execution');
$this->app->session->set('storyList', $this->app->getURI(true), 'product');
/* Header and session. */
$this->view->title = $execution->name . $this->lang->colon . $this->lang->execution->task;
@@ -491,7 +491,6 @@ class execution extends control
/* Save session. */
$this->app->session->set('taskList', $this->app->getURI(true), 'execution');
$this->app->session->set('storyList', $this->app->getURI(true), 'product');
$this->view->title = $execution->name . $this->lang->colon . $this->lang->execution->importTask;
$this->view->position[] = html::a(inlink('browse', "executionID=$toExecution"), $execution->name);
@@ -530,12 +529,6 @@ class execution extends control
$browseType = strtolower($browseType);
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
/* Save to session. */
$uri = $this->app->getURI(true);
$this->app->session->set('bugList', $uri, 'qa');
$this->app->session->set('storyList', $uri, 'product');
$this->app->session->set('executionList', $uri, 'execution');
$this->loadModel('bug');
$executions = $this->execution->getPairs(0, 'all', 'nocode');
$this->execution->setMenu($executionID);
@@ -822,7 +815,7 @@ class execution extends control
}
/**
* Exectuion qa dashboard.
* Execution qa dashboard.
*
* @param int $executionID
* @access public
@@ -1811,7 +1804,6 @@ class execution extends control
/* Save to session. */
$uri = $this->app->getURI(true);
$this->app->session->set('taskList', $uri, 'execution');
$this->app->session->set('storyList', $uri, 'product');
$this->app->session->set('bugList', $uri, 'qa');
/* Compatibility IE8*/
@@ -1836,9 +1828,9 @@ class execution extends control
$this->view->realnames = $this->loadModel('user')->getPairs('noletter');
$this->view->storyOrder = $orderBy;
$this->view->orderBy = 'id_asc';
$this->view->executionID = $executionID;
$this->view->executionID = $executionID;
$this->view->browseType = '';
$this->view->execution = $execution;
$this->view->execution = $execution;
$this->view->type = $type;
$this->view->kanbanGroup = $kanbanGroup;
$this->view->kanbanColumns = $this->execution->getKanbanColumns($kanbanSetting);
@@ -1868,8 +1860,8 @@ class execution extends control
/* Save to session. */
$uri = $this->app->getURI(true);
$this->app->session->set('taskList', $uri, 'execution');
$this->app->session->set('storyList', $uri, 'product');
$this->app->session->set('taskList', $uri, 'execution');
$this->app->session->set('storyList', $uri, 'execution');
$this->app->session->set('executionList', $uri, 'execution');
$this->app->session->set('caseList', $uri, 'qa');
$this->app->session->set('bugList', $uri, 'qa');
@@ -2004,10 +1996,6 @@ class execution extends control
*/
public function storyKanban($executionID)
{
/* Save to session. */
$uri = $this->app->getURI(true);
$this->app->session->set('storyList', $uri, 'product');
/* Compatibility IE8*/
if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7");
@@ -2026,8 +2014,8 @@ class execution extends control
$this->view->position[] = $this->lang->execution->storyKanban;
$this->view->stories = $this->story->getKanbanGroupData($stories);
$this->view->realnames = $this->loadModel('user')->getPairs('noletter');
$this->view->executionID = $executionID;
$this->view->execution = $execution;
$this->view->executionID = $executionID;
$this->view->execution = $execution;
$this->view->productID = $productID;
$this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable.
@@ -2370,15 +2358,15 @@ class execution extends control
$this->view->position[] = html::a($browseLink, $object->name);
$this->view->position[] = $this->lang->execution->linkStory;
$this->view->object = $object;
$this->view->products = $products;
$this->view->allStories = empty($allStories) ? $allStories : $allStories[$pageID - 1];;
$this->view->pager = $pager;
$this->view->browseType = $browseType;
$this->view->productType = $productType;
$this->view->modules = $modules;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->branchGroups = $branchGroups;
$this->view->object = $object;
$this->view->products = $products;
$this->view->allStories = empty($allStories) ? $allStories : $allStories[$pageID - 1];;
$this->view->pager = $pager;
$this->view->browseType = $browseType;
$this->view->productType = $productType;
$this->view->modules = $modules;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->branchGroups = $branchGroups;
$this->display();
}

View File

@@ -124,9 +124,9 @@
<ul class='dropdown-menu pull-right'>
<?php
$misc = "data-toggle='modal' data-type='iframe' data-width='95%'";
echo (common::hasPriv('task', 'create')) ? '<li>' . html::a($this->createLink('task', 'create', "executionID=$story->execution&storyID=$story->id&moduleID=$story->module", '', true), $lang->execution->wbs, '', $misc) : '' . '</li>';
echo (common::hasPriv('task', 'batchCreate')) ? '<li>' . html::a($this->createLink('task', 'batchCreate', "executionID=$story->execution&storyID=$story->id&moduleID=0&taskID=0&iframe=true", '', true), $lang->execution->batchWBS, '', $misc) : '' . '</li>';
echo (common::hasPriv('execution', 'unlinkStory')) ? '<li>' . html::a($this->createLink('execution', 'unlinkStory', "executionID=$story->execution&storyID=$story->story&confirm=no", '', true), $lang->execution->unlinkStory, 'hiddenwin') : '' . '</li>';
echo (common::hasPriv('task', 'create')) ? '<li>' . html::a($this->createLink('task', 'create', "executionID=$executionID&storyID=$story->id&moduleID=$story->module", '', true), $lang->execution->wbs, '', $misc) : '' . '</li>';
echo (common::hasPriv('task', 'batchCreate')) ? '<li>' . html::a($this->createLink('task', 'batchCreate', "executionID=$executionID&storyID=$story->id&moduleID=0&taskID=0&iframe=true", '', true), $lang->execution->batchWBS, '', $misc) : '' . '</li>';
echo (common::hasPriv('execution', 'unlinkStory')) ? '<li>' . html::a($this->createLink('execution', 'unlinkStory', "executionID=$executionID&storyID=$story->story&confirm=no", '', true), $lang->execution->unlinkStory, 'hiddenwin') : '' . '</li>';
$misc = "data-toggle='modal' data-type='iframe'";
echo (common::hasPriv('story', 'close')) ? '<li>' . html::a($this->createLink('story', 'close', "storyID=$story->id", '', true), $lang->story->close, '', $misc) : '' . '</li>';
?>

View File

@@ -78,6 +78,7 @@ class product extends control
public function project($status = 'all', $productID = 0, $branch = 0, $involved = 0)
{
$this->app->loadLang('execution');
$this->app->loadLang('project');
$this->product->setMenu($productID, $branch);

View File

@@ -427,7 +427,7 @@ class productModel extends model
$currentModule = $this->app->moduleName;
$currentMethod = $this->app->methodName;
/* init currentModule and currentMethod for report and story. */
/* Init currentModule and currentMethod for report and story. */
if($currentModule == 'story')
{
$storyMethods = ",track,create,batchcreate,batchclose,zerocase,";
@@ -436,7 +436,6 @@ class productModel extends model
}
if($currentMethod == 'report') $currentMethod = 'browse';
$this->app->loadLang('project');
$currentProductName = $this->lang->product->common;
if($productID)
{
@@ -456,7 +455,7 @@ class productModel extends model
{
$this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$currentProduct->type]);
$branches = $this->loadModel('branch')->getPairs($productID);
$branch = empty($branch) ? (int)$this->cookie->preBranch : $branch;
$branch = (int)$branch;
$branchName = isset($branches[$branch]) ? $branches[$branch] : $branches[0];
$dropMenuLink = helper::createLink('branch', 'ajaxGetDropMenu', "objectID=$productID&module=$currentModule&method=$currentMethod&extra=$extra");

View File

@@ -872,7 +872,7 @@ class project extends control
$project = $this->project->getByID($projectID);
$this->project->setMenu($projectID);
$this->session->set('buildList', $this->app->getURI(true), 'execution');
$this->session->set('buildList', $this->app->getURI(true), 'project');
/* Get products' list. */
$products = $this->project->getProducts($projectID, false);

View File

@@ -785,7 +785,7 @@ class projectModel extends model
$lib->name = $this->lang->doclib->main['project'];
$lib->type = 'project';
$lib->main = '1';
$lib->acl = 'default';
$lib->acl = $project->acl;
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
$this->updateProducts($projectID);
@@ -820,7 +820,7 @@ class projectModel extends model
$lib->name = $this->lang->doclib->main['product'];
$lib->type = 'product';
$lib->main = '1';
$lib->acl = 'default';
$lib->acl = $product->acl;
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
}
@@ -852,16 +852,6 @@ class projectModel extends model
$this->dao->replace(TABLE_USERGROUP)->data($groupPriv)->exec();
}
/* Create doc lib. */
$this->app->loadLang('doc');
$lib = new stdclass();
$lib->project = $projectID;
$lib->name = $this->lang->doclib->main['project'];
$lib->type = 'project';
$lib->main = '1';
$lib->acl = 'default';
$this->dao->insert(TABLE_DOCLIB)->data($lib)->exec();
return $projectID;
}
}

View File

@@ -192,8 +192,7 @@ class projectrelease extends control
*/
public function view($releaseID, $type = 'story', $link = 'false', $param = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
{
if($type == 'story') $this->session->set('storyList', $this->app->getURI(true), 'product');
if($type == 'bug' or $type == 'leftBug') $this->session->set('bugList', $this->app->getURI(true), 'qa');
$this->session->set('buildList', $this->app->getURI(true), 'execution');
$this->loadModel('story');
$this->loadModel('bug');
@@ -237,22 +236,23 @@ class projectrelease extends control
$this->executeHooks($releaseID);
$this->view->title = "RELEASE #$release->id $release->name/" . $product->name;
$this->view->position[] = $this->lang->release->view;
$this->view->release = $release;
$this->view->stories = $stories;
$this->view->bugs = $bugs;
$this->view->leftBugs = $leftBugs;
$this->view->actions = $this->loadModel('action')->getList('release', $releaseID);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->type = $type;
$this->view->link = $link;
$this->view->param = $param;
$this->view->orderBy = $orderBy;
$this->view->branchName = $release->productType == 'normal' ? '' : $this->loadModel('branch')->getById($release->branch);
$this->view->storyPager = $storyPager;
$this->view->bugPager = $bugPager;
$this->view->leftBugPager = $leftBugPager;
$this->view->title = "RELEASE #$release->id $release->name/" . $product->name;
$this->view->position[] = $this->lang->release->view;
$this->view->release = $release;
$this->view->stories = $stories;
$this->view->bugs = $bugs;
$this->view->leftBugs = $leftBugs;
$this->view->actions = $this->loadModel('action')->getList('release', $releaseID);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->type = $type;
$this->view->link = $link;
$this->view->param = $param;
$this->view->orderBy = $orderBy;
$this->view->branchName = $release->productType == 'normal' ? '' : $this->loadModel('branch')->getById($release->branch);
$this->view->storyPager = $storyPager;
$this->view->bugPager = $bugPager;
$this->view->leftBugPager = $leftBugPager;
$this->view->projectID = $this->session->project;
$this->display();
}
@@ -429,7 +429,7 @@ class projectrelease extends control
$this->projectrelease->linkStory($releaseID);
die(js::locate(inlink('view', "releaseID=$releaseID&type=story"), 'parent'));
}
$this->session->set('storyList', inlink('view', "releaseID=$releaseID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'product');
$this->session->set('storyList', inlink('view', "releaseID=$releaseID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), $this->app->openApp);
$release = $this->projectrelease->getByID($releaseID);
$build = $this->loadModel('build')->getByID($release->build);
@@ -482,6 +482,7 @@ class projectrelease extends control
$this->view->browseType = $browseType;
$this->view->param = $param;
$this->view->pager = $pager;
$this->view->projectID = $this->session->project;
$this->display();
}

View File

@@ -51,7 +51,7 @@
<td class='text-left nobr' title='<?php echo $story->title?>'>
<?php
if($story->parent > 0) echo "<span class='label'>{$lang->story->childrenAB}</span>";
echo html::a($this->createLink('story', 'view', "storyID=$story->id", '', true), $story->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");
echo html::a($this->createLink('story', 'view', "storyID={$story->id}&version=0&param=$projectID", '', true), $story->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");
?>
</td>
<td><?php echo zget($users, $story->openedBy);?></td>

View File

@@ -96,7 +96,7 @@
</thead>
<tbody>
<?php foreach($stories as $storyID => $story):?>
<?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id", '', true);?>
<?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id&version=0&param=$projectID", '', true);?>
<tr>
<td class='c-id text-left'>
<?php if(($canBatchUnlink or $canBatchClose) and $canBeChanged):?>

View File

@@ -145,6 +145,8 @@ class stakeholder extends control
public function edit($stakeholderID = 0)
{
$stakeholder = $this->stakeholder->getByID($stakeholderID);
$this->loadModel('project')->setMenu($stakeholder->objectID);
if($_POST)
{
$changes = $this->stakeholder->edit($stakeholderID);
@@ -318,11 +320,14 @@ class stakeholder extends control
*/
public function view($userID = 0)
{
$user = $this->stakeholder->getByID($userID);
$this->loadModel('project')->setMenu($user->objectID);
$this->commonAction($userID, 'stakeholder');
$this->view->title = $this->lang->stakeholder->common . $this->lang->colon . $this->lang->stakeholder->view;
$this->view->position[] = $this->lang->stakeholder->view;
$this->view->user = $this->stakeholder->getByID($userID);
$this->view->user = $user;
$this->view->users = $this->loadModel('execution')->getTeamMemberPairs($this->session->project,'nodeleted');
$this->view->expects = $this->stakeholder->getExpectByUser($userID);

View File

@@ -22,7 +22,7 @@
<?php echo html::select('dept', $depts, $dept, "class='form-control chosen' onchange='setDeptUsers(this)' data-placeholder='{$lang->execution->selectDeptTitle}'");?>
</div>
<?php if($project->parent and $config->systemMode == 'new'):?>
<?php echo html::a($this->createLink('stakeholder', 'batchcreate', "dept=&parent=$project->parent"), $lang->program->importStakeholder, '', 'class="btn btn-primary"');?>
<?php echo html::a($this->createLink('stakeholder', 'batchcreate', "projectID={$projectID}&dept=&parent=$project->parent"), $lang->program->importStakeholder, '', 'class="btn btn-primary"');?>
<?php endif;?>
</div>
</div>

View File

@@ -327,7 +327,7 @@ class testcase extends control
if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true));
setcookie('caseModule', 0, 0, $this->config->webRoot, '', $this->config->cookieSecure, false);
$response['locate'] = $this->createLink('testcase', 'browse', "productID={$this->post->product}&branch={$this->post->branch}&browseType=all&param=0&orderBy=id_desc");
$response['locate'] = $this->session->caseList ? $this->session->caseList : $this->createLink('testcase', 'browse', "productID={$this->post->product}&branch={$this->post->branch}&browseType=all&param=0&orderBy=id_desc");
$this->send($response);
}
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));