diff --git a/db/update18.0.beta1.sql b/db/update18.0.beta1.sql
new file mode 100644
index 0000000000..e7e4c35cbd
--- /dev/null
+++ b/db/update18.0.beta1.sql
@@ -0,0 +1 @@
+ALTER TABLE `zt_effort` ADD `extra` text COLLATE 'utf8_general_ci' NOT NULL AFTER `end`;
diff --git a/db/zentao.sql b/db/zentao.sql
index f6bc348d57..9fbac1cf39 100755
--- a/db/zentao.sql
+++ b/db/zentao.sql
@@ -6554,6 +6554,7 @@ ALTER TABLE `zt_effort` CHANGE `begin` `begin` smallint(4) unsigned zerofill NOT
ALTER TABLE `zt_effort` CHANGE `end` `end` smallint(4) unsigned zerofill NOT NULL AFTER `begin`;
ALTER TABLE `zt_effort` ADD `deleted` enum('0','1') NOT NULL DEFAULT '0' AFTER `end`;
ALTER TABLE `zt_effort` ADD `order` tinyint unsigned NOT NULL DEFAULT '0' AFTER `end`;
+ALTER TABLE `zt_effort` ADD `extra` text COLLATE 'utf8_general_ci' NULL AFTER `end`;
ALTER TABLE `zt_effort` ADD INDEX `execution` (`execution`);
ALTER TABLE `zt_effort` ADD INDEX `objectID` (`objectID`);
ALTER TABLE `zt_effort` ADD INDEX `date` (`date`);
@@ -7178,6 +7179,7 @@ CREATE TABLE IF NOT EXISTS `zt_ticket` (
key `product` (`product`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+-- DROP TABLE IF EXISTS `zt_ticketsource`;
CREATE TABLE IF NOT EXISTS `zt_ticketsource` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`ticketId` mediumint(8) unsigned NOT NULL,
@@ -7189,6 +7191,7 @@ CREATE TABLE IF NOT EXISTS `zt_ticketsource` (
key `ticketId` (`ticketId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+-- DROP TABLE IF EXISTS `zt_ticketrelation`;
CREATE TABLE IF NOT EXISTS `zt_ticketrelation` (
`id` mediumint unsigned NOT NULL AUTO_INCREMENT,
`ticketId` mediumint unsigned NOT NULL,
diff --git a/framework/base/control.class.php b/framework/base/control.class.php
index cc4853fe49..ab6415af38 100644
--- a/framework/base/control.class.php
+++ b/framework/base/control.class.php
@@ -600,7 +600,6 @@ class baseControl
if(!empty($jsExtPath))
{
- $realModulePath = realPath($modulePath);
foreach($jsExtPath as $jsPath)
{
if(empty($jsPath)) continue;
@@ -730,7 +729,7 @@ class baseControl
chdir(dirname($viewFile));
/**
- * 使用extract安定ob方法渲染$viewFile里面的代码。
+ * 使用extract和ob方法渲染$viewFile里面的代码。
* Use extract and ob functions to eval the codes in $viewFile.
*/
extract((array)$this->view);
diff --git a/framework/base/helper.class.php b/framework/base/helper.class.php
index 1089b8d145..acec227494 100644
--- a/framework/base/helper.class.php
+++ b/framework/base/helper.class.php
@@ -87,7 +87,7 @@ class baseHelper
/* 生成url链接的开始部分。Set the begin parts of the link. */
if($config->requestType == 'PATH_INFO') $link = $config->webRoot . $appName;
if($config->requestType != 'PATH_INFO') $link = $config->webRoot . $appName . basename($_SERVER['SCRIPT_NAME']);
- if($config->requestType == 'PATH_INFO2') $link .= '/';
+ if($config->requestType == 'PATH_INFO2') $link = '/';
/**
* #1: RequestType为GET。When the requestType is GET.
@@ -178,7 +178,7 @@ class baseHelper
* Check in only body mode or not.
*
* @access public
- * @return void
+ * @return bool
*/
public static function inOnlyBodyMode()
{
@@ -464,7 +464,7 @@ class baseHelper
$agent = $_SERVER["HTTP_USER_AGENT"];
- /* Chrome should checked before safari.*/
+ /* Chrome should check before safari.*/
if(strpos($agent, 'Firefox') !== false) $browser['name'] = "firefox";
if(strpos($agent, 'Opera') !== false) $browser['name'] = 'opera';
if(strpos($agent, 'Safari') !== false) $browser['name'] = 'safari';
@@ -853,7 +853,7 @@ function a($var)
* Judge the server ip is local or not.
*
* @access public
- * @return void
+ * @return bool
*/
function isLocalIP()
{
@@ -954,33 +954,42 @@ function htmlSpecialString($string, $flags = '', $encoding = 'UTF-8')
return htmlspecialchars($string, $flags, $encoding);
}
-if (!function_exists('array_column'))
+if(!function_exists('array_column'))
{
function array_column(array $input, $columnKey, $indexKey = null)
{
$output = array();
- foreach ($input as $row) {
- $key = $value = null;
+ foreach($input as $row)
+ {
+ $key = $value = null;
$keySet = $valueSet = false;
- if (null !== $indexKey && array_key_exists($indexKey, $row)) {
+ if(null !== $indexKey && array_key_exists($indexKey, $row))
+ {
$keySet = true;
- $key = (string) $row[$indexKey];
+ $key = (string) $row[$indexKey];
}
- if (null === $columnKey) {
+ if(null === $columnKey)
+ {
$valueSet = true;
- $value = $row;
- } elseif (\is_array($row) && \array_key_exists($columnKey, $row)) {
+ $value = $row;
+ }
+ elseif(\is_array($row) && \array_key_exists($columnKey, $row))
+ {
$valueSet = true;
- $value = $row[$columnKey];
+ $value = $row[$columnKey];
}
- if ($valueSet) {
- if ($keySet) {
+ if($valueSet)
+ {
+ if($keySet)
+ {
$output[$key] = $value;
- } else {
+ }
+ else
+ {
$output[] = $value;
}
}
diff --git a/framework/base/router.class.php b/framework/base/router.class.php
index de909ac83a..e1a87cf014 100644
--- a/framework/base/router.class.php
+++ b/framework/base/router.class.php
@@ -1719,7 +1719,7 @@ class baseRouter
}
/* 1. 如果extensionLevel == 2,且扩展文件存在,返回该站点扩展文件。 If extensionLevel == 2 and site extensionFile exists, return it. */
- if($this->config->framework->extensionLevel == 2 and !empty( $moduleExtPaths['site']))
+ if($this->config->framework->extensionLevel == 2 and !empty($moduleExtPaths['site']))
{
$this->extActionFile = $moduleExtPaths['site'] . $this->methodName . '.php';
if(file_exists($this->extActionFile)) return true;
@@ -1757,7 +1757,7 @@ class baseRouter
if(empty($moduleExtPaths)) return false;
/* 如果extensionLevel == 2,且扩展文件存在,返回该站点扩展文件。If extensionLevel == 2 and site extensionFile exists, return it. */
- if($this->config->framework->extensionLevel == 2 and !empty( $moduleExtPaths['site']))
+ if($this->config->framework->extensionLevel == 2 and !empty($moduleExtPaths['site']))
{
$locateFile = $moduleExtPaths['site'] . $this->methodName . '.302';
if(file_exists($locateFile)) $this->sendAPI($locateFile);
@@ -2497,9 +2497,8 @@ class baseRouter
*
* @param string $moduleName module name
* @param string $appName app name
- * @param bool $exitIfNone exit or not
* @access public
- * @return object|bool the config object or false.
+ * @return void
*/
public function loadModuleConfig($moduleName, $appName = '')
{
@@ -2525,7 +2524,7 @@ class baseRouter
if(!empty($extConfigPath['saas'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['saas'], '.php'));
if(!empty($extConfigPath['custom'])) $commonExtConfigFiles = array_merge($commonExtConfigFiles, helper::ls($extConfigPath['custom'], '.php'));
}
- if($config->framework->extensionLevel == 2 and !empty($extConfigPath['site'])) $siteExtConfigFiles = helper::ls($extConfigPath['site'], '.php');
+ if($config->framework->extensionLevel == 2 and !empty($extConfigPath['site'])) $siteExtConfigFiles = helper::ls($extConfigPath['site'], '.php');
$extConfigFiles = array_merge($commonExtConfigFiles, $siteExtConfigFiles);
/* 将主配置文件和扩展配置文件合并在一起。Put the main config file and extension config files together. */
@@ -2690,12 +2689,12 @@ class baseRouter
if($this->config->framework->extensionLevel >= 1)
{
if(!empty($extLangPath['common'])) $commonExtLangFiles = helper::ls($extLangPath['common'] . $this->clientLang, '.php');
- if(!empty($extLangPath['xuan'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['xuan'] . $this->clientLang, '.php'));
+ if(!empty($extLangPath['xuan'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['xuan'] . $this->clientLang, '.php'));
if(!empty($extLangPath['vision'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['vision'] . $this->clientLang, '.php'));
if(!empty($extLangPath['custom'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['custom'] . $this->clientLang, '.php'));
if(!empty($extLangPath['saas'])) $commonExtLangFiles = array_merge($commonExtLangFiles, helper::ls($extLangPath['saas'] . $this->clientLang, '.php'));
}
- if($this->config->framework->extensionLevel == 2 and !empty($extLangPath['site'])) $siteExtLangFiles = helper::ls($extLangPath['site'] . $this->clientLang, '.php');
+ if($this->config->framework->extensionLevel == 2 and !empty($extLangPath['site'])) $siteExtLangFiles = helper::ls($extLangPath['site'] . $this->clientLang, '.php');
$extLangFiles = array_merge($commonExtLangFiles, $siteExtLangFiles);
}
diff --git a/framework/router.class.php b/framework/router.class.php
index dac06b4ac9..9be28106e7 100755
--- a/framework/router.class.php
+++ b/framework/router.class.php
@@ -315,9 +315,8 @@ class router extends baseRouter
*
* @param string $moduleName module name
* @param string $appName app name
- * @param bool $exitIfNone exit or not
* @access public
- * @return object|bool the config object or false.
+ * @return void
*/
public function loadModuleConfig($moduleName, $appName = '')
{
diff --git a/module/action/config.php b/module/action/config.php
index 053d148d83..8dce374066 100755
--- a/module/action/config.php
+++ b/module/action/config.php
@@ -62,7 +62,7 @@ $config->action->majorList['project'] = array('opened', 'edited');
$config->action->majorList['execution'] = array('opened', 'edited');
$config->action->needGetProjectType = 'build,task,bug,case,testcase,caselib,testtask,testsuite,testreport,doc,issue,release,risk,design,opportunity,trainplan,gapanalysis,researchplan,researchreport,';
-$config->action->needGetRelateField = ',story,productplan,release,task,build,bug,testcase,case,testtask,testreport,doc,doclib,issue,risk,opportunity,trainplan,gapanalysis,team,whitelist,researchplan,researchreport,meeting,kanbanlane,kanbancolumn,module,';
+$config->action->needGetRelateField = ',story,productplan,release,task,build,bug,testcase,case,testtask,testreport,doc,doclib,issue,risk,opportunity,trainplan,gapanalysis,team,whitelist,researchplan,researchreport,meeting,kanbanlane,kanbancolumn,module,review,';
$config->action->noLinkModules = ',doclib,module,webhook,gitlab,gitea,gogs,sonarqube,pipeline,jenkins,kanban,kanbanspace,kanbancolumn,kanbanlane,kanbanregion,kanbancard,execution,project,traincategory,apistruct,program,product,user,entry,repo,';
$config->action->ignoreObjectType4Dynamic = 'kanbanregion,kanbanlane,kanbancolumn';
diff --git a/module/action/model.php b/module/action/model.php
index 17954cb970..7ee8ea4231 100755
--- a/module/action/model.php
+++ b/module/action/model.php
@@ -287,6 +287,15 @@ class actionModel extends model
if(strpos(',deleted,', ",$actionType,") !== false) $module = $this->dao->select('*')->from(TABLE_MODULE)->where('id')->eq($objectID)->fetch();
if(!empty($module) and $module->type == 'story') $record['product'] = $module->root;
break;
+ case 'review':
+ $result = $this->dao->select('*')->from($this->config->objectTables[$objectType])->where('id')->eq($objectID)->fetch();
+ if($result)
+ {
+ $products = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($result->project)->fetchPairs('product');
+ $record['product'] = join(',', array_keys($products));
+ $record['project'] = zget($result, 'project', 0);
+ }
+ break;
default:
$result = $this->dao->select('*')->from($this->config->objectTables[$objectType])->where('id')->eq($objectID)->fetch();
$record['product'] = zget($result, 'product', '0');
diff --git a/module/bug/control.php b/module/bug/control.php
index 438460af70..96ea49c4bf 100755
--- a/module/bug/control.php
+++ b/module/bug/control.php
@@ -488,7 +488,7 @@ class bug extends control
$steps = $this->lang->bug->tplStep . $this->lang->bug->tplResult . $this->lang->bug->tplExpect;
$os = '';
$browser = '';
- $assignedTo = '';
+ $assignedTo = isset($currentProduct->QD) ? $currentProduct->QD : '';
$deadline = '';
$mailto = '';
$keywords = '';
@@ -2504,9 +2504,9 @@ class bug extends control
/**
* Ajax get released builds.
- *
- * @param int $productID
- * @param int|string $branch
+ *
+ * @param int $productID
+ * @param int|string $branch
* @access public
* @return string
*/
diff --git a/module/build/control.php b/module/build/control.php
index bae863860c..562595c968 100644
--- a/module/build/control.php
+++ b/module/build/control.php
@@ -335,6 +335,7 @@ class build extends control
$this->view->type = $type;
$this->view->bugPager = $bugPager;
$this->view->branchName = $branchName;
+ $this->view->childBuilds = empty($build->builds) ? array() : $this->dao->select('id,name,bugs,stories')->from(TABLE_BUILD)->where('id')->in($build->builds)->fetchAll();
if($this->app->getViewType() == 'json')
{
diff --git a/module/build/css/view.css b/module/build/css/view.css
index 7c6550c08f..3f124385b5 100644
--- a/module/build/css/view.css
+++ b/module/build/css/view.css
@@ -1,7 +1,7 @@
.linkBox #queryBox .search-form .form-actions {padding-bottom: 5px;}
.linkBox .table-header {padding: 8px 15px; border-bottom: 1px solid #cbd0db;}
#unlinkStoryList, #unlinkBugList {border-top: 1px solid #cbd0db;}
-.page-title .dropdown-menu {top: 20px; left: 170px;}
+.page-title .dropdown-menu {top: 20px; left: 170px; max-height:300px; overflow:auto;}
.page-title .text>a {font-weight: 700;}
.body-modal #mainContent {min-height: 200px;}
diff --git a/module/build/model.php b/module/build/model.php
index 090beb297e..45d13f4296 100644
--- a/module/build/model.php
+++ b/module/build/model.php
@@ -661,8 +661,8 @@ class buildModel extends model
{
$build->allBugs = $build->bugs;
$build->allStories = $build->stories;
- $childBuilds = $this->dao->select('bugs, stories')->from(TABLE_BUILD)->where('id')->in($build->builds)->fetchAll();
+ $childBuilds = $this->dao->select('id,name,bugs,stories')->from(TABLE_BUILD)->where('id')->in($build->builds)->fetchAll();
foreach($childBuilds as $childBuild)
{
if($childBuild->bugs) $build->allBugs .= ",{$childBuild->bugs}";
@@ -720,7 +720,7 @@ class buildModel extends model
{
$executionID = $tab == 'execution' ? $extraParams['executionID'] : $build->execution;
$execution = $this->loadModel('execution')->getByID($executionID);
- $build->executionDeleted = $execution ? $execution->deleted : 0;
+ $build->executionDeleted = $execution ? $execution->deleted : 0;
$testtaskApp = (!empty($execution->type) and $execution->type == 'kanban') ? 'data-app="qa"' : "data-app='{$tab}'";
diff --git a/module/build/view/view.html.php b/module/build/view/view.html.php
index fe31522f6a..abdf3700b4 100644
--- a/module/build/view/view.html.php
+++ b/module/build/view/view.html.php
@@ -88,8 +88,11 @@ tbody tr td:first-child input {display: none;}
idAB);?>
-
pri;?>>priAB);?> |
+ pri;?>>priAB);?> |
story->title);?> |
+
+ build->common;?> |
+
openedByAB);?> |
story->estimateAB);?> |
statusAB);?> |
@@ -99,7 +102,21 @@ tbody tr td:first-child input {display: none;}
$story):?>
- stories,", ",$story->id,") !== false ? '' : "disabled";?>
+ stories,", ",$story->id,") !== false ? '' : "disabled";
+ $buildName = $build->name;
+ if($unlinkClass == 'disabled')
+ {
+ foreach($childBuilds as $childBuild)
+ {
+ if(strpos(",$childBuild->stories,", ",$story->id,") !== false)
+ {
+ $buildName = $childBuild->name;
+ break;
+ }
+ }
+ }
+ ?>
|
@@ -130,6 +147,9 @@ tbody tr td:first-child input {display: none;}
}
?>
|
+
+ |
+
openedBy);?> |
estimate . $config->hourUnit;?> |
@@ -190,6 +210,9 @@ tbody tr td:first-child input {display: none;}
| bug->title);?> |
bug->status);?> |
+
+ build->common?> |
+
openedByAB);?> |
bug->openedDateAB);?> |
bug->resolvedByAB);?> |
@@ -199,8 +222,22 @@ tbody tr td:first-child input {display: none;}
- createLink('bug', 'view', "bugID=$bug->id", '', true);?>
- bugs,", ",$bug->id,") !== false ? '' : "disabled";?>
+ createLink('bug', 'view', "bugID=$bug->id", '', true);?>
+ bugs,", ",$bug->id,") !== false ? '' : "disabled";
+ $buildName = $build->name;
+ if($unlinkClass == 'disabled')
+ {
+ foreach($childBuilds as $childBuild)
+ {
+ if(strpos(",$childBuild->bugs,", ",$bug->id,") !== false)
+ {
+ $buildName = $childBuild->name;
+ break;
+ }
+ }
+ }
+ ?>
|
@@ -216,6 +253,9 @@ tbody tr td:first-child input {display: none;}
processStatus('bug', $bug);?>
|
+
+ |
+
openedBy);?> |
openedDate) ? '' : substr($bug->openedDate, 5, 11);?> |
resolvedBy);?> |
@@ -261,6 +301,7 @@ tbody tr td:first-child input {display: none;}
bug->severity;?>>bug->severityAB);?> |
bug->title);?> |
bug->status);?> |
+ bug->openedBuild;?> |
openedByAB);?> |
bug->openedDateAB);?> |
bug->resolvedByAB);?> |
@@ -298,6 +339,11 @@ tbody tr td:first-child input {display: none;}
processStatus('bug', $bug);?>
+ openedBuild) as $buildID) $openedBuilds .= ($buildID == 'trunk' ? 'Trunk' : zget($buildPairs, $buildID, '')) . ' ';
+ ?>
+ |
openedBy);?> |
openedDate) ? '' : substr($bug->openedDate, 5, 11);?> |
resolvedBy);?> |
diff --git a/module/execution/model.php b/module/execution/model.php
index a272b7b283..b1ac471826 100755
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -1582,14 +1582,17 @@ class executionModel extends model
->andWhere('type')->eq('execution')
->fetchPairs();
}
+ $project = $this->loadModel('project')->getByID($projectID);
$executions = $this->dao->select('t1.*,t2.name projectName, t2.model as projectModel')->from(TABLE_EXECUTION)->alias('t1')
->leftJoin(TABLE_PROJECT)->alias('t2')->on('t1.project = t2.id')
- ->beginIF($productID)->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.id=t3.project')->fi()
+ ->leftJoin(TABLE_PROJECTPRODUCT)->alias('t3')->on('t1.id=t3.project')
+ ->beginIF($project->division)->leftJoin(TABLE_PRODUCT)->alias('t4')->on('t4.id=t3.product')->fi()
->where('t1.type')->in('sprint,stage,kanban')
->andWhere('t1.deleted')->eq('0')
->andWhere('t1.vision')->eq($this->config->vision)
->andWhere('t1.multiple')->eq('1')
+ ->beginIF($project->division)->andWhere('t4.deleted')->eq('0')->fi()
->beginIF(!$this->app->user->admin)->andWhere('t1.id')->in($this->app->user->view->sprints)->fi()
->beginIF(!empty($executionQuery))->andWhere($executionQuery)->fi()
->beginIF($productID)->andWhere('t3.product')->eq($productID)->fi()
diff --git a/module/productplan/config.php b/module/productplan/config.php
index 4dddb53677..bd16b51610 100644
--- a/module/productplan/config.php
+++ b/module/productplan/config.php
@@ -30,7 +30,7 @@ $config->productplan->search['fields']['end'] = $lang->productplan->end;
$config->productplan->search['params']['id'] = array('operator' => '=', 'control' => 'input', 'values' => '');
$config->productplan->search['params']['title'] = array('operator' => 'include', 'control' => 'input', 'values' => '');
-$config->productplan->search['params']['branch'] = array('operator' => '=', 'control' => 'select', 'values' => '');
+$config->productplan->search['params']['branch'] = array('operator' => 'include', 'control' => 'select', 'values' => '');
$config->productplan->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => array('' => '') + $lang->productplan->statusList);
$config->productplan->search['params']['begin'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
$config->productplan->search['params']['end'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date');
diff --git a/module/productplan/control.php b/module/productplan/control.php
index 91e31a77e2..3d34f90760 100644
--- a/module/productplan/control.php
+++ b/module/productplan/control.php
@@ -117,7 +117,7 @@ class productplan extends control
$this->view->branches = $branchPairs;
$this->view->defaultBranch = $defaultBranch;
$this->view->parent = $parent;
- $this->view->parentPlanPairs = $this->productplan->getTopPlanPairs($productID, '', 'done,closed');
+ $this->view->parentPlanPairs = $this->productplan->getTopPlanPairs($productID, 'done,closed');
$this->display();
}
@@ -151,11 +151,19 @@ class productplan extends control
$oldBranch = array($planID => $plan->branch);
/* Get the parent plan pair exclusion itself. */
- $parentPlanPairs = $this->productplan->getTopPlanPairs($plan->product, $plan->branch);
+ $parentPlanPairs = $this->productplan->getTopPlanPairs($plan->product);
unset($parentPlanPairs[$planID]);
$this->view->parentPlanPairs = $parentPlanPairs;
$this->commonAction($plan->product, $plan->branch);
+
+ if($plan->parent)
+ {
+ $parentPlan = $this->productplan->getByID($plan->parent);
+ $branchPairs = array();
+ foreach(explode(',', $parentPlan->branch) as $parentBranchID) $branchPairs[$parentBranchID] = $this->view->branchTagOption[$parentBranchID];
+ $this->view->branchTagOption = $branchPairs;
+ }
$this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->productplan->edit;
$this->view->position[] = $this->lang->productplan->edit;
$this->view->productID = $plan->product;
@@ -948,12 +956,17 @@ class productplan extends control
*/
public function ajaxGetConflict($planID, $newBranch)
{
- if($newBranch == '') return;
-
$plan = $this->productplan->getByID($planID);
$oldBranch = $plan->branch;
$planStories = $this->loadModel('story')->getPlanStories($planID, 'all');
$planBugs = $this->loadModel('bug')->getPlanBugs($planID, 'all');
+ $branchPairs = $this->loadModel('branch')->getPairs($plan->product);
+
+ $removeBranches = '';
+ foreach(explode(',', $oldBranch) as $oldBranchID)
+ {
+ if($oldBranchID and strpos(",$newBranch,", ",$oldBranchID,") === false) $removeBranches .= "{$branchPairs[$oldBranchID]},";
+ }
$conflictStoryCounts = 0;
$conflictBugCounts = 0;
@@ -972,15 +985,15 @@ class productplan extends control
if($conflictStoryCounts and $conflictBugCounts)
{
- printf($this->lang->productplan->confirmChangePlan, $conflictStoryCounts, $conflictBugCounts);
+ printf($this->lang->productplan->confirmChangePlan, trim($removeBranches, ','), $conflictStoryCounts, $conflictBugCounts);
}
elseif($conflictStoryCounts)
{
- printf($this->lang->productplan->confirmRemoveStory, $conflictStoryCounts);
+ printf($this->lang->productplan->confirmRemoveStory, trim($removeBranches, ','), $conflictStoryCounts);
}
elseif($conflictBugCounts)
{
- printf($this->lang->productplan->confirmRemoveBug, $conflictBugCounts);
+ printf($this->lang->productplan->confirmRemoveBug, trim($removeBranches, ','), $conflictBugCounts);
}
}
@@ -1000,19 +1013,28 @@ class productplan extends control
}
/**
- * AJAX: Get top plan.
+ * AJAX: Get parent branches.
*
* @param int $productID
- * @param int $branch
- * @param int $planID
+ * @param int $parentID
+ * @param string $currentBranches
* @access public
- * @return object
+ * @return void
*/
- public function ajaxGetTopPlan($productID, $branch = 0, $planID = 0)
+ public function ajaxGetParentBranches($productID = 0, $parentID = 0, $currentBranches = '')
{
- $parentPlanPairs = $this->productplan->getTopPlanPairs($productID, $branch);
- if(isset($parentPlanPairs[$planID])) unset($parentPlanPairs[$planID]);
- return print(html::select('parent', array(0 => '') + $parentPlanPairs, 0, 'class="form-control"'));
+ $branchPairs = $this->loadModel('branch')->getPairs($productID, 'active');
+ if(!empty($parentID))
+ {
+ $parentBranches = array();
+ $parentPlan = $this->productplan->getByID($parentID);
+ foreach(explode(',', $parentPlan->branch) as $parentBranchID)
+ {
+ $parentBranches[$parentBranchID] = $branchPairs[$parentBranchID];
+ if(!empty($currentBranches) and strpos(",$currentBranches,", ",$parentBranchID,") === false) $currentBranches = str_replace(",$parentBranchID,", ',', $currentBranches);
+ }
+ }
+ return print(html::select('branch[]', empty($parentID) ? $branchPairs : $parentBranches, trim($currentBranches, ','), "class='form-control chosen' multiple required"));
}
/**
diff --git a/module/productplan/js/create.js b/module/productplan/js/create.js
index 4c4be3f040..dc43f76277 100644
--- a/module/productplan/js/create.js
+++ b/module/productplan/js/create.js
@@ -63,7 +63,20 @@ $('#future').on('change', function()
}
});
-$('#branch').change(function()
+$('#parent').change(function()
+{
+ var parentID = $(this).val();
+ var currentBranches = $('#branch').val() ? $('#branch').val().toString() : '';
+ $.post(createLink('productplan', 'ajaxGetParentBranches', "productID=" + productID + "&parentID=" + parentID + "¤tBranches=" + currentBranches), function(data)
+ {
+ $('#branch').replaceWith(data);
+ $('#branch_chosen').remove();
+ $('#branch').chosen();
+ $('#branch').change();
+ })
+})
+
+$('#dataform').on('change', '#branch', function()
{
if(parentPlanID) return;
@@ -72,21 +85,12 @@ $('#branch').change(function()
var branchIdList = branchIdList.toString();
var lastPlanLink = createLink('productplan', 'ajaxGetLast', "productID=" + productID + "&branch=" + branchIdList);
- var topPlanLink = createLink('productplan', 'ajaxGetTopPlan', "productID=" + productID + "&branch=" + branchIdList);
-
$.post(lastPlanLink, function(data)
{
data = JSON.parse(data);
var planTitle = data ? '(' + lastLang + ': ' + data.title + ')' : '';
$('#title').parent().next('td').html(planTitle);
})
-
- $.post(topPlanLink, function(data)
- {
- $('#parent').replaceWith(data);
- $('#parent_chosen').remove();
- $('#parent').chosen();
- })
});
$('#submit').click(function()
diff --git a/module/productplan/js/edit.js b/module/productplan/js/edit.js
index 402f42c589..9d3733f176 100644
--- a/module/productplan/js/edit.js
+++ b/module/productplan/js/edit.js
@@ -13,14 +13,7 @@ function convertStringToDate(dateString)
return Date.parse(dateString);
}
-/**
- * Get conflict stories.
- *
- * @param int $planID
- * @access public
- * @return void
- */
-function getConflictStories(planID)
+$('#dataform').on('change', '#branch', function()
{
var newBranch = $('#branch').val() ? $('#branch').val().toString() : '';
$.get(createLink('productplan', 'ajaxGetConflict', 'planID=' + planID + '&newBranch=' + newBranch), function(conflictStories)
@@ -30,21 +23,12 @@ function getConflictStories(planID)
var result = confirm(conflictStories) ? true : false;
if(!result)
{
- newBranch = oldBranch[planID];
$('#branch').val(oldBranch[planID].split(','));
$('#branch').trigger("chosen:updated");
}
}
-
- var link = createLink('productplan', 'ajaxGetTopPlan', "productID=" + productID + "&branch=" + newBranch + "&planID=" + planID);
- $.post(link, function(data)
- {
- $('#parent').replaceWith(data);
- $('#parent_chosen').remove();
- $('#parent').chosen();
- })
});
-}
+});
/**
* Compute the end date for productplan.
@@ -72,6 +56,18 @@ function computeEndDate(delta)
$('#end').val(endDate).datetimepicker('update');
}
+$('#parent').change(function()
+{
+ var parentID = $(this).val();
+ var currentBranches = $('#branch').val() ? $('#branch').val().toString() : '';
+ $.post(createLink('productplan', 'ajaxGetParentBranches', "productID=" + productID + "&parentID=" + parentID + "¤tBranches=" + currentBranches), function(data)
+ {
+ $('#branch').replaceWith(data);
+ $('#branch_chosen').remove();
+ $('#branch').chosen();
+ })
+})
+
$('#future').on('change', function()
{
if($(this).prop('checked'))
diff --git a/module/productplan/lang/de.php b/module/productplan/lang/de.php
index c402dd43ff..ac56c0aeec 100644
--- a/module/productplan/lang/de.php
+++ b/module/productplan/lang/de.php
@@ -75,9 +75,9 @@ $lang->productplan->projectNotEmpty = 'Project cannot be empty.';
$lang->productplan->nextStep = "Next step";
$lang->productplan->summary = "Total: %s, Parents: %s, Children: %s,Independent: %s.";
$lang->productplan->checkedSummary = "Seleted: %total%, Parents: %parent%, Children: %child%, Independent: %independent%.";
-$lang->productplan->confirmChangePlan = "After the branch is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
-$lang->productplan->confirmRemoveStory = "After the branch is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?";
-$lang->productplan->confirmRemoveBug = "After the branch is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
+$lang->productplan->confirmChangePlan = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
+$lang->productplan->confirmRemoveStory = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?";
+$lang->productplan->confirmRemoveBug = "After the branch of『%s』is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
$lang->productplan->id = 'ID';
$lang->productplan->product = $lang->productCommon;
@@ -139,7 +139,7 @@ $lang->productplan->beginGreaterChildTip = "The start date of the parent plan[%s
$lang->productplan->endLetterChildTip = "The completion date of the parent plan[%s]: %s, cannot be less than the completion date of the child plan: %s.";
$lang->productplan->beginLetterParentTip = "The start date of the child plan[%s]: %s, cannot be less than the start date of the parent plan: %s.";
$lang->productplan->endGreaterParentTip = "The completion date of the child plan[%s]: %s, cannot be greater than the completion date of the parent plan: %s.";
-$lang->productplan->diffBranchesTip = "The @branch@ %s of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?";
+$lang->productplan->diffBranchesTip = "The @branch@『%s』 of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?";
$lang->productplan->featureBar['browse']['all'] = 'Alle';
$lang->productplan->featureBar['browse']['undone'] = 'Undone';
diff --git a/module/productplan/lang/en.php b/module/productplan/lang/en.php
index 3306bc5bdb..49a6bf5bd1 100644
--- a/module/productplan/lang/en.php
+++ b/module/productplan/lang/en.php
@@ -75,9 +75,9 @@ $lang->productplan->projectNotEmpty = 'Project cannot be empty.';
$lang->productplan->nextStep = "Next step";
$lang->productplan->summary = "Total: %s, Parents: %s, Children: %s,Independent: %s.";
$lang->productplan->checkedSummary = "Seleted: %total%, Parents: %parent%, Children: %child%, Independent: %independent%.";
-$lang->productplan->confirmChangePlan = "After the branch is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
-$lang->productplan->confirmRemoveStory = "After the branch is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?";
-$lang->productplan->confirmRemoveBug = "After the branch is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
+$lang->productplan->confirmChangePlan = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
+$lang->productplan->confirmRemoveStory = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?";
+$lang->productplan->confirmRemoveBug = "After the branch of『%s』is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
$lang->productplan->id = 'ID';
$lang->productplan->product = $lang->productCommon;
@@ -139,7 +139,7 @@ $lang->productplan->beginGreaterChildTip = "The start date of the parent plan[%s
$lang->productplan->endLetterChildTip = "The completion date of the parent plan[%s]: %s, cannot be less than the completion date of the child plan: %s.";
$lang->productplan->beginLetterParentTip = "The start date of the child plan[%s]: %s, cannot be less than the start date of the parent plan: %s.";
$lang->productplan->endGreaterParentTip = "The completion date of the child plan[%s]: %s, cannot be greater than the completion date of the parent plan: %s.";
-$lang->productplan->diffBranchesTip = "The @branch@ %s of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?";
+$lang->productplan->diffBranchesTip = "The @branch@『%s』of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?";
$lang->productplan->featureBar['browse']['all'] = 'All';
$lang->productplan->featureBar['browse']['undone'] = 'Undone';
diff --git a/module/productplan/lang/fr.php b/module/productplan/lang/fr.php
index 46bfcaf196..5fd88247f3 100644
--- a/module/productplan/lang/fr.php
+++ b/module/productplan/lang/fr.php
@@ -75,9 +75,9 @@ $lang->productplan->projectNotEmpty = 'Project cannot be empty.';
$lang->productplan->nextStep = "Next step";
$lang->productplan->summary = "Total: %s, Parents: %s, Children: %s,Independent: %s.";
$lang->productplan->checkedSummary = "Seleted: %total%, Parents: %parent%, Children: %child%, Independent: %independent%.";
-$lang->productplan->confirmChangePlan = "After the branch is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
-$lang->productplan->confirmRemoveStory = "After the branch is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?";
-$lang->productplan->confirmRemoveBug = "After the branch is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
+$lang->productplan->confirmChangePlan = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} and %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
+$lang->productplan->confirmRemoveStory = "After the branch of『%s』is unlinked, %s {$lang->SRCommon} under the branch will be removed from the plan at the same time, so still want to unassociate?";
+$lang->productplan->confirmRemoveBug = "After the branch of『%s』is unlinked, %s bugs under the branch will be removed from the plan at the same time, so still want to unassociate?";
$lang->productplan->id = 'ID';
$lang->productplan->product = $lang->productCommon;
@@ -139,7 +139,7 @@ $lang->productplan->beginGreaterChildTip = "The start date of the parent plan[%s
$lang->productplan->endLetterChildTip = "The completion date of the parent plan[%s]: %s, cannot be less than the completion date of the child plan: %s.";
$lang->productplan->beginLetterParentTip = "The start date of the child plan[%s]: %s, cannot be less than the start date of the parent plan: %s.";
$lang->productplan->endGreaterParentTip = "The completion date of the child plan[%s]: %s, cannot be greater than the completion date of the parent plan: %s.";
-$lang->productplan->diffBranchesTip = "The @branch@ %s of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?";
+$lang->productplan->diffBranchesTip = "The @branch@『%s』of parent plan is not linked with the child plan. @branch@'s stories and bugs whill be removed from the plan. Do you want to save?";
$lang->productplan->featureBar['browse']['all'] = 'Tous';
$lang->productplan->featureBar['browse']['undone'] = 'Undone';
diff --git a/module/productplan/lang/zh-cn.php b/module/productplan/lang/zh-cn.php
index b1765303ea..f756060d8e 100644
--- a/module/productplan/lang/zh-cn.php
+++ b/module/productplan/lang/zh-cn.php
@@ -75,9 +75,9 @@ $lang->productplan->projectNotEmpty = '所属项目不能为空。';
$lang->productplan->nextStep = "下一步";
$lang->productplan->summary = "本页共 %s 个计划,父计划 %s,子计划 %s,独立计划 %s。";
$lang->productplan->checkedSummary = "共选中 %total% 个计划,父计划 %parent%,子计划 %child%,独立计划 %independent%。";
-$lang->productplan->confirmChangePlan = "分支解除关联后,分支下的%s个{$lang->SRCommon}和%s个Bug将同步从计划中移除,是否解除?";
-$lang->productplan->confirmRemoveStory = "分支解除关联后,分支下的%s个{$lang->SRCommon}将同步从计划中移除,是否解除?";
-$lang->productplan->confirmRemoveBug = "分支解除关联后,分支下的%s个Bug将同步从计划中移除,是否解除?";
+$lang->productplan->confirmChangePlan = "分支『%s』解除关联后,分支下的%s个{$lang->SRCommon}和%s个Bug将同步从计划中移除,是否解除?";
+$lang->productplan->confirmRemoveStory = "分支『%s』解除关联后,分支下的%s个{$lang->SRCommon}将同步从计划中移除,是否解除?";
+$lang->productplan->confirmRemoveBug = "分支『%s』解除关联后,分支下的%s个Bug将同步从计划中移除,是否解除?";
$lang->productplan->id = '编号';
$lang->productplan->product = $lang->productCommon;
@@ -139,7 +139,7 @@ $lang->productplan->beginGreaterChildTip = "父计划[%s]的开始日期:%s,
$lang->productplan->endLetterChildTip = "父计划[%s]的完成日期:%s,不能小于子计划的完成日期: %s";
$lang->productplan->beginLetterParentTip = "子计划[%s]的开始日期:%s,不能小于父计划的开始日期: %s";
$lang->productplan->endGreaterParentTip = "子计划[%s]的完成日期:%s,不能大于父计划的完成日期: %s";
-$lang->productplan->diffBranchesTip = "父计划的@branch@ %s 未被子计划关联,对应@branch@的需求和bug将自动从计划中移除,是否保存?";
+$lang->productplan->diffBranchesTip = "父计划的@branch@『%s』未被子计划关联,对应@branch@的需求和bug将自动从计划中移除,是否保存?";
$lang->productplan->featureBar['browse']['all'] = '全部';
$lang->productplan->featureBar['browse']['undone'] = '未完成';
diff --git a/module/productplan/model.php b/module/productplan/model.php
index 7f1273fb81..74d0f09a85 100644
--- a/module/productplan/model.php
+++ b/module/productplan/model.php
@@ -222,29 +222,14 @@ class productplanModel extends model
* Get top plan pairs.
*
* @param int $productID
- * @param int $branch
* @param int $exclude
* @access public
* @return array
*/
- public function getTopPlanPairs($productID, $branch = '', $exclude = '')
+ public function getTopPlanPairs($productID, $exclude = '')
{
- $branchQuery = '';
- if($branch !== '')
- {
- $branchQuery .= '(';
- $branchCount = count(explode(',', $branch));
- foreach(explode(',', $branch) as $index => $branchID)
- {
- $branchQuery .= "CONCAT(',', branch, ',') LIKE '%,$branchID,%'";
- if($index < $branchCount - 1) $branchQuery .= ' AND ';
- }
- $branchQuery .= ')';
- }
-
$planPairs = $this->dao->select("id,title")->from(TABLE_PRODUCTPLAN)
->where('product')->eq($productID)
- ->beginIF($branch !== '' and !empty($branchQuery))->andWhere($branchQuery)->fi()
->andWhere('parent')->le(0)
->andWhere('deleted')->eq(0)
->beginIF($exclude)->andWhere('status')->notin($exclude)
diff --git a/module/productplan/view/create.html.php b/module/productplan/view/create.html.php
index 01a0a00b82..c0534d69fc 100644
--- a/module/productplan/view/create.html.php
+++ b/module/productplan/view/create.html.php
@@ -37,6 +37,12 @@
name;?> | | |
+
+
+ | productplan->parent;?> |
+ '') + $parentPlanPairs, 0, "class='form-control chosen'");?>
+ |
+
type != 'normal'):?>
| product->branch;?> |
@@ -57,12 +63,6 @@
|
productplan->last . ': ' . $lastPlan->title . ')';?> |
-
-
- | productplan->parent;?> |
- '') + $parentPlanPairs, 0, "class='form-control chosen'");?>
- |
-
| productplan->begin;?> |
|
diff --git a/module/productplan/view/edit.html.php b/module/productplan/view/edit.html.php
index 469eb90018..cf8f677dc1 100644
--- a/module/productplan/view/edit.html.php
+++ b/module/productplan/view/edit.html.php
@@ -17,6 +17,7 @@
+id);?>
@@ -30,17 +31,7 @@
productplan->product;?> |
name;?> | | |
- type != 'normal' and $plan->parent != '-1'):?>
-
- | product->branch;?> |
- branch, "onchange='getConflictStories($plan->id);' class='form-control chosen' multiple");?> | | |
-
-
-
- | productplan->title;?> |
- title, "class='form-control' required");?> | | |
-
parent == '-1'):?>
parent);?>
@@ -49,6 +40,16 @@
'') + $parentPlanPairs, $plan->parent, "class='form-control chosen'");?>
+ shadow and $product->type != 'normal' and $plan->parent != '-1'):?>
+ |
+ | product->branch;?> |
+ branch, "class='form-control chosen' multiple");?> | | |
+
+
+
+ | productplan->title;?> |
+ title, "class='form-control' required");?> | | |
+
| productplan->status;?> |
parent == -1 ? "disabled='disabled'" : '' ;?>
diff --git a/module/project/control.php b/module/project/control.php
index 653339f752..76f901238a 100755
--- a/module/project/control.php
+++ b/module/project/control.php
@@ -1278,6 +1278,7 @@ class project extends control
$this->view->branchOption = $branchOption;
$this->view->branchTagOption = $branchTagOption;
$this->view->executions = $executions;
+ $this->view->plans = $this->loadModel('productplan')->getPairs($productID ? $productID : array_keys($products));
$this->view->stories = $storyList;
$this->view->tasks = $taskList;
$this->view->projectPairs = $this->project->getPairsByProgram();
diff --git a/module/project/js/create.js b/module/project/js/create.js
index 1d1cdb8c1e..92e09db510 100644
--- a/module/project/js/create.js
+++ b/module/project/js/create.js
@@ -162,17 +162,16 @@ function setParentProgram(parentProgram)
var productSelectHtml = data.allProducts;
var planSelectHtml = data.plans;
- $('.productsBox .row .col-sm-4 .input-group').each(function(index)
+ $('.productsBox .row .col-sm-6 .input-group').each(function(index)
{
var selectedProduct = $(this).find('[name^=products]').val();
var selectedBranch = $(this).find('[name^=branch]').val();
var selectedPlan = $('#plan' + index ).find('[name^=plans]').val();
- $(this).html(productSelectHtml);
+ $(this).find('[name^=products]').html(productSelectHtml);
$(this).find('[name^=products]').attr('name', 'products[' + index + ']').attr('id', 'products' + index).attr('data-branch', selectedBranch).attr('data-plan', selectedPlan);
$(this).find('[name^=products]').val(selectedProduct).chosen().change();
});
- $('.productsBox .row .col-sm-4:last').find('.input-group').append($('.productsBox .addProduct .input-group:first .input-group-addon').prop('outerHTML'));
}
if(parentProgram != 0)
@@ -245,7 +244,7 @@ function addNewProduct(obj)
$('.newLine').removeClass('hidden');
$('.productsBox .row').removeClass('hidden');
$('.productsBox .row .input-group').find('select').removeAttr('disabled').trigger("chosen:updated");
- if($('#plansBox .col-sm-4').find('select').length > 1) $('.division').removeClass('hide');
+ if($('.productsBox').find("select[name^=products]").length > 1) $('.division').removeClass('hide');
/* Hide the input box for creating a product. */
$(obj).closest('td').attr('colspan', 3);
diff --git a/module/project/js/edit.js b/module/project/js/edit.js
index e676a6a499..d9abb1e438 100644
--- a/module/project/js/edit.js
+++ b/module/project/js/edit.js
@@ -18,13 +18,13 @@ $(function()
var productSelectHtml = data.allProducts;
var planSelectHtml = data.plans;
- $('#productsBox .row .col-sm-4 .input-group').each(function(index)
+ $('.productsBox .row .col-sm-6 .input-group').each(function(index)
{
var selectedProduct = $(this).find('[name^=products]').val();
var selectedBranch = $(this).find('[name^=branch]').val();
var selectedPlan = $('#plan' + index ).find('[name^=plans]').val();
- $(this).html(productSelectHtml);
+ $(this).find('[name^=products]').html(productSelectHtml);
$(this).find('[name^=products]').attr('name', 'products[' + index + ']').attr('id', 'products' + index).attr('data-branch', selectedBranch).attr('data-plan', selectedPlan);
$(this).find('[name^=products]').val(selectedProduct).chosen().change();
});
diff --git a/module/project/model.php b/module/project/model.php
index b2ab359b66..21467dd1af 100644
--- a/module/project/model.php
+++ b/module/project/model.php
@@ -1583,7 +1583,7 @@ class projectModel extends model
->exec();
if(dao::isError()) return false;
- if(!$oldProject->hasProduct && $oldProject->name != $project->name) $this->updateProductName($project->name, $projectID);
+ if(!$oldProject->hasProduct and ($oldProject->name != $project->name or $oldProject->parent != $project->parent)) $this->updateShadowProduct($project);
/* Get team and language item. */
$this->loadModel('user');
@@ -1744,7 +1744,7 @@ class projectModel extends model
if(!dao::isError())
{
- if(!$oldProject->hasProduct && $oldProject->name != $project->name) $this->updateProductName($project->name, $projectID);
+ if(!$oldProject->hasProduct and ($oldProject->name != $project->name or $oldProject->parent != $project->parent)) $this->updateShadowProduct($project);
if(isset($project->parent))
{
@@ -2038,17 +2038,18 @@ class projectModel extends model
}
/**
- * Update a product's name as its project.
+ * Update shadow product for its project.
*
- * @param string $projectName
- * @param int $projectID
+ * @param object $project
* @access public
* @return bool
*/
- public function updateProductName($projectName, $projectID)
+ public function updateShadowProduct($project)
{
- $product = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetch('product');
- $this->dao->update(TABLE_PRODUCT)->set('name')->eq($projectName)->where('id')->eq($product)->exec();
+ $product = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($project->id)->fetch('product');
+ $topProgram = !empty($project->parent) ? $this->loadModel('program')->getTopByID($project->parent) : 0;
+ $this->dao->update(TABLE_PRODUCT)->set('name')->eq($project->name)->set('program')->eq($topProgram)->where('id')->eq($product)->exec();
+
return !dao::isError();
}
diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php
index 67c4814aeb..124480f679 100644
--- a/module/project/view/build.html.php
+++ b/module/project/view/build.html.php
@@ -48,7 +48,7 @@
| build->id;?> |
- build->name;?> |
+ build->name;?> |
hasProduct):?>
build->product;?> |
@@ -56,8 +56,8 @@
executionCommon;?> |
build->url;?> |
- build->date;?> |
- build->builder;?> |
+ build->date;?> |
+ build->builder;?> |
actions;?> |
diff --git a/module/projectrelease/control.php b/module/projectrelease/control.php
index c1f353dd97..e69975257a 100644
--- a/module/projectrelease/control.php
+++ b/module/projectrelease/control.php
@@ -804,13 +804,12 @@ class projectrelease extends control
*
* @param int $projectID
* @param int $productID
- * @param int $branch
* @access public
* @return void
*/
- public function ajaxLoadBuilds($projectID, $productID, $branch = 0)
+ public function ajaxLoadBuilds($projectID, $productID)
{
- $builds = $this->loadModel('build')->getBuildPairs($productID, $branch, 'notrunk,withbranch,hasproject', $projectID, 'project', '', false);
+ $builds = $this->loadModel('build')->getBuildPairs($productID, 'all', 'notrunk,withbranch,hasproject', $projectID, 'project', '', false);
$releasedBuilds = $this->projectrelease->getReleasedBuilds($projectID);
foreach($releasedBuilds as $build) unset($builds[$build]);
diff --git a/module/projectrelease/js/create.js b/module/projectrelease/js/create.js
index 1cd106dcdb..21925ba77f 100644
--- a/module/projectrelease/js/create.js
+++ b/module/projectrelease/js/create.js
@@ -7,36 +7,8 @@
function loadBuilds()
{
var productID = $('#product').val();
- var branch = $('#branch').length == 0 ? 0 : $('#branch').val();
- $('#buildBox').load(createLink('projectrelease', 'ajaxLoadBuilds', "projectID=" + projectID + "&productID=" + productID + "&branch=" + branch), function()
+ $('#buildBox').load(createLink('projectrelease', 'ajaxLoadBuilds', "projectID=" + projectID + "&productID=" + productID), function()
{
$('#build').attr('data-placeholder', multipleSelect).chosen();
});
}
-
-/**
- * Flush the branch when switching products.
- *
- * @param int $productID
- * @access public
- * @return void
- */
-function loadBranches(productID)
-{
- $('#branch').remove();
- $('#branch_chosen').remove();
- $.get(createLink('branch', 'ajaxGetBranches', "productID=" + productID + '&oldBranch=0¶ms=active&projectID=' + projectID), function(data)
- {
- var $product = $('#product');
- var $inputGroup = $product.closest('.input-group');
- $inputGroup.find('.input-group-addon').toggleClass('hidden', !data);
- if(data)
- {
- $inputGroup.append(data);
- $inputGroup.find('#branch').attr('onchange', 'loadBuilds()');
- $('#branch').css('width', '120px').chosen();
- }
- loadBuilds();
- $inputGroup.fixInputGroup();
- })
-}
diff --git a/module/projectrelease/view/create.html.php b/module/projectrelease/view/create.html.php
index 7de52be52c..a06d0bb92d 100644
--- a/module/projectrelease/view/create.html.php
+++ b/module/projectrelease/view/create.html.php
@@ -39,12 +39,7 @@
| release->product;?> |
-
-
- id, "onchange='loadBranches(this.value)' class='form-control chosen'");?>
- type != 'normal') echo html::select('branch', $branches, $branch, "onchange='loadBuilds()' class='form-control chosen control-branch'");?>
-
- |
+ id, "onchange='loadBuilds()' class='form-control chosen'");?> |
|
diff --git a/module/transfer/config.php b/module/transfer/config.php
index 35deafb6c1..c53f3b1d84 100644
--- a/module/transfer/config.php
+++ b/module/transfer/config.php
@@ -18,6 +18,7 @@ $config->transfer->listFields = '';
$config->transfer->sysLangFields = ',pri,status,type,mode,severity,os,browser,resolution,confirmed,source,reviewResult,stage,change,category';
$config->transfer->sysDataFields = 'execution,product,user';
$config->transfer->userFields = 'assignedTo,openedBy,finishedBy,canceledBy,closedBy,lastEditedBy,lastRunner,resolvedBy,reviewedBy,mailto';
+$config->transfer->textareaFields = 'spec,desc';
$config->transfer->defaultZeroField = 'severity,pri';
$config->transfer->defaultEmptyField = '';
diff --git a/module/transfer/control.php b/module/transfer/control.php
index b9b7851107..65d13bbc52 100755
--- a/module/transfer/control.php
+++ b/module/transfer/control.php
@@ -163,13 +163,17 @@ class transfer extends control
if($product->type == 'normal') unset($fields['branch']);
if($this->session->storyType == 'requirement') unset($fields['plan']);
}
-
if($model == 'bug')
{
$product = $this->loadModel('product')->getByID($this->session->bugTransferParams['productID']);
if($product->type == 'normal') unset($fields['branch']);
if($product->shadow and ($this->app->tab == 'execution' or $this->app->tab == 'project')) unset($fields['product']);
}
+ if($model == 'testcase')
+ {
+ $product = $this->loadModel('product')->getByID($this->session->testcaseTransferParams['productID']);
+ if($product->type == 'normal') unset($fields['branch']);
+ }
if($model == 'task') $datas = $this->task->processDatas4Task($datas);
$html = $this->transfer->buildNextList($datas->datas, $lastID, $fields, $pagerID, $model);
die($html);
diff --git a/module/transfer/model.php b/module/transfer/model.php
index 1cee8c3173..0721b4d5af 100644
--- a/module/transfer/model.php
+++ b/module/transfer/model.php
@@ -1473,6 +1473,7 @@ class transferModel extends model
}
$html .= '';
}
+ elseif(strpos($this->transferConfig->textareaFields, $field) !== false) $html .= '' . html::textarea("$name", $selected, "class='form-control' style='overflow:hidden;'") . ' | ';
else $html .= '' . html::input("$name", $selected, "class='form-control autocomplete='off'") . ' | ';
}
diff --git a/www/js/my.full.js b/www/js/my.full.js
index 24a60642db..ca19375a73 100644
--- a/www/js/my.full.js
+++ b/www/js/my.full.js
@@ -1203,7 +1203,7 @@ function showCheckedFields(fields)
else if(!$fieldBox.hasClass('hidden'))
{
$fieldBox.addClass('hidden');
- $field.attr('disabled', true);
+ if($(this).val() != 'branch') $field.attr('disabled', true);
}
if(config.currentModule == 'story' && $(this).val() == 'source')