* add resloveBy for build.
This commit is contained in:
@@ -25,17 +25,18 @@ class actionModel extends model
|
||||
* @param string $actionType
|
||||
* @param string $comment
|
||||
* @param string $extra the extra info of this action, according to different modules and actions, can set different extra.
|
||||
* @param string $actor
|
||||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
public function create($objectType, $objectID, $actionType, $comment = '', $extra = '')
|
||||
public function create($objectType, $objectID, $actionType, $comment = '', $extra = '', $actor = '')
|
||||
{
|
||||
$action = new stdclass();
|
||||
|
||||
$objectType = str_replace('`', '', $objectType);
|
||||
$action->objectType = strtolower($objectType);
|
||||
$action->objectID = $objectID;
|
||||
$action->actor = $this->app->user->account;
|
||||
$action->actor = $actor ? $actor : $this->app->user->account;
|
||||
$action->action = strtolower($actionType);
|
||||
$action->date = helper::now();
|
||||
$action->comment = $comment;
|
||||
|
||||
+10
-4
@@ -120,7 +120,7 @@ class buildModel extends model
|
||||
->join('stories', ',')
|
||||
->join('bugs', ',')
|
||||
->remove('allchecker')
|
||||
->add('project', (int)$projectID)->get();
|
||||
->add('project', (int)$projectID)->remove('resolvedBy')->get();
|
||||
$this->dao->insert(TABLE_BUILD)->data($build)->autoCheck()->batchCheck($this->config->build->create->requiredFields, 'notempty')->check('name', 'unique', "product = {$build->product}")->exec();
|
||||
if(!dao::isError())
|
||||
{
|
||||
@@ -145,7 +145,7 @@ class buildModel extends model
|
||||
->setDefault('bugs', '')
|
||||
->join('stories', ',')
|
||||
->join('bugs', ',')
|
||||
->remove('allchecker')
|
||||
->remove('allchecker,resolvedBy')
|
||||
->get();
|
||||
$this->dao->update(TABLE_BUILD)->data($build)
|
||||
->autoCheck()
|
||||
@@ -172,12 +172,18 @@ class buildModel extends model
|
||||
$bugs = $this->dao->select('*')->from(TABLE_BUG)->where('id')->in($build->bugs)->fetchAll();
|
||||
$now = helper::now();
|
||||
|
||||
$resolvedPairs = array();
|
||||
foreach($this->post->bugs as $key => $bugID)
|
||||
{
|
||||
if(isset($_POST['resolvedBy'][$key]))$resolvedPairs[$bugID] = $this->post->resolvedBy[$key];
|
||||
}
|
||||
|
||||
$this->loadModel('action');
|
||||
foreach($bugs as $bug)
|
||||
{
|
||||
if($bug->status == 'resolved') continue;
|
||||
|
||||
$bug->resolvedBy = $this->app->user->account;
|
||||
$bug->resolvedBy = $resolvedPairs[$bug->id];
|
||||
$bug->resolvedDate = $now;
|
||||
$bug->status = 'resolved';
|
||||
$bug->confirmed = 1;
|
||||
@@ -188,7 +194,7 @@ class buildModel extends model
|
||||
$bug->resolution = 'fixed';
|
||||
$bug->resolvedBuild = $build->name;
|
||||
$this->dao->update(TABLE_BUG)->data($bug)->where('id')->eq($bug->id)->exec();
|
||||
$this->action->create('bug', $bug->id, 'Resolved', '', 'fixed');
|
||||
$this->action->create('bug', $bug->id, 'Resolved', '', 'fixed', $bug->resolvedBy);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,6 +86,7 @@
|
||||
</td>
|
||||
<td class='a-left nobr'><?php echo html::a($bugLink, $bug->title, '', "class='preview'");?></td>
|
||||
<td class='w-80px'><?php echo $lang->bug->statusList[$bug->status];?></td>
|
||||
<td class='w-80px'><?php echo $bug->status == 'resolved' ? $bug->resolvedBy : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
<td class='w-id a-left' id='bug'><input type='checkbox' name='bugs[]' value="<?php echo $bug->id;?>" <?php if(strpos(',' . $build->bugs . ',', ',' . $bug->id . ',') !== false) echo 'checked';?>> <?php echo sprintf('%03d', $bug->id);?></td>
|
||||
<td class='a-left nobr'><?php echo html::a($bugLink, $bug->title, '', "class='preview'");?></td>
|
||||
<td class='w-80px'><?php echo $lang->bug->statusList[$bug->status];?></td>
|
||||
<td class='w-80px'><?php echo $bug->status == 'resolved' ? $bug->resolvedBy : html::select('resolvedBy[]', $users, $this->app->user->account, "class='w-70px'");?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
|
||||
@@ -55,7 +55,7 @@ function toggleShow(obj)
|
||||
}
|
||||
$('.changes').each(function(){
|
||||
var box = $(this).parent();
|
||||
while($(box).attr('tagName').toLowerCase() != 'li') box = $(box).parent();
|
||||
while($(box).get(0).tagName.toLowerCase() != 'li') box = $(box).parent();
|
||||
var switchButtonID = ($(box).find('span').find("span").attr('id'));
|
||||
switchChange(switchButtonID.replace('switchButton', ''));
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user