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

Conflicts:
	module/build/model.php
This commit is contained in:
chenfeiCF
2015-10-27 20:21:01 +08:00
43 changed files with 446 additions and 222 deletions
+50 -1
View File
@@ -1 +1,50 @@
欢迎访问<a href='http://www.zentao.net' target='_blank'>禅道项目管理软件</a>主站,获得最新动态和文档支持。
1. What is ZenTao for?
=====================
ZenTao, developed by Nature Easy Soft Network Technology Development Co. Ltd, is an open source project management software. Combining product management, project management, quality management, document project, organization management and todo management, ZenTao is professional R&D project management software, completely covering the core processes of R & D project. Results-oriented with perfect functions, easy operation, beautiful interface, powerful search functions, various statistical statements and complete API, ZenTao is reasonably structured and can be extended flexibly.
ZenTao - focuses on R & D project management.
2. Why are we called ZenTao?
============================
In Chinese, Zen(禅) and Tao(道) are two words that have rich meanings in both religion and culture. ZenTao Project Management Software is originated in the cultural meanings of Zen and Tao, expecting to convey our understanding and thinking on management. Inspired by two books The Tao of Programming and The Zen of Programming, we name our software ZenTao.
3. Design philosophy of ZenTao Project Management Software
==========================================================
The main management theory of ZenTao Project Management Software is based on Scrum, an internationally popular agile management methodology. Results-oriented and operable, Scrum is very suitable for the fast sprint development of software development projects. However, Scrum only defines the core management framework. There are still many details and processes needing to be extended by the teams. On the basis of following the management methods of Scrum and with the consideration of the current domestic R&D status, ZenTao integrates the functions, such as bug management, test case management, release management and document management and completely covers the entire life cycle of software R&D projects. In ZenTao, the concepts of product, project and test are clearly defined. Product team, development team and testing team coordinate and check with each other while they are separated. With the interaction through requirements, tasks and bugs between the three teams, qualified products are ultimately made within the project.
4. Why choose ZenTao Project Management Software
===============================================
* ZenTao is a professional R&D project management software, beyond comparison with any other simple project management software.
* Precise and pragmatic management theory, which will help companies achieve fast and agile development.
* Complete functions: you dont need to integrate several systems together, like mantisbt + trac + testlink.
* Open source codes and flexible extension mechanism, convenient for uses and secondary development of companies.
* Underlying framework and front-end UI framework developed independently: robust and stable with beautiful interface and friendly interaction.
* Perfect community mechanism: you can get timely technical support and help.
* Zero input: you have no risk for choosing ZenTao compared with other commercial software of tens of thousands of dollars.
* Various deployments supported, either private deployment or cloud services.
5. Function lists of ZenTao Project Management Software
======================================================
* Product management: including products, requirements, plans, releases and roadmaps;
* Project management: including projects, tasks, teams, versions and burn-down charts;
* Quality management: including bus, test cases, test tasks and test results;
* Document management: including product document library, project document library and user-defined document library;
* Affair management: including to-do management and personal affairs management like my tasks, my bugs, my requirement and my projects;
* Organization management: including department, users, groups and authorities;
* Statistics function: various statistical statements;
* Search function: powerful search functions to help you find the data you need.
* Extension mechanism:extensible nearly anywhere in ZenTao;
* API mechanism, visible API: convenient for integration with other systems.
6. Website
Our website is: [www.zentao.pm](http://www.zentao.pm)
======================================================
+1
View File
@@ -174,6 +174,7 @@ $config->objectTables['doc'] = TABLE_DOC;
$config->objectTables['doclib'] = TABLE_DOCLIB;
$config->objectTables['todo'] = TABLE_TODO;
$config->objectTables['custom'] = TABLE_LANG;
$config->objectTables['branch'] = TABLE_BRANCH;
/* Include extension config files. */
$extConfigFiles = glob($configRoot . 'ext/*.php');
+2 -2
View File
@@ -9,8 +9,8 @@ ALTER TABLE `zt_build` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `produc
ALTER TABLE `zt_release` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`;
ALTER TABLE `zt_bug` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`;
ALTER TABLE `zt_case` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`;
ALTER TABLE `zt_module` ADD `branch` varchar(50) COLLATE 'utf8_general_ci' unsigned NOT NULL AFTER `root`;
ALTER TABLE `zt_story` ADD `branch` varchar(50) COLLATE 'utf8_general_ci' NOT NULL AFTER `product`;
ALTER TABLE `zt_module` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `root`;
ALTER TABLE `zt_story` ADD `branch` mediumint(8) unsigned NOT NULL AFTER `product`;
CREATE TABLE `zt_branch` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY,
+1 -1
View File
@@ -1189,7 +1189,7 @@ class router
*/
private function mergeParams($defaultParams, $passedParams)
{
/* If the not strict mode, the keys of passed params and defaaul params msut be the same. */
/* If not strict mode, the keys of passed params and default params must be the same order. */
if(!isset($this->config->strictParams) or $this->config->strictParams == false)
{
unset($passedParams['onlybody']);
+1
View File
@@ -14,5 +14,6 @@ $config->action->objectNameFields['user'] = 'account';
$config->action->objectNameFields['doc'] = 'title';
$config->action->objectNameFields['doclib'] = 'name';
$config->action->objectNameFields['todo'] = 'name';
$config->action->objectNameFields['branch'] = 'name';
$config->action->commonImgSize = 870;
+2
View File
@@ -58,6 +58,7 @@ $lang->action->objectTypes['user'] = '用户';
$lang->action->objectTypes['doc'] = '文档';
$lang->action->objectTypes['doclib'] = '文档库';
$lang->action->objectTypes['todo'] = '待办';
$lang->action->objectTypes['branch'] = '分支';
/* 用来描述操作历史记录。*/
$lang->action->desc = new stdclass();
@@ -176,6 +177,7 @@ $lang->action->search->objectTypeList['todo'] = '待办';
$lang->action->search->objectTypeList['build'] = 'Build';
$lang->action->search->objectTypeList['release'] = '发布';
$lang->action->search->objectTypeList['productplan'] = '计划';
$lang->action->search->objectTypeList['branch'] = '分支';
/* 用来在动态显示中显示动作 */
$lang->action->search->label[''] = '';
+17 -6
View File
@@ -18,12 +18,15 @@ class branch extends control
$this->branch->manage($productID);
die(js::reload('parent'));
}
$products = $this->loadModel('product')->getPairs('nocode');
$this->product->setMenu($products, $productID);
$position[] = html::a($this->createLink('product', 'browse', "productID=$productID"), $products[$productID]);
$position[] = $this->lang->branch->manage;
$this->view->title = $this->lang->branch->manage;
$this->view->position[] = $this->lang->branch->manage;
$this->loadModel('product')->setMenu($this->product->getPairs('nocode'), $productID);
$this->view->product = $this->product->getById($productID);
$this->view->position = $position;
$this->view->branches = $this->branch->getPairs($productID, 'noempty');
$this->display();
}
@@ -54,7 +57,15 @@ class branch extends control
if(empty($product) or $product->type == 'normal') die();
$branches = $this->branch->getPairs($productID);
die(html::select('branch', $branches, '', "class='form-control'"));
die(html::select('branch', $branches, '', "class='form-control' onchange='loadBranch()'"));
}
public function delete($branchID, $confirm = 'no')
{
if($confirm == 'no') die(js::confirm($this->lang->branch->confirmDelete, inlink('delete', "branchID=$branchID&confirm=yes")));
$this->branch->delete(TABLE_BRANCH, $branchID);
die(js::reload('parent'));
}
}
+1
View File
@@ -0,0 +1 @@
#branches .input-group{margin-bottom:5px;}
+11
View File
@@ -0,0 +1,11 @@
function addItem()
{
var $inputgroup = $('#branches .input-group:last');
$('#branches').append($inputgroup.clone()).find('.input-group:last').find('input').val('');
}
function deleteItem(obj)
{
if($(obj).closest('#branches').find("input[id^='newbranch']").size() <= 1) return;
$(obj).closest('.input-group').remove();
}
+2
View File
@@ -2,3 +2,5 @@
$lang->branch->manage = '分支管理';
$lang->branch->all = '所有';
$lang->branch->confirmDelete = '分支删除,会影响关联该分支的需求、模块、计划、发布、Bug、用例等等,请慎重考虑。是否删除改分支?';
+20 -13
View File
@@ -17,26 +17,33 @@
</div>
<form method='post' target='hiddenwin'>
<table class="table table-form">
<tr>
<td class='w-50px'></td>
<td class="w-300px">
<div id='branches'>
<?php foreach($branches as $branchID => $branch):?>
<tr>
<td class='w-50px'></td>
<td class="w-200px"><?php echo html::input("branch[$branchID]", $branch, "class='form-control'")?> </td>
<td></td>
</tr>
<div class='input-group'>
<?php echo html::input("branch[$branchID]", $branch, "class='form-control'")?>
<span class='input-group-addon'><a href='javascript:;' onclick='addItem()'><i class='icon icon-plus'></i></a></span>
<span class='input-group-addon'><a href='<?php echo inlink('delete', "branch=$branchID")?>' target='hiddenwin'><i class='icon icon-remove'></i></a></span>
</div>
<?php endforeach;?>
<?php for($i = 0; $i < 5; $i++):?>
<tr>
<td class='w-50px'></td>
<td class="w-200px"><?php echo html::input("newbranch[$i]", '', "class='form-control'")?> </td>
<?php for($i = 0; $i < 2; $i++):?>
<div class='input-group'>
<?php echo html::input("newbranch[]", '', "class='form-control'")?>
<span class='input-group-addon'><a href='javascript:;' onclick='addItem()'><i class='icon icon-plus'></i></a></span>
<span class='input-group-addon'><a href='javascript:;' onclick='deleteItem(this)'><i class='icon icon-remove'></i></a></span>
</div>
<?php endfor;?>
</div>
</td>
<td></td>
</tr>
<?php endfor;?>
<tr>
<td class='w-50px'></td>
<td class="w-200px"><?php echo html::submitButton()?> </td><td></td>
<td></td>
<td><?php echo html::submitButton() . html::backButton();?> </td><td></td>
</tr>
</table>
</form>
</div>
<?php include '../../common/view/footer.html.php';?>
+2
View File
@@ -61,6 +61,7 @@ $config->bug->search['fields']['status'] = $lang->bug->status;
$config->bug->search['fields']['confirmed'] = $lang->bug->confirmed;
$config->bug->search['fields']['product'] = $lang->bug->product;
$config->bug->search['fields']['branch'] = $lang->bug->branch;
$config->bug->search['fields']['plan'] = $lang->bug->productplan;
$config->bug->search['fields']['module'] = $lang->bug->module;
$config->bug->search['fields']['project'] = $lang->bug->project;
@@ -102,6 +103,7 @@ $config->bug->search['params']['status'] = array('operator' => '=',
$config->bug->search['params']['confirmed'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->bug->confirmedList);
$config->bug->search['params']['product'] = array('operator' => '=', 'control' => 'select', 'values' => '');
$config->bug->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => '');
$config->bug->search['params']['plan'] = array('operator' => '=', 'control' => 'select', 'values' => '');
$config->bug->search['params']['module'] = array('operator' => 'belong', 'control' => 'select', 'values' => 'modules');
$config->bug->search['params']['project'] = array('operator' => '=', 'control' => 'select', 'values' => 'projects');
+49 -37
View File
@@ -61,7 +61,7 @@ class bug extends control
* @access public
* @return void
*/
public function browse($productID = 0, $browseType = 'unclosed', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function browse($productID = 0, $branch = 0, $browseType = 'unclosed', $param = 0, $orderBy = '', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Set browseType, productID, moduleID and queryID. */
$browseType = strtolower($browseType);
@@ -70,7 +70,7 @@ class bug extends control
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
/* Set menu and save session. */
$this->bug->setMenu($this->products, $productID);
$this->bug->setMenu($this->products, $productID, $branch);
$this->session->set('bugList', $this->app->getURI(true));
/* Process the order by field. */
@@ -90,23 +90,23 @@ class bug extends control
/* Get bugs. */
$bugs = array();
if($browseType == 'all') $bugs = $this->bug->getAllBugs($productID, $projects, $sort, $pager);
if($browseType == 'all') $bugs = $this->bug->getAllBugs($productID, $branch, $projects, $sort, $pager);
elseif($browseType == "bymodule")
{
$childModuleIds = $this->tree->getAllChildId($moduleID);
$bugs = $this->bug->getModuleBugs($productID, $childModuleIds, $projects, $sort, $pager);
$bugs = $this->bug->getModuleBugs($productID, $branch, $childModuleIds, $projects, $sort, $pager);
}
elseif($browseType == 'assigntome') $bugs = $this->bug->getByAssigntome($productID, $projects, $sort, $pager);
elseif($browseType == 'openedbyme') $bugs = $this->bug->getByOpenedbyme($productID, $projects, $sort, $pager);
elseif($browseType == 'resolvedbyme') $bugs = $this->bug->getByResolvedbyme($productID, $projects, $sort, $pager);
elseif($browseType == 'assigntonull') $bugs = $this->bug->getByAssigntonull($productID, $projects, $sort, $pager);
elseif($browseType == 'unconfirmed') $bugs = $this->bug->getUnconfirmed($productID, $projects, $sort, $pager);
elseif($browseType == 'unresolved') $bugs = $this->bug->getByStatus($productID, $projects, 'unresolved', $sort, $pager);
elseif($browseType == 'unclosed') $bugs = $this->bug->getByStatus($productID, $projects, 'unclosed', $sort, $pager);
elseif($browseType == 'toclosed') $bugs = $this->bug->getByStatus($productID, $projects, 'toclosed', $sort, $pager);
elseif($browseType == 'longlifebugs') $bugs = $this->bug->getByLonglifebugs($productID, $projects, $sort, $pager);
elseif($browseType == 'postponedbugs') $bugs = $this->bug->getByPostponedbugs($productID, $projects, $sort, $pager);
elseif($browseType == 'needconfirm') $bugs = $this->bug->getByNeedconfirm($productID, $projects, $sort, $pager);
elseif($browseType == 'assigntome') $bugs = $this->bug->getByAssigntome($productID, $branch, $projects, $sort, $pager);
elseif($browseType == 'openedbyme') $bugs = $this->bug->getByOpenedbyme($productID, $branch, $projects, $sort, $pager);
elseif($browseType == 'resolvedbyme') $bugs = $this->bug->getByResolvedbyme($productID, $branch, $projects, $sort, $pager);
elseif($browseType == 'assigntonull') $bugs = $this->bug->getByAssigntonull($productID, $branch, $projects, $sort, $pager);
elseif($browseType == 'unconfirmed') $bugs = $this->bug->getUnconfirmed($productID, $branch, $projects, $sort, $pager);
elseif($browseType == 'unresolved') $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'unresolved', $sort, $pager);
elseif($browseType == 'unclosed') $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'unclosed', $sort, $pager);
elseif($browseType == 'toclosed') $bugs = $this->bug->getByStatus($productID, $branch, $projects, 'toclosed', $sort, $pager);
elseif($browseType == 'longlifebugs') $bugs = $this->bug->getByLonglifebugs($productID, $branch, $projects, $sort, $pager);
elseif($browseType == 'postponedbugs') $bugs = $this->bug->getByPostponedbugs($productID, $branch, $projects, $sort, $pager);
elseif($browseType == 'needconfirm') $bugs = $this->bug->getByNeedconfirm($productID, $branch, $projects, $sort, $pager);
elseif($browseType == 'bysearch') $bugs = $this->bug->getBySearch($productID, $queryID, $sort, $pager);
/* Process the sql, get the conditon partion, save it to session. */
@@ -116,7 +116,7 @@ class bug extends control
$bugs = $this->loadModel('story')->checkNeedConfirm($bugs);
/* Build the search form. */
$this->config->bug->search['actionURL'] = $this->createLink('bug', 'browse', "productID=$productID&browseType=bySearch&queryID=myQueryID");
$this->config->bug->search['actionURL'] = $this->createLink('bug', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
$this->config->bug->search['queryID'] = $queryID;
$this->config->bug->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->bug->allProduct);
$this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID);
@@ -124,6 +124,15 @@ class bug extends control
$this->config->bug->search['params']['project']['values'] = $this->product->getProjectPairs($productID);
$this->config->bug->search['params']['openedBuild']['values'] = $this->loadModel('build')->getProductBuildPairs($productID);
$this->config->bug->search['params']['resolvedBuild']['values'] = $this->build->getProductBuildPairs($productID);
if($this->session->currentProductType == 'normal')
{
unset($this->config->bug->search['fields']['branch']);
unset($this->config->bug->search['params']['branch']);
}
else
{
$this->config->bug->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty');
}
$this->loadModel('search')->setSearchParams($this->config->bug->search);
$users = $this->user->getPairs('noletter');
@@ -165,6 +174,7 @@ class bug extends control
$this->view->orderBy = $orderBy;
$this->view->moduleID = $moduleID;
$this->view->memberPairs = $memberPairs;
$this->view->branch = $branch;
$this->display();
}
@@ -253,8 +263,7 @@ class bug extends control
/* Get product, then set menu. */
$productID = $this->product->saveState($productID, $this->products);
$product = $this->product->getById($productID);
$branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID);
$branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID);
$this->bug->setMenu($this->products, $productID, $branch);
/* Init vars. */
@@ -336,9 +345,9 @@ class bug extends control
$this->view->productID = $productID;
$this->view->productName = $this->products[$productID];
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch);
$this->view->stories = $stories;
$this->view->projects = $this->product->getProjectPairs($productID, $params = 'nodeleted');
$this->view->projects = $this->product->getProjectPairs($productID, $branch, $params = 'nodeleted');
$this->view->builds = $builds;
$this->view->moduleID = $moduleID;
$this->view->projectID = $projectID;
@@ -360,7 +369,6 @@ class bug extends control
$this->view->keywords = $keywords;
$this->view->severity = $severity;
$this->view->type = $type;
$this->view->product = $product;
$this->view->branch = $branch;
$this->view->branches = $branches;
@@ -380,24 +388,24 @@ class bug extends control
{
if(!empty($_POST))
{
$actions = $this->bug->batchCreate($productID);
$actions = $this->bug->batchCreate($productID, $branch);
foreach($actions as $bugID => $actionID) $this->sendmail($bugID, $actionID);
die(js::locate($this->session->bugList, 'parent'));
}
/* Get product, then set menu. */
$productID = $this->product->saveState($productID, $this->products);
$this->bug->setMenu($this->products, $productID);
$this->bug->setMenu($this->products, $productID, $branch);
/* If projectID is setted, get builds and stories of this project. */
if($projectID)
{
$builds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, 'noempty');
$builds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, $branch, 'noempty');
$stories = $this->story->getProjectStoryPairs($projectID);
}
else
{
$builds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty');
$builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch, 'noempty');
$stories = $this->story->getProductStoryPairs($productID, $branch);
}
@@ -419,7 +427,7 @@ class bug extends control
}
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->bug->batchCreate;
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
$this->view->position[] = $this->lang->bug->batchCreate;
$this->view->productID = $productID;
@@ -428,8 +436,9 @@ class bug extends control
$this->view->users = $this->user->getPairs('nodeleted,devfirst');
$this->view->projects = $this->product->getProjectPairs($productID, $params = 'nodeleted');
$this->view->projectID = $projectID;
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $branch);
$this->view->moduleID = $moduleID;
$this->view->branch = $branch;
$this->display();
}
@@ -456,7 +465,7 @@ class bug extends control
if($bug->assignedTo == $this->app->user->account) $this->loadModel('action')->read('bug', $bugID);
/* Set menu. */
$this->bug->setMenu($this->products, $bug->product);
$this->bug->setMenu($this->products, $bug->product, $bug->branch);
/* Get product info. */
$productID = $bug->product;
@@ -472,6 +481,7 @@ class bug extends control
$this->view->productName = $productName;
$this->view->modulePath = $this->tree->getParents($bug->module);
$this->view->bug = $bug;
$this->view->branchName = $this->session->currentProductType == 'normal' ? '' : $this->loadModel('branch')->getById($bug->branch);
$this->view->users = $this->user->getPairs('noletter');
$this->view->actions = $this->action->getList('bug', $bugID);
$this->view->builds = $this->loadModel('build')->getProductBuildPairs($productID);
@@ -532,7 +542,7 @@ class bug extends control
$currentModuleID = $bug->module;
/* Set the menu. */
$this->bug->setMenu($this->products, $productID);
$this->bug->setMenu($this->products, $productID, $bug->branch);
/* Set header and position. */
$this->view->title = $this->lang->bug->edit . "BUG #$bug->id $bug->title - " . $this->products[$productID];
@@ -542,13 +552,13 @@ class bug extends control
/* Assign. */
if($projectID)
{
$openedBuilds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, 'noempty,noterminate,nodone');
$allBuilds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, 'noempty');
$openedBuilds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, $bug->branch, 'noempty,noterminate,nodone');
$allBuilds = $this->loadModel('build')->getProjectBuildPairs($projectID, $productID, $bug->branch, 'noempty');
}
else
{
$openedBuilds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty,noterminate,nodone');
$allBuilds = $this->loadModel('build')->getProductBuildPairs($productID, 'noempty');
$openedBuilds = $this->loadModel('build')->getProductBuildPairs($productID, $bug->branch, 'noempty,noterminate,nodone');
$allBuilds = $this->loadModel('build')->getProductBuildPairs($productID, $bug->branch, 'noempty');
}
/* Set the openedBuilds list*/
@@ -563,10 +573,11 @@ class bug extends control
$this->view->productID = $productID;
$this->view->productName = $this->products[$productID];
$this->view->plans = $this->loadModel('productplan')->getPairs($productID, $bug->branch);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'bug', $startModuleID = 0, $bug->branch);
$this->view->currentModuleID = $currentModuleID;
$this->view->projects = $this->product->getProjectPairs($bug->product);
$this->view->stories = $bug->project ? $this->story->getProjectStoryPairs($bug->project) : $this->story->getProductStoryPairs($bug->product, $bug->branch);
$this->view->branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($bug->product);
$this->view->tasks = $this->task->getProjectTaskPairs($bug->project);
$this->view->users = $this->user->getPairs('nodeleted', "$bug->assignedTo,$bug->resolvedBy,$bug->closedBy,$bug->openedBy");
$this->view->openedBuilds = $openedBuilds;
@@ -584,7 +595,7 @@ class bug extends control
* @access public
* @return void
*/
public function batchEdit($productID = 0)
public function batchEdit($productID = 0, $branch = 0)
{
if($this->post->titles)
{
@@ -623,9 +634,9 @@ class bug extends control
$product = $this->product->getByID($productID);
/* Set product menu. */
$this->bug->setMenu($this->products, $productID);
$this->bug->setMenu($this->products, $productID, $branch);
$this->view->title = $product->name . $this->lang->colon . "BUG" . $this->lang->bug->batchEdit;
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = html::a($this->createLink('bug', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
}
/* The bugs of my. */
else
@@ -652,6 +663,7 @@ class bug extends control
$this->view->bugIDList = $bugIDList;
$this->view->productID = $productID;
$this->view->bugs = $bugs;
$this->view->branch = $branch;
$this->view->users = $this->user->getPairs('nodeleted,devfirst');
$this->display();
+58 -14
View File
@@ -43,6 +43,7 @@ function loadAll(productID)
{
$('#taskIdBox').innerHTML = '<select id="task"></select>'; // Reset the task.
$('#task').chosen(defaultChosenOptions);
loadProductBranches(productID)
loadProductModules(productID);
loadProductProjects(productID);
loadProductBuilds(productID);
@@ -51,6 +52,18 @@ function loadAll(productID)
}
}
function loadBranch()
{
$('#taskIdBox').innerHTML = '<select id="task"></select>'; // Reset the task.
$('#task').chosen(defaultChosenOptions);
productID = $('#product').val();
loadProductModules(productID);
loadProductProjects(productID);
loadProductBuilds(productID);
loadProductplans(productID);
loadProductStories(productID);
}
/**
*Load all builds of one project or product.
*
@@ -80,9 +93,11 @@ function loadAllBuilds()
*/
function loadAllProjectBuilds(projectID, productID)
{
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
if(page == 'create') oldOpenedBuild = $('#openedBuild').val() ? $('#openedBuild').val() : 0;
link = createLink('build', 'ajaxGetAllProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild);
link = createLink('build', 'ajaxGetAllProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch);
if(page == 'create')
{
$('#buildBox').load(link, function(){ notice(); $('#openedBuild').chosen(defaultChosenOptions);});
@@ -91,7 +106,7 @@ function loadAllProjectBuilds(projectID, productID)
{
$('#openedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)});
buildLink = createLink('build', 'ajaxGetAllProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild);
buildLink = createLink('build', 'ajaxGetAllProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch);
$('#resolvedBuildBox').load(buildLink, function(){$(this).find('select').chosen(defaultChosenOptions)});
}
}
@@ -105,7 +120,9 @@ function loadAllProjectBuilds(projectID, productID)
*/
function loadAllProductBuilds(productID)
{
link = createLink('build', 'ajaxGetAllProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild);
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
link = createLink('build', 'ajaxGetAllProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch);
if(page == 'create')
{
$('#buildBox').load(link, function(){ notice(); $('#openedBuild').chosen(defaultChosenOptions);});
@@ -114,7 +131,7 @@ function loadAllProductBuilds(productID)
{
$('#openedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)});
buildLink = createLink('build', 'ajaxGetAllProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild);
buildLink = createLink('build', 'ajaxGetAllProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch);
$('#resolvedBuildBox').load(buildLink, function(){$(this).find('select').chosen(defaultChosenOptions)});
}
}
@@ -128,7 +145,9 @@ function loadAllProductBuilds(productID)
*/
function loadProductModules(productID)
{
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug&rootModuleID=0&returnType=html&needManage=true');
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=bug&branch=' + branch + '&rootModuleID=0&returnType=html&needManage=true');
$('#moduleIdBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)});
}
@@ -141,7 +160,9 @@ function loadProductModules(productID)
*/
function loadProductStories(productID)
{
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=0&moduleId=0&storyID=' + oldStoryID);
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
link = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branch + '&moduleId=0&storyID=' + oldStoryID);
$('#storyIdBox').load(link, function(){$('#story').chosen(defaultChosenOptions);});
}
@@ -154,7 +175,9 @@ function loadProductStories(productID)
*/
function loadProductProjects(productID)
{
link = createLink('product', 'ajaxGetProjects', 'productID=' + productID + '&projectID=' + oldProjectID);
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
link = createLink('product', 'ajaxGetProjects', 'productID=' + productID + '&projectID=' + oldProjectID + '&branch=' + branch);
$('#projectIdBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)});
}
@@ -167,7 +190,9 @@ function loadProductProjects(productID)
*/
function loadProductplans(productID)
{
link = createLink('productplan', 'ajaxGetProductplans', 'productID=' + productID);
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
link = createLink('productplan', 'ajaxGetProductplans', 'productID=' + productID + '&branch=' + branch);
$('#planIdBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)});
}
@@ -180,7 +205,9 @@ function loadProductplans(productID)
*/
function loadProductBuilds(productID)
{
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild);
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch);
if(page == 'create')
{
@@ -189,7 +216,7 @@ function loadProductBuilds(productID)
else
{
$('#openedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)});
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild);
link = createLink('build', 'ajaxGetProductBuilds', 'productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch);
$('#resolvedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)});
}
}
@@ -240,7 +267,9 @@ function loadProjectTasks(projectID)
*/
function loadProjectStories(projectID)
{
link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=' + $('#product').val() + '&moduleID=0&storyID=' + oldStoryID);
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
link = createLink('story', 'ajaxGetProjectStories', 'projectID=' + projectID + '&productID=' + $('#product').val() + '&branch=' + branch + '&moduleID=0&storyID=' + oldStoryID);
$('#storyIdBox').load(link, function(){$('#story').chosen(defaultChosenOptions);});
}
@@ -253,20 +282,22 @@ function loadProjectStories(projectID)
*/
function loadProjectBuilds(projectID)
{
branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
productID = $('#product').val();
if(page == 'create') oldOpenedBuild = $('#openedBuild').val() ? $('#openedBuild').val() : 0;
if(page == 'create')
{
link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + "&index=0&needCreate=true");
link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + "&branch=" + branch + "&index=0&needCreate=true");
$('#buildBox').load(link, function(){ notice(); $('#openedBuild').chosen(defaultChosenOptions);});
}
else
{
link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild);
link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=openedBuild&build=' + oldOpenedBuild + '&branch=' + branch);
$('#openedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)});
link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild);
link = createLink('build', 'ajaxGetProjectBuilds', 'projectID=' + projectID + '&productID=' + productID + '&varName=resolvedBuild&build=' + oldResolvedBuild + '&branch=' + branch);
$('#resolvedBuildBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)});
}
}
@@ -293,6 +324,19 @@ function setStories(moduleID, productID)
});
}
function loadProductBranches(productID)
{
$('#branch').remove();
$.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID), function(data)
{
if(data)
{
$('#product').closest('.input-group').append(data);
$('#branch').css('width', page == 'create' ? '100px' : '65px');
}
})
}
/**
* notice for create build.
*
+1
View File
@@ -14,6 +14,7 @@ $lang->bug->common = 'Bug';
$lang->bug->id = 'Bug编号';
$lang->bug->product = '所属' . $lang->productCommon;
$lang->bug->productplan = '所属计划';
$lang->bug->branch = '所属分支';
$lang->bug->module = '所属模块';
$lang->bug->path = '模块路径';
$lang->bug->project = '所属' . $lang->projectCommon;
+30 -19
View File
@@ -21,10 +21,10 @@ class bugModel extends model
* @access public
* @return void
*/
public function setMenu($products, $productID)
public function setMenu($products, $productID, $branch = 0)
{
$this->loadModel('product')->setMenu($products, $productID);
$selectHtml = $this->product->select($products, $productID, 'bug', 'browse');
$this->loadModel('product')->setMenu($products, $productID, $branch);
$selectHtml = $this->product->select($products, $productID, 'bug', 'browse', '', $branch);
foreach($this->lang->bug->menu as $key => $menu)
{
$replace = ($key == 'product') ? $selectHtml : $productID;
@@ -76,7 +76,7 @@ class bugModel extends model
* @access public
* @return void
*/
public function batchCreate($productID)
public function batchCreate($productID, $branch = 0)
{
$this->loadModel('action');
$now = helper::now();
@@ -84,7 +84,7 @@ class bugModel extends model
$data = fixer::input('post')->get();
$batchNum = count(reset($data));
$result = $this->loadModel('common')->removeDuplicate('bug', $data, "product=$productID");
$result = $this->loadModel('common')->removeDuplicate('bug', $data, "product=$productID&branch=$branch");
$data = $result['data'];
for($i = 0; $i < $batchNum; $i++)
@@ -93,7 +93,7 @@ class bugModel extends model
}
/* Get pairs(moduleID => moduleOwner) for bug. */
$stmt = $this->dbh->query($this->loadModel('tree')->buildMenuQuery($productID, 'bug', $startModuleID = 0));
$stmt = $this->dbh->query($this->loadModel('tree')->buildMenuQuery($productID, 'bug', $startModuleID = 0, $branch));
$moduleOwners = array();
while($module = $stmt->fetch()) $moduleOwners[$module->id] = $module->owner;
@@ -126,6 +126,7 @@ class bugModel extends model
$bug->openedBy = $this->app->user->account;
$bug->openedDate = $now;
$bug->product = $productID;
$bug->branch = $branch;
$bug->module = $data->modules[$i];
$bug->project = $data->projects[$i];
$bug->openedBuild = implode(',', $data->openedBuilds[$i]);
@@ -209,10 +210,11 @@ class bugModel extends model
* @access public
* @return array
*/
public function getModuleBugs($productID, $moduleIds = 0, $projects, $orderBy = 'id_desc', $pager = null)
public function getModuleBugs($productID, $branch, $moduleIds = 0, $projects, $orderBy = 'id_desc', $pager = null)
{
return $this->dao->select('*')->from(TABLE_BUG)
->where('product')->eq((int)$productID)
->beginIF(!empty($branch))->andWhere('branch')->in($branch)->fi()
->beginIF(!empty($moduleIds))->andWhere('module')->in($moduleIds)->fi()
->andWhere('project')->in(array_keys($projects))
->andWhere('deleted')->eq(0)
@@ -1353,13 +1355,13 @@ class bugModel extends model
* @access public
* @return array
*/
public function getAllBugs($productID, $projects, $orderBy, $pager = null)
public function getAllBugs($productID, $branch, $projects, $orderBy, $pager = null)
{
$bugs = $this->dao->select('t1.*, t2.title as planTitle')
->from(TABLE_BUG)->alias('t1')
$bugs = $this->dao->select('t1.*, t2.title as planTitle')->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_PRODUCTPLAN)->alias('t2')->on('t1.plan = t2.id')
->where('t1.product')->eq($productID)
->andWhere('t1.project')->in(array_keys($projects))
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
@@ -1379,9 +1381,10 @@ class bugModel extends model
* @access public
* @return array
*/
public function getByAssigntome($productID, $projects, $orderBy, $pager)
public function getByAssigntome($productID, $branch, $projects, $orderBy, $pager)
{
return $this->dao->findByAssignedTo($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID)
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->andWhere('project')->in(array_keys($projects))
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
@@ -1398,9 +1401,10 @@ class bugModel extends model
* @access public
* @return array
*/
public function getByOpenedbyme($productID, $projects, $orderBy, $pager)
public function getByOpenedbyme($productID, $branch, $projects, $orderBy, $pager)
{
return $this->dao->findByOpenedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID)
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->andWhere('project')->in(array_keys($projects))
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
@@ -1417,9 +1421,10 @@ class bugModel extends model
* @access public
* @return array
*/
public function getByResolvedbyme($productID, $projects, $orderBy, $pager)
public function getByResolvedbyme($productID, $branch, $projects, $orderBy, $pager)
{
return $this->dao->findByResolvedBy($this->app->user->account)->from(TABLE_BUG)->andWhere('product')->eq($productID)
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->andWhere('project')->in(array_keys($projects))
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
@@ -1436,10 +1441,11 @@ class bugModel extends model
* @access public
* @return array
*/
public function getByAssigntonull($productID, $projects, $orderBy, $pager)
public function getByAssigntonull($productID, $branch, $projects, $orderBy, $pager)
{
return $this->dao->findByAssignedTo('')->from(TABLE_BUG)->andWhere('product')->eq($productID)
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->andWhere('project')->in(array_keys($projects))
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
@@ -1455,10 +1461,11 @@ class bugModel extends model
* @access public
* @return void
*/
public function getUnconfirmed($productID, $projects, $orderBy, $pager)
public function getUnconfirmed($productID, $branch, $projects, $orderBy, $pager)
{
return $this->dao->select('*')->from(TABLE_BUG)
->where('confirmed')->eq(0)
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->andWhere('product')->eq($productID)
->andWhere('project')->in(array_keys($projects))
->andWhere('deleted')->eq(0)
@@ -1477,11 +1484,12 @@ class bugModel extends model
* @access public
* @return array
*/
public function getByStatus($productID, $projects, $status, $orderBy, $pager)
public function getByStatus($productID, $branch, $projects, $status, $orderBy, $pager)
{
return $this->dao->select('*')->from(TABLE_BUG)
->where('project')->in(array_keys($projects))
->andWhere('product')->eq($productID)
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->beginIF($status == 'unclosed')->andWhere('status')->ne('closed')->fi()
->beginIF($status == 'unresolved')->andWhere('status')->eq('active')->fi()
->beginIF($status == 'toclosed')->andWhere('status')->eq('resolved')->fi()
@@ -1500,10 +1508,11 @@ class bugModel extends model
* @access public
* @return array
*/
public function getByLonglifebugs($productID, $projects, $orderBy, $pager)
public function getByLonglifebugs($productID, $branch, $projects, $orderBy, $pager)
{
return $this->dao->findByLastEditedDate("<", date(DT_DATE1, strtotime('-7 days')))->from(TABLE_BUG)->andWhere('product')->eq($productID)
->andWhere('project')->in(array_keys($projects))
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->andWhere('openedDate')->lt(date(DT_DATE1,strtotime('-7 days')))
->andWhere('deleted')->eq(0)
->andWhere('status')->ne('closed')->orderBy($orderBy)->page($pager)->fetchAll();
@@ -1520,9 +1529,10 @@ class bugModel extends model
* @access public
* @return array
*/
public function getByPostponedbugs($productID, $projects, $orderBy, $pager)
public function getByPostponedbugs($productID, $branch, $projects, $orderBy, $pager)
{
return $this->dao->findByResolution('postponed')->from(TABLE_BUG)->andWhere('product')->eq($productID)
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->andWhere('project')->in(array_keys($projects))
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
@@ -1539,11 +1549,12 @@ class bugModel extends model
* @access public
* @return array
*/
public function getByNeedconfirm($productID, $projects, $orderBy, $pager)
public function getByNeedconfirm($productID, $branch, $projects, $orderBy, $pager)
{
return $this->dao->select('t1.*, t2.title AS storyTitle')->from(TABLE_BUG)->alias('t1')->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->where("t2.status = 'active'")
->andWhere('t1.product')->eq($productID)
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
->andWhere('t2.version > t1.storyVersion')
->andWhere('t1.project')->in(array_keys($projects))
->andWhere('t1.deleted')->eq(0)
+17 -17
View File
@@ -19,18 +19,18 @@ js::set('moduleID', $moduleID);
<div id='featurebar'>
<ul class='nav'>
<?php
echo "<li id='unclosedTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=unclosed&param=0"), $lang->bug->unclosed) . "</li>";
echo "<li id='allTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=all&param=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->bug->allBugs) . "</li>";
echo "<li id='assigntomeTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=assignToMe&param=0"), $lang->bug->assignToMe) . "</li>";
echo "<li id='openedbymeTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=openedByMe&param=0"), $lang->bug->openedByMe) . "</li>";
echo "<li id='resolvedbymeTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=resolvedByMe&param=0"), $lang->bug->resolvedByMe) . "</li>";
echo "<li id='unconfirmedTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=unconfirmed&param=0"), $lang->bug->confirmedList[0]) . "</li>";
echo "<li id='assigntonullTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=assignToNull&param=0"), $lang->bug->assignToNull) . "</li>";
echo "<li id='unresolvedTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=unResolved&param=0"), $lang->bug->unResolved) . "</li>";
echo "<li id='toclosedTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=toClosed&param=0"), $lang->bug->toClosed) . "</li>";
echo "<li id='longlifebugsTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=longLifeBugs&param=0"), $lang->bug->longLifeBugs) . "</li>";
echo "<li id='postponedbugsTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=postponedBugs&param=0"), $lang->bug->postponedBugs) . "</li>";
echo "<li id='needconfirmTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&browseType=needconfirm&param=0"), $lang->bug->needConfirm) . "</li>";
echo "<li id='unclosedTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=unclosed&param=0"), $lang->bug->unclosed) . "</li>";
echo "<li id='allTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=all&param=0&orderBy=$orderBy&recTotal=0&recPerPage=200"), $lang->bug->allBugs) . "</li>";
echo "<li id='assigntomeTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=assignToMe&param=0"), $lang->bug->assignToMe) . "</li>";
echo "<li id='openedbymeTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=openedByMe&param=0"), $lang->bug->openedByMe) . "</li>";
echo "<li id='resolvedbymeTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=resolvedByMe&param=0"), $lang->bug->resolvedByMe) . "</li>";
echo "<li id='unconfirmedTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=unconfirmed&param=0"), $lang->bug->confirmedList[0]) . "</li>";
echo "<li id='assigntonullTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=assignToNull&param=0"), $lang->bug->assignToNull) . "</li>";
echo "<li id='unresolvedTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=unResolved&param=0"), $lang->bug->unResolved) . "</li>";
echo "<li id='toclosedTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=toClosed&param=0"), $lang->bug->toClosed) . "</li>";
echo "<li id='longlifebugsTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=longLifeBugs&param=0"), $lang->bug->longLifeBugs) . "</li>";
echo "<li id='postponedbugsTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=postponedBugs&param=0"), $lang->bug->postponedBugs) . "</li>";
echo "<li id='needconfirmTab'>" . html::a($this->createLink('bug', 'browse', "productid=$productID&branch=$branch&browseType=needconfirm&param=0"), $lang->bug->needConfirm) . "</li>";
echo "<li id='bysearchTab'><a href='#'><i class='icon-search icon'></i>&nbsp;{$lang->bug->byQuery}</a></li> ";
?>
</ul>
@@ -55,8 +55,8 @@ js::set('moduleID', $moduleID);
</div>
<div class='btn-group'>
<?php
common::printIcon('bug', 'batchCreate', "productID=$productID&projectID=0&moduleID=$moduleID");
common::printIcon('bug', 'create', "productID=$productID&extra=moduleID=$moduleID");
common::printIcon('bug', 'batchCreate', "productID=$productID&branch=$branch&projectID=0&moduleID=$moduleID");
common::printIcon('bug', 'create', "productID=$productID&branch=$branch&extra=moduleID=$moduleID");
?>
</div>
</div>
@@ -82,7 +82,7 @@ js::set('moduleID', $moduleID);
<div class='main'>
<form method='post'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed' id='bugList'>
<?php $vars = "productID=$productID&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<?php $vars = "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<thead>
<tr>
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
@@ -154,7 +154,7 @@ js::set('moduleID', $moduleID);
common::printIcon('bug', 'resolve', $params, $bug, 'list', '', '', 'iframe', true);
common::printIcon('bug', 'close', $params, $bug, 'list', '', '', 'iframe', true);
common::printIcon('bug', 'edit', $params, $bug, 'list');
common::printIcon('bug', 'create', "product=$bug->product&extra=bugID=$bug->id", $bug, 'list', 'copy');
common::printIcon('bug', 'create', "product=$bug->product&branch=$bug->branch&extra=bugID=$bug->id", $bug, 'list', 'copy');
?>
</td>
<?php endif;?>
@@ -175,7 +175,7 @@ js::set('moduleID', $moduleID);
</div>
<div class='btn-group dropup'>
<?php
$actionLink = $this->createLink('bug', 'batchEdit', "productID=$productID");
$actionLink = $this->createLink('bug', 'batchEdit', "productID=$productID&branch=$branch");
$misc = common::hasPriv('bug', 'batchEdit') ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
echo html::commonButton($lang->edit, $misc);
?>
+4 -1
View File
@@ -32,7 +32,10 @@ js::set('refresh', $lang->refresh);
<tr>
<th class='w-110px'><?php echo $lang->bug->lblProductAndModule;?></th>
<td class='w-p45-f'>
<?php echo html::select('product', $products, $productID, "onchange=loadAll(this.value) class='form-control chosen' autocomplete='off'");?>
<div class='input-group'>
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value);' class='form-control chosen' autocomplete='off'");?>
<?php if($this->session->currentProductType != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch()' class='form-control' style='width:100px'");?>
</div>
</td>
<td>
<div class='input-group' id='moduleIdBox'>
+7 -2
View File
@@ -71,12 +71,17 @@ js::set('oldResolvedBuild' , $bug->resolvedBuild);
<table class='table table-form'>
<tr>
<th class='w-80px'><?php echo $lang->bug->product;?></th>
<td><?php echo html::select('product', $products, $productID, "onchange=loadAll(this.value); class='form-control chosen'");?></td>
<td>
<div class='input-group'>
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value)' class='form-control chosen'");?>
<?php if($this->session->currentProductType != 'normal') echo html::select('branch', $branches, $bug->branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->bug->module;?></th>
<td>
<span id='moduleIdBox'><?php echo html::select('module', $moduleOptionMenu, $currentModuleID, "onchange='loadModuleRelated()' class='form-control chosen'");?></span>
<div class='input-group' id='moduleIdBox'><?php echo html::select('module', $moduleOptionMenu, $currentModuleID, "onchange='loadModuleRelated()' class='form-control chosen'");?></div>
</td>
</tr>
<tr>
+9 -3
View File
@@ -24,8 +24,8 @@
<?php
$browseLink = $app->session->bugList != false ? $app->session->bugList : inlink('browse', "productID=$bug->product");
$params = "bugID=$bug->id";
$copyParams = "productID=$productID&extras=bugID=$bug->id";
$convertParams = "productID=$productID&moduleID=0&from=bug&bugID=$bug->id";
$copyParams = "productID=$productID&branch=$bug->branch&extras=bugID=$bug->id";
$convertParams = "productID=$productID&branch=$bug->branch&moduleID=0&from=bug&bugID=$bug->id";
if(!$bug->deleted)
{
ob_start();
@@ -36,7 +36,7 @@
common::printIcon('bug', 'close', $params, $bug, 'button', '', '', 'text-danger iframe showinonlybody', true);
common::printIcon('bug', 'activate', $params, $bug, 'button', '', '', 'text-success iframe showinonlybody', true);
common::printIcon('bug', 'toStory', "product=$bug->product&module=0&story=0&project=0&bugID=$bug->id", $bug, 'button', $lang->icons['story']);
common::printIcon('bug', 'toStory', "product=$bug->product&branch=$bug->branch&module=0&story=0&project=0&bugID=$bug->id", $bug, 'button', $lang->icons['story']);
common::printIcon('bug', 'createCase', $convertParams, '', 'button', 'sitemap');
echo '</div>';
@@ -110,6 +110,12 @@
<th class='w-60px'><?php echo $lang->bug->product;?></th>
<td><?php if(!common::printLink('bug', 'browse', "productID=$bug->product", $productName)) echo $productName;?></td>
</tr>
<?php if($this->session->currentProductType != 'normal'):?>
<tr>
<th><?php echo $lang->bug->branch;?></th>
<td><?php if(!common::printLink('bug', 'browse', "productID=$bug->product&branch=$bug->branch", $branchName)) echo $branchName;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->bug->module;?></th>
<?php
+15 -15
View File
@@ -206,11 +206,11 @@ class build extends control
* @access public
* @return string
*/
public function ajaxGetProductBuilds($productID, $varName, $build = '', $index = 0)
public function ajaxGetProductBuilds($productID, $varName, $build = '', $branch = 0, $index = 0)
{
if($varName == 'openedBuild' ) die(html::select($varName . '[]', $this->build->getProductBuildPairs($productID, 'noempty,release,noterminate,nodone'), $build, 'size=4 class=form-control multiple'));
if($varName == 'openedBuilds' ) die(html::select($varName . "[$index][]", $this->build->getProductBuildPairs($productID, 'noempty,release'), $build, 'size=4 class=form-control multiple'));
if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProductBuildPairs($productID, 'noempty,release,noterminate,nodone'), $build, "class='form-control'"));
if($varName == 'openedBuild' ) die(html::select($varName . '[]', $this->build->getProductBuildPairs($productID, $branch, 'noempty,release,noterminate,nodone'), $build, 'size=4 class=form-control multiple'));
if($varName == 'openedBuilds' ) die(html::select($varName . "[$index][]", $this->build->getProductBuildPairs($productID, $branch, 'noempty,release'), $build, 'size=4 class=form-control multiple'));
if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProductBuildPairs($productID, $branch, 'noempty,release,noterminate,nodone'), $build, "class='form-control'"));
}
/**
@@ -224,17 +224,17 @@ class build extends control
* @access public
* @return string
*/
public function ajaxGetProjectBuilds($projectID, $productID, $varName, $build = '', $index = 0, $needCreate = false)
public function ajaxGetProjectBuilds($projectID, $productID, $varName, $build = '', $branch = 0, $index = 0, $needCreate = false)
{
if($varName == 'openedBuild')
{
$builds = $this->build->getProjectBuildPairs($projectID, $productID, 'noempty,release,noterminate,nodone');
$builds = $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty,release,noterminate,nodone');
$output = html::select($varName . '[]', $builds , $build, 'size=4 class=form-control multiple');
die($output);
}
if($varName == 'openedBuilds') die(html::select($varName . "[$index][]", $this->build->getProjectBuildPairs($projectID, $productID, 'noempty'), $build, 'size=4 class=form-control multiple'));
if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, $productID, 'noempty,noterminate,nodone'), $build, "class='form-control'"));
if($varName == 'testTaskBuild') die(html::select('build', $this->build->getProjectBuildPairs($projectID, $productID, 'noempty'), $build, "class='form-control'"));
if($varName == 'openedBuilds') die(html::select($varName . "[$index][]", $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty'), $build, 'size=4 class=form-control multiple'));
if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty,noterminate,nodone'), $build, "class='form-control'"));
if($varName == 'testTaskBuild') die(html::select('build', $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty'), $build, "class='form-control'"));
}
/**
@@ -246,10 +246,10 @@ class build extends control
* @access public
* @return string
*/
public function ajaxGetAllProductBuilds($productID, $varName, $build = '')
public function ajaxGetAllProductBuilds($productID, $varName, $build = '', $branch = 0)
{
if($varName == 'openedBuild' ) die(html::select($varName . '[]', $this->build->getProductBuildPairs($productID, 'noempty,release'), $build, 'size=4 class=form-control multiple'));
if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProductBuildPairs($productID, 'noempty,release'), $build, "class='form-control'"));
if($varName == 'openedBuild' ) die(html::select($varName . '[]', $this->build->getProductBuildPairs($productID, $branch, 'noempty,release'), $build, 'size=4 class=form-control multiple'));
if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProductBuildPairs($productID, $branch, 'noempty,release'), $build, "class='form-control'"));
}
/**
@@ -262,15 +262,15 @@ class build extends control
* @access public
* @return string
*/
public function ajaxGetAllProjectBuilds($projectID, $productID, $varName, $build = '')
public function ajaxGetAllProjectBuilds($projectID, $productID, $varName, $build = '', $branch = 0)
{
if($varName == 'openedBuild')
{
$builds = $this->build->getProjectBuildPairs($projectID, $productID, 'noempty,release');
$builds = $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty,release');
$output = html::select($varName . '[]', $builds , $build, 'size=4 class=form-control multiple');
die($output);
}
if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, $productID, 'noempty'), $build, "class='form-control'"));
if($varName == 'resolvedBuild') die(html::select($varName, $this->build->getProjectBuildPairs($projectID, $productID, $branch, 'noempty'), $build, "class='form-control'"));
}
/**
+8 -8
View File
@@ -64,17 +64,17 @@ class buildModel extends model
* @access public
* @return array
*/
public function getProjectBuildPairs($projectID, $productID, $params = '')
public function getProjectBuildPairs($projectID, $productID, $branch = 0, $params = '')
{
$sysBuilds = array();
if(strpos($params, 'noempty') === false) $sysBuilds = array('' => '');
if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => 'Trunk');
$builds = $this->dao->select('t1.id, t1.name')->from(TABLE_BUILD)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')
->on('t1.project = t2.id')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.project')->eq((int)$projectID)
->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi()
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
->beginIF(strpos($params, 'nodone') !== false)->andWhere('t2.status')->ne('done')->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy('t1.date desc, t1.id desc')->fetchPairs();
@@ -82,6 +82,7 @@ class buildModel extends model
$releases = $this->dao->select('build,name')->from(TABLE_RELEASE)
->where('build')->in(array_keys($builds))
->beginIF(strpos($params, 'noterminate') !== false)->andWhere('status')->ne('terminate')->fi()
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->andWhere('deleted')->eq(0)
->fetchPairs();
foreach($releases as $buildID => $releaseName) $builds[$buildID] = $releaseName;
@@ -96,24 +97,23 @@ class buildModel extends model
* @access public
* @return string
*/
public function getProductBuildPairs($products, $branchID = 0, $params = '')
public function getProductBuildPairs($products, $branch = 0, $params = '')
{
$sysBuilds = array();
if(strpos($params, 'noempty') === false) $sysBuilds = array('' => '');
if(strpos($params, 'notrunk') === false) $sysBuilds = $sysBuilds + array('trunk' => 'Trunk');
$productBuilds = $this->dao->select('t1.id, t1.name, t1.project')->from(TABLE_BUILD)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')
->on('t1.project = t2.id')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->in($products)
->beginIF($branchID)->andWhere('t1.branch')->eq($branchID)->fi()
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
->beginIF(strpos($params, 'nodone') !== false)->andWhere('t2.status')->ne('done')->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy('t1.date desc, t1.id desc')->fetchAll('id');
$releases = $this->dao->select('build,name,deleted')->from(TABLE_RELEASE)
->where('product')->in($products)
->beginIF($branchID)->andWhere('branch')->eq($branchID)->fi()
->beginIF(strpos($params, 'noterminate') !== false)->andWhere('status')->ne('terminate')->fi()
->beginIF($branch)->andWhere('branch')->in($branch)->fi()
->fetchAll('build');
$builds = array();
+1
View File
@@ -320,6 +320,7 @@ $lang->dev->menu = $lang->admin->menu;
$lang->menugroup = new stdclass();
$lang->menugroup->release = 'product';
$lang->menugroup->story = 'product';
$lang->menugroup->branch = 'product';
$lang->menugroup->productplan = 'product';
$lang->menugroup->task = 'project';
$lang->menugroup->build = 'project';
+3 -4
View File
@@ -117,7 +117,6 @@ class product extends control
/* Set product, module and query. */
$productID = $this->product->saveState($productID, $this->products);
$product = $this->product->getById($productID);
if($branch === '') $branch = $this->session->branch;
$moduleID = ($browseType == 'bymodule') ? (int)$param : 0;
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
@@ -172,7 +171,7 @@ class product extends control
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getPairs($productID);
$this->config->product->search['params']['product']['values'] = array($productID => $this->products[$productID], 'all' => $this->lang->product->allProduct);
$this->config->product->search['params']['module']['values'] = $this->tree->getOptionMenu($productID, $viewType = 'story', $startModuleID = 0);
if($product->type == 'normal')
if($this->session->currentProductType == 'normal')
{
unset($this->config->product->search['fields']['branch']);
unset($this->config->product->search['params']['branch']);
@@ -502,9 +501,9 @@ class product extends control
* @access public
* @return void
*/
public function ajaxGetProjects($productID, $projectID = 0)
public function ajaxGetProjects($productID, $projectID = 0, $branch = 0)
{
$projects = $this->product->getProjectPairs($productID, $params = 'nodeleted');
$projects = $this->product->getProjectPairs($productID, $branch, $params = 'nodeleted');
die(html::select('project', $projects, $projectID, 'class=form-control onchange=loadProjectRelated(this.value)'));
}
+7 -5
View File
@@ -64,7 +64,9 @@ class productModel extends model
setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot);
setCookie("lastBranch", "$productID-$branch", $this->config->cookieLife, $this->config->webRoot);
$currentProduct = $this->getById($productID);
$this->session->set('currentProductType', $currentProduct->type);
$output = "<a id='currentItem' href=\"javascript:showDropMenu('product', '$productID', '$currentModule', '$currentMethod', '$extra')\">{$currentProduct->name} <span class='icon-caret-down'></span></a><div id='dropMenu'><i class='icon icon-spin icon-spinner'></i></div>";
if($currentProduct->type == 'normal') unset($this->lang->product->menu->branch);
if($currentProduct->type != 'normal')
{
$branches = $this->loadModel('branch')->getPairs($productID);
@@ -348,14 +350,14 @@ class productModel extends model
* @access public
* @return array
*/
public function getProjectPairs($productID, $param = 'all')
public function getProjectPairs($productID, $branch = 0, $param = 'all')
{
$projectList = array_keys($this->loadModel('project')->getPairs());
$projects = array();
$datas = $this->dao->select('t2.id, t2.name, t2.deleted')
->from(TABLE_PROJECTPRODUCT)->alias('t1')->leftJoin(TABLE_PROJECT)->alias('t2')
->on('t1.project = t2.id')
$datas = $this->dao->select('t2.id, t2.name, t2.deleted')->from(TABLE_PROJECTPRODUCT)
->alias('t1')->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq((int)$productID)
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
->andWhere('t2.id')->in($projectList)
->orderBy('t1.project desc')
->fetchAll();
@@ -697,7 +699,7 @@ class productModel extends model
}
else
{
$link = helper::createLink($module, $method, "productID=%s&branch=%s");
$link = helper::createLink($module, $method, "productID=%s" . ($branch ? "&branch=%s" : ''));
}
}
else if($module == 'productplan' || $module == 'release')
+1 -1
View File
@@ -115,7 +115,7 @@
common::printIcon('story', 'review', $vars, $story, 'list', 'search');
common::printIcon('story', 'close', $vars, $story, 'list', 'off', '', 'iframe', true);
common::printIcon('story', 'edit', $vars, $story, 'list', 'pencil');
common::printIcon('story', 'createCase', "productID=$story->product&module=0&from=&param=0&$vars", $story, 'list', 'sitemap');
common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=&param=0&$vars", $story, 'list', 'sitemap');
?>
</td>
</tr>
+3 -5
View File
@@ -555,15 +555,13 @@ class projectModel extends model
{
if($productID != 0)
{
return $this->dao->select('t2.*')
->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')
->on('t1.project = t2.id')
return $this->dao->select('t2.*')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.deleted')->eq(0)
->andWhere('t2.iscat')->eq(0)
->beginIF($status == 'undone')->andWhere('t2.status')->ne('done')->fi()
->beginIF($branch != 0)->andWhere('t1.branch')->like(",$branch,")->fi()
->beginIF($branch != 0)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($status == 'isdoing')->andWhere('t2.status')->ne('done')->andWhere('t2.status')->ne('suspended')->fi()
->beginIF($status != 'all' and $status != 'isdoing' and $status != 'undone')->andWhere('status')->in($status)->fi()
->orderBy('order_desc')
+1 -1
View File
@@ -18,7 +18,7 @@
</div>
<div class='actions'>
<?php common::printIcon('bug', 'export', "productID=$productID&orderBy=$orderBy", '', 'button', '', '', "iframe");?>
<?php common::printIcon('bug', 'create', "productID=$productID&extra=projectID=$project->id");?>
<?php common::printIcon('bug', 'create', "productID=$productID&branch=0&extra=projectID=$project->id");?>
</div>
</div>
<form method='post' id='projectBugForm'>
+2 -3
View File
@@ -336,7 +336,6 @@ class release extends control
$this->loadModel('product');
/* Build search form. */
$product = $this->product->getByID($release->product);
$queryID = ($browseType == 'bySearch') ? (int)$param : 0;
unset($this->config->product->search['fields']['product']);
unset($this->config->product->search['fields']['project']);
@@ -346,14 +345,14 @@ class release extends control
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($release->product => $release->product));
$this->config->product->search['params']['module']['values'] = $this->tree->getOptionMenu($release->product, $viewType = 'story', $startModuleID = 0);
$this->config->product->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $this->lang->story->statusList);
if($product->type == 'normal')
if($this->session->currentProductType == 'normal')
{
unset($this->config->product->search['fields']['branch']);
unset($this->config->product->search['params']['branch']);
}
else
{
$this->config->product->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($product->id, 'noempty');
$this->config->product->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($release->product, 'noempty');
}
$this->loadModel('search')->setSearchParams($this->config->product->search);
+4 -4
View File
@@ -109,7 +109,7 @@ class story extends control
$moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'story', 0, $branch);
/* Set menu. */
$this->product->setMenu($products, $product->id);
$this->product->setMenu($products, $product->id, $branch);
/* Init vars. */
$planID = 0;
@@ -166,7 +166,7 @@ class story extends control
$this->view->contactLists = $this->user->getContactLists($this->app->user->account, 'withnote');
$this->view->moduleID = $moduleID;
$this->view->moduleOptionMenu = $moduleOptionMenu;
$this->view->plans = $this->loadModel('productplan')->getPairs($productID, 'unexpired');
$this->view->plans = $this->loadModel('productplan')->getPairs($productID, $branch, 'unexpired');
$this->view->planID = $planID;
$this->view->source = $source;
$this->view->pri = $pri;
@@ -896,14 +896,14 @@ class story extends control
* @access public
* @return void
*/
public function ajaxGetProjectStories($projectID, $productID = 0, $moduleID = 0, $storyID = 0, $number = '', $type= 'full')
public function ajaxGetProjectStories($projectID, $productID = 0, $branch = 0, $moduleID = 0, $storyID = 0, $number = '', $type= 'full')
{
if($moduleID)
{
$moduleID = $this->loadModel('tree')->getStoryModule($moduleID);
$moduleID = $this->tree->getAllChildID($moduleID);
}
$stories = $this->story->getProjectStoryPairs($projectID, $productID, $moduleID, $type);
$stories = $this->story->getProjectStoryPairs($projectID, $productID, $branch, $moduleID, $type);
$storyName = $number === '' ? 'story' : "story[$number]";
die(html::select($storyName, empty($stories) ? array('' => '') : $stories, $storyID, 'class=form-control onchange=setStoryRelated(' . $number . ');'));
}
+5 -9
View File
@@ -215,23 +215,20 @@ class storyModel extends model
$stories = fixer::input('post')->get();
$batchNum = count(reset($stories));
$result = $this->loadModel('common')->removeDuplicate('story', $stories, "product={$productID}");
$result = $this->loadModel('common')->removeDuplicate('story', $stories, "product={$productID}&branch=$branch");
$stories = $result['data'];
$module = 0;
$plan = 0;
$pri = 0;
$branch = 0;
for($i = 0; $i < $batchNum; $i++)
{
$module = $stories->module[$i] == 'same' ? $module : $stories->module[$i];
$plan = $stories->plan[$i] == 'same' ? $plan : $stories->plan[$i];
$pri = $stories->pri[$i] == 'same' ? $pri : $stories->pri[$i];
$branch = $stories->pri[$i] == 'same' ? $branch : $stories->branch[$i];
$stories->module[$i] = (int)$module;
$stories->plan[$i] = (int)$plan;
$stories->pri[$i] = (int)$pri;
$stories->branch[$i] = (int)$branch;
}
if(isset($stories->uploadImage)) $this->loadModel('file');
@@ -1220,17 +1217,16 @@ class storyModel extends model
* @access public
* @return array
*/
public function getProjectStoryPairs($projectID = 0, $productID = 0, $moduleIds = 0, $type = 'full')
public function getProjectStoryPairs($projectID = 0, $productID = 0, $branch = 0, $moduleIds = 0, $type = 'full')
{
$stories = $this->dao->select('t2.id, t2.title, t2.module, t2.pri, t2.estimate, t3.name AS product')
->from(TABLE_PROJECTSTORY)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')
->on('t1.story = t2.id')
->leftJoin(TABLE_PRODUCT)->alias('t3')
->on('t1.product = t3.id')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->leftJoin(TABLE_PRODUCT)->alias('t3')->on('t1.product = t3.id')
->where('t1.project')->eq((int)$projectID)
->andWhere('t2.deleted')->eq(0)
->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi()
->beginIF($branch)->andWhere('t2.branch')->eq((int)$branch)->fi()
->beginIF($moduleIds)->andWhere('t2.module')->in($moduleIds)->fi()
->fetchAll();
if(!$stories) return array();
+2
View File
@@ -35,6 +35,7 @@ $config->testcase->search['fields']['type'] = $lang->testcase->type;
$config->testcase->search['fields']['openedBy'] = $lang->testcase->openedBy;
$config->testcase->search['fields']['status'] = $lang->testcase->status;
$config->testcase->search['fields']['product'] = $lang->testcase->product;
$config->testcase->search['fields']['branch'] = $lang->testcase->branch;
$config->testcase->search['fields']['stage'] = $lang->testcase->stage;
$config->testcase->search['fields']['module'] = $lang->testcase->module;
$config->testcase->search['fields']['pri'] = $lang->testcase->pri;
@@ -52,6 +53,7 @@ $config->testcase->search['params']['pri'] = array('operator' => '=',
$config->testcase->search['params']['openedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users');
$config->testcase->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->testcase->statusList);
$config->testcase->search['params']['product'] = array('operator' => '=', 'control' => 'select', 'values' => '');
$config->testcase->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => '');
$config->testcase->search['params']['stage'] = array('operator' => 'include', 'control' => 'select', 'values' => $lang->testcase->stageList);
$config->testcase->search['params']['openedDate'] = array('operator' => '>=', 'control' => 'input', 'values' => '', 'class' => 'date');
+41 -25
View File
@@ -52,7 +52,7 @@ class testcase extends control
* @access public
* @return void
*/
public function browse($productID = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
public function browse($productID = 0, $branch = 0, $browseType = 'all', $param = 0, $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
/* Set browseType, productID, moduleID and queryID. */
$browseType = strtolower($browseType);
@@ -61,7 +61,7 @@ class testcase extends control
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
/* Set menu, save session. */
$this->testcase->setMenu($this->products, $productID);
$this->testcase->setMenu($this->products, $productID, $branch);
$this->session->set('caseList', $this->app->getURI(true));
$this->session->set('productID', $productID);
$this->session->set('moduleID', $moduleID);
@@ -80,7 +80,7 @@ class testcase extends control
if($browseType == 'bymodule' or $browseType == 'all')
{
$childModuleIds = $this->tree->getAllChildId($moduleID);
$cases = $this->testcase->getModuleCases($productID, $childModuleIds, $sort, $pager);
$cases = $this->testcase->getModuleCases($productID, $branch, $childModuleIds, $sort, $pager);
}
/* Cases need confirmed. */
elseif($browseType == 'needconfirm')
@@ -142,13 +142,22 @@ class testcase extends control
/* Build the search form. */
$this->config->testcase->search['params']['product']['values']= array($productID => $this->products[$productID], 'all' => $this->lang->testcase->allProduct);
$this->config->testcase->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($productID, $viewType = 'case');
$this->config->testcase->search['actionURL'] = $this->createLink('testcase', 'browse', "productID=$productID&browseType=bySearch&queryID=myQueryID");
if($this->session->currentProductType == 'normal')
{
unset($this->config->testcase->search['fields']['branch']);
unset($this->config->testcase->search['params']['branch']);
}
else
{
$this->config->testcase->search['params']['branch']['values'] = array('' => '') + $this->loadModel('branch')->getPairs($productID, 'noempty');
}
$this->config->testcase->search['actionURL'] = $this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=bySearch&queryID=myQueryID");
$this->config->testcase->search['queryID'] = $queryID;
$this->loadModel('search')->setSearchParams($this->config->testcase->search);
/* Assign. */
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->common;
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
$this->view->position[] = $this->lang->testcase->common;
$this->view->productID = $productID;
$this->view->productName = $this->products[$productID];
@@ -160,6 +169,7 @@ class testcase extends control
$this->view->browseType = $browseType;
$this->view->param = $param;
$this->view->cases = $cases;
$this->view->branch = $branch;
$this->display();
}
@@ -172,17 +182,17 @@ class testcase extends control
* @access public
* @return void
*/
public function groupCase($productID = 0, $groupBy = 'stroy')
public function groupCase($productID = 0, $branch = 0, $groupBy = 'stroy')
{
$groupBy = empty($groupBy) ? 'stroy' : $groupBy;
$productID = $this->product->saveState($productID, $this->products);
$this->app->loadLang('testtask');
$this->testcase->setMenu($this->products, $productID);
$this->testcase->setMenu($this->products, $productID, $branch);
$this->session->set('caseList', $this->app->getURI(true));
$cases = $this->testcase->getModuleCases($productID, 0, $groupBy);
$cases = $this->testcase->getModuleCases($productID, $branch, 0, $groupBy);
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', false);
$groupCases = array();
@@ -248,7 +258,7 @@ class testcase extends control
$this->loadModel('action');
$this->action->create('case', $caseID, 'Opened');
$response['locate'] = $this->createLink('testcase', 'browse', "productID=$_POST[product]&browseType=byModule&args=$_POST[module]");
$response['locate'] = $this->createLink('testcase', 'browse', "productID={$_POST['product']}&branch={$_POST['branch']}&browseType=byModule&args={$_POST['module']}");
$this->send($response);
}
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
@@ -263,7 +273,7 @@ class testcase extends control
$currentModuleID = (int)$moduleID;
/* Set menu. */
$this->testcase->setMenu($this->products, $productID);
$this->testcase->setMenu($this->products, $productID, $branch);
/* Init vars. */
$type = 'feature';
@@ -312,7 +322,7 @@ class testcase extends control
}
$title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->create;
$position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
$position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
$position[] = $this->lang->testcase->common;
$position[] = $this->lang->testcase->create;
@@ -332,7 +342,7 @@ class testcase extends control
$this->view->position = $position;
$this->view->productID = $productID;
$this->view->productName = $this->products[$productID];
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
$this->view->currentModuleID = $currentModuleID ? $currentModuleID : (isset($stories[$storyID]) ? $stories[$storyID]->module : 0);
$this->view->stories = $stories;
$this->view->type = $type;
@@ -343,6 +353,8 @@ class testcase extends control
$this->view->precondition = $precondition;
$this->view->keywords = $keywords;
$this->view->steps = $steps;
$this->view->branch = $branch;
$this->view->branches = $this->session->currentProductType != 'normal' ? $this->loadModel('branch')->getPairs($productID) : array();
$this->display();
}
@@ -362,9 +374,9 @@ class testcase extends control
$this->loadModel('story');
if(!empty($_POST))
{
$caseID = $this->testcase->batchCreate($productID, $storyID);
$caseID = $this->testcase->batchCreate($productID, $branch, $storyID);
if(dao::isError()) die(js::error(dao::getError()));
die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&browseType=byModule&param=$moduleID"), 'parent'));
die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch&browseType=byModule&param=$moduleID"), 'parent'));
}
if(empty($this->products)) $this->locate($this->createLink('product', 'create'));
@@ -385,7 +397,7 @@ class testcase extends control
$title = '';
$title = $this->products[$productID] . $this->lang->colon . $this->lang->testcase->batchCreate;
$position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
$position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch"), $this->products[$productID]);
$position[] = $this->lang->testcase->common;
$position[] = $this->lang->testcase->batchCreate;
@@ -459,8 +471,8 @@ class testcase extends control
if($from == 'testtask') $run = $this->loadModel('testtask')->getRunByCase($taskID, $caseID);
$productID = $case->product;
$this->testcase->setMenu($this->products, $productID);
$product = $this->loadModel('product')->getById($productID);
$this->testcase->setMenu($this->products, $productID, $case->branch);
$this->view->title = "CASE #$case->id $case->title - " . $this->products[$productID];
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
@@ -472,6 +484,8 @@ class testcase extends control
$this->view->taskID = $taskID;
$this->view->version = $version ? $version : $case->version;
$this->view->productName = $this->products[$productID];
$this->view->product = $product;
$this->view->branchName = $product->type == 'normal' ? '' : $this->loadModel('branch')->getById($case->branch);
$this->view->modulePath = $this->tree->getParents($case->module);
$this->view->users = $this->user->getPairs('noletter');
$this->view->actions = $this->loadModel('action')->getList('case', $caseID);
@@ -530,13 +544,14 @@ class testcase extends control
$position[] = $this->lang->testcase->edit;
/* Set menu. */
$this->testcase->setMenu($this->products, $productID);
$this->testcase->setMenu($this->products, $productID, $case->branch);
$this->view->title = $title;
$this->view->position = $position;
$this->view->productID = $productID;
$this->view->branches = $this->session->currentProductType == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID);
$this->view->productName = $this->products[$productID];
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $case->branch);
$this->view->currentModuleID = $currentModuleID;
$this->view->users = $this->user->getPairs('noletter');
$this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch);
@@ -553,7 +568,7 @@ class testcase extends control
* @access public
* @return void
*/
public function batchEdit($productID = 0)
public function batchEdit($productID = 0, $branch = 0)
{
if($this->post->titles)
{
@@ -580,9 +595,9 @@ class testcase extends control
/* The cases of a product. */
if($productID)
{
$this->testcase->setMenu($this->products, $productID);
$this->testcase->setMenu($this->products, $productID, $branch);
$product = $this->product->getByID($productID);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0);
$this->view->moduleOptionMenu = $this->tree->getOptionMenu($productID, $viewType = 'case', $startModuleID = 0, $branch);
$this->view->position[] = html::a($this->createLink('testcase', 'browse', "productID=$productID"), $this->products[$productID]);
$this->view->title = $product->name . $this->lang->colon . $this->lang->testcase->batchEdit;
}
@@ -906,7 +921,7 @@ class testcase extends control
* @access public
* @return void
*/
public function import($productID)
public function import($productID, $branch = 0)
{
if($_FILES)
{
@@ -958,7 +973,7 @@ class testcase extends control
$this->session->set('importFile', $fileName);
die(js::locate(inlink('showImport', "productID=$productID"), 'parent.parent'));
die(js::locate(inlink('showImport', "productID=$productID&branch=$branch"), 'parent.parent'));
}
$this->display();
}
@@ -1093,7 +1108,7 @@ class testcase extends control
if(empty($caseData))
{
echo js::alert($this->lang->error->noData);
die(js::locate($this->createLink('testcase', 'browse')));
die(js::locate($this->createLink('testcase', 'browse', "productID=$productID&branch=$branch")));
}
$this->view->title = $this->lang->testcase->common . $this->lang->colon . $this->lang->testcase->showImport;
@@ -1105,6 +1120,7 @@ class testcase extends control
$this->view->caseData = $caseData;
$this->view->stepData = $stepData;
$this->view->productID = $productID;
$this->view->branch = $branch;
$this->view->product = $this->products[$productID];
$this->display();
}
+26 -2
View File
@@ -8,10 +8,32 @@ var newRowID = 0;
*/
function loadAll(productID)
{
loadProductBranches(productID)
loadProductModules(productID);
setStories();
}
function loadBranch()
{
var branch = $('#branch').val();
if(typeof(branch) == 'undefined') branch = 0;
loadProductModules($('#product').val(), branch);
setStories();
}
function loadProductBranches(productID)
{
$('#branch').remove();
$.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID), function(data)
{
if(data)
{
$('#product').closest('.input-group').append(data);
$('#branch').css('width', '65px');
}
})
}
/**
* Load stories of module.
*
@@ -30,9 +52,11 @@ function loadModuleRelated()
* @access public
* @return void
*/
function loadProductModules(productID)
function loadProductModules(productID, branch)
{
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=case&rootModuleID=0&returnType=html&needManage=true');
if(typeof(branch) == 'undefined') branch = 0;
if(!branch) branch = 0;
link = createLink('tree', 'ajaxGetOptionMenu', 'productID=' + productID + '&viewtype=case&branch=' + branch + '&rootModuleID=0&returnType=html&needManage=true');
$('#moduleIdBox').load(link, function(){$(this).find('select').chosen(defaultChosenOptions)});
setStories();
}
+1
View File
@@ -11,6 +11,7 @@
*/
$lang->testcase->id = '用例编号';
$lang->testcase->product = "所属{$lang->productCommon}";
$lang->testcase->branch = "所属分支";
$lang->testcase->module = '所属模块';
$lang->testcase->story = '相关需求';
$lang->testcase->storyVersion = '需求版本';
+8 -6
View File
@@ -21,10 +21,10 @@ class testcaseModel extends model
* @access public
* @return void
*/
public function setMenu($products, $productID)
public function setMenu($products, $productID, $branch = 0)
{
$this->loadModel('product')->setMenu($products, $productID);
$selectHtml = $this->product->select($products, $productID, 'testcase', 'browse');
$this->loadModel('product')->setMenu($products, $productID, $branch);
$selectHtml = $this->product->select($products, $productID, 'testcase', 'browse', '', $branch);
foreach($this->lang->testcase->menu as $key => $menu)
{
$replace = ($key == 'product') ? $selectHtml : $productID;
@@ -86,13 +86,13 @@ class testcaseModel extends model
* @access public
* @return void
*/
function batchCreate($productID, $storyID)
function batchCreate($productID, $branch, $storyID)
{
$now = helper::now();
$cases = fixer::input('post')->get();
$batchNum = count(reset($cases));
$result = $this->loadModel('common')->removeDuplicate('case', $cases, "product=$productID");
$result = $this->loadModel('common')->removeDuplicate('case', $cases, "product=$productID&branch=$branch");
$cases = $result['data'];
for($i = 0; $i < $batchNum; $i++)
@@ -119,6 +119,7 @@ class testcaseModel extends model
{
$data[$i] = new stdclass();
$data[$i]->product = $productID;
$data[$i]->branch = $branch;
$data[$i]->module = $cases->module[$i];
$data[$i]->type = $cases->type[$i];
$data[$i]->story = $storyID ? $storyID : $cases->story[$i];
@@ -170,11 +171,12 @@ class testcaseModel extends model
* @access public
* @return array
*/
public function getModuleCases($productID, $moduleIds = 0, $orderBy = 'id_desc', $pager = null)
public function getModuleCases($productID, $branch = 0, $moduleIds = 0, $orderBy = 'id_desc', $pager = null)
{
return $this->dao->select('t1.*, t2.title as storyTitle')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id')
->where('t1.product')->eq((int)$productID)
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($moduleIds)->andWhere('t1.module')->in($moduleIds)->fi()
->andWhere('t1.deleted')->eq('0')
->orderBy($orderBy)->page($pager)->fetchAll('id');
+3 -3
View File
@@ -38,7 +38,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
<div class='main'>
<form id='batchForm' method='post'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed' id='caseList'>
<?php $vars = "productID=$productID&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<?php $vars = "productID=$productID&branch=$branch&browseType=$browseType&param=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}"; ?>
<thead>
<tr>
<th class='w-id'> <?php common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
@@ -82,7 +82,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
common::printIcon('testtask', 'runCase', "runID=0&caseID=$case->id&version=$case->version", '', 'list', 'play', '', 'runCase iframe');
common::printIcon('testtask', 'results', "runID=0&caseID=$case->id", '', 'list', 'flag-checkered', '', 'results iframe');
common::printIcon('testcase', 'edit', "caseID=$case->id", $case, 'list');
common::printIcon('testcase', 'create', "productID=$case->product&moduleID=$case->module&from=testcase&param=$case->id", $case, 'list', 'copy');
common::printIcon('testcase', 'create', "productID=$case->product&branch=$case->branch&moduleID=$case->module&from=testcase&param=$case->id", $case, 'list', 'copy');
if(common::hasPriv('testcase', 'delete'))
{
@@ -107,7 +107,7 @@ js::set('batchDelete', $lang->testcase->confirmBatchDelete);
</div>
<div class='btn-group dropup'>
<?php
$actionLink = $this->createLink('testcase', 'batchEdit', "productID=$productID");
$actionLink = $this->createLink('testcase', 'batchEdit', "productID=$productID&branch=$branch");
$misc = common::hasPriv('testcase', 'batchEdit') ? "onclick=\"setFormAction('$actionLink')\"" : "disabled='disabled'";
echo html::commonButton($lang->edit, $misc);
?>
+7 -6
View File
@@ -1,8 +1,9 @@
<?php if(!isset($branch)) $branch = 0;?>
<div id='featurebar'>
<ul class='nav'>
<?php
echo "<li id='allTab'>" . html::a($this->createLink('testcase', 'browse', "productid=$productID&browseType=all"), $lang->testcase->allCases) . "</li>";
echo "<li id='needconfirmTab'>" . html::a($this->createLink('testcase', 'browse', "productid=$productID&browseType=needconfirm"), $lang->testcase->needConfirm) . "</li>";
echo "<li id='allTab'>" . html::a($this->createLink('testcase', 'browse', "productid=$productID&branch=$branch&browseType=all"), $lang->testcase->allCases) . "</li>";
echo "<li id='needconfirmTab'>" . html::a($this->createLink('testcase', 'browse', "productid=$productID&branch=$branch&browseType=needconfirm"), $lang->testcase->needConfirm) . "</li>";
if(common::hasPriv('testcase', 'groupcase'))
{
@@ -16,7 +17,7 @@
{
if($key == '') continue;
echo '<li' . ($key == $groupBy ? " class='active'" : '') . '>';
echo html::a($this->createLink('testcase', 'groupCase', "productID=$productID&groupBy=$key"), $value);
echo html::a($this->createLink('testcase', 'groupCase', "productID=$productID&branch=$branch&groupBy=$key"), $value);
}
echo '</ul></li>';
}
@@ -45,11 +46,11 @@
</ul>
</div>
<?php
common::printIcon('testcase', 'import', "productID=$productID", '', 'button', '', '', 'export cboxElement iframe');
common::printIcon('testcase', 'import', "productID=$productID&branch=$branch", '', 'button', '', '', 'export cboxElement iframe');
$initModule = isset($moduleID) ? (int)$moduleID : 0;
common::printIcon('testcase', 'batchCreate', "productID=$productID&moduleID=$initModule");
common::printIcon('testcase', 'create', "productID=$productID&moduleID=$initModule");
common::printIcon('testcase', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$initModule");
common::printIcon('testcase', 'create', "productID=$productID&branch=$branch&moduleID=$initModule");
?>
</div>
</div>
+4 -1
View File
@@ -27,7 +27,10 @@
<tr>
<th class='w-80px'><?php echo $lang->testcase->lblProductAndModule;?></th>
<td class='w-p25-f'>
<?php echo html::select('product', $products, $productID, "onchange=loadAll(this.value); class='form-control chosen'");?>
<div class='input-group'>
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value);' class='form-control chosen'");?>
<?php if($this->session->currentProductType != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?>
</div>
</td>
<td class='w-p25-f' style='padding-left:15px'>
<div class='input-group' id='moduleIdBox'>
+7 -2
View File
@@ -15,7 +15,7 @@
<?php js::set('lblDelete', $lang->testcase->deleteStep);?>
<?php js::set('lblBefore', $lang->testcase->insertBefore);?>
<?php js::set('lblAfter', $lang->testcase->insertAfter);?>
<form method='post' enctype='multipart/form-data' target='hiddenwin' id='dataform'>
<form method='post' class='form-condensed' enctype='multipart/form-data' target='hiddenwin' id='dataform'>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['testcase']);?> <strong><?php echo $case->id;?></strong></span>
@@ -89,7 +89,12 @@
<table class='table table-form' cellpadding='0' cellspacing='0'>
<tr>
<th class='w-80px'><?php echo $lang->testcase->product;?></th>
<td><?php echo html::select('product', $products, $productID, "onchange=loadAll(this.value); class='form-control chosen'");?></td>
<td>
<div class='input-group'>
<?php echo html::select('product', $products, $productID, "onchange='loadAll(this.value)' class='form-control chosen'");?>
<?php if($this->session->currentProductType != 'normal') echo html::select('branch', $branches, $case->branch, "onchange='loadBranch();' class='form-control' style='width:65px'");?>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->testcase->module;?></th>
+6
View File
@@ -122,6 +122,12 @@
<th class='w-60px'><?php echo $lang->testcase->product;?></th>
<td><?php if(!common::printLink('testcase', 'browse', "productID=$case->product", $productName)) echo $productName;?></td>
</tr>
<?php if($product->type != 'normal'):?>
<tr>
<th><?php echo $lang->testcase->branch;?></th>
<td><?php if(!common::printLink('testcase', 'browse', "productID=$case->product&branch=$case->branch", $branchName)) echo $branchName;?></td>
</tr>
<?php endif;?>
<tr>
<th><?php echo $lang->testcase->module;?></th>
<td>
+2 -2
View File
@@ -35,13 +35,13 @@ $lang->testtask->wait = "待测版本";
$lang->testtask->done = "已测版本";
$lang->testtask->common = '测试视图版本';
$lang->testtask->id = '版本编号';
$lang->testtask->id = '编号';
$lang->testtask->product = '所属' . $lang->productCommon;
$lang->testtask->project = '所属' . $lang->projectCommon;
$lang->testtask->build = '版本';
$lang->testtask->owner = '负责人';
$lang->testtask->pri = '优先级';
$lang->testtask->name = '版本名称';
$lang->testtask->name = '名称';
$lang->testtask->begin = '开始日期';
$lang->testtask->end = '结束日期';
$lang->testtask->desc = '描述';
+1 -1
View File
@@ -62,7 +62,7 @@ a,a:focus,a:active {text-decoration: none; outline:none;}
.label-badge {padding: 2px 6px}
/* dropdown */
.dropdown-menu {min-width: 80px; padding: 4px 0}
.dropdown-menu {min-width: 80px; padding: 4px 0; z-index:2222;}
.dropdown-menu > li > a, .dropdown-header {font-size: 12px; padding: 5px 25px 5px 15px}
.dropdown-menu > .active > a, .dropdown-menu > .active > a:hover, .dropdown-menu > .active > a:active {background: #f1f1f1; font-weight: bold;}
.dropdown-menu > .active {position: relative;}