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

This commit is contained in:
wangyidong
2021-03-25 13:21:59 +08:00
42 changed files with 236 additions and 170 deletions
+2
View File
@@ -136,6 +136,8 @@ ALTER TABLE `zt_task` ADD `designVersion` smallint(6) unsigned NOT NULL AFTER `s
ALTER TABLE `zt_burn` ADD `storyPoint` float NOT NULL AFTER `consumed`;
ALTER TABLE `zt_burn` ADD `product` mediumint(8) unsigned NOT NULL DEFAULT '0' AFTER `execution`;
ALTER TABLE `zt_projectcase` ADD `count` mediumint(8) unsigned NOT NULL DEFAULT '1' AFTER `case`;
-- DROP TABLE IF EXISTS `zt_taskspec`;
CREATE TABLE IF NOT EXISTS `zt_taskspec` (
`task` mediumint(8) NOT NULL,
+1 -1
View File
@@ -209,7 +209,7 @@ class actionModel extends model
{
$record = (array)$record;
$record['product'] = isset($record['product']) ? ',' . $record['product'] . ',' : ',0,';
if(!isset($record['project'])) $record['project'] = 0;
if(!isset($record['project'])) $record['project'] = 0;
if(!isset($record['execution'])) $record['execution'] = 0;
return $record;
}
+5
View File
@@ -257,6 +257,10 @@ class block extends control
{
$block->moreLink = $this->createLink($moduleName, 'work', 'mode=' . $method . '&' . $vars);
}
elseif($moduleName = 'project')
{
$block->moreLink = $this->createLink('project', 'dynamic', "projectID={$this->session->project}");
}
}
elseif($block->block == 'dynamic')
{
@@ -675,6 +679,7 @@ class block extends control
->leftJoin(TABLE_PROJECTPRODUCT)->alias('t5')->on('t1.execution=t5.project')
->where('t1.deleted')->eq('0')
->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi()
->beginIF(!$this->app->user->admin)->andWhere('t1.execution')->in($this->app->user->view->sprints)->fi()
->andWhere('t1.product = t5.product')
->beginIF($this->params->type != 'all')->andWhere('t1.status')->eq($this->params->type)->fi()
->orderBy('t1.id desc')
+1 -1
View File
@@ -13,7 +13,7 @@
<th class='w-80px'><?php echo $lang->project->PM;?></th>
<th class='w-60px'><?php echo $lang->project->status;?></th>
<?php if($longBlock):?>
<th class='w-90px'><?php echo $lang->project->teamCount;?></th>
<th class='w-60px'><?php echo $lang->project->teamCount;?></th>
<th class='w-90px text-right'><?php echo $lang->task->consumed;?></th>
<th class='w-80px text-right'><?php echo $lang->project->budget;?></th>
<th class='w-80px'><?php echo $lang->project->leftStories;?></th>
+2
View File
@@ -56,6 +56,8 @@ $config->bug->editor->resolve = array('id' => 'comment', 'tools' => 'bugTools
$config->bug->editor->close = array('id' => 'comment', 'tools' => 'bugTools');
$config->bug->editor->activate = array('id' => 'comment', 'tools' => 'bugTools');
$config->bug->discardedTypes = array('interface', 'designchange', 'newfeature', 'trackthings');
global $lang;
$config->bug->search['module'] = 'bug';
$config->bug->search['fields']['title'] = $lang->bug->title;
+20 -6
View File
@@ -287,6 +287,9 @@ class bug extends control
$this->qa->setMenu($this->products, $productID);
/* Unset discarded types. */
foreach($this->config->bug->discardedTypes as $type) unset($this->lang->bug->typeList[$type]);
/* Whether there is a object to transfer bug, for example feedback. */
$extras = str_replace(array(',', ' '), array('&', ''), $extras);
parse_str($extras, $output);
@@ -370,6 +373,10 @@ class bug extends control
{
$location = $this->createLink('execution', 'bug', "executionID={$output['executionID']}");
}
if(isset($output['projectID']))
{
$location = $this->createLink('project', 'bug', "projectID={$output['projectID']}");
}
else
{
setcookie('bugModule', 0, 0, $this->config->webRoot, '', false, false);
@@ -675,11 +682,10 @@ class bug extends control
if($bug->assignedTo == $this->app->user->account) $this->loadModel('action')->read('bug', $bugID);
/* Set menu. */
if($from == 'bug')
{
$this->qa->setMenu($this->products, $bug->product, $bug->branch);
}
elseif($from == 'repo')
if($this->app->openApp == 'project') $this->loadModel('project')->setMenu($bug->project);
if($this->app->openApp == 'execution') $this->loadModel('execution')->setMenu($bug->execution);
if($this->app->openApp == 'qa') $this->qa->setMenu($this->products, $bug->product, $bug->branch);
if($this->app->openApp == 'repo')
{
session_write_close();
$repos = $this->loadModel('repo')->getRepoPairs($this->session->project);
@@ -782,7 +788,15 @@ class bug extends control
$this->bug->checkBugExecutionPriv($bug);
/* Set the menu. */
$this->bug->setMenu($this->products, $productID, $bug->branch);
if($this->app->openApp == 'project') $this->loadModel('project')->setMenu($bug->project);
if($this->app->openApp == 'execution') $this->loadModel('execution')->setMenu($bug->execution);
if($this->app->openApp == 'qa') $this->bug->setMenu($this->products, $productID, $bug->branch);
/* Unset discarded types. */
foreach($this->config->bug->discardedTypes as $type)
{
if($bug->type != $type) unset($this->lang->bug->typeList[$type]);
}
/* Set header and position. */
$this->view->title = $this->lang->bug->edit . "BUG #$bug->id $bug->title - " . $this->products[$productID];
+1 -1
View File
@@ -2,7 +2,7 @@
$config->build = new stdclass();
$config->build->create = new stdclass();
$config->build->edit = new stdclass();
$config->build->create->requiredFields = 'product,name,builder,date';
$config->build->create->requiredFields = 'product,execution,name,builder,date';
$config->build->edit->requiredFields = 'product,execution,name,builder,date';
$config->build->editor = new stdclass();
+14 -7
View File
@@ -27,6 +27,10 @@ class build extends control
if(!empty($_POST))
{
$executionID = empty($executionID) ? $this->post->execution : $executionID;
if(empty($executionID)) dao::$errors['execution'] = $this->lang->build->emptyExecution;
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$buildID = $this->build->create($executionID);
if(dao::isError()) $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('build', $buildID, 'opened');
@@ -42,7 +46,7 @@ class build extends control
{
$this->loadModel('project')->setMenu($projectID);
$executions = $this->execution->getPairs($projectID);
$executionID = $executionID == 0 ? key($executions) : $executionID;
$executionID = empty($executionID) ? key($executions) : $executionID;
$this->session->set('project', $projectID);
}
elseif($this->app->openApp == 'execution')
@@ -113,7 +117,7 @@ class build extends control
}
elseif($this->app->openApp == 'exectuion')
{
$this->execution->setMenu($this->execution->getPairs($build->project), $build->execution);
$this->execution->setMenu($build->execution);
}
/* Get stories and bugs. */
@@ -410,10 +414,12 @@ 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")));
$this->session->set('storyList', inlink('view', "buildID=$buildID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'product');
$build = $this->build->getById($buildID);
$product = $this->loadModel('product')->getById($build->product);
$this->loadModel('execution')->setMenu($this->execution->getPairs($build->project), $build->execution);
$this->loadModel('execution')->setMenu($build->execution);
$this->loadModel('story');
$this->loadModel('tree');
$this->loadModel('product');
@@ -429,9 +435,10 @@ class build extends control
$this->config->product->search['actionURL'] = $this->createLink('build', 'view', "buildID=$buildID&type=story&link=true&param=" . helper::safe64Encode("&browseType=bySearch&queryID=myQueryID"));
$this->config->product->search['queryID'] = $queryID;
$this->config->product->search['style'] = 'simple';
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($build->product => $build->product));
$this->config->product->search['params']['module']['values'] = $this->tree->getOptionMenu($build->product, $viewType = 'story', $startModuleID = 0);
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($build->product => $build->product));
$this->config->product->search['params']['module']['values'] = $this->tree->getOptionMenu($build->product, 'story', 0);
$this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList);
if($product->type == 'normal')
{
unset($this->config->product->search['fields']['branch']);
@@ -528,7 +535,7 @@ class build extends control
die(js::locate(inlink('view', "buildID=$buildID&type=bug"), 'parent'));
}
$this->session->set('bugList', inlink('view', "buildID=$buildID&type=bug&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")));
$this->session->set('bugList', inlink('view', "buildID=$buildID&type=bug&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'qa');
/* Set menu. */
$build = $this->build->getByID($buildID);
$product = $this->loadModel('product')->getByID($build->product);
+3 -3
View File
@@ -26,14 +26,14 @@ function loadProducts(executionID)
{
if(data.indexOf("required") != -1)
{
$('.input-group').addClass('required');
$('#productBox').addClass('required');
}
else
{
$('.input-group').removeClass('required');
$('#productBox').removeClass('required');
}
$('.input-group').append(data);
$('#productBox').append(data);
$('#product').chosen();
}
});
+1 -1
View File
@@ -1,7 +1,7 @@
function showLink(buildID, type, param)
{
var method = type == 'story' ? 'linkStory' : 'linkBug';
loadURL(createLink('build', method, 'buildID=' + buildID + param), type);
loadURL(createLink('build', method, 'buildID=' + buildID), type);
$('.actions').find("a[href*='" + type + "']").addClass('hidden');
}
+21 -20
View File
@@ -27,26 +27,27 @@ $lang->build->confirmUnlinkBug = "您确认移除该Bug吗?";
$lang->build->basicInfo = '基本信息';
$lang->build->id = 'ID';
$lang->build->product = $lang->productCommon;
$lang->build->branch = '平台/分支';
$lang->build->execution = '所属' . $lang->executionCommon;
$lang->build->name = '名称编号';
$lang->build->date = '打包日期';
$lang->build->builder = '构建者';
$lang->build->scmPath = '源代码地址';
$lang->build->filePath = '下载地址';
$lang->build->desc = '描述';
$lang->build->files = '上传发行包';
$lang->build->last = '上个版本';
$lang->build->packageType = '包类型';
$lang->build->unlinkStory = "移除{$lang->SRCommon}";
$lang->build->unlinkBug = '移除Bug';
$lang->build->stories = "完成的{$lang->SRCommon}";
$lang->build->bugs = '解决的Bug';
$lang->build->generatedBugs = '产生的Bug';
$lang->build->noProduct = " <span id='noProduct' style='color:red'>该{$lang->executionCommon}没有关联{$lang->productCommon},无法创建版本,请先<a href='%s' data-app='%s' data-toggle='modal' data-type='iframe'>关联{$lang->productCommon}</a></span>";
$lang->build->noBuild = '暂时没有版本。';
$lang->build->id = 'ID';
$lang->build->product = $lang->productCommon;
$lang->build->branch = '平台/分支';
$lang->build->execution = '所属' . $lang->executionCommon;
$lang->build->name = '名称编号';
$lang->build->date = '打包日期';
$lang->build->builder = '构建者';
$lang->build->scmPath = '源代码地址';
$lang->build->filePath = '下载地址';
$lang->build->desc = '描述';
$lang->build->files = '上传发行包';
$lang->build->last = '上个版本';
$lang->build->packageType = '包类型';
$lang->build->unlinkStory = "移除{$lang->SRCommon}";
$lang->build->unlinkBug = '移除Bug';
$lang->build->stories = "完成的{$lang->SRCommon}";
$lang->build->bugs = '解决的Bug';
$lang->build->generatedBugs = '产生的Bug';
$lang->build->noProduct = " <span id='noProduct' style='color:red'>该{$lang->executionCommon}没有关联{$lang->productCommon},无法创建版本,请先<a href='%s' data-app='%s' data-toggle='modal' data-type='iframe'>关联{$lang->productCommon}</a></span>";
$lang->build->noBuild = '暂时没有版本。';
$lang->build->emptyExecution = $lang->executionCommon . '不能为空。';
$lang->build->notice = new stdclass();
$lang->build->notice->changeProduct = "已经关联{$lang->SRCommon}、Bug或提交测试单的版本,不能修改其所属{$lang->productCommon}";
+4 -1
View File
@@ -352,8 +352,10 @@ class buildModel extends model
$build->stories = '';
$build->bugs = '';
$execution = $this->loadModel('execution')->getByID($executionID);
$build = fixer::input('post')
->setDefault('project', $this->session->project)
->setDefault('project', $execution->project)
->setDefault('product', 0)
->setDefault('branch', 0)
->cleanInt('product,branch')
@@ -368,6 +370,7 @@ class buildModel extends model
->batchCheck($this->config->build->create->requiredFields, 'notempty')
->check('name', 'unique', "product = {$build->product} AND branch = {$build->branch} AND deleted = '0'")
->exec();
if(!dao::isError())
{
$buildID = $this->dao->lastInsertID();
+1 -1
View File
@@ -29,7 +29,7 @@
<th><?php echo $lang->build->product;?></th>
<?php if(!empty($products)):?>
<td>
<div class='input-group'>
<div class='input-group' id='productBox'>
<?php echo html::select('product', $products, empty($product) ? '' : $product->id, "onchange='loadBranches(this.value);' class='form-control chosen' required");?>
<?php
if(!empty($product) and $product->type != 'normal' and isset($branches[$product->branch]))
+2 -1
View File
@@ -38,6 +38,7 @@
</thead>
<tbody class='text-center'>
<?php $unlinkedCount = 0;?>
<?php $objectID = $this->app->openApp == 'execution' ? $build->execution : $build->project;?>
<?php foreach($allStories as $story):?>
<tr>
<td class='c-id text-left'>
@@ -47,7 +48,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=$objectID", '', true), $story->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");
?>
</td>
<td><?php echo zget($users, $story->openedBy);?></td>
+2 -1
View File
@@ -99,8 +99,9 @@ tbody tr td:first-child input {display: none;}
</tr>
</thead>
<tbody class='text-center'>
<?php $objectID = $this->app->openApp == 'execution' ? $build->execution : $build->project;?>
<?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=$objectID", '', true);?>
<tr>
<td class='c-id text-left'>
<?php if($canBatchUnlink):?>
+16 -11
View File
@@ -202,7 +202,7 @@ $lang->scrum->menuOrder[50] = 'settings';
$lang->scrum->menu->qa['subMenu'] = new stdclass();
$lang->scrum->menu->qa['subMenu']->index = array('link' => "$lang->dashboard|project|qa|projectID=%s");
$lang->scrum->menu->qa['subMenu']->bug = array('link' => "{$lang->bug->common}|project|bug|projectID=%s", 'subModule' => 'bug');
$lang->scrum->menu->qa['subMenu']->testcase = array('link' => "{$lang->testcase->shortCommon}|project|testcase|projectID=%s", 'subModule' => 'testsuite,testcase,caselib');
$lang->scrum->menu->qa['subMenu']->testcase = array('link' => "{$lang->testcase->shortCommon}|project|testcase|projectID=%s", 'subModule' => 'testsuite,testcase,caselib,tree');
$lang->scrum->menu->qa['subMenu']->testtask = array('link' => "{$lang->testtask->common}|project|testtask|projectID=%s", 'subModule' => 'testtask', 'class' => 'dropdown dropdown-hover');
$lang->scrum->menu->settings['subMenu'] = new stdclass();
@@ -217,11 +217,10 @@ $lang->scrum->menu->settings['subMenu']->group = array('link' => "{$lang->
$lang->waterfall->menu = new stdclass();
$lang->waterfall->menu->index = array('link' => "$lang->dashboard|project|index|project=%s");
$lang->waterfall->menu->programplan = array('link' => "{$lang->productplan->shortCommon}|programplan|browse|project=%s", 'subModule' => 'programplan');
$lang->waterfall->menu->doc = array('link' => "{$lang->doc->common}|doc|index|project=%s");
$lang->waterfall->menu->doc = array('link' => "{$lang->doc->common}|doc|objectLibs|type=project&objectID=%s");
$lang->waterfall->menu->story = array('link' => "$lang->SRCommon|projectstory|story|project=%s", 'subModule' => 'projectstory');
$lang->waterfall->menu->design = array('link' => "$lang->design|design|browse|product=0&project=%s");
$lang->waterfall->menu->design = array('link' => "$lang->design|design|browse|product=%s");
$lang->waterfall->menu->repo = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&objectID=%s", 'subModule' => 'repo');
$lang->waterfall->menu->track = array('link' => "$lang->track|projectstory|track", 'alias' => 'track');
$lang->waterfall->menu->qa = array('link' => "{$lang->qa->common}|project|qa|projectID=%s", 'subModule' => 'testcase,testtask,bug', 'alias' => 'bug,testtask,testcase');
$lang->waterfall->menu->release = array('link' => "{$lang->release->common}|projectrelease|browse", 'subModule' => 'projectrelease');
$lang->waterfall->menu->build = array('link' => "{$lang->build->common}|project|build|project=%s");
@@ -247,11 +246,17 @@ $lang->waterfall->menuOrder[65] = 'other';
$lang->waterfall->menuOrder[68] = 'dynamic';
$lang->waterfall->menuOrder[70] = 'projectsetting';
$lang->waterfall->menu->qa['subMenu'] = new stdclass();
$lang->waterfall->menu->qa['subMenu']->index = array('link' => "$lang->dashboard|project|qa|projectID=%s");
$lang->waterfall->menu->qa['subMenu']->bug = array('link' => "{$lang->bug->common}|project|bug|projectID=%s", 'subModule' => 'bug');
$lang->waterfall->menu->qa['subMenu']->testcase = array('link' => "{$lang->testcase->shortCommon}|project|testcase|projectID=%s", 'subModule' => 'testsuite,testcase,caselib');
$lang->waterfall->menu->qa['subMenu']->testtask = array('link' => "{$lang->testtask->common}|project|testtask|projectID=%s", 'subModule' => 'testtask', 'class' => 'dropdown dropdown-hover');
$lang->waterfall->menu->other['dropMenu'] = new stdclass();
$lang->waterfall->menu->other['dropMenu']->estimation = array('link' => "$lang->estimation|workestimation|index|program=%s", 'subModule' => 'workestimation,durationestimation,budget');
$lang->waterfall->menu->other['dropMenu']->issue = array('link' => "$lang->issue|issue|browse|", 'subModule' => 'issue');
$lang->waterfall->menu->other['dropMenu']->risk = array('link' => "$lang->risk|risk|browse|", 'subModule' => 'risk');
$lang->waterfall->menu->other['dropMenu']->stakeholder = array('link' => "{$lang->stakeholder->common}|stakeholder|browse|", 'subModule' => 'stakeholder');
$lang->waterfall->menu->other['dropMenu']->estimation = array('link' => "$lang->estimation|workestimation|index|projectID=%s", 'subModule' => 'workestimation,durationestimation,budget');
$lang->waterfall->menu->other['dropMenu']->issue = array('link' => "$lang->issue|issue|browse|projectID=%s", 'subModule' => 'issue');
$lang->waterfall->menu->other['dropMenu']->risk = array('link' => "$lang->risk|risk|browse|projectID=%s", 'subModule' => 'risk');
$lang->waterfall->menu->other['dropMenu']->stakeholder = array('link' => "{$lang->stakeholder->common}|stakeholder|browse|projectID=%s", 'subModule' => 'stakeholder');
$lang->waterfall->menu->settings = $lang->scrum->menu->settings;
@@ -266,7 +271,7 @@ $lang->execution->menu->kanban = array('link' => "$lang->kanban|execution|kanb
$lang->execution->menu->burn = array('link' => "$lang->burn|execution|burn|executionID=%s");
$lang->execution->menu->view = array('link' => "$lang->view|execution|grouptask|executionID=%s", 'alias' => 'grouptask,tree', 'class' => 'dropdown dropdown-hover');
$lang->execution->menu->story = array('link' => "$lang->SRCommon|execution|story|executionID=%s", 'subModule' => 'story', 'alias' => 'batchcreate,linkstory,storykanban');
$lang->execution->menu->qa = array('link' => "{$lang->qa->common}|execution|qa|executionID=%s", 'subModule' => 'bug', 'alias' => 'qa,bug,testcase,testtask,testreport');
$lang->execution->menu->qa = array('link' => "{$lang->qa->common}|execution|qa|executionID=%s", 'subModule' => 'bug,testcase,testtask,testreport', 'alias' => 'qa,bug,testcase,testtask,testreport');
$lang->execution->menu->repo = array('link' => "{$lang->repo->common}|repo|browse|repoID=0&objectID=%s", 'subModule' => 'repo');
$lang->execution->menu->doc = array('link' => "{$lang->doc->common}|doc|objectLibs|type=execution&objectID=%s", 'subModule' => 'doc');
$lang->execution->menu->build = array('link' => "{$lang->build->common}|execution|build|executionID=%s", 'subModule' => 'build');
@@ -294,9 +299,9 @@ $lang->execution->menu->view['subMenu']->tree = "$lang->treeView|execution|
$lang->execution->menu->qa['subMenu'] = new stdclass();
$lang->execution->menu->qa['subMenu']->qa = array('link' => "$lang->dashboard|execution|qa|executionID=%s");
$lang->execution->menu->qa['subMenu']->bug = array('link' => "{$lang->bug->common}|execution|bug|executionID=%s");
$lang->execution->menu->qa['subMenu']->bug = array('link' => "{$lang->bug->common}|execution|bug|executionID=%s", 'subModule' => 'bug');
$lang->execution->menu->qa['subMenu']->testcase = array('link' => "{$lang->testcase->shortCommon}|execution|testcase|executionID=%s", 'alias' => 'create');
$lang->execution->menu->qa['subMenu']->testtask = array('link' => "{$lang->testtask->common}|execution|testtask|executionID=%s");
$lang->execution->menu->qa['subMenu']->testtask = array('link' => "{$lang->testtask->common}|execution|testtask|executionID=%s", 'subModule' => 'testtask,testreport');
// $lang->execution->menu->qa['subMenu']->testreport = array('link' => "$lang->project->report|testreport|browse|exeutionID=%s&type=execution");
$lang->execution->menu->qa['menuOrder'][5] = 'qa';
+29 -28
View File
@@ -13,7 +13,7 @@ class company extends control
{
/**
* Construct function, load dept and user models auto.
*
*
* @access public
* @return void
*/
@@ -25,7 +25,7 @@ class company extends control
/**
* Index page, header to browse.
*
*
* @access public
* @return void
*/
@@ -36,13 +36,13 @@ class company extends control
/**
* Browse departments and users of a company.
*
* @param int $param
* @param string $type
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
*
* @param int $param
* @param string $type
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
@@ -56,7 +56,7 @@ class company extends control
$this->company->setMenu($deptID);
/* Save session. */
$this->session->set('userList', $this->app->getURI(true));
$this->session->set('userList', $this->app->getURI(true), 'admin');
/* Set the pager. */
$this->app->loadClass('pager', $static = true);
@@ -112,7 +112,7 @@ class company extends control
/**
* Edit a company.
*
*
* @access public
* @return void
*/
@@ -142,7 +142,7 @@ class company extends control
/**
* View a company.
*
*
* @access public
* @return void
*/
@@ -157,12 +157,12 @@ class company extends control
/**
* Company dynamic.
*
* @param string $browseType
* @param string $param
* @param int $recTotal
* @param string $date
* @param string $direction next|pre
*
* @param string $browseType
* @param string $param
* @param int $recTotal
* @param string $date
* @param string $direction next|pre
* @access public
* @return void
*/
@@ -175,16 +175,17 @@ class company extends control
/* Save session. */
$uri = $this->app->getURI(true);
$this->session->set('productList', $uri);
$this->session->set('productPlanList', $uri);
$this->session->set('releaseList', $uri);
$this->session->set('storyList', $uri);
$this->session->set('executionList', $uri);
$this->session->set('taskList', $uri);
$this->session->set('buildList', $uri);
$this->session->set('bugList', $uri);
$this->session->set('caseList', $uri);
$this->session->set('testtaskList', $uri);
$this->session->set('productList', $uri, 'product');
$this->session->set('productPlanList', $uri, 'product');
$this->session->set('releaseList', $uri, 'product');
$this->session->set('storyList', $uri, 'product');
$this->session->set('projectList', $uri, 'project');
$this->session->set('executionList', $uri, 'execution');
$this->session->set('taskList', $uri, 'execution');
$this->session->set('buildList', $uri, 'execution');
$this->session->set('bugList', $uri, 'qa');
$this->session->set('caseList', $uri, 'qa');
$this->session->set('testtaskList', $uri, 'qa');
/* Set the pager. */
$this->app->loadClass('pager', $static = true);
+6 -6
View File
@@ -43,7 +43,7 @@ class doc extends control
$this->from = 'doc';
setcookie('from', 'doc', $this->config->cookieLife, $this->config->webRoot, '', false, true);
$this->session->set('docList', $this->app->getURI(true));
$this->session->set('docList', $this->app->getURI(true), 'doc');
$this->app->loadClass('pager', $static = true);
$pager = new pager(0, 5, 1);
@@ -121,7 +121,7 @@ class doc extends control
{
$menuType = (!$type && (in_array($browseType, array_keys($this->lang->doc->fastMenuList)) || $browseType == 'bysearch')) ? $browseType : $type;
}
$this->session->set('docList', $this->app->getURI(true));
$this->session->set('docList', $this->app->getURI(true), 'doc');
/* Set header and position. */
$this->view->title = $this->lang->doc->common . ($libID ? $this->lang->colon . $this->libs[$libID] : '');
@@ -762,9 +762,9 @@ class doc extends control
public function showFiles($type, $objectID, $from = 'doc', $viewType = '', $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$uri = $this->app->getURI(true);
$this->app->session->set('taskList', $uri);
$this->app->session->set('storyList', $uri);
$this->app->session->set('docList', $uri);
$this->app->session->set('taskList', $uri, 'execution');
$this->app->session->set('storyList', $uri, 'product');
$this->app->session->set('docList', $uri, 'doc');
if(empty($viewType)) $viewType = !empty($_COOKIE['docFilesViewType']) ? $this->cookie->docFilesViewType : 'card';
setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot, '', false, true);
@@ -852,7 +852,7 @@ class doc extends control
public function objectLibs($type, $objectID)
{
// setcookie('from', $from, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$this->session->set('docList', $this->app->getURI(true));
$this->session->set('docList', $this->app->getURI(true), 'doc');
$table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
-7
View File
@@ -145,7 +145,6 @@ class executionModel extends model
if($this->config->systemMode == 'classic')
{
$this->session->set('moreExecutionLink', $this->app->getURI(true));
$output = "<div class='btn-group header-btn' id='swapper'><button data-toggle='dropdown' type='button' class='btn' id='currentItem' title='{$currentExecutionName}'><span class='text'><i class='icon icon-sprint'></i> {$currentExecutionName}</span> <span class='caret'></span></button><div id='dropMenu' class='dropdown-menu search-list' data-ride='searchList' data-url='$dropMenuLink'>";
$output .= '<div class="input-control search-box has-icon-left has-icon-right search-example"><input type="search" class="form-control search-input" /><label class="input-control-icon-left search-icon"><i class="icon icon-search"></i></label><a class="input-control-icon-right search-clear-btn"><i class="icon icon-close icon-sm"></i></a></div>';
$output .= "</div></div>";
@@ -841,8 +840,6 @@ class executionModel extends model
{
if(in_array($currentMethod, array('index', 'all', 'batchedit'))) return;
$this->session->set('moreExecutionLink', $this->app->getURI(true));
$currentExecutionName = $this->lang->execution->common;
if($executionID)
{
@@ -1325,8 +1322,6 @@ class executionModel extends model
if(($this->session->taskBrowseType) and ($this->session->taskBrowseType != 'bysearch')) $browseType = $this->session->taskBrowseType;
}
$this->session->set('taskWithChildren', in_array($browseType, array('unclosed', 'byexecution', 'all', 'bysearch')) ? false : true);
/* Get tasks. */
$tasks = array();
if($browseType != "bysearch")
@@ -1369,8 +1364,6 @@ class executionModel extends model
$taskQuery = str_replace("`execution` = 'all'", $executionQuery, $taskQuery); // Search all execution.
$this->session->set('taskQueryCondition', $taskQuery);
$this->session->set('taskOnlyCondition', true);
$this->session->set('taskOrderBy', $sort);
$this->session->set('taskBrowseList', array());
$tasks = $this->getSearchTasks($taskQuery, $pager, $sort);
}
+4 -4
View File
@@ -22,8 +22,8 @@
<?php js::set('workingHourError', sprintf($this->lang->error->notempty, $this->lang->workingHour))?>
<style>
.btn-group a i.icon-plus {font-size: 16px;}
.btn-group a.btn-primary {border-right: 1px solid rgba(255,255,255,0.2);}
.btn-group button.dropdown-toggle.btn-primary {padding:6px;}
.btn-group a.btn-secondary {border-right: 1px solid rgba(255,255,255,0.2);}
.btn-group button.dropdown-toggle.btn-secondary {padding:6px;}
</style>
<div id="mainMenu" class="clearfix">
<?php if(!empty($module->name) or !empty($product->name) or !empty($branch)):?>
@@ -62,8 +62,8 @@
$storyModuleID = (int)$this->cookie->storyModuleParam;
$createStoryLink = $this->createLink('story', 'create', "productID=$productID&branch=0&moduleID={$storyModuleID}&story=0&execution=$execution->id");
echo "<div class='btn-group dropdown'>";
echo html::a($createStoryLink, "<i class='icon icon-plus'></i> {$lang->story->create}", '', "class='btn btn-primary' data-app='execution'");
echo "<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>";
echo html::a($createStoryLink, "<i class='icon icon-plus'></i> {$lang->story->create}", '', "class='btn btn-secondary' data-app='execution'");
echo "<button type='button' class='btn btn-secondary dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>";
echo "<ul class='dropdown-menu pull-right'>";
if(common::hasPriv('story', 'create')) echo '<li>' . html::a($createStoryLink, $lang->story->create, '', "data-app='execution'") . '</li>';
if(common::hasPriv('story', 'batchCreate')) echo '<li>' . html::a($this->createLink('story', 'batchCreate', "productID=$productID&branch=0&moduleID={$storyModuleID}&story=0&execution=$execution->id"), $lang->story->batchCreate, '', "data-app='execution'") . '</li>';
+1 -1
View File
@@ -87,7 +87,7 @@
<?php printf('%03d', $task->id);?>
<?php endif;?>
</td>
<td class='text-left' title="<?php echo $task->name?>"><?php echo html::a($this->createLink('testtask', 'view', "taskID=$task->id"), $task->name);?></td>
<td class='text-left' title="<?php echo $task->name?>"><?php echo html::a($this->createLink('testtask', 'view', "taskID=$task->id"), $task->name, '', "data-app='execution'");?></td>
<td title="<?php echo $task->buildName?>"><?php echo ($task->build == 'trunk' || empty($task->buildName)) ? $lang->trunk : html::a($this->createLink('build', 'view', "buildID=$task->build"), $task->buildName);?></td>
<td><?php echo zget($users, $task->owner);?></td>
<td><?php echo $task->begin?></td>
+2 -2
View File
@@ -198,11 +198,11 @@ class group extends control
$changelog = array();
foreach($this->lang->changelog as $currentVersion => $currentChangeLog)
{
if(version_compare($currentVersion, $realVersion, '>=')) $changelog[] = join($currentChangeLog, ',');
if(version_compare($currentVersion, $realVersion, '>=')) $changelog[] = join(',', $currentChangeLog);
}
$this->view->group = $group;
$this->view->changelogs = ',' . join($changelog, ',') . ',';
$this->view->changelogs = ',' . join(',', $changelog) . ',';
$this->view->groupPrivs = $groupPrivs;
$this->view->groupID = $groupID;
$this->view->menu = $menu;
+1
View File
@@ -20,3 +20,4 @@ $config->index->appGroup['testreport'] = 'qa';
$config->index->appGroup['doc'] = 'doc';
$config->index->appGroup['todo'] = 'my';
$config->index->appGroup['effort'] = 'my';
$config->index->appGroup['user'] = 'admin';
+2 -2
View File
@@ -61,7 +61,7 @@
}
/**
* Get app app code from url
* Get app code from url
* @param {String} urlOrModuleName Url string
* @return {String}
*/
@@ -474,7 +474,7 @@
window.addEventListener('popstate', function(event)
{
if(lastOpenedApp !== event.state.app) openApp(event.state.app);
if(event.state && lastOpenedApp !== event.state.app) openApp(event.state.app);
});
/* Redirect or open default app after document load */
+1 -1
View File
@@ -302,7 +302,7 @@ class productModel extends model
* @access public
* @return array
*/
public function getProducts($projectID, $status = 'all', $orderBy = '')
public function getProducts($projectID = 0, $status = 'all', $orderBy = '')
{
return $this->dao->select('t1.branch, t1.plan, t2.*')
->from(TABLE_PROJECTPRODUCT)->alias('t1')
+9 -2
View File
@@ -31,8 +31,14 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
<style>
.btn-group .icon-close:before {font-size: 5px; vertical-align: 25%;}
.btn-group a i.icon-plus {font-size: 16px;}
<?php if($from == 'project'):?>
.btn-group a.btn-secondary {border-right: 1px solid rgba(255,255,255,0.2);}
.btn-group button.dropdown-toggle.btn-secondary {padding:6px;}
<?php endif;?>
<?php if($from == 'product'):?>
.btn-group a.btn-primary {border-right: 1px solid rgba(255,255,255,0.2);}
.btn-group button.dropdown-toggle.btn-primary {padding:6px;}
<?php endif;?>
</style>
<div id="mainMenu" class="clearfix">
<?php if(!$isProjectStory):?>
@@ -135,8 +141,9 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : '';
</div>
<?php if(common::canModify('product', $product)):?>
<div class='btn-group dropdown'>
<?php echo html::a($this->createLink('story', 'create', "product=$productID&branch=$branch&moduleID=$moduleID&storyID=0&projectID=$projectID"), "<i class='icon icon-plus'></i> {$lang->story->create}", '', "class='btn btn-primary' data-app='$openApp'");?>
<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
<?php $buttonType = $from == 'project' ? 'btn-secondary' : 'btn-primary';?>
<?php echo html::a($this->createLink('story', 'create', "product=$productID&branch=$branch&moduleID=$moduleID&storyID=0&projectID=$projectID"), "<i class='icon icon-plus'></i> {$lang->story->create}", '', "class='btn $buttonType' data-app='$openApp'");?>
<button type='button' class="btn <?php echo $buttonType?> dropdown-toggle" data-toggle='dropdown'><span class='caret'></span></button>
<ul class='dropdown-menu pull-right'>
<li>
<?php
+12 -4
View File
@@ -891,6 +891,7 @@ class project extends control
*/
public function manageView($groupID, $projectID, $programID)
{
$this->loadModel('group');
if($_POST)
{
$this->group->updateView($groupID);
@@ -915,6 +916,7 @@ class project extends control
/**
* Manage privleges of a group.
*
* @param int $projectID
* @param string $type
* @param int $param
* @param string $menu
@@ -922,8 +924,9 @@ class project extends control
* @access public
* @return void
*/
public function managePriv($type = 'byGroup', $param = 0, $menu = '', $version = '')
public function managePriv($projectID, $type = 'byGroup', $param = 0, $menu = '', $version = '')
{
$this->loadModel('group');
if($type == 'byGroup')
{
$groupID = $param;
@@ -944,6 +947,8 @@ class project extends control
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('group', "projectID=$group->project")));
}
$this->project->setMenu($projectID);
if($type == 'byGroup')
{
$this->group->sortResource();
@@ -958,11 +963,11 @@ class project extends control
$changelog = array();
foreach($this->lang->changelog as $currentVersion => $currentChangeLog)
{
if(version_compare($currentVersion, $realVersion, '>=')) $changelog[] = join($currentChangeLog, ',');
if(version_compare($currentVersion, $realVersion, '>=')) $changelog[] = join(',', $currentChangeLog);
}
$this->view->group = $group;
$this->view->changelogs = ',' . join($changelog, ',') . ',';
$this->view->changelogs = ',' . join(',', $changelog) . ',';
$this->view->groupPrivs = $groupPrivs;
$this->view->groupID = $groupID;
$this->view->menu = $menu;
@@ -1030,6 +1035,7 @@ class project extends control
*/
public function manageGroupMember($groupID, $deptID = 0)
{
$this->loadModel('group');
if(!empty($_POST))
{
$this->group->updateUser($groupID);
@@ -1065,6 +1071,7 @@ class project extends control
*/
public function copyGroup($groupID)
{
$this->loadModel('group');
if(!empty($_POST))
{
$group = $this->group->getByID($groupID);
@@ -1090,7 +1097,8 @@ class project extends control
*/
public function editGroup($groupID)
{
if(!empty($_POST))
$this->loadModel('group');
if(!empty($_POST))
{
$this->group->update($groupID);
die(js::closeModal('parent.parent', 'this'));
+3 -5
View File
@@ -60,9 +60,8 @@ $lang->project->code = '项目代号';
$lang->project->copy = '复制项目';
$lang->project->begin = '计划开始';
$lang->project->end = '计划完成';
$lang->project->status = '项目状态';
$lang->project->PM = '项目负责人';
$lang->project->budget = '项目预算';
$lang->project->status = '状态';
$lang->project->budget = '预算';
$lang->project->template = '项目模板';
$lang->project->estimate = '预计';
$lang->project->consume = '消耗';
@@ -81,7 +80,6 @@ $lang->project->acl = '访问控制';
$lang->project->setPlanduration = '设置工期';
$lang->project->auth = '权限控制';
$lang->project->durationEstimation = '工作量估算';
$lang->project->teamCount = '人数';
$lang->project->leftStories = '剩余需求';
$lang->project->leftTasks = '剩余任务';
$lang->project->leftBugs = '剩余Bug';
@@ -97,7 +95,7 @@ $lang->project->ev = 'EV';
$lang->project->sv = 'SV%';
$lang->project->ac = 'AC';
$lang->project->cv = 'CV%';
$lang->project->teamCount = '项目成员';
$lang->project->teamCount = '成员';
$lang->project->longTime = '长期';
$lang->project->future = '待定';
$lang->project->moreProject = '更多项目';
+9 -7
View File
@@ -628,7 +628,7 @@ class projectModel extends model
}
krsort($projectMenu);
$projectMenu = implode('', $projectMenu);
$projectMenu = array_pop($projectMenu);
$lastMenu = "<ul class='tree' data-ride='tree' id='projectTree' data-name='tree-project'>{$projectMenu}</ul>\n";
return $lastMenu;
@@ -1336,18 +1336,17 @@ class projectModel extends model
}
$from = $project->from == 'project' ? 'project' : 'pgmproject';
$openApp = $this->app->openApp;
common::printIcon('project', 'edit', "projectID=$project->id&from=$from", $project, 'list', 'edit', '', '', '', "data-app=$openApp", '', $project->id);
common::printIcon('project', 'manageMembers', "projectID=$project->id", $project, 'list', 'group', '', '', '', '', $this->lang->execution->team, $project->id);
if($this->config->systemMode == 'new') common::printIcon('project', 'group', "projectID=$project->id&programID=$programID", $project, 'list', 'lock', '', '', '', '', '', $project->id);
common::printIcon('project', 'edit', "projectID=$project->id&from=$from", $project, 'list', 'edit', '', '', '', "data-app=project", '', $project->id);
common::printIcon('project', 'manageMembers', "projectID=$project->id", $project, 'list', 'group', '', '', '', "data-app=project", $this->lang->execution->team, $project->id);
if($this->config->systemMode == 'new') common::printIcon('project', 'group', "projectID=$project->id&programID=$programID", $project, 'list', 'lock', '', '', '', "data-app=project", '', $project->id);
if(common::hasPriv('project','manageProducts') || common::hasPriv('project', 'whitelist') || common::hasPriv('project', 'delete'))
{
echo "<div class='btn-group'>";
echo "<button type='button' class='btn dropdown-toggle' data-toggle='context-dropdown' title='{$this->lang->more}'><i class='icon-more-alt'></i></button>";
echo "<ul class='dropdown-menu pull-right text-center' role='menu'>";
common::printIcon('project', 'manageProducts', "projectID=$project->id&programID=$programID", $project, 'list', 'link', '', 'btn-action', '', "data-app=$openApp", $this->lang->project->manageProducts, $project->id);
if($this->config->systemMode == 'new') common::printIcon('project', 'whitelist', "projectID=$project->id&programID=$programID&module=project&from=$from", $project, 'list', 'shield-check', '', 'btn-action', '', "data-app=$openApp", '', $project->id);
common::printIcon('project', 'manageProducts', "projectID=$project->id&programID=$programID", $project, 'list', 'link', '', 'btn-action', '', "data-app=project", $this->lang->project->manageProducts, $project->id);
if($this->config->systemMode == 'new') common::printIcon('project', 'whitelist', "projectID=$project->id&module=project&from=$from", $project, 'list', 'shield-check', '', 'btn-action', '', "data-app=project", '', $project->id);
if(common::hasPriv('project','delete')) echo html::a(inLink("delete", "projectID=$project->id"), "<i class='icon-trash'></i>", 'hiddenwin', "class='btn btn-action' title='{$this->lang->project->delete}'");
echo "</ul>";
echo "</div>";
@@ -1601,9 +1600,12 @@ class projectModel extends model
$this->lang->project->menu = $this->lang->{$project->model}->menu;
$this->lang->project->menuOrder = $this->lang->{$project->model}->menuOrder;
$moduleName = $this->app->getModuleName();
$methodName = $this->app->getMethodName();
foreach($this->lang->project->menu as $key => $menu)
{
if(!isset($this->lang->project->menu->{$key}['dropMenu'])) continue;
$projectSubMenu = $this->lang->project->menu->{$key}['dropMenu'];
$dropMenu = common::createDropMenu($this->lang->project->menu->{$key}['dropMenu'], $objectID);
if(!empty($dropMenu))
{
+7 -7
View File
@@ -32,7 +32,7 @@
<p>
<span class="text-muted"><?php echo $lang->bug->noBug;?></span>
<?php if(common::canModify('project', $project) and common::hasPriv('bug', 'create')):?>
<?php echo html::a($this->createLink('bug', 'create', "productID=$productID&branch=$branchID&extra=projectID=$project->id"), "<i class='icon icon-plus'></i> " . $lang->bug->create, '', "class='btn btn-info'");?>
<?php echo html::a($this->createLink('bug', 'create', "productID=$productID&branch=$branchID&extra=projectID=$project->id"), "<i class='icon icon-plus'></i> " . $lang->bug->create, '', "class='btn btn-info' data-app='project'");?>
<?php endif;?>
</p>
</div>
@@ -51,12 +51,12 @@
<?php endif;?>
<?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?>
</th>
<th class='w-80px'> <?php common::printOrderLink('severity', $orderBy, $vars, $lang->bug->severityAB);?></th>
<th class='c-pri'> <?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th> <?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
<th class='c-user'> <?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
<th class='w-110px c-user'><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->assignedToAB);?></th>
<th class='w-100px'><?php common::printOrderLink('resolvedBy', $orderBy, $vars, $lang->bug->resolvedBy);?></th>
<th class='w-80px'><?php common::printOrderLink('severity', $orderBy, $vars, $lang->bug->severityAB);?></th>
<th class='c-pri'><?php common::printOrderLink('pri', $orderBy, $vars, $lang->priAB);?></th>
<th><?php common::printOrderLink('title', $orderBy, $vars, $lang->bug->title);?></th>
<th class='c-user'><?php common::printOrderLink('openedBy', $orderBy, $vars, $lang->openedByAB);?></th>
<th class='w-110px c-user'><?php common::printOrderLink('assignedTo', $orderBy, $vars, $lang->assignedToAB);?></th>
<th class='w-100px'><?php common::printOrderLink('resolvedBy', $orderBy, $vars, $lang->bug->resolvedBy);?></th>
<th class='w-100px'><?php common::printOrderLink('resolution', $orderBy, $vars, $lang->bug->resolutionAB);?></th>
<th class='c-actions-5'><?php echo $lang->actions;?></th>
</tr>
+1 -1
View File
@@ -45,7 +45,7 @@
<?php $lang->group->managepriv = $lang->group->managePrivByGroup;?>
<?php $disabled = $group->role == 'limited' ? 'disabled' : '';?>
<?php common::printIcon('project', 'manageView', "groupID=$group->id&projectID=$projectID&programID=$project->parent", $group, 'list', 'eye', '', $disabled);?>
<?php common::printIcon('project', 'managePriv', "type=byGroup&param=$group->id", $group, 'list', 'lock');?>
<?php common::printIcon('project', 'managePriv', "projectID=$projectID&type=byGroup&param=$group->id", $group, 'list', 'lock', '', '', '', "data-app='project'");?>
<?php $lang->group->managemember = $lang->group->manageMember;?>
<?php common::printIcon('project', 'manageGroupMember', "groupID=$group->id", $group, 'list', 'persons', '', 'iframe', 'yes', "data-width='90%'");?>
<?php common::printIcon('project', 'editGroup', "groupID=$group->id", $group, 'list', 'edit', '', 'iframe', 'yes', "data-width='550'");?>
+12 -12
View File
@@ -40,15 +40,15 @@ class stakeholder extends control
/**
* Create a stakeholder.
*
* @param int projectID
* @param int objectID
* @access public
* @return void
*/
public function create($projectID = 0)
public function create($objectID = 0)
{
if($_POST)
{
$stakeholderID = $this->stakeholder->create($projectID);
$stakeholderID = $this->stakeholder->create($objectID);
$response['result'] = 'success';
$response['message'] = $this->lang->saveSuccess;
@@ -62,29 +62,29 @@ class stakeholder extends control
$actionID = $this->loadModel('action')->create('stakeholder', $stakeholderID, 'added');
$moduleName = $programID ? 'program' : $this->moduleName;
$methodName = $programID ? 'stakeholder' : 'browse';
$param = $programID ? "programID=$programID" : '';
$moduleName = $this->app->openApp == 'program' ? 'program' : $this->moduleName;
$methodName = $this->app->openApp == 'program' ? 'stakeholder' : 'browse';
$param = $this->app->openApp == 'program' ? "programID=$objectID" : "projectID=$objectID";
$locate = $this->createLink($moduleName, $methodName, $param);
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $locate));
}
if($this->app->openApp == 'program')
{
$this->loadModel('program')->setMenu($projectID);
$this->view->members = $this->loadModel('program')->getTeamMemberPairs($projectID);
$this->loadModel('program')->setMenu($objectID);
$this->view->members = $this->loadModel('program')->getTeamMemberPairs($objectID);
}
else
{
$this->loadModel('project')->setMenu($projectID);
$this->view->members = $this->loadModel('project')->getTeamMemberPairs($projectID);
$this->loadModel('project')->setMenu($objectID);
$this->view->members = $this->loadModel('project')->getTeamMemberPairs($objectID);
}
$this->view->title = $this->lang->stakeholder->create;
$this->view->position[] = $this->lang->stakeholder->create;
$this->view->companys = $this->loadModel('company')->getOutsideCompanies();
$this->view->programID = $this->app->openApp == 'program' ? $projectID : 0;
$this->view->projectID = $this->app->openApp == 'project' ? $projectID : 0;
$this->view->programID = $this->app->openApp == 'program' ? $objectID : 0;
$this->view->projectID = $this->app->openApp == 'project' ? $objectID : 0;
$this->display();
}
+4 -4
View File
@@ -2189,21 +2189,21 @@ class storyModel extends model
*/
public function getBySearch($productID, $branch = 0, $queryID, $orderBy, $executionID = '', $type = 'story', $excludeStories = '', $pager = null)
{
if($executionID != '')
if(!empty($executionID))
{
$products = $this->loadModel('project')->getProducts($executionID);
}
else
{
$products = $this->loadModel('product')->getPairs();
$products = $this->loadModel('product')->getProducts();
}
$query = $queryID ? $this->loadModel('search')->getQuery($queryID) : '';
/* Get the sql and form status from the query. */
if($query)
{
$this->session->set('storyQuery', $query->sql);
$this->session->set('storyForm', $query->form);
$this->session->set('storyQuery', $query->sql, $this->app->openApp);
$this->session->set('storyForm', $query->form, $this->app->openApp);
}
if($this->session->storyQuery == false) $this->session->set('storyQuery', ' 1 = 1');
+14 -4
View File
@@ -42,6 +42,7 @@ class testcase extends control
$this->loadModel('qa');
$this->view->products = $this->products = $this->product->getPairs();
if($this->app->openApp == 'project') $this->view->products = $this->products = $this->loadModel('project')->getProducts($this->session->project, false);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testcase")));
}
@@ -96,7 +97,7 @@ class testcase extends control
/* Set menu, save session. */
if($this->app->openApp == 'project')
{
$this->products = array('0' => $this->lang->product->all) + $this->products;
$this->products = array('0' => $this->lang->product->all) + $this->loadModel('project')->getProducts($this->session->project, false);
$this->loadModel('project')->setMenu($projectID);
}
else
@@ -134,7 +135,10 @@ class testcase extends control
$cases = $this->testcase->appendData($cases);
/* Build the search form. */
$actionURL = $this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
$currentModule = $this->app->openApp == 'project' ? 'project' : 'testcase';
$currentMethod = $this->app->openApp == 'project' ? 'testcase' : 'browse';
$projectParam = $this->app->openApp == 'project' ? "projectID={$this->session->project}&" : '';
$actionURL = $this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
$this->config->testcase->search['onMenuBar'] = 'yes';
$this->testcase->buildSearchForm($productID, $this->products, $queryID, $actionURL);
@@ -299,7 +303,10 @@ class testcase extends control
if(isonlybody()) $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'closeModal' => true));
setcookie('caseModule', 0, 0, $this->config->webRoot, '', false, false);
$response['locate'] = $this->createLink('testcase', 'browse', "productID={$this->post->product}&branch={$this->post->branch}&browseType=all&param=0&orderBy=id_desc");
$currentModule = $this->app->openApp == 'project' ? 'project' : 'testcase';
$currentMethod = $this->app->openApp == 'project' ? 'testcase' : 'browse';
$projectParam = $this->app->openApp == 'project' ? "projectID={$this->session->project}&" : '';
$response['locate'] = $this->createLink($currentModule, $currentMethod, $projectParam . "productID={$this->post->product}&branch={$this->post->branch}&browseType=all&param=0&orderBy=id_desc");
if($this->app->openApp == 'execution') $response['locate'] = $this->createLink('execution', 'testcase', "executionID={$this->session->execution}&type=all");
$this->send($response);
}
@@ -439,7 +446,10 @@ class testcase extends control
if(isonlybody()) die(js::closeModal('parent.parent', 'this'));
setcookie('caseModule', 0, 0, $this->config->webRoot, '', false, false);
die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=all&param=0&orderBy=id_desc"), 'parent'));
$currentModule = $this->app->openApp == 'project' ? 'project' : 'testcase';
$currentMethod = $this->app->openApp == 'project' ? 'testcase' : 'browse';
$projectParam = $this->app->openApp == 'project' ? "projectID={$this->session->project}&" : '';
die(js::locate($this->createLink($currentModule, $currentMethod, $projectParam . "productID=$productID&branch=$branch&browseType=all&param=0&orderBy=id_desc"), 'parent'));
}
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
+10 -2
View File
@@ -502,8 +502,16 @@ class testcaseModel extends model
if(strpos($caseQuery, $allBranch) !== false) $caseQuery = str_replace($allBranch, '1', $caseQuery);
$caseQuery .= ')';
$cases = $this->dao->select('*')->from(TABLE_CASE)->where($caseQuery)
->beginIF($queryProductID != 'all')->andWhere('product')->eq($productID)->fi()
if($this->app->openApp == 'project') $caseQuery = str_replace('`product`', 't2.`product`', $caseQuery);
$cases = $this->dao->select('*')->from(TABLE_CASE)
->beginIF($this->app->openApp == 'project')->alias('t1')->fi()
->beginIF($this->app->openApp == 'project')->leftJoin(TABLE_PROJECTCASE)->alias('t2')->on('t1.id=t2.case')->fi()
->where($caseQuery)
->beginIF($this->app->openApp == 'project')->andWhere('t2.project')->eq($this->session->project)->fi()
->beginIF(!empty($productID) and $queryProductID != 'all')
->beginIF($this->app->openApp == 'project')->andWhere('t2.product')->eq($productID)->fi()
->beginIF($this->app->openApp != 'project')->andWhere('product')->eq($productID)->fi()
->fi()
->beginIF($auto != 'unit')->andWhere('auto')->ne('unit')->fi()
->beginIF($auto == 'unit')->andWhere('auto')->eq('unit')->fi()
->andWhere('deleted')->eq(0)
+2
View File
@@ -153,7 +153,9 @@
<button type='button' class='btn btn-primary dropdown-toggle' data-toggle='dropdown'><span class='caret'></span></button>
<ul class='dropdown-menu'>
<li><?php echo html::a($actionLink, $lang->testcase->create);?></li>
<?php if(!empty($productID)):?>
<li><?php echo html::a($this->createLink('testcase', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$initModule"), $lang->testcase->batchCreate, '', "data-app='{$this->app->openApp}'");?></li>
<?php endif;?>
</ul>
</div>
<?php endif;?>
+1 -1
View File
@@ -441,7 +441,7 @@ class testreport extends control
else
{
$executionID = $this->commonAction($report->execution, 'execution');
if($executionID != $report->objectID) die(js::error($this->lang->error->accessDenied) . js::locate('back'));
if($executionID != $report->execution) die(js::error($this->lang->error->accessDenied) . js::locate('back'));
$browseLink = inlink('browse', "objectID=$executionID&objectType=project");
$this->view->position[] = html::a($browseLink, $execution->name);
+2 -1
View File
@@ -53,7 +53,8 @@
<?php $params = isset($testtask) ? ",testtask=$testtask->id,executionID=$testtask->execution,buildID=$testtask->build" : '';?>
<tr class='result-detail hide' id='tr-detail_<?php echo $trCount++; ?>'>
<td colspan='7' class='pd-0'>
<form data-params='<?php echo "product=$case->product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . $params?>' method='post'>
<?php $projectParam = $this->app->openApp == 'project' ? "projectID={$this->session->project}" : ''?>
<form data-params='<?php echo "product=$case->product&branch=$case->branch&extras=$projectParam,caseID=$case->id,version=$case->version,resultID=$result->id,runID=$runID" . $params?>' method='post'>
<table class='table table-condensed resultSteps'>
<thead>
<tr>
+4
View File
@@ -37,6 +37,10 @@ class tree extends control
$products = $this->product->getPairs('noclosed');
$this->loadModel('qa')->setMenu($products, $rootID);;
}
else if($this->app->openApp == 'project')
{
$this->loadModel('project')->setMenu($this->session->project);
}
/* According to the type, set the module root and modules. */
if(strpos('story|bug|case', $viewType) !== false)
+2 -2
View File
File diff suppressed because one or more lines are too long
-10
View File
@@ -14,16 +14,6 @@
#pageNav .btn-group.angle-btn{margin-right:10px !important;}
#dropMenu.show-right-col{width:502px;max-width:520px;}
#dropMenu.has-search-text{width:250px;max-width:260px;}
#dropMenu.has-search-text .col-right{margin-left:0px;}
#dropMenu>.search-box{max-width:240px;}
#dropMenu .list-group{width:250px; max-width:260px;}
#dropMenu.show-right-col>.list-group{width:502px;max-width:520px;}
#dropMenu.show-right-col .col-left>.list-group{width:250px;max-width:260px;}
#dropMenu.show-right-col .col-right>.list-group{width:250px;max-width:260px;}
#dropMenu .col-footer{width:230px;}
.main-actions .btn-toolbar .divider {margin-right:8px !important; margin-left: 8px !important;}
.main-actions .btn-toolbar .btn + .btn {margin-left: 8px !important;}
File diff suppressed because one or more lines are too long