* fix bugs.
This commit is contained in:
@@ -217,6 +217,7 @@ class buildModel extends model
|
||||
->where('id')->eq((int)$buildID)
|
||||
->check('name', 'unique', "id != $buildID AND product = {$build->product} AND deleted = '0'")
|
||||
->exec();
|
||||
if(isset($build->branch) and $oldBuild->branch != $build->branch) $this->dao->update(TABLE_RELEASE)->set('branch')->eq($build->branch)->where('build')->eq($buildID)->exec();
|
||||
if(!dao::isError()) return common::createChanges($oldBuild, $build);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class release extends control
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$releaseID = $this->release->create($productID);
|
||||
$releaseID = $this->release->create($productID, $branch);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$this->loadModel('action')->create('release', $releaseID, 'opened');
|
||||
die(js::locate(inlink('view', "releaseID=$releaseID"), 'parent'));
|
||||
|
||||
@@ -100,7 +100,7 @@ class releaseModel extends model
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function create($productID)
|
||||
public function create($productID, $branch = 0)
|
||||
{
|
||||
$buildID = 0;
|
||||
if($this->post->build == false)
|
||||
@@ -108,6 +108,7 @@ class releaseModel extends model
|
||||
$build = fixer::input('post')
|
||||
->add('product', (int)$productID)
|
||||
->add('builder', $this->app->user->account)
|
||||
->add('branch', $branch)
|
||||
->stripTags($this->config->release->editor->create['id'], $this->config->allowedTags)
|
||||
->remove('build,files,labels')
|
||||
->get();
|
||||
@@ -116,7 +117,6 @@ class releaseModel extends model
|
||||
$buildID = $this->dao->lastInsertID();
|
||||
}
|
||||
|
||||
$branch = 0;
|
||||
if($this->post->build) $branch = $this->dao->select('branch')->from(TABLE_BUILD)->where('id')->eq($this->post->build)->fetch('branch');
|
||||
$release = fixer::input('post')
|
||||
->add('product', (int)$productID)
|
||||
@@ -152,8 +152,7 @@ class releaseModel extends model
|
||||
public function update($releaseID)
|
||||
{
|
||||
$oldRelease = $this->getByID($releaseID);
|
||||
|
||||
$branch = $this->dao->select('branch')->from(TABLE_BUILD)->where('id')->eq($this->post->build)->fetch('branch');
|
||||
$branch = $this->dao->select('branch')->from(TABLE_BUILD)->where('id')->eq($this->post->build)->fetch('branch');
|
||||
|
||||
$release = fixer::input('post')->stripTags($this->config->release->editor->edit['id'], $this->config->allowedTags)
|
||||
->add('branch', (int)$branch)
|
||||
|
||||
@@ -326,7 +326,7 @@ class testtaskModel extends model
|
||||
* */
|
||||
$postData = fixer::input('post')->get();
|
||||
$caseResult = isset($postData->result) ? $postData->result : 'pass';
|
||||
if($postData->steps)
|
||||
if(isset($postData->steps) and $postData->steps)
|
||||
{
|
||||
foreach($postData->steps as $stepID => $stepResult)
|
||||
{
|
||||
@@ -339,7 +339,7 @@ class testtaskModel extends model
|
||||
}
|
||||
|
||||
/* Create result of every step. */
|
||||
if($postData->steps)
|
||||
if(isset($postData->steps) and $postData->steps)
|
||||
{
|
||||
foreach($postData->steps as $stepID =>$stepResult)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user