From e6bd9c4ae935be4995ff8bf39f3b22387da97ceb Mon Sep 17 00:00:00 2001 From: wangyidong Date: Tue, 18 Dec 2018 13:03:50 +0800 Subject: [PATCH] * adjust for doc and testcase view page in card. --- framework/control.class.php | 8 +- module/doc/control.php | 1 + module/doc/css/x.create.css | 7 ++ module/doc/css/x.view.css | 13 +++ module/doc/view/create.html.php | 5 +- module/doc/view/view.html.php | 12 ++- module/doc/view/x.create.html.php | 101 ------------------ module/doc/view/x.view.html.php | 58 ----------- module/testcase/css/x.view.css | 14 +++ module/testcase/view/view.html.php | 12 ++- module/testcase/view/x.view.html.php | 87 ---------------- module/todo/css/x.create.css | 7 ++ module/todo/view/x.create.html.php | 149 --------------------------- 13 files changed, 70 insertions(+), 404 deletions(-) create mode 100644 module/doc/css/x.create.css create mode 100644 module/doc/css/x.view.css delete mode 100644 module/doc/view/x.create.html.php delete mode 100644 module/doc/view/x.view.html.php create mode 100644 module/testcase/css/x.view.css delete mode 100644 module/testcase/view/x.view.html.php create mode 100644 module/todo/css/x.create.css delete mode 100644 module/todo/view/x.create.html.php diff --git a/framework/control.class.php b/framework/control.class.php index 1715391310..f7b7adf73f 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -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; diff --git a/module/doc/control.php b/module/doc/control.php index 7f9492a930..c406cab72d 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -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; diff --git a/module/doc/css/x.create.css b/module/doc/css/x.create.css new file mode 100644 index 0000000000..b53353b4cf --- /dev/null +++ b/module/doc/css/x.create.css @@ -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;} diff --git a/module/doc/css/x.view.css b/module/doc/css/x.view.css new file mode 100644 index 0000000000..d188287b0b --- /dev/null +++ b/module/doc/css/x.view.css @@ -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;} diff --git a/module/doc/view/create.html.php b/module/doc/view/create.html.php index daf1322cbd..1267bd2351 100644 --- a/module/doc/view/create.html.php +++ b/module/doc/view/create.html.php @@ -25,12 +25,11 @@ doc->lib;?> - + doc->module;?> - @@ -81,7 +80,7 @@ - + diff --git a/module/doc/view/view.html.php b/module/doc/view/view.html.php index 43c428cd23..5722c2eb1f 100644 --- a/module/doc/view/view.html.php +++ b/module/doc/view/view.html.php @@ -134,7 +134,17 @@ js::set('retrack', $lang->doc->retrack); 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), "", '_blank', "class='btn btn-link'"); + } + else + { + common::printIcon('doc', 'edit', "docID=$doc->id", $doc); + } common::printIcon('doc', 'delete', "docID=$doc->id", $doc, 'button', '', 'hiddenwin'); } ?> diff --git a/module/doc/view/x.create.html.php b/module/doc/view/x.create.html.php deleted file mode 100644 index 4473d3eaf4..0000000000 --- a/module/doc/view/x.create.html.php +++ /dev/null @@ -1,101 +0,0 @@ - - * @package doc - * @version $Id: create.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $ - * @link http://www.zentao.net - */ -?> - - - - -doc->placeholder);?> - -
-
-
- - - - - doc->getLibs($type = 'all', $extra = 'withObject');?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
doc->lib;?>
doc->module;?> - -
doc->title;?>
doc->keywords;?>
doc->type;?>doc->types, 'text');?>
doc->content;?> -
- - -
doc->files;?>fetch('file', 'buildform');?>
doclib->control;?>doc->aclList, 'open', "onchange='toggleAcl(this.value)'")?>
- -
-
-
-
- - diff --git a/module/doc/view/x.view.html.php b/module/doc/view/x.view.html.php deleted file mode 100644 index 0620a2fb9f..0000000000 --- a/module/doc/view/x.view.html.php +++ /dev/null @@ -1,58 +0,0 @@ - - * @package doc - * @version $Id: view.html.php 975 2010-07-29 03:30:25Z jajacn@126.com $ - * @link http://www.zentao.net - */ -?> - - - -session->docList ? $this->session->docList : inlink('browse');?> - -
-
-
- id;?> title;?> -
-
-
-
-
-
doc->content;?>
-
- content;?> - files as $file):?> - extension, $config->file->imageExtensions)):?> -
- id}");?>" alt="title?>"> -
- files[$file->id]);?> - - -
- fetch('file', 'printFiles', array('files' => $doc->files, 'fieldset' => 'true'));?> -
- -
-
-
-
- createLink('doc', 'edit', "docID=$doc->id"); - $url .= strpos($url, '?') === false ? '?' : '&'; - $url .= 'width=100%&height=100%'; - echo html::a('xxc:openUrlInDialog/' . urlencode($url), "", '_blank', "class='btn btn-link'"); - ?> -
- - - diff --git a/module/testcase/css/x.view.css b/module/testcase/css/x.view.css new file mode 100644 index 0000000000..668989143a --- /dev/null +++ b/module/testcase/css/x.view.css @@ -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;} diff --git a/module/testcase/view/view.html.php b/module/testcase/view/view.html.php index 2ae6b28902..340ab4faad 100644 --- a/module/testcase/view/view.html.php +++ b/module/testcase/view/view.html.php @@ -113,7 +113,17 @@ if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'button', '', '', 'iframe'); ?> 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), "", '_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¶m=$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¶m=$case->id", $case), "", '', "class='btn' title='{$lang->testcase->copy}'"); common::printIcon('testcase', 'delete', "caseID=$case->id", $case, 'button', '', 'hiddenwin'); diff --git a/module/testcase/view/x.view.html.php b/module/testcase/view/x.view.html.php deleted file mode 100644 index e49863c39f..0000000000 --- a/module/testcase/view/x.view.html.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @package case - * @version $Id: view.html.php 5000 2013-07-03 08:20:57Z chencongzhi520@gmail.com $ - * @link http://www.zentao.net - */ -?> - - -session->caseList != false ? $app->session->caseList : $this->createLink('testcase', 'browse', "productID=$case->product");?> - -
-
-
- id;?> - title;?> - fromCaseID):?> - icons['testcase']) . " {$lang->testcase->fromCase}$lang->colon$case->fromCaseID";?> - -
-
-
-
-
-
testcase->precondition;?>
-
precondition);?>
-
-
-
testcase->steps;?>
-
- - - - - - - - - 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 ""; - echo ""; - echo ""; - echo ""; - echo ""; - $childId ++; - } - ?> -
testcase->stepID;?>testcase->stepDesc;?>testcase->stepExpect;?>
$stepId
"; - if($step->type == 'item') echo "{$stepId}.{$childId}"; - echo nl2br(str_replace(' ', ' ', $step->desc)) . "
" . nl2br(str_replace(' ', ' ', $step->expect)) . "
- fetch('file', 'printFiles', array('files' => $case->files, 'fieldset' => 'true'));?> -
-
- -
-
-
- 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), "", '_blank', "class='btn btn-link'"); - ?> -
-
- diff --git a/module/todo/css/x.create.css b/module/todo/css/x.create.css new file mode 100644 index 0000000000..b53353b4cf --- /dev/null +++ b/module/todo/css/x.create.css @@ -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;} diff --git a/module/todo/view/x.create.html.php b/module/todo/view/x.create.html.php deleted file mode 100644 index 05aab6dd76..0000000000 --- a/module/todo/view/x.create.html.php +++ /dev/null @@ -1,149 +0,0 @@ - - * @package todo - * @version $Id: create.html.php 4728 2013-05-03 06:14:34Z chencongzhi520@gmail.com $ - * @link http://www.zentao.net - */ -?> - - - - -todo->noTodo);?> -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
todo->date;?> -
- - -
- - -
-
- -
- - -
-
-
-
todo->type;?>todo->typeList, '', 'onchange="loadList(this.value);" class="form-control"');?>
todo->pri;?>todo->priList, '', "class='form-control'");?>
todo->name;?> - -
-
todo->desc;?>
todo->status;?>todo->statusList, '', "class='form-control chosen'");?>
todo->beginAndEnd;?> -
- -
-
-
- - -
-
todo->private;?> -
- - -
-
- -
-
-
-
- -user->account)?> - -