This commit is contained in:
Catouse
2018-05-24 16:18:34 +08:00
10 changed files with 122 additions and 102 deletions
+16 -12
View File
@@ -1279,26 +1279,30 @@ class testcase extends control
$modules = $this->loadModel('tree')->getOptionMenu($productID, 'case');
$rows = array();
foreach($modules as $moduleID => $module)
$num = (int)$this->post->num;
for($i = 0; $i < $num; $i++)
{
$row = new stdclass();
$row->module = $module . "(#$moduleID)";
$row->stepDesc = "1. \n2. \n3.";
$row->stepExpect = "1. \n2. \n3.";
if(empty($rows))
foreach($modules as $moduleID => $module)
{
$row->typeValue = join("\n", $this->lang->testcase->typeList);
$row->stageValue = join("\n", $this->lang->testcase->stageList);
if($product->type != 'normal') $row->branchValue = join("\n", $branches);
$row = new stdclass();
$row->module = $module . "(#$moduleID)";
$row->stepDesc = "1. \n2. \n3.";
$row->stepExpect = "1. \n2. \n3.";
if(empty($rows))
{
$row->typeValue = join("\n", $this->lang->testcase->typeList);
$row->stageValue = join("\n", $this->lang->testcase->stageList);
if($product->type != 'normal') $row->branchValue = join("\n", $branches);
}
$rows[] = $row;
}
$rows[] = $row;
}
$this->post->set('fields', $fields);
$this->post->set('kind', 'testcase');
$this->post->set('rows', $rows);
$this->post->set('extraNum', $this->post->num);
$this->post->set('extraNum', $num);
$this->post->set('fileName', 'templet');
$this->fetch('file', 'export2csv', $_POST);
}
+2 -2
View File
@@ -1,7 +1,7 @@
<?php $sysURL = $this->session->notHead ? common::getSysURL() : '';?>
<table class='table main-table' id='bugs'>
<thead>
<tr class='text-center'>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th class='text-left'><?php echo $lang->testreport->bugTitle;?></th>
@@ -12,7 +12,7 @@
</tr>
</thead>
<?php if($bugs):?>
<tbody class='text-center'>
<tbody>
<?php foreach($bugs as $bug):?>
<tr>
<td><?php echo sprintf('%03d', $bug->id) . html::hidden('bugs[]', $bug->id)?></td>
+2 -2
View File
@@ -1,7 +1,7 @@
<?php $sysURL = $this->session->notHead ? common::getSysURL() : '';?>
<table class='table main-table' id='builds'>
<thead>
<tr class='text-center'>
<tr>
<th class='w-id'> <?php echo $lang->build->id;?></th>
<th class='text-left'><?php echo $lang->build->name;?></th>
<th class='w-user'><?php echo $lang->build->builder;?></th>
@@ -9,7 +9,7 @@
</tr>
</thead>
<?php if($builds):?>
<tbody class='text-center'>
<tbody>
<?php foreach($builds as $build):?>
<tr>
<td><?php echo sprintf('%03d', $build->id) . html::hidden('builds[]', $build->id)?></td>
+2 -2
View File
@@ -1,7 +1,7 @@
<?php $sysURL = $this->session->notHead ? common::getSysURL() : '';?>
<table class='table main-table' id='cases'>
<thead>
<tr class='text-center'>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th class='text-left'><?php echo $lang->testcase->title;?></th>
@@ -14,7 +14,7 @@
</tr>
</thead>
<?php if($cases):?>
<tbody class='text-center'>
<tbody>
<?php foreach($cases as $case):?>
<tr>
<td><?php echo sprintf('%03d', $case->id) . html::hidden('cases[]', $case->id)?></td>
@@ -1,7 +1,7 @@
<?php $sysURL = $this->session->notHead ? common::getSysURL() : '';?>
<table class='table main-table' id='legacyBugs'>
<thead>
<tr class='text-center'>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th class='text-left'><?php echo $lang->bug->title;?></th>
@@ -12,7 +12,7 @@
</tr>
</thead>
<?php if($legacyBugs):?>
<tbody class='text-center'>
<tbody>
<?php foreach($legacyBugs as $bug):?>
<tr>
<td><?php echo sprintf('%03d', $bug->id);?></td>
+2 -2
View File
@@ -1,7 +1,7 @@
<?php $sysURL = $this->session->notHead ? common::getSysURL() : '';?>
<table class='table main-table' id='stories'>
<thead>
<tr class='text-center'>
<tr>
<th class='w-id'> <?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th class='text-left'><?php echo $lang->testreport->storyTitle;?></th>
@@ -13,7 +13,7 @@
</tr>
</thead>
<?php if($stories):?>
<tbody class='text-center'>
<tbody>
<?php foreach($stories as $story):?>
<tr>
<td><?php echo sprintf('%03d', $story->id) . html::hidden('stories[]', $story->id)?></td>
+7 -1
View File
@@ -47,14 +47,17 @@
<tr>
<th><?php echo $lang->testreport->members?></th>
<td colspan='2'><?php echo html::select('members[]', $users, $members, "class='form-control chosen' multiple")?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->title?></th>
<td colspan='2'><?php echo html::input('title', $reportTitle, "class='form-control'")?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $project->desc?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->profile?></th>
@@ -66,17 +69,20 @@
unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']);
?>
</td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->report?></th>
<td colspan='2'><?php echo html::textarea('report', '', "class='form-control'")?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->files?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
<td></td>
</tr>
<tr>
<td class='text-center' colspan='3'>
<td class='text-center' colspan='4'>
<?php echo html::submitButton('', '', 'btn btn-wide btn-primary');?>
<?php echo html::backButton('', '', 'btn btn-wide');?>
</td>
+7 -1
View File
@@ -47,14 +47,17 @@
<tr>
<th><?php echo $lang->testreport->members?></th>
<td colspan='2'><?php echo html::select('members[]', $users, $report->members, "class='form-control chosen' multiple")?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->title?></th>
<td colspan='2'><?php echo html::input('title', $report->title, "class='form-control'")?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->goal?></th>
<td colspan='2'><?php echo $project->desc?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->profile?></th>
@@ -66,17 +69,20 @@
unset($bugInfo['countBugByTask']); unset($bugInfo['bugConfirmedRate']); unset($bugInfo['bugCreateByCaseRate']); unset($bugInfo['foundBugs']);
?>
</td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->testreport->report?></th>
<td colspan='2'><?php echo html::textarea('report', $report->report, "class='form-control'")?></td>
<td></td>
</tr>
<tr>
<th><?php echo $lang->files?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
<td></td>
</tr>
<tr>
<td class='text-center' colspan='3'>
<td class='text-center' colspan='4'>
<?php echo html::submitButton('', '', 'btn btn-wide btn-primary');?>
<?php echo html::backButton('', '', 'btn btn-wide');?>
</td>
+2 -2
View File
@@ -54,7 +54,7 @@
</tr>
<tr>
<th><?php echo $lang->testreport->owner?></th>
<td><?php echo zget($users, $report->owner);?></td>
<td colspan='2'><?php echo zget($users, $report->owner);?></td>
</tr>
<tr>
<th><?php echo $lang->testreport->members?></th>
@@ -78,7 +78,7 @@
<?php if(!$this->session->notHead):?>
<tr>
<th><?php echo $lang->files?></th>
<td><?php echo $this->fetch('file', 'printFiles', array('files' => $report->files, 'fieldset' => 'false'));?></td>
<td colspan='2'><?php echo $this->fetch('file', 'printFiles', array('files' => $report->files, 'fieldset' => 'false'));?></td>
</tr>
<?php endif;?>
</table>
+80 -76
View File
@@ -15,7 +15,7 @@ class testsuite extends control
/**
* Index page, header to browse.
*
*
* @access public
* @return void
*/
@@ -25,13 +25,13 @@ class testsuite extends control
}
/**
* Browse test suites.
*
* @param int $productID
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* Browse test suites.
*
* @param int $productID
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
@@ -69,8 +69,8 @@ class testsuite extends control
/**
* Create a test suite.
*
* @param int $productID
*
* @param int $productID
* @access public
* @return void
*/
@@ -109,12 +109,12 @@ class testsuite extends control
/**
* View a test suite.
*
* @param int $suiteID
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
*
* @param int $suiteID
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
@@ -159,8 +159,8 @@ class testsuite extends control
/**
* Edit a test suite.
*
* @param int $suiteID
*
* @param int $suiteID
* @access public
* @return void
*/
@@ -226,8 +226,8 @@ class testsuite extends control
/**
* Delete a test suite.
*
* @param int $suiteID
*
* @param int $suiteID
* @param string $confirm yes|no
* @access public
* @return void
@@ -265,12 +265,12 @@ class testsuite extends control
/**
* Link cases to a test suite.
*
* @param int $suiteID
* @param int $param
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
*
* @param int $suiteID
* @param int $param
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
@@ -333,10 +333,10 @@ class testsuite extends control
/**
* Remove a case from test suite.
*
* @param int $suiteID
* @param int $rowID
* @param string $confirm
*
* @param int $suiteID
* @param int $rowID
* @param string $confirm
* @access public
* @return void
*/
@@ -383,14 +383,14 @@ class testsuite extends control
/**
* Show library case.
*
* @param int $libID
* @param string $browseType
* @param int $param
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
*
* @param int $libID
* @param string $browseType
* @param int $param
* @param string $orderBy
* @param int $recTotal
* @param int $recPerPage
* @param int $pageID
* @access public
* @return void
*/
@@ -465,8 +465,8 @@ class testsuite extends control
}
/**
* Create lib
*
* Create lib
*
* @access public
* @return void
*/
@@ -503,9 +503,9 @@ class testsuite extends control
/**
* Create case for library.
*
* @param int $libID
* @param int $moduleID
*
* @param int $libID
* @param int $moduleID
* @access public
* @return void
*/
@@ -590,9 +590,9 @@ class testsuite extends control
/**
* Batch create case.
*
* @param int $libID
* @param int $moduleID
*
* @param int $libID
* @param int $moduleID
* @access public
* @return void
*/
@@ -632,8 +632,8 @@ class testsuite extends control
/**
* View library
*
* @param int $libID
*
* @param int $libID
* @access public
* @return void
*/
@@ -659,11 +659,11 @@ class testsuite extends control
/**
* Ajax get drop menu.
*
* @param int $libID
* @param string $module
* @param string $method
* @param string $extra
*
* @param int $libID
* @param string $module
* @param string $method
* @param string $extra
* @access public
* @return void
*/
@@ -684,11 +684,11 @@ class testsuite extends control
/**
* The results page of search.
*
* @param string $keywords
* @param string $module
* @param string $method
* @param mix $extra
*
* @param string $keywords
* @param string $module
* @param string $method
* @param mix $extra
* @access public
* @return void
*/
@@ -703,8 +703,8 @@ class testsuite extends control
/**
* Export templet.
*
* @param int $libID
*
* @param int $libID
* @access public
* @return void
*/
@@ -729,25 +729,29 @@ class testsuite extends control
$modules = $this->loadModel('tree')->getOptionMenu($libID, $viewType = 'caselib', $startModuleID = 0);
$rows = array();
foreach($modules as $moduleID => $module)
$num = (int)$this->post->num;
for($i = 0; $i < $num; $i++)
{
$row = new stdclass();
$row->module = $module . "(#$moduleID)";
$row->stepDesc = "1. \n2. \n3.";
$row->stepExpect = "1. \n2. \n3.";
if(empty($rows))
foreach($modules as $moduleID => $module)
{
$row->typeValue = join("\n", $this->lang->testcase->typeList);
$row->stageValue = join("\n", $this->lang->testcase->stageList);
$row = new stdclass();
$row->module = $module . "(#$moduleID)";
$row->stepDesc = "1. \n2. \n3.";
$row->stepExpect = "1. \n2. \n3.";
if(empty($rows))
{
$row->typeValue = join("\n", $this->lang->testcase->typeList);
$row->stageValue = join("\n", $this->lang->testcase->stageList);
}
$rows[] = $row;
}
$rows[] = $row;
}
$this->post->set('fields', $fields);
$this->post->set('kind', 'testcase');
$this->post->set('rows', $rows);
$this->post->set('extraNum', $this->post->num);
$this->post->set('extraNum', $num);
$this->post->set('fileName', 'templet');
$this->fetch('file', 'export2csv', $_POST);
}
@@ -757,8 +761,8 @@ class testsuite extends control
/**
* Import case csv file.
*
* @param int $libID
*
* @param int $libID
* @access public
* @return void
*/
@@ -824,8 +828,8 @@ class testsuite extends control
/**
* Show import case.
*
* @param int $libID
*
* @param int $libID
* @access public
* @return void
*/
@@ -890,7 +894,7 @@ class testsuite extends control
{
$id = trim(substr($cellValue, strrpos($cellValue,'(#') + 2), ')');
$case->$field = $id;
}
}
}
elseif(in_array($field, $caseConfig->export->listFields))
{