diff --git a/lib/sendcloud/sendcloud.class.php b/lib/sendcloud/sendcloud.class.php index b4656fbb59..d3df928fc1 100644 --- a/lib/sendcloud/sendcloud.class.php +++ b/lib/sendcloud/sendcloud.class.php @@ -8,13 +8,10 @@ class sendcloud public $secretKey = ''; public $from = ''; public $fromname = ''; - public $to = ''; - public $cc = ''; public $subject = ''; public $content = ''; public $files = ''; public $headers = ''; - public $replyto = ''; public $Subject = ''; //Compatible phpmailer. public $nickNames = ''; @@ -219,9 +216,7 @@ class sendcloud */ public function clearAllRecipients() { - $this->to = ''; - $this->cc = ''; - $this->replyto = ''; + $this->nickNames = ''; } /** diff --git a/module/bug/js/common.js b/module/bug/js/common.js index b990c79fdb..927d38cd0e 100644 --- a/module/bug/js/common.js +++ b/module/bug/js/common.js @@ -377,7 +377,9 @@ function notice() var html = ''; if($('#project').val() == '') { - html += '' + createRelease + ' '; + branch = $('#branch').val(); + if(typeof(branch) == 'undefined') branch = 0; + html += '' + createRelease + ' '; html += '' + refresh + ''; } else diff --git a/module/build/control.php b/module/build/control.php index fb75b30d16..ffb4c66a4a 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -285,7 +285,7 @@ class build extends control public function ajaxGetBranchBuilds($productID, $branchID, $operation, $build = '') { $builds = $this->build->getProductBuildPairs($productID, $branchID); - $releasedBuilds = $this->loadModel('release')->getReleaseBuilds($productID); + $releasedBuilds = $this->loadModel('release')->getReleaseBuilds($productID, $branchID); if($operation == 'editRelease') { diff --git a/module/product/control.php b/module/product/control.php index 933b1e0d10..eee917f75f 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -420,9 +420,9 @@ class product extends control * @access public * @return void */ - public function roadmap($productID) + public function roadmap($productID, $branch = 0) { - $this->product->setMenu($this->products, $productID); + $this->product->setMenu($this->products, $productID, $branch); $this->session->set('releaseList', $this->app->getURI(true)); $this->session->set('productPlanList', $this->app->getURI(true)); @@ -432,7 +432,8 @@ class product extends control $this->view->position[] = html::a($this->createLink($this->moduleName, 'browse'), $product->name); $this->view->position[] = $this->lang->product->roadmap; $this->view->product = $product; - $this->view->roadmaps = $this->product->getRoadmap($productID); + $this->view->roadmaps = $this->product->getRoadmap($productID, $branch); + $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($productID); $this->display(); } diff --git a/module/product/model.php b/module/product/model.php index ea331a96be..ede626aed9 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -378,23 +378,23 @@ class productModel extends model * @access public * @return array */ - public function getRoadmap($productID) + public function getRoadmap($productID, $branch = 0) { - $plans = $this->loadModel('productplan')->getList($productID); - $releases = $this->loadModel('release')->getList($productID); + $plans = $this->loadModel('productplan')->getList($productID, $branch); + $releases = $this->loadModel('release')->getList($productID, $branch); $roadmap = array(); if(is_array($releases)) $releases = array_reverse($releases); if(is_array($plans)) $plans = array_reverse($plans); foreach($releases as $release) { $year = substr($release->date, 0, 4); - $roadmap[$year][] = $release; + $roadmap[$year][$release->branch][] = $release; } foreach($plans as $plan) { if($plan->end != '0000-00-00' and strtotime($plan->end) - time() <= 0) continue; $year = substr($plan->end, 0, 4); - $roadmap[$year][] = $plan; + $roadmap[$year][$plan->branch][] = $plan; } ksort($roadmap); @@ -689,7 +689,7 @@ class productModel extends model { $link = helper::createLink($module, $method, "status=all&productID=%s" . ($branch ? "&branch=%s" : '')); } - elseif($module == 'product' && ($method == 'dynamic' or $method == 'roadmap' or $method == 'doc' or $method == 'view')) + elseif($module == 'product' && ($method == 'dynamic' or $method == 'doc' or $method == 'view')) { $link = helper::createLink($module, $method, "productID=%s"); } diff --git a/module/product/view/roadmap.html.php b/module/product/view/roadmap.html.php index f901e9a994..365bfcade2 100644 --- a/module/product/view/roadmap.html.php +++ b/module/product/view/roadmap.html.php @@ -19,30 +19,35 @@ echo ''; foreach($years as $year) { + $colspans = count($roadmaps[$year]); $year = $year == '0000' ? $lang->future : $year . $lang->year; - echo "

