Merge branch '15.0.beta3' of http://gitlab.zcorp.cc/easycorp/zentaopms into 15.0.beta3
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -679,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')
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")));
|
||||
$this->session->set('storyList', inlink('view', "buildID=$buildID&type=story&link=true¶m=" . 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¶m=" . 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']);
|
||||
|
||||
@@ -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
@@ -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}";
|
||||
|
||||
@@ -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')
|
||||
@@ -361,6 +363,7 @@ class buildModel extends model
|
||||
->stripTags($this->config->build->editor->create['id'], $this->config->allowedTags)
|
||||
->remove('resolvedBy,allchecker,files,labels,uid')
|
||||
->get();
|
||||
a($_POST);die();
|
||||
|
||||
$build = $this->loadModel('file')->processImgURL($build, $this->config->build->editor->create['id'], $this->post->uid);
|
||||
$this->dao->insert(TABLE_BUILD)->data($build)
|
||||
@@ -368,6 +371,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();
|
||||
|
||||
@@ -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¶m=$objectID", '', true), $story->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo zget($users, $story->openedBy);?></td>
|
||||
|
||||
@@ -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¶m=$objectID", '', true);?>
|
||||
<tr>
|
||||
<td class='c-id text-left'>
|
||||
<?php if($canBatchUnlink):?>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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;
|
||||
@@ -1600,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))
|
||||
{
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user