* Adjust code style.
This commit is contained in:
@@ -179,7 +179,7 @@ class build extends control
|
||||
$this->view->products = $products;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter', $build->builder);
|
||||
$this->view->build = $build;
|
||||
$this->view->testtask = $this->dao->select('id')->from(TABLE_TESTTASK)->where('build')->eq($build->id)->andWhere('deleted')->eq(0)->fetch('id');
|
||||
$this->view->testtaskID = $this->dao->select('id')->from(TABLE_TESTTASK)->where('build')->eq($build->id)->andWhere('deleted')->eq(0)->fetch('id');
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
+3
-12
@@ -86,23 +86,14 @@ class buildModel extends model
|
||||
/* If there are saved query conditions, reset the session. */
|
||||
if((int)$queryID)
|
||||
{
|
||||
$buildQuery = $this->loadModel('search')->getQuery($queryID);
|
||||
if($buildQuery)
|
||||
$query = $this->loadModel('search')->getQuery($queryID);
|
||||
if($query)
|
||||
{
|
||||
$this->session->set('projectBuildQuery', $query->sql);
|
||||
$this->session->set('projectBuildForm', $query->form);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->session->set('projectBuildQuery', ' 1 = 1');
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->session->projectBuildQuery == false) $this->session->set('projectBuildQuery', ' 1 = 1');
|
||||
}
|
||||
|
||||
$buildQuery = $this->session->projectBuildQuery;
|
||||
if($this->session->projectBuildQuery == false) $this->session->set('projectBuildQuery', ' 1 = 1');
|
||||
|
||||
$buildQuery = $this->session->projectBuildQuery;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<td>
|
||||
<?php
|
||||
$disabled = '';
|
||||
if($build->stories or $build->bugs or $testtask) $disabled = 'disabled';
|
||||
if($build->stories or $build->bugs or $testtaskID) $disabled = 'disabled';
|
||||
?>
|
||||
<div class='input-group'>
|
||||
<?php echo html::select('product', $products, $build->product, "onchange='loadBranches(this.value);' class='form-control chosen' $disabled required");?>
|
||||
@@ -45,7 +45,7 @@
|
||||
</tr>
|
||||
<?php if($this->config->global->flow != 'onlyTest'):?>
|
||||
<tr>
|
||||
<?php $disabled = $testtask ? 'disabled' : '';?>
|
||||
<?php $disabled = $testtaskID ? 'disabled' : '';?>
|
||||
<th><?php echo $lang->build->project;?></th>
|
||||
<td id='projectsBox'><?php echo html::select('project', $projects, $build->project, "class='form-control chosen' required $disabled");?></td>
|
||||
<td><?php if($disabled) echo $lang->build->notice->changeProject;?></td>
|
||||
|
||||
@@ -160,7 +160,7 @@ class task extends control
|
||||
elseif($this->post->after == 'toTaskList')
|
||||
{
|
||||
setcookie('moduleBrowseParam', 0, 0, $this->config->webRoot, '', false, false);
|
||||
$taskLink = $this->createLink('project', 'task', "projectID=$projectID&status=bymodule¶m=$moduleID&orderBy=id_desc");
|
||||
$taskLink = $this->createLink('project', 'task', "projectID=$projectID&status=unclosed¶m=0&orderBy=id_desc");
|
||||
$response['locate'] = $taskLink;
|
||||
$this->send($response);
|
||||
}
|
||||
@@ -1024,9 +1024,10 @@ class task extends control
|
||||
$changes = $this->task->close($taskID);
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
|
||||
if(!empty($changes))
|
||||
if($this->post->comment != '' or !empty($changes))
|
||||
{
|
||||
$actionID = $this->action->create('task', $taskID, 'Closed', $this->post->comment);
|
||||
$action = (!empty($changes)) ? 'Closed' : 'Commented';
|
||||
$actionID = $this->action->create('task', $taskID, $action, $this->post->comment);
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
|
||||
|
||||
@@ -1602,12 +1602,12 @@ class taskModel extends model
|
||||
*
|
||||
* @param int $taskID
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function close($taskID)
|
||||
{
|
||||
$oldTask = $this->dao->select('*')->from(TABLE_TASK)->where('id')->eq($taskID)->fetch();
|
||||
if($oldTask->status == 'closed') return;
|
||||
if($oldTask->status == 'closed') return array();
|
||||
|
||||
$now = helper::now();
|
||||
$task = fixer::input('post')
|
||||
|
||||
Reference in New Issue
Block a user