From 225189e217a0fdbdd05ce5ca5cc73f31bf828c65 Mon Sep 17 00:00:00 2001 From: Yagami <976204163@qq.com> Date: Mon, 2 Nov 2020 13:22:44 +0800 Subject: [PATCH] * Fix details. --- db/demo.sql | 4 ++-- db/zentao.sql | 1 - framework/router.class.php | 2 +- module/design/control.php | 3 +-- module/design/model.php | 7 ++----- module/design/view/browse.html.php | 4 ++-- module/product/control.php | 3 ++- module/product/model.php | 19 ++++++++----------- module/program/model.php | 2 +- module/program/view/pgmbrowsebylist.html.php | 2 +- module/programplan/control.php | 2 +- module/project/control.php | 1 - module/repo/model.php | 8 ++++---- module/repo/view/create.html.php | 2 +- module/repo/view/edit.html.php | 2 +- 15 files changed, 27 insertions(+), 35 deletions(-) diff --git a/db/demo.sql b/db/demo.sql index bfd262c037..be777a3371 100644 --- a/db/demo.sql +++ b/db/demo.sql @@ -223,8 +223,8 @@ INSERT INTO `zt_product` (`id`, `program`, `name`, `code`, `status`, `desc`, `PO INSERT INTO `zt_productplan` (`id`, `product`, `title`, `desc`, `begin`, `end`, `deleted`) VALUES(1, 1, '1.0版本', '开发出企业网站1.0版本。
', '2000-01-01', '2015-01-01', '0'); -INSERT INTO `zt_project` (`id`, `isCat`, `catID`, `type`, `template`, `category`,`parent`, `name`, `code`, `begin`, `end`, `days`, `status`, `statge`, `pri`, `desc`, `openedBy`, `openedDate`, `closedBy`, `closedDate`, `canceledBy`, `canceledDate`, `PO`, `PM`, `QD`, `RD`, `team`, `acl`, `whitelist`, `order`, `deleted`) VALUES(1, '0', 0, 'sprint', 'waterfall', 'single', 0, '企业网站第一期', 'coWeb1', '2012-06-05', '2012-12-04', 184, 'done', '1', '1', '开发企业网站的基本雏形。
', '', 0, '', 0, '', 0, 'productManager', 'projectManager', 'testManager', 'productManager', '公司开发团队', 'open', '', '5', '0'); -INSERT INTO `zt_project` (`id`, `isCat`, `catID`, `type`, `template`, `category`, `parent`, `name`, `code`, `begin`, `end`, `days`, `status`, `statge`, `pri`, `desc`, `openedBy`, `openedDate`, `closedBy`, `closedDate`, `canceledBy`, `canceledDate`, `PO`, `PM`, `QD`, `RD`, `team`, `acl`, `whitelist`, `order`, `deleted`) VALUES(2, '0', 0, 'sprint', 'waterfall', 'single', 0, '企业网站第二期', 'coWebsite2', '2013-06-05', '2014-06-04', 365, 'wait', '1', '1', '', '', 0, '', 0, '', 0, 'productManager', 'projectManager', 'testManager', 'productManager', '公司开发团队', 'open', '', '10', '0'); +INSERT INTO `zt_project` (`id`, `type`, `model`, `parent`, `name`, `code`, `begin`, `end`, `days`, `status`, `statge`, `pri`, `desc`, `openedBy`, `openedDate`, `closedBy`, `closedDate`, `canceledBy`, `canceledDate`, `PO`, `PM`, `QD`, `RD`, `team`, `acl`, `whitelist`, `order`, `deleted`) VALUES(1, 'program', '', 0, '企业网站第一期', 'coWeb1', '2012-06-05', '2012-12-04', 184, 'done', '1', '1', '开发企业网站的基本雏形。
', '', 0, '', 0, '', 0, 'productManager', 'projectManager', 'testManager', 'productManager', '公司开发团队', 'open', '', '5', '0'); +INSERT INTO `zt_project` (`id`, `type`, `model`, `parent`, `name`, `code`, `begin`, `end`, `days`, `status`, `statge`, `pri`, `desc`, `openedBy`, `openedDate`, `closedBy`, `closedDate`, `canceledBy`, `canceledDate`, `PO`, `PM`, `QD`, `RD`, `team`, `acl`, `whitelist`, `order`, `deleted`) VALUES(2, 'program', '', 0, '企业网站第二期', 'coWebsite2', '2013-06-05', '2014-06-04', 365, 'wait', '1', '1', '', '', 0, '', 0, '', 0, 'productManager', 'projectManager', 'testManager', 'productManager', '公司开发团队', 'open', '', '10', '0'); INSERT INTO `zt_doclib` (`id`, `type`, `product`, `project`, `name`, `acl`, `main`) VALUES(1, 'product', 1, 0, '产品库', 'default','1'); INSERT INTO `zt_doclib` (`id`, `type`, `product`, `project`, `name`, `acl`, `main`) VALUES(2, 'product', 2, 0, '产品库', 'default', '1'); diff --git a/db/zentao.sql b/db/zentao.sql index d9850f3948..6051eb8915 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -8,7 +8,6 @@ CREATE TABLE IF NOT EXISTS `zt_acl` ( `source` char(30) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -- DROP TABLE IF EXISTS `zt_action`; CREATE TABLE IF NOT EXISTS `zt_action` ( `id` mediumint(8) unsigned NOT NULL auto_increment, diff --git a/framework/router.class.php b/framework/router.class.php index bf4fc40b58..6315b70a11 100755 --- a/framework/router.class.php +++ b/framework/router.class.php @@ -175,7 +175,7 @@ class router extends baseRouter if(isset($model->model) && $model->model == 'waterfall') { $projectIndex = 2; - $planIndex = 1; + //$planIndex = 1; } $config->storyCommon = $storyIndex; diff --git a/module/design/control.php b/module/design/control.php index 192444a500..ecfdd76a2d 100644 --- a/module/design/control.php +++ b/module/design/control.php @@ -26,7 +26,7 @@ class design extends control parent::__construct($moduleName, $methodName); $products = array(); $this->loadModel('product'); - $this->view->products = $this->products = $this->product->getPairs('nocode', $this->session->PRJ); + $this->view->products = $this->products = $this->product->getProductsByProject($this->session->PRJ); } /** @@ -46,7 +46,6 @@ class design extends control { /* Save session for design list and process product id. */ $this->session->set('designList', $this->app->getURI(true)); - $productID = $this->product->saveState($productID, $this->products); $this->design->setProductMenu($productID); /* Build the search form. */ diff --git a/module/design/model.php b/module/design/model.php index b11e1db81e..4b76aa9050 100644 --- a/module/design/model.php +++ b/module/design/model.php @@ -393,14 +393,11 @@ class designModel extends model */ public function setProductMenu($productID = 0) { - $programID = $this->session->PRJ; - $program = $this->loadModel('project')->getByID($programID); - $products = $this->loadModel('product')->getPairs('', $programID); - if(empty($products)) die(js::locate(helper::createLink('product', 'create'))); + $products = $this->loadModel('product')->getPairs(); $productID = in_array($productID, array_keys($products)) ? $productID : key($products); $productID = $this->loadModel('product')->saveState($productID, $products); - if($program->product == 'multiple') $this->loadModel('product')->setMenu($products, $productID); + $this->loadModel('product')->setMenu($products, $productID); } /** diff --git a/module/design/view/browse.html.php b/module/design/view/browse.html.php index ebf90ad999..a987e0bde4 100644 --- a/module/design/view/browse.html.php +++ b/module/design/view/browse.html.php @@ -63,9 +63,9 @@ id}"; - common::printIcon('design', 'edit', $vars, $design, 'list', 'fork', '', '', '', '', '', $design->program); + common::printIcon('design', 'edit', $vars, $design, 'list', 'fork', '', '', '', '', '', $design->PRJ); common::printIcon('design', 'viewCommit', $vars, $design, 'list', 'list-alt', '', 'iframe showinonlybody', true); - common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin', '', '', '', '', $design->program); + common::printIcon('design', 'delete', $vars, $design, 'list', 'trash', 'hiddenwin', '', '', '', '', $design->PRJ); ?> diff --git a/module/product/control.php b/module/product/control.php index 66ade4a8f7..669c1b090c 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -700,9 +700,10 @@ class product extends control $this->view->module = $module; $this->view->method = $method; $this->view->extra = $extra; + $products = $this->product->getProductsByProject($this->session->PRJ); $product = $this->product->getByID($productID); - $this->view->products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in(array_keys($this->products))->orderBy('`order` desc')->fetchAll('id'); + $this->view->products = $this->dao->select('*')->from(TABLE_PRODUCT)->where('id')->in(array_keys($products))->orderBy('`order` desc')->fetchAll('id'); $this->view->programID = $product->program; $this->display(); diff --git a/module/product/model.php b/module/product/model.php index dca679db20..c5588ab604 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -88,18 +88,15 @@ class productModel extends model } else { - if(isset($project->product) and $project->product == 'multiple') - { - $label = $this->lang->product->index; - $pageNav = '
'; - $pageNav .= '
'; + $pageNav .= $selectHtml; } return $pageNav; diff --git a/module/program/model.php b/module/program/model.php index 9a2bc5b547..6a19ee4136 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -320,7 +320,7 @@ class programModel extends model $groupPriv = new stdclass(); $groupPriv->account = $this->app->user->account; $groupPriv->group = $PRJAdminID; - $groupPriv->program = $programID; + $groupPriv->PRJ = $programID; $this->dao->insert(TABLE_USERGROUP)->data($groupPriv)->exec(); } diff --git a/module/program/view/pgmbrowsebylist.html.php b/module/program/view/pgmbrowsebylist.html.php index 312fb139c1..a2d5b6dd61 100644 --- a/module/program/view/pgmbrowsebylist.html.php +++ b/module/program/view/pgmbrowsebylist.html.php @@ -50,7 +50,7 @@ type == 'program'):?> - createLink('program', 'pgmview', "programID=$program->id"), "" . $program->name);?> + createLink('program', 'pgmview', "programID=$program->id"), " " . $program->name);?> createLink('program', 'index', "programID=$program->id", '', '', $program->id), " " . $program->name);?> diff --git a/module/programplan/control.php b/module/programplan/control.php index 7527eeb9cc..41d5eeb80e 100644 --- a/module/programplan/control.php +++ b/module/programplan/control.php @@ -36,7 +36,7 @@ class programplan extends control */ public function commonAction($projectID, $productID = 0, $extra = '') { - $products = $this->loadModel('product')->getProductsByProject('', $projectID); + $products = $this->loadModel('product')->getProductsByProject($projectID); $productID = $this->product->saveState($productID, $products); $this->productID = $productID; $this->product->setMenu($products, $productID, 0, 0, '', $extra); diff --git a/module/project/control.php b/module/project/control.php index f1ad16f7d0..c0f1cbd525 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -25,7 +25,6 @@ class project extends control { $this->projects = $this->project->getPairs('nocode', $this->session->PRJ); if(!$this->projects and $this->methodName != 'index' and $this->methodName != 'create' and $this->app->getViewType() != 'mhtml') $this->locate($this->createLink('project', 'create')); - if(!$this->projects and $this->methodName != 'index' and $this->methodName != 'create' and $this->app->getViewType() == 'mhtml') $this->locate($this->createLink('project', 'index')); } } diff --git a/module/repo/model.php b/module/repo/model.php index a6d8d5466f..c3233bb281 100644 --- a/module/repo/model.php +++ b/module/repo/model.php @@ -144,7 +144,7 @@ class repoModel extends model { $repos = $this->dao->select('*')->from(TABLE_REPO) ->where('deleted')->eq('0') - ->andWhere("CONCAT(',', program, ',')")->like("%,{$programID},%") + ->andWhere("CONCAT(',', PRJ, ',')")->like("%,{$programID},%") ->orderBy($orderBy) ->page($pager)->fetchAll('id'); @@ -195,7 +195,7 @@ class repoModel extends model if(!$this->checkConnection()) return false; $data = fixer::input('post') ->skipSpecial('path,client,account,password') - ->join('program', ',') + ->join('PRJ', ',') ->get(); $data->acl = empty($data->acl) ? '' : json_encode($data->acl); @@ -237,7 +237,7 @@ class repoModel extends model ->setDefault('prefix', $repo->prefix) ->setIF($this->post->path != $repo->path, 'synced', 0) ->skipSpecial('path,client,account,password') - ->join('program', ',') + ->join('PRJ', ',') ->get(); $data->acl = empty($data->acl) ? '' : json_encode($data->acl); @@ -286,7 +286,7 @@ class repoModel extends model { $repos = $this->dao->select('*')->from(TABLE_REPO) ->where('deleted')->eq(0) - ->andWhere("CONCAT(',', program, ',')")->like("%,{$programID},%") + ->andWhere("CONCAT(',', PRJ, ',')")->like("%,{$programID},%") ->fetchAll(); $repoPairs = array(); diff --git a/module/repo/view/create.html.php b/module/repo/view/create.html.php index 8196c8dfeb..565fc1dde5 100644 --- a/module/repo/view/create.html.php +++ b/module/repo/view/create.html.php @@ -26,7 +26,7 @@ - + diff --git a/module/repo/view/edit.html.php b/module/repo/view/edit.html.php index b0160796b9..2f947050e1 100644 --- a/module/repo/view/edit.html.php +++ b/module/repo/view/edit.html.php @@ -28,7 +28,7 @@
repo->program; ?>session->PRJ, "class='form-control chosen' multiple"); ?>session->PRJ, "class='form-control chosen' multiple"); ?>
repo->type; ?>
- +
repo->program; ?>program, "class='form-control chosen' multiple"); ?>program, "class='form-control chosen' multiple"); ?>
repo->type; ?>