* Fix bug.
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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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):?>
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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