$year

"; + echo "

$year

"; } echo ''; echo ''; foreach($years as $year) { - echo ''; - foreach($roadmaps[$year] as $key => $roadmap) + foreach($roadmaps[$year] as $branch => $roadmapData) { - if(isset($roadmap->build)) + echo ''; + if(!empty($branches)) echo "
{$branches[$branch]}
"; + foreach($roadmapData as $key => $roadmap) { - echo "
"; - echo "
" . html::a($this->createLink('release', 'view', "releaseID=$roadmap->id"), $roadmap->name, '_blank') . '
' . $roadmap->date; + if(isset($roadmap->build)) + { + echo "
"; + echo "
" . html::a($this->createLink('release', 'view', "releaseID=$roadmap->id"), $roadmap->name, '_blank') . '
' . $roadmap->date; + } + else + { + echo "
"; + echo "
" . html::a($this->createLink('productplan', 'view', "planID=$roadmap->id"), $roadmap->title, '_blank') . '
' . $roadmap->begin . ' ~ ' . $roadmap->end; + } + echo "
"; + if(isset($roadmaps[$year][$branch][$key + 1])) echo "
{$lang->downArrow}
"; } - else - { - echo "
"; - echo "
" . html::a($this->createLink('productplan', 'view', "planID=$roadmap->id"), $roadmap->title, '_blank') . '
' . $roadmap->begin . ' ~ ' . $roadmap->end; - } - echo "
"; - if(isset($roadmaps[$year][$key + 1])) echo "
{$lang->downArrow}
"; + echo ''; } - echo ''; } echo ''; ?> diff --git a/module/productplan/model.php b/module/productplan/model.php index 0d80894d09..7de6634094 100644 --- a/module/productplan/model.php +++ b/module/productplan/model.php @@ -204,7 +204,15 @@ class productplanModel extends model $this->loadModel('action'); foreach($this->post->stories as $storyID) { - $this->dao->update(TABLE_STORY)->set("plan=CONCAT(plan, ',', $planID)")->where('id')->eq((int)$storyID)->exec(); + if($this->session->currentProductType == 'normal') + { + $this->dao->update(TABLE_STORY)->set("plan")->eq($planID)->where('id')->eq((int)$storyID)->exec(); + } + else + { + $this->dao->update(TABLE_STORY)->set("plan")->eq($planID)->where('id')->eq((int)$storyID)->andWhere('branch')->ne('0')->exec(); + $this->dao->update(TABLE_STORY)->set("plan=CONCAT(plan, ',', $planID)")->where('id')->eq((int)$storyID)->andWhere('branch')->eq('0')->exec(); + } $this->action->create('story', $storyID, 'linked2plan', '', $planID); $this->story->setStage($storyID); } diff --git a/module/release/control.php b/module/release/control.php index 99efb0302d..2a9d847f7f 100644 --- a/module/release/control.php +++ b/module/release/control.php @@ -26,7 +26,7 @@ class release extends control $this->view->branch = $branch; $this->view->branches = $product->type == 'normal' ? array() : $this->loadModel('branch')->getPairs($product->id); $this->view->position[] = html::a($this->createLink('product', 'browse', "productID={$this->view->product->id}&branch=$branch"), $this->view->product->name); - $this->product->setMenu($this->product->getPairs(), $productID); + $this->product->setMenu($this->product->getPairs(), $productID, $branch); } /** @@ -36,14 +36,14 @@ class release extends control * @access public * @return void */ - public function browse($productID) + public function browse($productID, $branch = 0) { - $this->commonAction($productID); + $this->commonAction($productID, $branch); $products = $this->product->getPairs(); $this->session->set('releaseList', $this->app->getURI(true)); $this->view->title = $products[$productID] . $this->lang->colon . $this->lang->release->browse; $this->view->position[] = $this->lang->release->browse; - $this->view->releases = $this->release->getList($productID); + $this->view->releases = $this->release->getList($productID, $branch); $this->display(); } @@ -54,7 +54,7 @@ class release extends control * @access public * @return void */ - public function create($productID) + public function create($productID, $branch = 0) { if(!empty($_POST)) { @@ -64,17 +64,17 @@ class release extends control die(js::locate(inlink('view', "releaseID=$releaseID"), 'parent')); } - $builds = $this->loadModel('build')->getProductBuildPairs($productID); - $releaseBuilds = $this->release->getReleaseBuilds($productID); + $builds = $this->loadModel('build')->getProductBuildPairs($productID, $branch); + $releaseBuilds = $this->release->getReleaseBuilds($productID, $branch); foreach($releaseBuilds as $build) unset($builds[$build]); unset($builds['trunk']); - $this->commonAction($productID); + $this->commonAction($productID, $branch); $this->view->title = $this->view->product->name . $this->lang->colon . $this->lang->release->edit; $this->view->position[] = $this->lang->release->create; $this->view->builds = $builds; $this->view->productID = $productID; - $this->view->lastRelease = $this->release->getLast($productID); + $this->view->lastRelease = $this->release->getLast($productID, $branch); $this->display(); } diff --git a/module/release/model.php b/module/release/model.php index c59f882243..a32e35d39b 100644 --- a/module/release/model.php +++ b/module/release/model.php @@ -46,13 +46,14 @@ class releaseModel extends model * @access public * @return array */ - public function getList($productID) + public function getList($productID, $branch = 0) { return $this->dao->select('t1.*, t2.name as productName, t3.name as buildName') ->from(TABLE_RELEASE)->alias('t1') ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id') ->leftJoin(TABLE_BUILD)->alias('t3')->on('t1.build = t3.id') ->where('t1.product')->eq((int)$productID) + ->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi() ->andWhere('t1.deleted')->eq(0) ->orderBy('t1.date DESC') ->fetchAll(); @@ -65,10 +66,11 @@ class releaseModel extends model * @access public * @return bool | object */ - public function getLast($productID) + public function getLast($productID, $branch = 0) { return $this->dao->select('id, name')->from(TABLE_RELEASE) ->where('product')->eq((int)$productID) + ->beginIF($branch)->andWhere('branch')->eq($branch)->fi() ->orderBy('date DESC') ->limit(1) ->fetch(); @@ -81,9 +83,13 @@ class releaseModel extends model * @access public * @return void */ - public function getReleaseBuilds($productID) + public function getReleaseBuilds($productID, $branch = 0) { - $releases = $this->dao->select('build')->from(TABLE_RELEASE)->where('deleted')->eq(0)->andWhere('product')->eq($productID)->fetchAll('build'); + $releases = $this->dao->select('build')->from(TABLE_RELEASE) + ->where('deleted')->eq(0) + ->andWhere('product')->eq($productID) + ->beginIF($branch)->andWhere('branch')->eq($branch)->fi() + ->fetchAll('build'); return array_keys($releases); } diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php index 6b4338c74e..e543c0f91d 100644 --- a/module/release/view/browse.html.php +++ b/module/release/view/browse.html.php @@ -17,7 +17,7 @@
release->browse;?>
- id");?> + id&branch=$branch");?>
diff --git a/module/release/view/create.html.php b/module/release/view/create.html.php index 5d5a9ac258..38e25264ee 100644 --- a/module/release/view/create.html.php +++ b/module/release/view/create.html.php @@ -29,7 +29,7 @@ js::set('page' , 'create'); type != 'normal'):?> - +
release->branch;?>