./config/my.php.back

This commit is contained in:
pengjiangxiu
2017-03-07 10:15:26 +08:00
parent f1515951b0
commit e4001d23d5
11 changed files with 177 additions and 110 deletions
+30 -13
View File
@@ -723,22 +723,39 @@ class testtask extends control
$preAndNext = $this->loadModel('common')->getPreAndNextObject('testcase', $caseID);
if(!empty($_POST))
{
$this->testtask->createResult($runID);
$caseResult = $this->testtask->createResult($runID);
if(dao::isError()) die(js::error(dao::getError()));
/* set cookie for ajax load caselist when close colorbox. */
setcookie('selfClose', 1);
if('pass' == $caseResult)
{
/* set cookie for ajax load caselist when close colorbox. */
setcookie('selfClose', 1);
if($preAndNext->next)
{
$nextRunID = $runID ? $preAndNext->next->id : 0;
$nextCaseID = $runID ? $preAndNext->next->case : $preAndNext->next->id;
$nextVersion = $preAndNext->next->version;
if($preAndNext->next)
{
$nextRunID = $runID ? $preAndNext->next->id : 0;
$nextCaseID = $runID ? $preAndNext->next->case : $preAndNext->next->id;
$nextVersion = $preAndNext->next->version;
die(js::locate(inlink('runCase', "runID=$nextRunID&caseID=$nextCaseID&version=$nextVersion")));
}
else
{
die(js::closeModal('parent'));
$response['result'] = 'success';
$response['next'] = 'success';
$response['locate'] = inlink('runCase', "runID=$nextRunID&caseID=$nextCaseID&version=$nextVersion");
die($this->send($response));
die(js::locate(inlink('runCase', "runID=$nextRunID&caseID=$nextCaseID&version=$nextVersion")));
}
else
{
$response['result'] = 'success';
$response['locate'] = 'reload';
$response['target'] = 'parent';
die($this->send($response));
}
} else if('fail' == $caseResult) {
$response['result'] = 'success';
$response['locate'] = $this->createLink('testtask', 'results',"runID=$runID&caseID=$caseID&version=$version");
die($this->send($response));
}
}
+43
View File
@@ -42,3 +42,46 @@ function loadFilesName()
if(fileName) $('#filesName').append("<li>" + fileName + '</li>');//Show file name.
})
}
$(document).ready(function()
{
/* First unbind ajaxForm for form.*/
$("form[data-type='ajax']").unbind('submit');
setForm();
/* Bind ajaxForm for form again. */
$.ajaxForm("form[data-type='ajax']", function(response)
{
console.info(response);
if(response.locate)
{
if(response.locate == 'reload' && response.target == 'parent')
{
parent.$.cookie('selfClose', 1);
parent.$.closeModal(null, 'this');
} else if(response.next) {
location.href = response.locate;
} else {
$('#resultsContainer').load(response.locate + " #casesResults", function()
{
$('#tr-detail_1').show();
$('.result-item').click(function()
{
var $this = $(this);
$this.toggleClass('show-detail');
var show = $this.hasClass('show-detail');
$this.next('.result-detail').toggleClass('hide', !show);
$this.find('.collapse-handle').toggleClass('icon-chevron-down', !show).toggleClass('icon-chevron-up', show);
});
$('#casesResults table caption .result-tip').html($('#resultTip').html());
$("#submit").text('保存');
$("#submit").attr({"disabled":"disabled"});
});
}
}
return false;
});
});
-1
View File
@@ -41,7 +41,6 @@
<td title="<?php echo $task->projectName . '/' . $task->buildName?>">
<?php
echo $task->projectName . '/';
//echo html::a($this->createLink('project', 'story', "projectID=$task->project"), $task->projectName) . '/';
$task->build == 'trunk' ? print($lang->trunk) : print(html::a($this->createLink('build', 'view', "buildID=$task->build"), $task->buildName));;
?>
</td>
+19 -5
View File
@@ -31,14 +31,14 @@
<caption class='text-left'>
<strong><?php echo $lang->testcase->result?> &nbsp;<span> <?php printf($lang->testtask->showResult, $count)?></span> <span class='result-tip'></span></strong>
</caption>
<?php $failCount = 0; ?>
<?php $failCount = 0; $trCount=1?>
<?php foreach($results as $result):?>
<?php
$class = ($result->caseResult == 'pass' ? 'success' : ($result->caseResult == 'fail' ? 'danger' : ($result->caseResult == 'blocked' ? 'warning' : '')));
if($class != 'success') $failCount++;
$fileCount = '(' . count($result->files) . ')';
?>
<tr class='result-item' style='cursor: pointer'>
<tr class='result-item' id='result-<?php echo $class?>' style='cursor: pointer'>
<td class='w-120px'> &nbsp; #<?php echo $result->id?></td>
<td class='w-180px'><?php echo $result->date;?></td>
<td><?php echo $users[$result->lastRunner] . ' ' . $lang->testtask->runCase;?></td>
@@ -47,15 +47,16 @@
<td class='w-60px'><?php if(!empty($result->files)) echo html::a("#caseResult{$result->id}", $lang->files . $fileCount, '', "data-toggle='modal' data-type='iframe'")?></td>
<td class='w-50px text-center'><i class='collapse-handle icon-chevron-down text-muted'></i></td>
</tr>
<tr class='result-detail hide'>
<tr class='result-detail hide' id='tr-detail_<?php echo $trCount++; ?>'>
<td colspan='7' class='pd-0'>
<form action='<?php echo $this->createLink('bug', 'create', "product=$case->product&branch=$case->branch&extras=caseID=$case->id,version=$case->version,runID=")?>' target='_parent' method='post'>
<table class='table table-condensed borderless mg-0 resultSteps'>
<thead>
<tr>
<th class='w-40px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p30 text-left'><?php echo $lang->testcase->stepDesc;?></th>
<th class='w-p25 text-left'><?php echo $lang->testcase->stepExpect;?></th>
<th class='w-p10 text-left'><?php echo $lang->testcase->stepVersion;?></th>
<th class='w-p5 text-left'><?php echo $lang->testcase->stepVersion;?></th>
<th class='text-center'><?php echo $lang->testcase->result;?></th>
<th class='w-p20 text-left'><?php echo $lang->testcase->real;?></th>
<th class='w-80px'></th>
@@ -79,7 +80,12 @@
$fileCount = '(' . count($stepResult['files']) . ')';
?>
<tr class='step <?php echo $stepClass?>'>
<td class='step-id'><?php echo $stepId;?></td>
<td class='step-id'>
<?php if($result->caseResult == 'fail'):?>
<input type='checkbox' name='stepIDList[]' value='<?php echo $key;?>'/>
<?php endif;?>
<?php echo $stepId;?>
</td>
<td class='text-left' <?php if($stepResult['type'] == 'group') echo "colspan='6'"?>>
<div class='input-group'>
<?php if($stepResult['type'] == 'item' and $stepResult['parent'] != 0) echo "<span class='step-item-id'>{$stepId}.{$childId}</span>";?>
@@ -99,7 +105,15 @@
<?php endif; endif; $childId++;?>
</tr>
<?php endforeach;?>
<?php if($result->caseResult == 'fail'):?>
<tr><td></td><td></td><td></td><td></td><td></td><td></td>
<td>
<?php echo html::submitButton($lang->testcase->createBug);?>
</td>
</tr>
<?php endif;?>
</table>
</form>
</td>
</tr>
<?php endforeach;?>
+2 -1
View File
@@ -11,6 +11,7 @@
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<?php include '../../common/view/form.html.php';?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['usecase']);?> <strong><?php echo $run->case->id;?></strong></span>
@@ -19,7 +20,7 @@
</div>
</div>
<div class='main'>
<form class='form-condensed' method='post' enctype='multipart/form-data'>
<form class='form-condensed' method='post' enctype='multipart/form-data' id='dataform' data-type='ajax'>
<table class='table table-bordered table-form' style='word-break:break-all' id='steps'>
<thead>
<tr>