* adjust for doc and testcase view page in card.

This commit is contained in:
wangyidong
2018-12-18 13:03:50 +08:00
parent bcf24e9f50
commit e6bd9c4ae9
13 changed files with 70 additions and 404 deletions
+4 -4
View File
@@ -43,10 +43,10 @@ class control extends baseControl
/* If the main view file doesn't exist, set the device prefix to empty and reset the main view file. */
if(!file_exists($mainViewFile))
{
$oldPrefix = $this->devicePrefix;
$originalPrefix = $this->devicePrefix;
$this->devicePrefix = '';
$mainViewFile = $modulePath . 'view' . DS . $this->devicePrefix . $methodName . '.' . $viewType . '.php';
$this->devicePrefix = $oldPrefix;
$this->devicePrefix = $originalPrefix;
}
$viewFile = $mainViewFile;
@@ -97,11 +97,11 @@ class control extends baseControl
/* If the js or css file doesn't exist, set the device prefix to empty and reset the js or css file. */
if($this->viewType == 'xhtml')
{
$oldPrefix = $this->devicePrefix;
$originalPrefix = $this->devicePrefix;
$this->devicePrefix = '';
$css .= $this->getCSS($moduleName, $methodName);
$js .= $this->getJS($moduleName, $methodName);
$this->devicePrefix = $oldPrefix;
$this->devicePrefix = $originalPrefix;
}
if($css) $this->view->pageCSS = $css;
if($js) $this->view->pageJS = $js;
+1
View File
@@ -348,6 +348,7 @@ class doc extends control
$this->view->position[] = $this->lang->doc->create;
$this->view->libID = $libID;
$this->view->libs = $this->doc->getLibs($type = 'all', $extra = 'withObject');
$this->view->libName = $this->dao->findByID($libID)->from(TABLE_DOCLIB)->fetch('name');
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($libID, 'doc', $startModuleID = 0);
$this->view->moduleID = $moduleID;
+7
View File
@@ -0,0 +1,7 @@
body{padding:0px;}
#header{display:none;}
#header+#main{min-width:auto;}
#main{padding:0px;}
#main .container{padding:0px;}
.main-header{display:none;}
#footer{display:none;}
+13
View File
@@ -0,0 +1,13 @@
#header{display:none;}
#header+#main{min-width:auto;}
#main{padding:0px;}
#main .container{padding:0px;}
.side-col.col-4{display:none;}
#mainMenu{margin-top:0px;}
#mainMenu .btn{display:none;}
#mainMenu .divider{display:none;}
.main-actions #back{display:none;}
.main-actions .divider{display:none;}
.main-actions .fullscreen-btn{display:none;}
.main-actions a[href*=delete]{display:none;}
#footer{display:none;}
+2 -3
View File
@@ -25,12 +25,11 @@
<tbody>
<tr>
<th><?php echo $lang->doc->lib;?></th>
<td><?php echo $libName?></td><td></td>
<td> <?php echo html::select('lib', $libs, $libID, "class='form-control chosen' onchange=loadDocModule(this.value)");?> </td><td></td>
</tr>
<tr>
<th><?php echo $lang->doc->module;?></th>
<td>
<?php echo html::hidden('lib', $libID);?>
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></span>
</td><td></td>
</tr>
@@ -81,7 +80,7 @@
</tr>
<tr>
<td colspan='3' class='text-center form-actions'>
<?php echo html::submitButton() . ' ' . html::backButton() . html::hidden('lib', $libID);?>
<?php echo html::submitButton() . ' ' . html::backButton();?>
</td>
</tr>
</tbody>
+11 -1
View File
@@ -134,7 +134,17 @@ js::set('retrack', $lang->doc->retrack);
<?php
if(!$doc->deleted)
{
common::printIcon('doc', 'edit', "docID=$doc->id", $doc);
if($this->app->getViewType() == 'xhtml' and common::hasPriv('doc', 'edit'))
{
$url = common::getSysURL() . $this->createLink('doc', 'edit', "docID=$doc->id");
$url .= strpos($url, '?') === false ? '?' : '&';
$url .= 'width=1000px&height=800px';
echo html::a('xxc:openUrlInDialog/' . urlencode($url), "<i class='icon-edit'></i>", '_blank', "class='btn btn-link'");
}
else
{
common::printIcon('doc', 'edit', "docID=$doc->id", $doc);
}
common::printIcon('doc', 'delete', "docID=$doc->id", $doc, 'button', '', 'hiddenwin');
}
?>
-101
View File
@@ -1,101 +0,0 @@
<?php
/**
* The create view of doc module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Jia Fu <fujia@cnezsoft.com>
* @package doc
* @version $Id: create.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<?php include '../../common/view/ueditor.html.php';?>
<?php include '../../common/view/markdown.html.php';?>
<style>body{padding:0px;}</style>
<?php js::set('holders', $lang->doc->placeholder);?>
<?php js::set('type', 'doc');?>
<div id="mainContent" class="main-content">
<div class='center-block'>
<form class="load-indicator main-form form-ajax" id="dataform" method='post' enctype='multipart/form-data'>
<table class='table table-form'>
<tbody>
<tr>
<th><?php echo $lang->doc->lib;?></th>
<?php $libs = $this->doc->getLibs($type = 'all', $extra = 'withObject');?>
<td> <?php echo html::select('lib', $libs, $libID, "class='form-control chosen' onchange=loadDocModule(this.value)");?> </td><td></td>
</tr>
<tr>
<th><?php echo $lang->doc->module;?></th>
<td>
<span id='moduleBox'><?php echo html::select('module', $moduleOptionMenu, $moduleID, "class='form-control chosen'");?></span>
</td><td></td>
</tr>
<tr>
<th><?php echo $lang->doc->title;?></th>
<td colspan='2'><?php echo html::input('title', '', "class='form-control' autocomplete='off' required");?></td>
</tr>
<tr>
<th><?php echo $lang->doc->keywords;?></th>
<td colspan='2'><?php echo html::input('keywords', '', "class='form-control' autocomplete='off'");?></td>
</tr>
<tr>
<th><?php echo $lang->doc->type;?></th>
<td><?php echo html::radio('type', $lang->doc->types, 'text');?></td>
</tr>
<tr id='contentBox'>
<th><?php echo $lang->doc->content;?></th>
<td colspan='2'>
<div class='contenthtml'><?php echo html::textarea('content', '', "style='width:100%;height:200px'");?></div>
<div class='contentmarkdown hidden'><?php echo html::textarea('contentMarkdown', '', "style='width:100%;height:200px'");?></div>
<?php echo html::hidden('contentType', 'html');?>
</td>
</tr>
<tr id='urlBox' class='hidden'>
<th><?php echo $lang->doc->url;?></th>
<td colspan='2'><?php echo html::input('url', '', "class='form-control' autocomplete='off'");?></td>
</tr>
<tr id='fileBox'>
<th><?php echo $lang->doc->files;?></th>
<td colspan='2'><?php echo $this->fetch('file', 'buildform');?></td>
</tr>
<tr>
<th><?php echo $lang->doclib->control;?></th>
<td><?php echo html::radio('acl', $lang->doc->aclList, 'open', "onchange='toggleAcl(this.value)'")?></td>
</tr>
<tr id='whiteListBox' class='hidden'>
<th><?php echo $lang->doc->whiteList;?></th>
<td colspan='2'>
<div class='input-group'>
<span class='input-group-addon groups-addon'><?php echo $lang->doclib->group?></span>
<?php echo html::select('groups[]', $groups, '', "class='form-control chosen' multiple")?>
</div>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->doclib->user?></span>
<?php echo html::select('users[]', $users, '', "class='form-control chosen' multiple")?>
</div>
</td>
</tr>
<tr>
<td colspan='3' class='text-center form-actions'>
<?php echo html::submitButton();?>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
<script>
window.injectWithXXC = function(message)
{
$('#title').val(message.content);
if(message.type == 'url')
{
$('#typeurl').attr('checked', 'checked');
$('input[name="type"]').change();
}
}
</script>
<?php include '../../common/view/footer.lite.html.php';?>
-58
View File
@@ -1,58 +0,0 @@
<?php
/**
* The view of doc module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Jia Fu <fujia@cnezsoft.com>
* @package doc
* @version $Id: view.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<?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;}
.xuanxuan-card{padding-bottom:55px;}
</style>
<div class='xuanxuan-card'>
<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>
<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';?>
+14
View File
@@ -0,0 +1,14 @@
#header{display:none;}
#header+#main{min-width:auto;}
#main{padding:0px;}
#main .container{padding:0px;}
.side-col.col-4{display:none;}
#mainMenu{margin-top:0px;}
#mainMenu .btn{display:none;}
#mainMenu .divider{display:none;}
.main-actions #back{display:none;}
.main-actions .divider{display:none;}
.main-actions a[href*=delete]{display:none;}
.main-actions a[href*=create]{display:none;}
.main-actions a[href*=runCase]{display:none;}
#footer{display:none;}
+11 -1
View File
@@ -113,7 +113,17 @@
if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'button', '', '', 'iframe');
?>
<?php
common::printIcon('testcase', 'edit',"caseID=$case->id", $case);
if($this->app->getViewType() == 'xhtml' and common::hasPriv('testcase', 'edit'))
{
$url = common::getSysURL() . $this->createLink('testcase', 'edit', "case=$case->id");
$url .= strpos($url, '?') === false ? '?' : '&';
$url .= 'width=1000px&height=800px';
echo html::a('xxc:openUrlInDialog/' . urlencode($url), "<i class='icon-edit'></i>", '_blank', "class='btn btn-link'");
}
else
{
common::printIcon('testcase', 'edit',"caseID=$case->id", $case);
}
if(!$isLibCase) common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'button', 'copy');
if($isLibCase and common::hasPriv('testsuite', 'createCase')) echo html::a($this->createLink('testsuite', 'createCase', "libID=$case->lib&moduleID=$case->module&param=$case->id", $case), "<i class='icon-copy'></i>", '', "class='btn' title='{$lang->testcase->copy}'");
common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', '', 'hiddenwin');
-87
View File
@@ -1,87 +0,0 @@
<?php
/**
* The view file of case module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package case
* @version $Id: view.html.php 5000 2013-07-03 08:20:57Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?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;}
.xuanxuan-card{padding-bottom:55px;}
</style>
<div class='xuanxuan-card'>
<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>
<?php if($case->fromCaseID):?>
<small><?php echo html::icon($lang->icons['testcase']) . " {$lang->testcase->fromCase}$lang->colon$case->fromCaseID";?></small>
<?php endif;?>
</div>
</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
$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'));?>
</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';?>
+7
View File
@@ -0,0 +1,7 @@
body{padding:0px;}
#header{display:none;}
#header+#main{min-width:auto;}
#main{padding:0px;}
#main .container{padding:0px;}
.main-header{display:none;}
#footer{display:none;}
-149
View File
@@ -1,149 +0,0 @@
<?php
/**
* The create view of todo module of ZenTaoPMS.
*
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
* @package todo
* @version $Id: create.html.php 4728 2013-05-03 06:14:34Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<?php include '../../common/view/datepicker.html.php';?>
<?php include '../../common/view/kindeditor.html.php';?>
<style>
body{padding:0px;}
</style>
<?php js::set('noTodo', $lang->todo->noTodo);?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<form method='post' target='hiddenwin' id='dataform'>
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->todo->date;?></th>
<td class='w-300px'>
<div class='input-group'>
<?php echo html::input('date', $date, "class='form-control form-date'");?>
<span class='input-group-addon switchDate'>
<div class='checkbox-primary'>
<input type='checkbox' id='switchDate' onclick='switchDateTodo(this);' />
<label for='switchDate'><?php echo $lang->todo->periods['future'];?></label>
</div>
</span>
<span class='input-group-addon'>
<div class='checkbox-primary'>
<input type='checkbox' id='cycle' name='cycle' value='1' />
<label for='cycle'><?php echo $lang->todo->cycle;?></label>
</div>
</span>
</div>
</td><td></td>
</tr>
<tr class='cycleConfig hidden'>
<th><?php echo $lang->todo->cycleConfig;?></th>
<td colspan='2'>
<ul class="nav nav-tabs">
<li class="active"><a data-tab data-type='day' href="#day"><?php echo $lang->todo->cycleDay;?></a></li>
<li><a data-tab data-type='week' href="#week"><?php echo $lang->todo->cycleWeek;?></a></li>
<li><a data-tab data-type='month' href="#month"><?php echo $lang->todo->cycleMonth;?></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="day">
<div class='input-group w-150px'>
<span class='input-group-addon'><?php echo $lang->todo->every;?></span>
<?php echo html::input('config[day]', 1, "class='form-control'")?>
<span class='input-group-addon'><?php echo $lang->todo->cycleDay;?></span>
</div>
</div>
<div class="tab-pane clearfix" id="week">
<?php echo html::checkbox('config[week]', $lang->todo->dayNames)?>
</div>
<div class="tab-pane clearfix" id="month">
<?php
$days = array();
for($i = 1; $i <= 10; $i ++) $days[$i] = $i;
echo html::checkbox('config[month]', $days);
$days = array();
for($i = 11; $i <= 20; $i ++) $days[$i] = $i;
echo html::checkbox('config[month]', $days);
$days = array();
for($i = 21; $i <= 31; $i ++) $days[$i] = $i;
echo html::checkbox('config[month]', $days);
?>
</div>
</div>
<?php echo html::hidden('config[type]', 'day')?>
<div class='input-group' style='width:200px; padding-top:5px;'>
<?php printf($lang->todo->beforeDays, html::input('config[beforeDays]', 0, "class='form-control'"));?>
</div>
</td>
</tr>
<tr class='cycleConfig hidden'>
<th><?php echo $lang->todo->deadline;?></th>
<td><?php echo html::input("config[end]", '', "class='form-control form-date'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->type;?></th>
<td><?php echo html::select('type', $lang->todo->typeList, '', 'onchange="loadList(this.value);" class="form-control"');?></td>
</tr>
<tr>
<th><?php echo $lang->todo->pri;?></th>
<td><?php echo html::select('pri', $lang->todo->priList, '', "class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->name;?></th>
<td colspan='2'>
<div id='nameBox' class='hidden'><?php echo html::input('name', '', "class='form-control' autocomplete='off'");?></div>
<div class='nameBox required'><?php echo html::input('name', '', "class='form-control' autocomplete='off'");?></div>
</td>
</tr>
<tr>
<th><?php echo $lang->todo->desc;?></th>
<td colspan='2'><?php echo html::textarea('desc', '', "rows='8' class='form-control'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->status;?></th>
<td><?php echo html::select('status', $lang->todo->statusList, '', "class='form-control chosen'");?></td>
</tr>
<tr>
<th><?php echo $lang->todo->beginAndEnd;?></th>
<td>
<div class='input-group'>
<?php echo html::select('begin', $times, date('Y-m-d') != $date ? key($times) : $time, 'onchange=selectNext(); class="form-control chosen" style="width: 50%;"') . html::select('end', $times, '', 'class="form-control chosen" style="width: 50%; margin-left:-1px"');?>
</div>
</td>
<td>
<div class='checkbox-primary'>
<input type='checkbox' id='switchDate' onclick='switchDateFeature(this);' />
<label for='switchDate'><?php echo $lang->todo->lblDisableDate;?></label>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->todo->private;?></th>
<td>
<div class='checkbox-primary'>
<input type='checkbox' name='private' id='private' value='1' />
<label for='private'></label>
</div>
</td>
</tr>
<tr>
<td colspan='3' class='text-center form-actions'>
<?php echo html::submitButton();?>
</td>
</tr>
</table>
</form>
</div>
</div>
<?php js::set('account', $app->user->account)?>
<script>
var nowTime = '<?php echo $time?>';
var today = '<?php echo date('Y-m-d')?>';
var start = '<?php echo key($times)?>';
</script>
<?php include '../../common/view/footer.lite.html.php';?>