* adjust for doc and testtask view for xuanxuan.

This commit is contained in:
wangyidong
2018-12-17 15:39:49 +08:00
parent 14bb43df14
commit 201e157ffd
6 changed files with 128 additions and 273 deletions
+3 -6
View File
@@ -41,13 +41,10 @@ class control extends baseControl
$mainViewFile = $modulePath . 'view' . DS . $this->devicePrefix . $methodName . '.' . $viewType . '.php';
/* If the main view file doesn't exist, set the device prefix to empty and reset the main view file. */
if($this->viewType == 'mhtml' or $this->viewType == 'xhtml')
if(!file_exists($mainViewFile))
{
if(!file_exists($mainViewFile))
{
$this->devicePrefix = '';
$mainViewFile = $modulePath . 'view' . DS . $this->devicePrefix . $methodName . '.' . $viewType . '.php';
}
$this->devicePrefix = '';
$mainViewFile = $modulePath . 'view' . DS . $this->devicePrefix . $methodName . '.' . $viewType . '.php';
}
$viewFile = $mainViewFile;
+1 -1
View File
@@ -20,7 +20,7 @@
<div class='panel-heading strong'>
<span class="label label-id"><?php echo $bug->id;?></span> <span class="text" title='<?php echo $bug->title;?>'><?php echo $bug->title;?></span>
</div>
<div class="main-col col-8">
<div class="main-col">
<div class="cell">
<div class="detail">
<div class="detail-title"><?php echo $lang->bug->legendSteps;?></div>
+33 -58
View File
@@ -14,70 +14,45 @@
<?php include '../../common/view/kindeditor.html.php';?>
<?php echo css::internal($keTableCSS);?>
<?php $browseLink = $this->session->docList ? $this->session->docList : inlink('browse');?>
<style>body{padding:0px;}</style>
<style>
body{padding:0px;}
.xuanxuan-card{padding-bottom:55px;}
</style>
<div class='xuanxuan-card'>
<div class='panel'>
<div id="mainContent" class="main-row">
<div class='panel-heading strong'>
<span class="label label-id"><?php echo $doc->id;?></span> <span class="text" title='<?php echo $doc->title;?>'><?php echo $doc->title;?></span>
</div>
<div class="panel-body">
<table class="table table-data">
<tbody>
<tr>
<th class='w-80px'><?php echo $lang->doc->content;?></th>
<td>
<div class="detail-content article-content no-margin no-padding">
<?php echo $doc->content;?>
<?php foreach($doc->files as $file):?>
<?php if(in_array($file->extension, $config->file->imageExtensions)):?>
<div class='file-image'>
<img onload="setImageSize(this, 0)" src="<?php echo $this->createLink('file', 'read', "fileID={$file->id}");?>" alt="<?php echo $file->title?>">
</div>
<?php unset($doc->files[$file->id]);?>
<?php endif;?>
<?php endforeach;?>
</div>
<?php echo $this->fetch('file', 'printFiles', array('files' => $doc->files, 'fieldset' => 'true'));?>
</td>
</tr>
<?php if($doc->productName):?>
<tr>
<th><?php echo $lang->doc->product;?></th>
<td><?php echo $doc->productName;?></td>
</tr>
<?php endif;?>
<?php if($doc->projectName):?>
<tr>
<th><?php echo $lang->doc->project;?></th>
<td><?php echo $doc->projectName;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->doc->lib;?></th>
<td><?php echo $lib->name;?></td>
</tr>
<tr>
<th><?php echo $lang->doc->module;?></th>
<td><?php echo $doc->moduleName ? $doc->moduleName : '/';?></td>
</tr>
<tr>
<th><?php echo $lang->doc->addedDate;?></th>
<td><?php echo $doc->addedDate;?></td>
</tr>
<tr>
<th><?php echo $lang->doc->editedBy;?></th>
<td><?php echo zget($users, $doc->editedBy);?></td>
</tr>
<tr>
<th><?php echo $lang->doc->editedDate;?></th>
<td><?php echo $doc->editedDate;?></td>
</tr>
</tbody>
</table>
<?php include '../../common/view/action.html.php';?>
</div>
<div class="main-col">
<div class="cell">
<div class="detail no-padding">
<div class="detail-title"><?php echo $lang->doc->content;?></div>
<div class="detail-content article-content no-margin no-padding">
<?php echo $doc->content;?>
<?php foreach($doc->files as $file):?>
<?php if(in_array($file->extension, $config->file->imageExtensions)):?>
<div class='file-image'>
<img onload="setImageSize(this, 0)" src="<?php echo $this->createLink('file', 'read', "fileID={$file->id}");?>" alt="<?php echo $file->title?>">
</div>
<?php unset($doc->files[$file->id]);?>
<?php endif;?>
<?php endforeach;?>
</div>
<?php echo $this->fetch('file', 'printFiles', array('files' => $doc->files, 'fieldset' => 'true'));?>
</div>
<?php include '../../common/view/action.html.php';?>
</div>
</div>
</div>
<div class='xuancard-actions fixed'>
<?php
$url = common::getSysURL() . $this->createLink('doc', 'edit', "docID=$doc->id");
$url .= strpos($url, '?') === false ? '?' : '&';
$url .= 'width=100%&height=100%';
echo html::a('xxc:openUrlInDialog/' . urlencode($url), "<i class='icon-edit'></i>", '_blank', "class='btn btn-link'");
?>
</div>
</div>
<?php include '../../common/view/syntaxhighlighter.html.php';?>
<?php include '../../common/view/footer.lite.html.php';?>
+36
View File
@@ -16,6 +16,11 @@
<div id='mainContent' class='main-content'>
<form class='main-form form-ajax' method='post' enctype='multipart/form-data' id='dataform'>
<table class='table table-form'>
<tr>
<th class='w-70px'><?php echo $lang->task->project;?></th>
<?php $projects = $this->loadModel('project')->getPairs();?>
<td><?php echo html::select('project', $projects, $project->id, "class='form-control chosen' onchange='loadAll(this.value)' required");?></td><td></td><td></td>
</tr>
<tr>
<th class='w-70px'><?php echo $lang->task->type;?></th>
<td><?php echo html::select('type', $lang->task->typeList, $task->type, "class='form-control chosen' onchange='setOwners(this.value)' required");?></td><td></td><td></td>
@@ -185,3 +190,34 @@
</div>
</form>
</div>
<script>
function loadAll(projectID)
{
loadModuleMenu(projectID);
loadProjectStories(projectID);
loadProjectMembers(projectID);
}
function loadModuleMenu(projectID)
{
var link = createLink('tree', 'ajaxGetOptionMenu', 'rootID=' + projectID + '&viewtype=task');
$('#moduleIdBox').load(link, function(){$('#module').chosen();});
}
function loadProjectStories(projectID)
{
var link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=0&branch=0&moduleID=0&storyID=' + oldStoryID);
$.get(link, function(data)
{
$('#story').replaceWith(data);
$('#story').chosen();
});
}
function loadProjectMembers(projectID)
{
var link = createLink('project', 'ajaxGetMembers', 'projectID=' + projectID + '&assignedTo=' + oldAssignedTo);
$('#assignedToIdBox').load(link, function(){$('#assignedToIdBox').find('select').chosen()});
}
</script>
<?php include '../../common/view/footer.lite.html.php';?>
+2 -2
View File
@@ -1,5 +1,5 @@
$(document).ready(function()
{
if(config.onlybody != 'yes')$(".runCase").modalTrigger({width:900, type:'iframe', afterHide:function(){parent.location.href=parent.location.href;}});
if(config.onlybody != 'yes')$(".results").modalTrigger({width:900, type:'iframe'});
if(config.onlybody != 'yes')$(".runCase").modalTrigger({width:'90%', type:'iframe', afterHide:function(){parent.location.href=parent.location.href;}});
if(config.onlybody != 'yes')$(".results").modalTrigger({width:'90%', type:'iframe'});
})
+53 -206
View File
@@ -13,9 +13,12 @@
<?php include '../../common/view/header.lite.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<?php $browseLink = $app->session->caseList != false ? $app->session->caseList : $this->createLink('testcase', 'browse', "productID=$case->product");?>
<style>body{padding:0px;}</style>
<style>
body{padding:0px;}
.xuanxuan-card{padding-bottom:55px;}
</style>
<div class='xuanxuan-card'>
<div class='panel'>
<div id="mainContent" class="main-row">
<div class='panel-heading strong'>
<span class='label label-id'><?php echo $case->id;?></span>
<span class='text' title='<?php echo $case->title;?>' style='color: <?php echo $case->color; ?>'><?php echo $case->title;?></span>
@@ -23,218 +26,62 @@
<small><?php echo html::icon($lang->icons['testcase']) . " {$lang->testcase->fromCase}$lang->colon$case->fromCaseID";?></small>
<?php endif;?>
</div>
<div class='panel-body'>
<table class='table table-data'>
<tr>
<th><?php echo $lang->testcase->precondition;?></th>
<td><?php echo nl2br($case->precondition);?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->steps;?></th>
<td>
<table class='table table-condensed table-hover table-striped table-bordered' id='steps'>
<thead>
<tr>
<th class='w-50px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p70 text-left'><?php echo $lang->testcase->stepDesc;?></th>
<th class='text-left'><?php echo $lang->testcase->stepExpect;?></th>
</tr>
</thead>
<?php
$stepId = $childId = 0;
foreach($case->steps as $stepID => $step)
{
$stepClass = "step-{$step->type}";
if($step->type == 'group' or $step->type == 'step')
{
$stepId++;
$childId = 0;
}
if($step->type == 'step') $stepClass = 'step-group';
echo "<tr class='step {$stepClass}'>";
echo "<th class='step-id'>$stepId</th>";
echo "<td class='text-left'><div class='input-group'>";
if($step->type == 'item') echo "<span class='step-item-id'>{$stepId}.{$childId}</span>";
echo nl2br(str_replace(' ', '&nbsp;', $step->desc)) . "</td>";
echo "<td class='text-left'>" . nl2br(str_replace(' ', '&nbsp;', $step->expect)) . "</div></td>";
echo "</tr>";
$childId ++;
}
?>
</table>
<?php echo $this->fetch('file', 'printFiles', array('files' => $case->files, 'fieldset' => 'true'));?>
</td>
</tr>
<tr>
<th colspan='2' class='text-left stong'><?php echo $lang->testcase->legendBasicInfo;?></th>
</tr>
<?php if($isLibCase):?>
<tr>
<th class='w-80px'><?php echo $lang->testcase->lib;?></th>
<td><?php echo $libName;?></td>
</tr>
<?php else:?>
<tr>
<th class='w-80px'><?php echo $lang->testcase->product;?></th>
<td><?php echo $productName;?></td>
</tr>
<?php if($this->session->currentProductType != 'normal'):?>
<tr>
<th><?php echo $lang->product->branch;?></th>
<td><?php echo $branchName;?></td>
</tr>
<?php endif;?>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->module;?></th>
<td>
</div>
<div class='main-col'>
<div class='cell' style='word-break:break-all'>
<div class='detail'>
<div class='detail-title'><?php echo $lang->testcase->precondition;?></div>
<div class="detail-content article-content"><?php echo nl2br($case->precondition);?></div>
</div>
<div class='detail'>
<div class='detail-title'><?php echo $lang->testcase->steps;?></div>
<div class="detail-content">
<table class='table table-condensed table-hover table-striped table-bordered' id='steps'>
<thead>
<tr>
<th class='w-50px'><?php echo $lang->testcase->stepID;?></th>
<th class='w-p70 text-left'><?php echo $lang->testcase->stepDesc;?></th>
<th class='text-left'><?php echo $lang->testcase->stepExpect;?></th>
</tr>
</thead>
<?php
if(empty($modulePath))
$stepId = $childId = 0;
foreach($case->steps as $stepID => $step)
{
echo "/";
}
else
{
foreach($modulePath as $key => $module)
{
echo $module->name;
if(isset($modulePath[$key + 1])) echo $lang->arrow;
}
}
?>
</td>
</tr>
<?php if(!$isLibCase and $config->global->flow != 'onlyTest'):?>
<tr class='nofixed'>
<th><?php echo $lang->testcase->story;?></th>
<td>
<?php
if(isset($case->storyTitle)) echo "#$case->story:$case->storyTitle";
if($case->story and $case->storyStatus == 'active' and $case->latestStoryVersion > $case->storyVersion)
{
echo "(<span class='warning'>{$lang->story->changed}</span> ";
echo html::a($this->createLink('testcase', 'confirmStoryChange', "caseID=$case->id"), $lang->confirm, 'hiddenwin');
echo ")";
}
?>
</td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->type;?></th>
<td><?php echo $lang->testcase->typeList[$case->type];?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->stage;?></th>
<td>
<?php
if($case->stage)
{
$stags = explode(',', $case->stage);
foreach($stags as $stage)
$stepClass = "step-{$step->type}";
if($step->type == 'group' or $step->type == 'step')
{
if(empty($stage)) continue;
isset($lang->testcase->stageList[$stage]) ? print($lang->testcase->stageList[$stage]) : print($stage);
echo "<br />";
$stepId++;
$childId = 0;
}
if($step->type == 'step') $stepClass = 'step-group';
echo "<tr class='step {$stepClass}'>";
echo "<th class='step-id'>$stepId</th>";
echo "<td class='text-left'><div class='input-group'>";
if($step->type == 'item') echo "<span class='step-item-id'>{$stepId}.{$childId}</span>";
echo nl2br(str_replace(' ', '&nbsp;', $step->desc)) . "</td>";
echo "<td class='text-left'>" . nl2br(str_replace(' ', '&nbsp;', $step->expect)) . "</div></td>";
echo "</tr>";
$childId ++;
}
?>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->pri;?></th>
<td><span class='label-pri label-pri-<?php echo $case->pri;?>' title='<?php echo zget($lang->testcase->priList, $case->pri);?>'><?php echo zget($lang->testcase->priList, $case->pri)?></span></td>
</tr>
<tr>
<th><?php echo $lang->testcase->status;?></th>
<td>
<?php
echo $lang->testcase->statusList[$case->status];
if($case->version > $case->currentVersion and $from == 'testtask')
{
echo "(<span class='warning'>{$lang->testcase->changed}</span> ";
echo html::a($this->createLink('testcase', 'confirmchange', "caseID=$case->id"), $lang->confirm, 'hiddenwin', "class='btn btn-mini btn-info'");
echo ")";
}
?>
</td>
</tr>
<?php if(!$isLibCase):?>
<tr>
<th><?php echo $this->app->loadLang('testtask')->testtask->lastRunTime;?></th>
<td><?php if(!helper::isZeroDate($case->lastRunDate)) echo $case->lastRunDate;?></td>
</tr>
<tr>
<th><?php echo $this->app->loadLang('testtask')->testtask->lastRunResult;?></th>
<td><?php if($case->lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->keywords;?></th>
<td><?php echo $case->keywords;?></td>
</tr>
<?php if(!$isLibCase):?>
<tr>
<th><?php echo $lang->testcase->linkCase;?></th>
<td>
<?php
if(isset($case->linkCaseTitles))
{
foreach($case->linkCaseTitles as $linkCaseID => $linkCaseTitle)
{
echo html::a($this->createLink('testcase', 'view', "caseID=$linkCaseID", '', true), "#$linkCaseID $linkCaseTitle", '', "class='iframe' data-width='80%'") . '<br />';
}
}
?>
</td>
</tr>
<?php endif;?>
<?php if($case->fromBug):?>
<tr>
<th colspan='2' class='text-left stong'><?php echo $lang->testcase->legendLinkBugs;?></th>
</tr>
<tr>
<th class='w-60px'><?php echo $lang->testcase->fromBug;?></th>
<td><?php echo html::a($this->createLink('bug', 'view', "bugID=$case->fromBug", '', true), $case->fromBugTitle, '', "class='iframe' data-width='80%'");?></td>
</tr>
<?php endif;?>
<?php if($case->toBugs):?>
<tr>
<th class='w-60px' valign="top"><?php echo $lang->testcase->toBug;?></th>
<td>
<?php
foreach($case->toBugs as $bugID => $bugTitle)
{
echo '<p style="margin-bottom:0;">' . html::a($this->createLink('bug', 'view', "bugID=$bugID", '', true), $bugTitle, '', "class='iframe' data-width='80%'") . '</p>';
}
?>
</td>
</tr>
<?php endif;?>
<tr>
<th colspan='2' class='text-left stong'><?php echo $lang->testcase->legendOpenAndEdit;?></tr>
</tr>
<tr>
<th class='w-60px'><?php echo $lang->testcase->openedBy;?></th>
<td><?php echo $users[$case->openedBy] . $lang->at . $case->openedDate;?></td>
</tr>
<?php if($config->testcase->needReview or !empty($config->testcase->forceReview)):?>
<tr>
<th><?php echo $lang->testcase->reviewedBy;?></th>
<td><?php $reviewedBy = explode(',', $case->reviewedBy); foreach($reviewedBy as $account) echo ' ' . $users[trim($account)]; ?></td>
</tr>
<tr>
<th><?php echo $lang->testcase->reviewedDate;?></th>
<td><?php if($case->reviewedBy) echo $case->reviewedDate;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->lblLastEdited;?></th>
<td><?php if($case->lastEditedBy) echo $users[$case->lastEditedBy] . $lang->at . $case->lastEditedDate;?></td>
</tr>
</table>
</table>
<?php echo $this->fetch('file', 'printFiles', array('files' => $case->files, 'fieldset' => 'true'));?>
</div>
</div>
<?php include '../../common/view/action.html.php';?>
</div>
</div>
<div class='xuancard-actions fixed'>
<?php
common::printIcon('testtask', 'results', "runID=$runID&caseID=$case->id&version=$case->version", $case, 'button', '', '', 'results', false, "data-width='90%'");
common::printIcon('testcase', 'createBug', "product=$case->product&branch=$case->branch&extra=caseID=$case->id,version=$case->version,runID=$runID", $case, 'button', 'bug', '', 'iframe', '', "data-width='90%'");
$url = common::getSysURL() . $this->createLink('testcase', 'edit', "case=$case->id");
$url .= strpos($url, '?') === false ? '?' : '&';
$url .= 'width=100%&height=100%';
echo html::a('xxc:openUrlInDialog/' . urlencode($url), "<i class='icon-edit'></i>", '_blank', "class='btn btn-link'");
?>
</div>
</div>
<?php include '../../common/view/footer.lite.html.php';?>