Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
leiyong
2020-11-02 15:28:35 +08:00
11 changed files with 36 additions and 26 deletions
+2 -2
View File
@@ -31,7 +31,7 @@ class bug extends control
$this->loadModel('action');
$this->loadModel('story');
$this->loadModel('task');
$this->view->products = $this->products = $this->product->getPairs('nocode');
$this->view->products = $this->products = $this->product->getProductsByProject($this->session->PRJ);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=bug")));
}
@@ -439,7 +439,7 @@ class bug extends control
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch);
if(empty($moduleOptionMenu)) die(js::locate(helper::createLink('tree', 'browse', "productID=$productID&view=story")));
$productList = $this->product->getOrderedProducts('all');
$productList = $this->product->getOrderedProducts('all', 40, $this->session->PRJ);
foreach($productList as $product) $products[$product->id] = $product->name;
/* Set custom. */
+3 -3
View File
@@ -130,7 +130,7 @@ if($config->URAndSR)
/* 主导航菜单。*/
$lang->mainNav = new stdclass();
$lang->mainNav->my = '<i class="icon icon-menu-my"></i> 地盘|my|index|';
$lang->mainNav->program = '<i class="icon icon-folder-open-o"></i> 项目集|program|pgmindex|';
$lang->mainNav->program = '<i class="icon icon-folder-open-o"></i> 项目集|program|pgmbrowse|';
$lang->mainNav->product = '<i class="icon icon-menu-project"></i> 产品|product|index|';
$lang->mainNav->project = '<i class="icon icon-file"></i> 项目|program|prjbrowse|';
$lang->mainNav->system = '<i class="icon icon-menu-users"></i> 组织|custom|estimate|';
@@ -142,11 +142,11 @@ $lang->dividerMenu = ',admin,';
/* Program set menu. */
$lang->program = new stdclass();
$lang->program->menu = new stdclass();
$lang->program->menu->index = '主页|program|pgmindex|';
//$lang->program->menu->index = '主页|program|pgmindex|';
$lang->program->menu->browse = array('link' => '项目集|program|pgmbrowse|', 'alias' => 'pgmcreate,pgmedit,pgmgroup,pgmmanagepriv,pgmmanageview,pgmmanagemembers');
$lang->program->viewMenu = new stdclass();
$lang->program->viewMenu->view = array('link' => '概况|program|pgmview|program=%s');
//$lang->program->viewMenu->view = array('link' => '概况|program|pgmview|program=%s');
$lang->program->viewMenu->product = array('link' => '产品|program|pgmproduct|program=%s');
$lang->program->viewMenu->project = array('link' => "项目|program|pgmproject|program=%s");
$lang->program->viewMenu->personnel = array('link' => "人员|personnel|accessible|program=%s");
+4 -4
View File
@@ -161,12 +161,12 @@ $lang->todo->methodOrder[80] = 'batchClose';
/* Program. */
$lang->resource->program = new stdclass();
$lang->resource->program->createGuide = 'createGuide';
$lang->resource->program->PGMIndex = 'PGMIndex';
//$lang->resource->program->PGMIndex = 'PGMIndex';
$lang->resource->program->PGMBrowse = 'PGMBrowse';
$lang->resource->program->PGMProduct = 'PGMProduct';
$lang->resource->program->PGMCreate = 'PGMCreate';
$lang->resource->program->PGMEdit = 'PGMEdit';
$lang->resource->program->PGMView = 'PGMView';
//$lang->resource->program->PGMView = 'PGMView';
$lang->resource->program->PGMClose = 'PGMClose';
$lang->resource->program->PGMActivate = 'PGMActivate';
$lang->resource->program->PGMDelete = 'PGMDelete';
@@ -200,12 +200,12 @@ $lang->resource->program->unbindWhielist = 'unbindWhielist';
$lang->resource->program->PRJManageProducts = 'PRJManageProducts';
$lang->program->methodOrder[0] = 'createGuide';
$lang->program->methodOrder[5] = 'PGMIndex';
//$lang->program->methodOrder[5] = 'PGMIndex';
$lang->program->methodOrder[10] = 'PGMBrowse';
$lang->program->methodOrder[15] = 'PGMProduct';
$lang->program->methodOrder[20] = 'PGMCreate';
$lang->program->methodOrder[25] = 'PGMEdit';
$lang->program->methodOrder[30] = 'PGMView';
//$lang->program->methodOrder[30] = 'PGMView';
$lang->program->methodOrder[35] = 'PGMClose';
$lang->program->methodOrder[40] = 'PGMActivate';
$lang->program->methodOrder[45] = 'PGMDelete';
+3 -2
View File
@@ -700,11 +700,12 @@ class product extends control
$this->view->module = $module;
$this->view->method = $method;
$this->view->extra = $extra;
$products = $this->product->getProductsByProject($this->session->PRJ);
$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($products))->orderBy('`order` desc')->fetchAll('id');
$this->view->programID = $product->program;
$this->view->programID = $this->session->PRJ;
$this->display();
}
+13 -3
View File
@@ -138,7 +138,7 @@ class productModel extends model
if($isMobile) $output = "<a id='currentItem' href=\"javascript:showSearchMenu('product', '$productID', '$currentModule', '$currentMethod', '$extra')\">{$currentProduct->name} <span class='icon-caret-down'></span></a><div id='currentItemDropMenu' class='hidden affix enter-from-bottom layer'></div>";
if($currentProduct->type == 'normal') unset($this->lang->product->menu->branch);
if($currentProduct->type != 'normal')
if($currentProduct->type != 'normal' && $currentModule != 'programplan')
{
$this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$currentProduct->type]);
$this->lang->product->menu->branch = str_replace('@branch@', $this->lang->product->branchName[$currentProduct->type], $this->lang->product->branch);
@@ -358,9 +358,19 @@ class productModel extends model
* @access public
* @return array
*/
public function getOrderedProducts($status, $num = 0)
public function getOrderedProducts($status, $num = 0, $projectID = 0)
{
$products = $this->getList($this->session->program, $status);
$products = array();
if($projectID)
{
$pairs = $this->getProductsByProject($this->session->PRJ);
$products = $this->getByIdList(array_keys($pairs));
}
else
{
$products = $this->getList('', $status, $num);
}
if(empty($products)) return $products;
$lines = $this->loadModel('tree')->getLinePairs($useShort = true);
+1 -1
View File
@@ -50,7 +50,7 @@
<td class='c-name text-left pgm-title table-nest-title' title='<?php echo $program->name?>'>
<span class="table-nest-icon icon <?php if($program->type == 'program') echo ' table-nest-toggle' ?>"></span>
<?php if($program->type == 'program'):?>
<?php echo html::a($this->createLink('program', 'pgmview', "programID=$program->id"), "<i class='icon icon-folder-open-o'></i> " . $program->name);?>
<?php echo html::a($this->createLink('program', 'pgmproduct', "programID=$program->id"), "<i class='icon icon-folder-open-o'></i> " . $program->name);?>
<?php else:?>
<?php echo html::a($this->createLink('program', 'index', "programID=$program->id", '', '', $program->id), "<i class='icon icon-file'></i> " . $program->name);?>
<?php endif;?>
-1
View File
@@ -736,7 +736,6 @@ class projectModel extends model
/* Order by status's content whether or not done */
$projects = $this->dao->select('*, IF(INSTR(" done,closed", status) < 2, 0, 1) AS isDone')->from(TABLE_PROJECT)
->where('deleted')->eq(0)
->andWhere('grade')->eq(1)
->beginIF($programID)->andWhere('project')->eq($programID)->fi()
->beginIF(strpos($mode, 'withdelete') === false)->andWhere('deleted')->eq(0)->fi()
->beginIF(!$this->app->user->admin and strpos($mode, 'all') === false)->andWhere('id')->in($this->app->user->view->sprints)->fi()
+1 -1
View File
@@ -25,7 +25,7 @@ class testcase extends control
$this->loadModel('product');
$this->loadModel('tree');
$this->loadModel('user');
$this->view->products = $this->products = $this->product->getPairs('nocode');
$this->view->products = $this->products = $this->product->getProductsByProject($this->session->PRJ);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testcase")));
}
+1 -1
View File
@@ -520,7 +520,7 @@ class testreport extends control
{
if($objectType == 'product')
{
$this->products = $this->product->getPairs('nocode');
$this->products = $this->product->getProductsByProject($this->session->PRJ);
$productID = $this->product->saveState($objectID, $this->products);
$this->testreport->setMenu($this->products, $productID);
return $productID;
+4 -4
View File
@@ -41,7 +41,7 @@ class testsuite extends control
$this->session->set('testsuiteList', $this->app->getURI(true));
/* Set menu. */
$this->view->products = $this->products = $this->loadModel('product')->getPairs('nocode');
$this->view->products = $this->products = $this->loadModel('product')->getProductsByProject($this->session->PRJ);
$productID = $this->product->saveState($productID, $this->products);
$this->testsuite->setMenu($this->products, $productID);
@@ -49,6 +49,9 @@ class testsuite extends control
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
$suites = $this->testsuite->getSuites($productID, $sort, $pager);
if(empty($suites) and $pageID > 1)
{
@@ -56,10 +59,7 @@ class testsuite extends control
$suites = $this->testsuite->getSuites($productID, $sort, $pager);
}
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
$productName = isset($this->products[$productID]) ? $this->products[$productID] : '';
$suites = $this->testsuite->getSuites($productID, $sort, $pager);
$this->view->title = $productName . $this->lang->testsuite->common;
+4 -4
View File
@@ -23,7 +23,7 @@ class testtask extends control
{
parent::__construct($moduleName, $methodName);
$this->loadModel('product');
$this->view->products = $this->products = $this->product->getPairs('nocode');
$this->view->products = $this->products = $this->product->getProductsByProject($this->session->PRJ);
if(empty($this->products)) die($this->locate($this->createLink('product', 'showErrorNone', "fromModule=testtask")));
}
@@ -72,6 +72,9 @@ class testtask extends control
$this->app->loadClass('pager', $static = true);
$pager = pager::init($recTotal, $recPerPage, $pageID);
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
/* Get tasks. */
$tasks = $this->testtask->getProductTasks($productID, $branch, $sort, $pager, $scopeAndStatus, $beginTime, $endTime);
if(empty($tasks) and $pageID > 1)
@@ -80,9 +83,6 @@ class testtask extends control
$tasks = $this->testtask->getProductTasks($productID, $branch, $sort, $pager, $scopeAndStatus, $beginTime, $endTime);
}
/* Append id for secend sort. */
$sort = $this->loadModel('common')->appendOrder($orderBy);
/* Get tasks. */
$tasks = $this->testtask->getProductTasks($productID, $branch, $sort, $pager, $scopeAndStatus, $beginTime, $endTime);