* finish task 2322.
This commit is contained in:
@@ -454,9 +454,6 @@ $lang->resource->testcase->batchEdit = 'batchEdit';
|
||||
$lang->resource->testcase->delete = 'delete';
|
||||
$lang->resource->testcase->batchDelete = 'batchDelete';
|
||||
$lang->resource->testcase->export = 'export';
|
||||
$lang->resource->testcase->exportTemplet = 'exportTemplet';
|
||||
$lang->resource->testcase->import = 'import';
|
||||
$lang->resource->testcase->showImport = 'showImport';
|
||||
$lang->resource->testcase->confirmChange = 'confirmChange';
|
||||
$lang->resource->testcase->confirmStoryChange = 'confirmStoryChange';
|
||||
|
||||
@@ -1001,9 +998,6 @@ $lang->changelog['4.3.beta'][] = 'productplan-linkBug';
|
||||
$lang->changelog['4.3.beta'][] = 'productplan-unlinkBug';
|
||||
$lang->changelog['4.3.beta'][] = 'productplan-batchUnlinkBug';
|
||||
$lang->changelog['4.3.beta'][] = 'bug-batchCreate';
|
||||
$lang->changelog['4.3.beta'][] = 'testcase-exportTemplet';
|
||||
$lang->changelog['4.3.beta'][] = 'testcase-import';
|
||||
$lang->changelog['4.3.beta'][] = 'testcase-showImport';
|
||||
$lang->changelog['4.3.beta'][] = 'testcase-confirmChange';
|
||||
$lang->changelog['4.3.beta'][] = 'mail-reset';
|
||||
$lang->changelog['4.3.beta'][] = 'api-debug';
|
||||
|
||||
@@ -840,233 +840,4 @@ class testcase extends control
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Export templet
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function exportTemplet($productID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$fields['module'] = $this->lang->testcase->module;
|
||||
$fields['story'] = $this->lang->testcase->story;
|
||||
$fields['title'] = $this->lang->testcase->title;
|
||||
$fields['stepDesc'] = $this->lang->testcase->stepDesc;
|
||||
$fields['stepExpect'] = $this->lang->testcase->stepExpect;
|
||||
$fields['keywords'] = $this->lang->testcase->keywords;
|
||||
$fields['type'] = $this->lang->testcase->type;
|
||||
$fields['pri'] = $this->lang->testcase->pri;
|
||||
$fields['stage'] = $this->lang->testcase->stage;
|
||||
$fields['precondition'] = $this->lang->testcase->precondition;
|
||||
$this->post->set('fields', $fields);
|
||||
$this->post->set('kind', 'testcase');
|
||||
$this->post->set('rows', array());
|
||||
$this->post->set('extraNum', $this->post->num);
|
||||
$this->post->set('fileName', 'templet');
|
||||
$this->fetch('file', 'export2csv', $_POST);
|
||||
}
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Import csv
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function import($productID)
|
||||
{
|
||||
if($_FILES)
|
||||
{
|
||||
$file = $this->loadModel('file')->getUpload('file');
|
||||
$file = $file[0];
|
||||
|
||||
$fc = file_get_contents($file['tmpname']);
|
||||
if( $this->post->encode != "utf-8")
|
||||
{
|
||||
if(function_exists('mb_convert_encoding'))
|
||||
{
|
||||
$fc = @mb_convert_encoding($fc, 'utf-8', $this->post->encode);
|
||||
}
|
||||
elseif(function_exists('iconv'))
|
||||
{
|
||||
$fc = @iconv($this->post->encode, 'utf-8', $fc);
|
||||
}
|
||||
else
|
||||
{
|
||||
die(js::alert($this->lang->testcase->noFunction));
|
||||
}
|
||||
}
|
||||
file_put_contents($this->file->savePath . $file['pathname'], $fc);
|
||||
|
||||
$fileName = $this->file->savePath . $file['pathname'];
|
||||
$this->session->set('importFile', $fileName);
|
||||
|
||||
die(js::locate(inlink('showImport', "productID=$productID"), 'parent.parent'));
|
||||
}
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show import data
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function showImport($productID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->testcase->createFromImport($productID);
|
||||
die(js::locate(inlink('browse', "productID=$productID"), 'parent'));
|
||||
}
|
||||
|
||||
$this->testcase->setMenu($this->products, $productID);
|
||||
|
||||
$file = $this->session->importFile;
|
||||
$caseLang = $this->lang->testcase;
|
||||
$caseConfig = $this->config->testcase;
|
||||
$fields = explode(',', $caseConfig->exportFields);
|
||||
$modules = $this->loadModel('tree')->getOptionMenu($productID, 'case');
|
||||
$stories = $this->loadModel('story')->getProductStoryPairs($productID);
|
||||
foreach($fields as $key => $fieldName)
|
||||
{
|
||||
$fieldName = trim($fieldName);
|
||||
$fields[$fieldName] = isset($caseLang->$fieldName) ? $caseLang->$fieldName : $fieldName;
|
||||
unset($fields[$key]);
|
||||
}
|
||||
|
||||
$rows = $this->loadModel('file')->parseCSV($file);
|
||||
$header = $rows[0];
|
||||
unset($rows[0]);
|
||||
|
||||
foreach($header as $title)
|
||||
{
|
||||
$field = array_search($title, $fields);
|
||||
if(!$field) continue;
|
||||
$columnKey[] = $field;
|
||||
}
|
||||
if(empty($columnKey))
|
||||
{
|
||||
echo js::alert($this->lang->testcase->errorEncode);
|
||||
die(js::locate(inlink('browse', "productID=$productID")));
|
||||
}
|
||||
|
||||
$endField = $field;
|
||||
$caseData = array();
|
||||
$stepData = array();
|
||||
foreach($rows as $row => $data)
|
||||
{
|
||||
$case = new stdclass();
|
||||
foreach($columnKey as $key => $field)
|
||||
{
|
||||
if(!isset($data[$key])) continue;
|
||||
$cellValue = $data[$key];
|
||||
if($field == 'story')
|
||||
{
|
||||
$case->$field = 0;
|
||||
if(strrpos($cellValue, '(#') !== false)
|
||||
{
|
||||
$id = trim(substr($cellValue, strrpos($cellValue,'(#') + 2), ')');
|
||||
$case->$field = $id;
|
||||
}
|
||||
}
|
||||
elseif($field == 'module')
|
||||
{
|
||||
$case->$field = 0;
|
||||
if(strrpos($cellValue, '(#') !== false)
|
||||
{
|
||||
$id = trim(substr($cellValue, strrpos($cellValue,'(#') + 2), ')');
|
||||
$case->$field = $id;
|
||||
}
|
||||
}
|
||||
elseif(in_array($field, $caseConfig->export->listFields))
|
||||
{
|
||||
if($field == 'stage')
|
||||
{
|
||||
$stages = explode("\n", $cellValue);
|
||||
foreach($stages as $stage) $case->stage[] = array_search($stage, $caseLang->{$field . 'List'});
|
||||
$case->stage = join(',', $case->stage);
|
||||
}
|
||||
else
|
||||
{
|
||||
$case->$field = array_search($cellValue, $caseLang->{$field . 'List'});
|
||||
}
|
||||
}
|
||||
elseif($field != 'stepDesc' and $field != 'stepExpect')
|
||||
{
|
||||
$case->$field = $cellValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
$steps = explode("\n", $cellValue);
|
||||
$stepKey = str_replace('step', '', strtolower($field));
|
||||
$caseStep = array();
|
||||
|
||||
foreach($steps as $step)
|
||||
{
|
||||
$step = trim($step);
|
||||
if(empty($step)) continue;
|
||||
if(preg_match('/^([0-9]+)([.、]{1})/U', $step, $out))
|
||||
{
|
||||
$num = $out[1];
|
||||
$sign = $out[2];
|
||||
$signbit = $sign == '.' ? 1 : 3;
|
||||
$step = trim(substr($step, strpos($step, $sign) + $signbit));
|
||||
if(!empty($step)) $caseStep[$num] = $step;
|
||||
}
|
||||
elseif(isset($num))
|
||||
{
|
||||
$caseStep[$num] .= "\n" . $step;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($field == 'stepDesc')
|
||||
{
|
||||
$num = 1;
|
||||
$caseStep[$num] = $step;
|
||||
}
|
||||
if($field == 'stepExpect' and isset($stepData[$row]['desc']))
|
||||
{
|
||||
end($stepData[$row]['desc']);
|
||||
$num = key($stepData[$row]['desc']);
|
||||
$caseStep[$num] = $step;
|
||||
}
|
||||
}
|
||||
}
|
||||
unset($num);
|
||||
unset($sign);
|
||||
$stepData[$row][$stepKey] = $caseStep;
|
||||
}
|
||||
}
|
||||
|
||||
$caseData[$row] = $case;
|
||||
unset($case);
|
||||
}
|
||||
|
||||
if(empty($caseData))
|
||||
{
|
||||
echo js::alert($this->lang->error->noData);
|
||||
die(js::locate($this->createLink('testcase', 'browse')));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->testcase->common . $this->lang->colon . $this->lang->testcase->showImport;
|
||||
$this->view->position[] = $this->lang->testcase->showImport;
|
||||
|
||||
$this->view->stories = $stories;
|
||||
$this->view->modules = $modules;
|
||||
$this->view->cases = $this->dao->select('id, module, story')->from(TABLE_CASE)->where('product')->eq($productID)->andWhere('deleted')->eq(0)->fetchAll('id');
|
||||
$this->view->caseData = $caseData;
|
||||
$this->view->stepData = $stepData;
|
||||
$this->view->productID = $productID;
|
||||
$this->view->product = $this->products[$productID];
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,165 +421,4 @@ class testcaseModel extends model
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create from import
|
||||
*
|
||||
* @param int $productID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function createFromImport($productID)
|
||||
{
|
||||
$this->loadModel('action');
|
||||
$this->loadModel('story');
|
||||
$this->loadModel('file');
|
||||
$now = helper::now();
|
||||
$data = fixer::input('post')->get();
|
||||
|
||||
if(!empty($_POST['id']))
|
||||
{
|
||||
$oldSteps = $this->dao->select('t2.*')->from(TABLE_CASE)->alias('t1')
|
||||
->leftJoin(TABLE_CASESTEP)->alias('t2')->on('t1.id = t2.case')
|
||||
->where('t1.id')->in(($_POST['id']))
|
||||
->andWhere('t1.product')->eq($productID)
|
||||
->andWhere('t1.version=t2.version')
|
||||
->orderBy('t2.id')
|
||||
->fetchGroup('case');
|
||||
$oldCases = $this->dao->select('*')->from(TABLE_CASE)->where('id')->in($_POST['id'])->fetchAll('id');
|
||||
}
|
||||
|
||||
$cases = array();
|
||||
foreach($data->product as $key => $product)
|
||||
{
|
||||
$caseData = new stdclass();
|
||||
|
||||
$caseData->product = $product;
|
||||
$caseData->module = $data->module[$key];
|
||||
$caseData->story = (int)$data->story[$key];
|
||||
$caseData->title = $data->title[$key];
|
||||
$caseData->pri = (int)$data->pri[$key];
|
||||
$caseData->type = $data->type[$key];
|
||||
$caseData->status = $data->status[$key];
|
||||
$caseData->stage = join(',', $data->stage[$key]);
|
||||
$caseData->frequency = 1;
|
||||
$caseData->precondition = $data->precondition[$key];
|
||||
|
||||
if(isset($this->config->testcase->create->requiredFields))
|
||||
{
|
||||
$requiredFields = explode(',', $this->config->testcase->create->requiredFields);
|
||||
foreach($requiredFields as $requiredField)
|
||||
{
|
||||
$requiredField = trim($requiredField);
|
||||
if(empty($caseData->$requiredField)) die(js::alert(sprintf($this->lang->testcase->noRequire, $key, $this->lang->testcase->$requiredField)));
|
||||
}
|
||||
}
|
||||
|
||||
$cases[$key] =$caseData;
|
||||
}
|
||||
|
||||
foreach($cases as $key => $caseData)
|
||||
{
|
||||
if(!empty($_POST['id'][$key]))
|
||||
{
|
||||
$caseID = $data->id[$key];
|
||||
$stepChanged = false;
|
||||
$steps = array();
|
||||
$oldStep = isset($oldSteps[$caseID]) ? $oldSteps[$caseID] : array();
|
||||
$oldCase = $oldCases[$caseID];
|
||||
|
||||
/* Remove the empty setps in post. */
|
||||
$steps = array();
|
||||
if(isset($_POST['desc'][$key]))
|
||||
{
|
||||
foreach($this->post->desc[$key] as $id => $desc)
|
||||
{
|
||||
$desc = trim($desc);
|
||||
if(empty($desc))continue;
|
||||
$step = new stdclass();
|
||||
$step->desc = $desc;
|
||||
$step->expect = trim($this->post->expect[$key][$id]);
|
||||
|
||||
$steps[] = $step;
|
||||
}
|
||||
}
|
||||
|
||||
/* If step count changed, case changed. */
|
||||
if((!$oldStep != !$steps) or (count($oldStep) != count($steps)))
|
||||
{
|
||||
$stepChanged = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Compare every step. */
|
||||
foreach($oldStep as $id => $oldStep)
|
||||
{
|
||||
if(trim($oldStep->desc) != trim($steps[$id]->desc) or trim($oldStep->expect) != $steps[$id]->expect)
|
||||
{
|
||||
$stepChanged = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$version = $stepChanged ? $oldCase->version + 1 : $oldCase->version;
|
||||
$caseData->version = $version;
|
||||
$changes = common::createChanges($oldCase, $caseData);
|
||||
if(!$changes and !$stepChanged) continue;
|
||||
|
||||
if($changes or $stepChanged)
|
||||
{
|
||||
$caseData->lastEditedBy = $this->app->user->account;
|
||||
$caseData->lastEditedDate = $now;
|
||||
$this->dao->update(TABLE_CASE)->data($caseData)->where('id')->eq($caseID)->autoCheck()->exec();
|
||||
if($stepChanged)
|
||||
{
|
||||
foreach($steps as $id => $step)
|
||||
{
|
||||
$step = (array)$step;
|
||||
if(empty($step['desc'])) continue;
|
||||
$stepData = new stdclass();
|
||||
$stepData->case = $caseID;
|
||||
$stepData->version = $version;
|
||||
$stepData->desc = htmlspecialchars($step['desc']);
|
||||
$stepData->expect = htmlspecialchars($step['expect']);
|
||||
$this->dao->insert(TABLE_CASESTEP)->data($stepData)->autoCheck()->exec();
|
||||
}
|
||||
}
|
||||
$oldCase->steps = $this->joinStep($oldStep);
|
||||
$caseData->steps = $this->joinStep($steps);
|
||||
$changes = common::createChanges($oldCase, $caseData);
|
||||
$actionID = $this->action->create('case', $caseID, 'Edited');
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$caseData->version = 1;
|
||||
$caseData->openedBy = $this->app->user->account;
|
||||
$caseData->openedDate = $now;
|
||||
$this->dao->insert(TABLE_CASE)->data($caseData)->autoCheck()->exec();
|
||||
|
||||
if(!dao::isError())
|
||||
{
|
||||
$caseID = $this->dao->lastInsertID();
|
||||
foreach($this->post->desc[$key] as $id => $desc)
|
||||
{
|
||||
$desc = trim($desc);
|
||||
if(empty($desc)) continue;
|
||||
$stepData = new stdclass();
|
||||
$stepData->case = $caseID;
|
||||
$stepData->version = 1;
|
||||
$stepData->desc = htmlspecialchars($desc);
|
||||
$stepData->expect = htmlspecialchars($this->post->expect[$key][$id]);
|
||||
$this->dao->insert(TABLE_CASESTEP)->data($stepData)->autoCheck()->exec();
|
||||
}
|
||||
$this->action->create('case', $caseID, 'Opened');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unlink($this->session->importFile);
|
||||
unset($_SESSION['importFile']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,16 +37,10 @@
|
||||
$misc = common::hasPriv('testcase', 'export') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'export') ? $this->createLink('testcase', 'export', "productID=$productID&orderBy=$orderBy") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->export, '', $misc) . "</li>";
|
||||
|
||||
$misc = common::hasPriv('testcase', 'exportTemplet') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('testcase', 'exportTemplet') ? $this->createLink('testcase', 'exportTemplet', "productID=$productID") : '#';
|
||||
echo "<li>" . html::a($link, $lang->testcase->exportTemplet, '', $misc) . "</li>";
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
common::printIcon('testcase', 'import', "productID=$productID", '', 'button', '', '', 'export cboxElement iframe');
|
||||
|
||||
$initModule = isset($moduleID) ? (int)$moduleID : 0;
|
||||
common::printIcon('testcase', 'batchCreate', "productID=$productID&moduleID=$initModule");
|
||||
common::printIcon('testcase', 'create', "productID=$productID&moduleID=$initModule");
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<script>
|
||||
function setDownloading()
|
||||
{
|
||||
if($.browser.opera) return true; // Opera don't support, omit it.
|
||||
|
||||
$.cookie('downloading', 0);
|
||||
time = setInterval("closeWindow()", 300);
|
||||
return true;
|
||||
}
|
||||
|
||||
function closeWindow()
|
||||
{
|
||||
if($.cookie('downloading') == 1)
|
||||
{
|
||||
parent.$.closeModal();
|
||||
$.cookie('downloading', null);
|
||||
clearInterval(time);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div id='titlebar'>
|
||||
<div class='heading'>
|
||||
<span class='prefix'><?php echo html::icon($lang->icons['export']);?></span>
|
||||
<strong><?php echo $lang->testcase->exportTemplet;?></strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form class='form-condensed' method='post' target='hiddenwin' onsubmit='setDownloading();' style='padding: 40px 5%'>
|
||||
<table class='w-p100'>
|
||||
<tr>
|
||||
<td>
|
||||
<div class='input-group'>
|
||||
<span class='input-group-addon'><?php echo $lang->testcase->num;?></span>
|
||||
<?php
|
||||
echo html::input('num', '10', 'class=form-control');
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
<td class='w-100px'>
|
||||
<?php echo html::select('encode', $config->charsets[$this->cookie->lang], 'utf-8', "class='form-control'");?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo html::submitButton();?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
@@ -1,19 +0,0 @@
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<div class='container mw-600px'>
|
||||
<form class='form-condensed' method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<td align='center' style="padding:30px">
|
||||
<input type='file' name='file' class='form-control'/>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo html::select('encode', $config->charsets[$this->cookie->lang], 'utf-8', "class='form-control'");?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo html::submitButton();?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
@@ -1,100 +0,0 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<style>
|
||||
.affix {position:fixed; top:0px; width:95.6%;z-index:10000;}
|
||||
</style>
|
||||
<form target='hiddenwin' method='post' class='form-condensed'>
|
||||
<table class='table table-fixed active-disabled'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class='w-80px'><?php echo $lang->testcase->id?></th>
|
||||
<th><?php echo $lang->testcase->title?></th>
|
||||
<th class='w-90px'><?php echo $lang->testcase->module?></th>
|
||||
<th class='w-100px'><?php echo $lang->testcase->story?></th>
|
||||
<th class='w-70px'><?php echo $lang->testcase->pri?></th>
|
||||
<th class='w-100px'><?php echo $lang->testcase->type?></th>
|
||||
<th class='w-80px'><?php echo $lang->testcase->status?></th>
|
||||
<th><?php echo $lang->testcase->stage?></th>
|
||||
<th><?php echo $lang->testcase->precondition?></th>
|
||||
<th class='w-300px'>
|
||||
<table class='w-p100 table-borderless'>
|
||||
<tr>
|
||||
<th colspan='2'><?php echo $lang->testcase->steps?></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->testcase->stepDesc?></th>
|
||||
<th><?php echo $lang->testcase->stepExpect?></th>
|
||||
</tr>
|
||||
</table>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<?php foreach($caseData as $key => $case):?>
|
||||
<tr valign='top' align='center'>
|
||||
<td>
|
||||
<?php
|
||||
if(!empty($case->id))
|
||||
{
|
||||
echo $case->id . html::hidden("id[$key]", $case->id);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $key . " <sub class='gray' style='vertical-align:sub;'>{$lang->testcase->new}</sub>";
|
||||
}
|
||||
echo html::hidden("product[$key]", $productID);
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo html::input("title[$key]", $case->title, "class='form-control' style='margin-top:2px'")?></td>
|
||||
<td class='text-left' style='overflow:visible'><?php echo html::select("module[$key]", $modules, isset($case->module) ? $case->module : (!empty($case->id) ? $cases[$case->id]->module : ''), "class='form-control chosen'")?></td>
|
||||
<td class='text-left' style='overflow:visible'><?php echo html::select("story[$key]", $stories, isset($case->story) ? $case->story : (!empty($case->id) ? $cases[$case->id]->story : ''), "class='form-control chosen'")?></td>
|
||||
<td><?php echo html::select("pri[$key]", $lang->testcase->priList, isset($case->pri) ? $case->pri : (!empty($case->id) ? $cases[$case->id]->pri : ''), "class='form-control'")?></td>
|
||||
<td><?php echo html::select("type[$key]", $lang->testcase->typeList, $case->type, "class='form-control'")?></td>
|
||||
<td><?php echo html::select("status[$key]", $lang->testcase->statusList, isset($case->status) ? $case->status : '', "class='form-control'")?></td>
|
||||
<td class='text-left' style='overflow:visible'><?php echo html::select("stage[$key][]", $lang->testcase->stageList, isset($case->stage) ? $case->stage : '', "multiple='multiple' class='form-control chosen'")?></td>
|
||||
<td><?php echo html::textarea("precondition[$key]", isset($case->precondition) ? $case->precondition : "", "class='form-control'")?></td>
|
||||
<td>
|
||||
<?php if(isset($stepData[$key]['desc'])):?>
|
||||
<table class='w-p100 bd-0'>
|
||||
<?php foreach($stepData[$key]['desc'] as $id => $desc):?>
|
||||
<tr>
|
||||
<td><?php echo html::textarea("desc[$key][$id]", $desc, "class='form-control'")?></td>
|
||||
<td><?php echo html::textarea("expect[$key][$id]", isset($stepData[$key]['expect'][$id]) ? $stepData[$key]['expect'][$id] : '', "class='form-control'")?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</table>
|
||||
<?php endif;?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php unset($caseData[$key]);?>
|
||||
<?php endforeach;?>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='10' class='text-center'><?php echo html::submitButton() . ' ' . html::backButton()?></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
<script>
|
||||
$(function(){affix('thead')})
|
||||
function affix(obj)
|
||||
{
|
||||
var fixH = $(obj).offset().top;
|
||||
var first = true;
|
||||
$(window).scroll(function()
|
||||
{
|
||||
var scroH = $(this).scrollTop();
|
||||
if(scroH>=fixH && first)
|
||||
{
|
||||
$(obj).parent().parent().before("<table id='headerClone' class='table'></table>");
|
||||
$('#headerClone').append($(obj).clone()).addClass('affix');
|
||||
$('.active-disabled ' + obj + ' th').each(function(i){$('#headerClone ' + obj + ' th').eq(i).width($(this).width())});
|
||||
first = false;
|
||||
}
|
||||
else if(scroH<fixH)
|
||||
{
|
||||
$("#headerClone").remove();
|
||||
first = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
Reference in New Issue
Block a user