From bf326f57ffe72764302cf163ea3f72da9d4ccbd8 Mon Sep 17 00:00:00 2001 From: daitingting Date: Mon, 16 Apr 2018 16:55:32 +0800 Subject: [PATCH] * Rewrite view page of product. --- module/branch/lang/zh-cn.php | 1 + module/common/lang/zh-cn.php | 2 + module/common/view/action.html.php | 15 ++ module/file/control.php | 6 +- module/product/control.php | 8 + module/product/css/view.css | 5 +- module/product/lang/zh-cn.php | 34 +-- module/product/view/view.html.php | 336 +++++++++++++++++------------ 8 files changed, 249 insertions(+), 158 deletions(-) diff --git a/module/branch/lang/zh-cn.php b/module/branch/lang/zh-cn.php index 3f8d2d374d..2de28a09d4 100644 --- a/module/branch/lang/zh-cn.php +++ b/module/branch/lang/zh-cn.php @@ -3,6 +3,7 @@ $lang->branch->common = '分支'; $lang->branch->manage = '分支管理'; $lang->branch->sort = '排序'; $lang->branch->delete = '分支删除'; +$lang->branch->add = '添加'; $lang->branch->manageTitle = '%s管理'; $lang->branch->all = '所有'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index bea3860fc0..5a4c86a81c 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -59,6 +59,8 @@ $lang->history = '历史记录'; $lang->attatch = '附件'; $lang->reverse = '切换顺序'; $lang->switchDisplay = '切换显示'; +$lang->expand = '展开全部'; +$lang->collapse = '收起'; $lang->addFiles = '上传了附件 '; $lang->files = '附件 '; $lang->pasteText = '多项录入'; diff --git a/module/common/view/action.html.php b/module/common/view/action.html.php index c4e3f45e2c..ae29b021c2 100755 --- a/module/common/view/action.html.php +++ b/module/common/view/action.html.php @@ -1,5 +1,9 @@ getExtViewFile(__FILE__)){include $extView; return helper::cd();}?> + +
+
+ + +
+
+ history?>  
+ +
+ + +
+
+
    diff --git a/module/file/control.php b/module/file/control.php index 3dbdaf656b..28980323e4 100644 --- a/module/file/control.php +++ b/module/file/control.php @@ -21,7 +21,7 @@ class file extends control * @access public * @return void */ - public function buildForm($fileCount = 1, $percent = 0.9, $filesName = 'files', $labelsName = 'labels') + public function buildForm() { if(!file_exists($this->file->savePath)) { @@ -34,10 +34,6 @@ class file extends control return false; } - $this->view->fileCount = $fileCount; - $this->view->percent = $percent; - $this->view->filesName = $filesName; - $this->view->labelsName = $labelsName; $this->display(); } diff --git a/module/product/control.php b/module/product/control.php index 2d272c7298..862a0ee779 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -394,6 +394,11 @@ class product extends control $product->desc = $this->loadModel('file')->setImgSize($product->desc); if(!$product) die(js::error($this->lang->notFound) . js::locate('back')); + $actions = $this->dao->select('*')->from(TABLE_ACTION)->where('product')->like("%,$productID,%")->orderBy('date_desc')->limit(6)->fetchAll(); + if($actions) $this->loadModel('action')->transformActions($actions); + + $releases = $this->dao->select('*')->from(TABLE_RELEASE)->where('deleted')->eq(0)->andWhere('product')->eq($productID)->orderBy('date')->fetchAll(); + $this->view->title = $product->name . $this->lang->colon . $this->lang->product->view; $this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $product->name); $this->view->position[] = $this->lang->product->view; @@ -402,6 +407,9 @@ class product extends control $this->view->users = $this->user->getPairs('noletter'); $this->view->groups = $this->loadModel('group')->getPairs(); $this->view->lines = array('') + $this->loadModel('tree')->getLinePairs(); + $this->view->branches = $this->loadModel('branch')->getPairs($productID); + $this->view->actions = $actions; + $this->view->releases = $releases; $this->display(); } diff --git a/module/product/css/view.css b/module/product/css/view.css index 03e5de0542..5d3502e33c 100644 --- a/module/product/css/view.css +++ b/module/product/css/view.css @@ -1 +1,4 @@ -.outer .main-side > fieldset {padding-right: 0px;} +.branch-list {padding-left: 0; margin: 0;} +.branch-list > li {float: left; list-style: none; width: 50%; margin: 5px 0;} +.data-basic.table-data tbody > tr > th {width: 80px;} +.block-release .panel-body, .block-dynamic .panel-body {height: 224px; overflow: auto;} diff --git a/module/product/lang/zh-cn.php b/module/product/lang/zh-cn.php index 03f305bb7e..cf7c10315b 100644 --- a/module/product/lang/zh-cn.php +++ b/module/product/lang/zh-cn.php @@ -56,20 +56,26 @@ $lang->product->confirmDelete = " 您确定删除该{$lang->productCommon}吗 $lang->product->errorNoProduct = "还没有创建{$lang->productCommon}!"; $lang->product->accessDenied = "您无权访问该{$lang->productCommon}"; -$lang->product->id = "编号"; -$lang->product->name = "{$lang->productCommon}名称"; -$lang->product->code = "{$lang->productCommon}代号"; -$lang->product->line = '产品线'; -$lang->product->order = '排序'; -$lang->product->type = "{$lang->productCommon}类型"; -$lang->product->status = '状态'; -$lang->product->desc = "{$lang->productCommon}描述"; -$lang->product->PO = "{$lang->productCommon}负责人"; -$lang->product->QD = '测试负责人'; -$lang->product->RD = '发布负责人'; -$lang->product->acl = '访问控制'; -$lang->product->whitelist = '分组白名单'; -$lang->product->branch = '所属%s'; +$lang->product->id = "编号"; +$lang->product->name = "{$lang->productCommon}名称"; +$lang->product->code = "{$lang->productCommon}代号"; +$lang->product->line = '产品线'; +$lang->product->order = '排序'; +$lang->product->type = "{$lang->productCommon}类型"; +$lang->product->status = '状态'; +$lang->product->desc = "{$lang->productCommon}描述"; +$lang->product->manager = '负责人'; +$lang->product->PO = "{$lang->productCommon}负责人"; +$lang->product->QD = '测试负责人'; +$lang->product->RD = '发布负责人'; +$lang->product->acl = '访问控制'; +$lang->product->whitelist = '分组白名单'; +$lang->product->branch = '所属%s'; +$lang->product->qa = '测试'; +$lang->product->release = '发布'; +$lang->product->latestDynamic = "最新动态"; +$lang->product->iteration = "版本迭代"; +$lang->product->iterationInfo = "迭代 %s 次"; $lang->product->searchStory = '搜索'; $lang->product->assignedToMe = '指给我'; diff --git a/module/product/view/view.html.php b/module/product/view/view.html.php index 5c178815bd..8d8bf34881 100644 --- a/module/product/view/view.html.php +++ b/module/product/view/view.html.php @@ -11,15 +11,204 @@ */ ?> -
    -
    - icons['product']);?> id;?> - name;?> - deleted):?> - product->deleted;?> - +
    +
    +
    +
    +
    +
    +
    product->iteration;?> product->iterationInfo, count($releases));?>
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    product->latestDynamic;?>
    + +
    +
    +
      + + + +
    • > +
      + date;?> + actor) . ' ' . $action->actionLabel . $action->objectLabel . ' ' . html::a($action->objectLink, $action->objectName);?> +
      +
    • + +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
    +
    +
    +
    +

    id;?> zentaopms name;?>

    +
    +

    desc;?>

    +

    + product->typeList, $product->type);?> + product->statusList, $product->status);?> + deleted):?> + product->deleted;?> + +

    +
    +
    + type == 'platform'):?> +
    +
    product->branchName['platform'];?>MORE
    + +
    + +
    +
    product->manager;?>
    +
    + + + + + + + + + + + + + +
    productCommon;?>PO);?> product->release;?>QD);?>
    product->qa;?>RD);?>
    +
    +
    +
    +
    product->basicInfo;?>
    +
    + + + + + + + + + + + + + + + + + + + + + + + acl == 'custom'):?> + + + + + + +
    product->code;?>code;?>
    product->line;?>line);?>
    story->openedBy?>createdBy);?>
    story->openedDate?>createdDate, DT_DATE1);?>
    product->acl;?>product->aclList[$product->acl];?>
    product->whitelist;?> + + whitelist); + foreach($whitelist as $groupID) if(isset($groups[$groupID])) echo $groups[$groupID] . ' '; + ?> + +
    +
    +
    + config->global->flow != 'onlyTest'):?> +
    +
    product->otherInfo;?>
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    story->statusList['active'] . $lang->story->common;?>stories['active']?>product->plans?>plans?>product->bugs?>bugs?>
    story->statusList['changed'] . $lang->story->common;?>stories['changed']?>product->projects?>projects?>product->cases?>cases?>
    story->statusList['draft'] . $lang->story->common;?>stories['draft']?>product->builds?>builds?>product->docs?>docs?>
    story->statusList['closed'] . $lang->story->common;?>stories['closed']?>product->releases?>releases?>
    +
    +
    + +
    +
    +
    +
    -
    +
    + +
    + +
    id"; $browseLink = $this->session->productList ? $this->session->productList : inlink('browse', "productID=$product->id"); @@ -27,11 +216,10 @@ { ob_start(); common::printIcon('product', 'close', "productID=$product->id", $product, 'button', '', '', 'iframe text-danger', true); + echo "
    "; - echo "
    "; common::printIcon('product', 'edit', $params, $product); common::printIcon('product', 'delete', $params, $product, 'button', '', 'hiddenwin'); - echo '
    '; common::printRPN($browseLink); $actionLinks = ob_get_contents(); @@ -44,132 +232,4 @@ } ?>
    -
    -
    -
    -
    -
    - product->desc;?> -
    desc;?>
    -
    - -
    deleted) echo $actionLinks;?>
    -
    -
    -
    -
    -
    - product->basicInfo?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - acl == 'custom'):?> - - - - - -
    product->name;?>deleted) echo "class='deleted text-danger'";?>>name;?>
    product->code;?>code;?>
    product->line;?>line);?>
    product->PO;?>PO);?>
    product->QD;?>QD);?>
    product->RD;?>RD);?>
    product->type;?>product->typeList[$product->type];?>
    product->status;?>product->statusList[$product->status];?>
    story->openedBy?>createdBy);?>
    story->openedDate?>createdDate;?>
    product->acl;?>product->aclList[$product->acl];?>
    product->whitelist;?> - whitelist); - foreach($whitelist as $groupID) if(isset($groups[$groupID])) echo $groups[$groupID] . ' '; - ?> -
    -
    - config->global->flow != 'onlyTest'):?> -
    - product->otherInfo?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    story->statusList['active'] . $lang->story->common;?>stories['active']?>
    story->statusList['changed'] . $lang->story->common;?>stories['changed']?>
    story->statusList['draft'] . $lang->story->common;?>stories['draft']?>
    story->statusList['closed'] . $lang->story->common;?>stories['closed']?>
    product->plans?>plans?>
    product->projects?>projects?>
    product->bugs?>bugs?>
    product->docs?>docs?>
    product->cases?>cases?>
    product->builds?>builds?>
    product->releases?>releases?>
    -
    - -
    -
    -