From dba1cbb7a116f80da19891cef01b9ff0c93ed10e Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 14 Dec 2018 15:37:52 +0800 Subject: [PATCH] * add for doc/testcase/todo xuanxuan view page. --- framework/router.class.php | 10 +- module/doc/view/x.view.html.php | 83 +++++++++ module/testcase/view/x.view.html.php | 250 +++++++++++++++++++++++++++ module/todo/view/x.view.html.php | 79 +++++++++ 4 files changed, 414 insertions(+), 8 deletions(-) create mode 100644 module/doc/view/x.view.html.php create mode 100644 module/testcase/view/x.view.html.php create mode 100644 module/todo/view/x.view.html.php diff --git a/framework/router.class.php b/framework/router.class.php index 34509bacc9..f4b72a9a03 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -168,10 +168,7 @@ class router extends baseRouter { parent::parsePathInfo(); - if($this->get->display == 'card') - { - $this->viewType = 'xhtml'; - } + if($this->get->display == 'card') $this->viewType = 'xhtml'; } /** @@ -185,9 +182,6 @@ class router extends baseRouter { parent::parseGET(); - if($this->get->display == 'card') - { - $this->viewType = 'xhtml'; - } + if($this->get->display == 'card') $this->viewType = 'xhtml'; } } diff --git a/module/doc/view/x.view.html.php b/module/doc/view/x.view.html.php new file mode 100644 index 0000000000..38bed049ff --- /dev/null +++ b/module/doc/view/x.view.html.php @@ -0,0 +1,83 @@ + + * @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;?> +
+
+ + + + + + + productName):?> + + + + + + projectName):?> + + + + + + + + + + + + + + + + + + + + + + + + + + +
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'));?> +
doc->product;?>productName;?>
doc->project;?>projectName;?>
doc->lib;?>name;?>
doc->module;?>moduleName ? $doc->moduleName : '/';?>
doc->addedDate;?>addedDate;?>
doc->editedBy;?>editedBy);?>
doc->editedDate;?>editedDate;?>
+ +
+
+
+ + diff --git a/module/testcase/view/x.view.html.php b/module/testcase/view/x.view.html.php new file mode 100644 index 0000000000..61752dd4ae --- /dev/null +++ b/module/testcase/view/x.view.html.php @@ -0,0 +1,250 @@ + + * @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";?> + +
+
+ + + + + + + + + + + + + + + + + + + + + + + session->currentProductType != 'normal'):?> + + + + + + + + + + + global->flow != 'onlyTest'):?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + fromBug):?> + + + + + + + + + toBugs):?> + + + + + + + + + + + + + testcase->needReview or !empty($config->testcase->forceReview)):?> + + + + + + + + + + + + + +
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'));?> +
testcase->legendBasicInfo;?>
testcase->lib;?>
testcase->product;?>
product->branch;?>
testcase->module;?> + $module) + { + echo $module->name; + if(isset($modulePath[$key + 1])) echo $lang->arrow; + } + } + ?> +
testcase->story;?> + storyTitle)) echo "#$case->story:$case->storyTitle"); + if($case->story and $case->storyStatus == 'active' and $case->latestStoryVersion > $case->storyVersion) + { + echo "({$lang->story->changed} "; + echo html::a($this->createLink('testcase', 'confirmStoryChange', "caseID=$case->id"), $lang->confirm, 'hiddenwin'); + echo ")"; + } + ?> +
testcase->type;?>testcase->typeList[$case->type];?>
testcase->stage;?> + stage) + { + $stags = explode(',', $case->stage); + foreach($stags as $stage) + { + if(empty($stage)) continue; + isset($lang->testcase->stageList[$stage]) ? print($lang->testcase->stageList[$stage]) : print($stage); + echo "
"; + } + } + ?> +
testcase->pri;?>testcase->priList, $case->pri)?>
testcase->status;?> + testcase->statusList[$case->status]; + if($case->version > $case->currentVersion and $from == 'testtask') + { + echo "({$lang->testcase->changed} "; + echo html::a($this->createLink('testcase', 'confirmchange', "caseID=$case->id"), $lang->confirm, 'hiddenwin', "class='btn btn-mini btn-info'"); + echo ")"; + } + ?> +
app->loadLang('testtask')->testtask->lastRunTime;?>lastRunDate)) echo $case->lastRunDate;?>
app->loadLang('testtask')->testtask->lastRunResult;?>lastRunResult) echo $lang->testcase->resultList[$case->lastRunResult];?>
testcase->keywords;?>keywords;?>
testcase->linkCase;?> + linkCaseTitles)) + { + foreach($case->linkCaseTitles as $linkCaseID => $linkCaseTitle) + { + echo html::a($this->createLink('testcase', 'view', "caseID=$linkCaseID", '', true), "#$linkCaseID $linkCaseTitle", '', "class='iframe' data-width='80%'") . '
'; + } + } + ?> +
testcase->legendLinkBugs;?>
testcase->fromBug;?>createLink('bug', 'view', "bugID=$case->fromBug", '', true), $case->fromBugTitle, '', "class='iframe' data-width='80%'");?>
testcase->toBug;?> + toBugs as $bugID => $bugTitle) + { + echo '

' . html::a($this->createLink('bug', 'view', "bugID=$bugID", '', true), $bugTitle, '', "class='iframe' data-width='80%'") . '

'; + } + ?> +
testcase->legendOpenAndEdit;?>
testcase->openedBy;?>openedBy] . $lang->at . $case->openedDate;?>
testcase->reviewedBy;?>reviewedBy); foreach($reviewedBy as $account) echo ' ' . $users[trim($account)]; ?>
testcase->reviewedDate;?>reviewedBy) echo $case->reviewedDate;?>
testcase->lblLastEdited;?>lastEditedBy) echo $users[$case->lastEditedBy] . $lang->at . $case->lastEditedDate;?>
+ +
+
+
+ id&version=$case->version", $case, 'button', '', '', 'results', false, "data-width='95%'"); + if($caseFails > 0) 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%'"); + } + if($config->testcase->needReview or !empty($config->testcase->forceReview)) common::printIcon('testcase', 'review', "caseID=$case->id", $case, 'button', '', '', 'iframe'); + ?> +
+
+ diff --git a/module/todo/view/x.view.html.php b/module/todo/view/x.view.html.php new file mode 100644 index 0000000000..2f3151daba --- /dev/null +++ b/module/todo/view/x.view.html.php @@ -0,0 +1,79 @@ + + * @package todo + * @version $Id: view.html.php 4955 2013-07-02 01:47:21Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ +?> + + +private or ($todo->private and $todo->account == $app->user->account)):?> + +
+
+
+ id?> + name;?> +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + assignedTo)):?> + + + + + + + + + +
+ todo->desc; + if($todo->type == 'bug') common::printLink('bug', 'view', "id={$todo->idvalue}", ' BUG#' . $todo->idvalue); + if($todo->type == 'task') common::printLink('task', 'view', "id={$todo->idvalue}", ' TASK#' . $todo->idvalue); + if($todo->type == 'story') common::printLink('story', 'view', "id={$todo->idvalue}", ' STORY#' . $todo->idvalue); + ?> + desc;?>
todo->pri;?>pri;?>' title='todo->priList, $todo->pri, $todo->pri);?>'>todo->priList, $todo->pri)?>
todo->status;?> todo->statusList[$todo->status];?>
todo->type;?>todo->typeList[$todo->type];?>
todo->account;?>account);?>
todo->date;?>date == '20300101' ? $lang->todo->periods['future'] : formatTime($todo->date, DT_DATE1);?>
todo->beginAndEnd;?>begin])) echo $times[$todo->begin]; if(isset($times[$todo->end])) echo ' ~ ' . $times[$todo->end];?>
todo->assignTo;?>assignedTo);?>
todo->assignTo . $lang->todo->date;?>assignedDate, DT_DATE1);?>
+ +
+
+
+id);?> + +todo->thisIsPrivate;?> + +