* finish task #2255.

This commit is contained in:
wangyidong
2015-05-13 14:13:32 +08:00
parent ca1a37436e
commit 6f3931a15b
22 changed files with 321 additions and 416 deletions

View File

@@ -104,8 +104,11 @@ class build extends control
* @access public
* @return void
*/
public function view($buildID)
public function view($buildID, $type = 'story', $link = 'false', $param = '')
{
if($type == 'story')$this->session->set('storyList', $this->app->getURI(true));
if($type == 'bug') $this->session->set('bugList', $this->app->getURI(true));
$this->loadModel('story');
$this->loadModel('bug');
@@ -133,6 +136,9 @@ class build extends control
$this->view->stories = $stories;
$this->view->bugs = $bugs;
$this->view->actions = $this->loadModel('action')->getList('build', $buildID);
$this->view->type = $type;
$this->view->link = $link;
$this->view->param = $param;
$this->display();
}
@@ -226,9 +232,11 @@ class build extends control
*/
public function linkStory($buildID = 0, $browseType = '', $param = 0)
{
$this->session->set('storyList', $this->app->getURI(true));
if(!empty($_POST['stories'])) $this->build->linkStory($buildID);
if(!empty($_POST['stories']))
{
$this->build->linkStory($buildID);
die(js::locate(inlink('view', "buildID=$buildID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&param=$param")), 'parent'));
}
$build = $this->build->getById($buildID);
$this->loadModel('project')->setMenu($this->project->getPairs(), $build->project);
@@ -240,7 +248,7 @@ class build extends control
$queryID = ($browseType == 'bySearch') ? (int)$param : 0;
unset($this->config->product->search['fields']['product']);
unset($this->config->product->search['fields']['project']);
$this->config->product->search['actionURL'] = $this->createLink('build', 'linkStory', "planID=$buildID&browseType=bySearch&queryID=myQueryID");
$this->config->product->search['actionURL'] = $this->createLink('build', 'view', "buildID=$buildID&type=story&link=true&param=" . helper::safe64Encode("&browseType=bySearch&queryID=myQueryID"));
$this->config->product->search['queryID'] = $queryID;
$this->config->product->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($build->product => $build->product));
$this->config->product->search['params']['module']['values'] = $this->tree->getOptionMenu($build->product, $viewType = 'story', $startModuleID = 0);
@@ -256,13 +264,12 @@ class build extends control
$allStories = $this->story->getProjectStories($build->project);
}
$this->view->title = $build->name . $this->lang->colon . $this->lang->build->linkStory;
$this->view->position[] = html::a($this->createLink('build', 'view', "buildID=$build->id"), $build->name);
$this->view->position[] = $this->lang->build->linkStory;
$this->view->allStories = $allStories;
$this->view->build = $build;
$this->view->buildStories = empty($build->stories) ? array() : $this->story->getByList($build->stories);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->browseType = $browseType;
$this->view->param = $param;
$this->display();
}
@@ -303,10 +310,10 @@ class build extends control
* @access public
* @return void
*/
public function batchUnlinkStory($buildID)
public function batchUnlinkStory($buildID, $link = 'false', $param = '')
{
$this->build->batchUnlinkStory($buildID);
die(js::reload('parent'));
die(js::locate($this->createLink('build', 'view', "buildID=$buildID&type=story&link=$link&param=$param"), 'parent'));
}
/**
@@ -320,9 +327,11 @@ class build extends control
*/
public function linkBug($buildID = 0, $browseType = '', $param = 0)
{
$this->session->set('bugList', $this->app->getURI(true));
if(!empty($_POST['bugs'])) $this->build->linkBug($buildID);
if(!empty($_POST['bugs']))
{
$this->build->linkBug($buildID);
die(js::locate(inlink('view', "buildID=$buildID&type=bug&link=true&param=" . helper::safe64Encode("&browseType=$browseType&param=$param")), 'parent'));
}
/* Set menu. */
$build = $this->build->getByID($buildID);
@@ -332,7 +341,7 @@ class build extends control
/* Build the search form. */
$this->loadModel('bug');
$this->config->bug->search['actionURL'] = $this->createLink('build', 'linkBug', "planID=$buildID&browseType=bySearch&queryID=myQueryID");
$this->config->product->search['actionURL'] = $this->createLink('build', 'view', "buildID=$buildID&type=bug&link=true&param=" . helper::safe64Encode("&browseType=bySearch&queryID=myQueryID"));
$this->config->bug->search['queryID'] = $queryID;
$this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($build->product => $build->product));
$this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($build->product, $viewType = 'bug', $startModuleID = 0);
@@ -364,13 +373,12 @@ class build extends control
$allBugs += $projectBugs;
}
$this->view->title = $build->name . $this->lang->colon . $this->lang->productplan->linkBug;
$this->view->position[] = html::a($this->createLink('build', 'view', "buildID=$build->id"), $build->name);
$this->view->position[] = $this->lang->build->linkBug;
$this->view->allBugs = $allBugs;
$this->view->buildBugs = empty($build->bugs) ? array() : $this->bug->getByList($build->bugs);
$this->view->build = $build;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->browseType = $browseType;
$this->view->param = $param;
$this->display();
}
@@ -411,9 +419,9 @@ class build extends control
* @access public
* @return void
*/
public function batchUnlinkBug($buildID)
public function batchUnlinkBug($buildID, $link = 'false', $param = '')
{
$this->build->batchUnlinkBug($buildID);
die(js::reload('parent'));
die(js::locate($this->createLink('build', 'view', "buildID=$buildID&type=bug&link=$link&param=$param"), 'parent'));
}
}

View File

@@ -1,2 +1,5 @@
.contentDiv { height:190px; overflow-y:auto; margin-bottom: 10px!important}
.contentDiv .panel-heading {line-height: 14px;}
.red {color:red}
.green {color:green}
#unlinkBugList, #unlinkStoryList{margin-bottom:5px;}

View File

@@ -1,2 +1,5 @@
.tabs{position:relative;}
.tabs .tab-content .tab-pane .action{position: absolute; right: 0px; top: 0px;}
.tabs .tab-content .tab-pane #querybox{margin:0px}
.tabs .tab-content .tab-pane #querybox form{padding-left:0px;}
.tabs .tab-content .tab-pane #querybox form .btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){display:none;}

13
module/build/js/view.js Normal file
View File

@@ -0,0 +1,13 @@
function showLink(buildID, type, param)
{
var method = type == 'story' ? 'linkStory' : 'linkBug';
$.get(createLink('build', method, 'buildID=' + buildID + (typeof(param) == 'undefined' ? '' : param)), function(data)
{
var obj = type == 'story' ? '.tab-pane#stories .linkBox' : '.tab-pane#bugs .linkBox';
$(obj).html(data);
});
}
$(function()
{
if(link == 'true') showLink(buildID, type, param);
})

View File

@@ -19,6 +19,7 @@ $lang->build->deleted = "Deleted";
$lang->build->view = "Info";
$lang->build->ajaxGetProductBuilds = 'API:Product builds';
$lang->build->ajaxGetProjectBuilds = 'API:Project builds';
$lang->build->batchUnlink = 'Batch unlink';
$lang->build->batchUnlinkStory = 'Batch unlink story';
$lang->build->batchUnlinkBug = 'Batch unlink bug';

View File

@@ -19,6 +19,7 @@ $lang->build->deleted = "已删除";
$lang->build->view = "版本详情";
$lang->build->ajaxGetProductBuilds = '接口:产品版本列表';
$lang->build->ajaxGetProjectBuilds = '接口:项目版本列表';
$lang->build->batchUnlink = '批量移除';
$lang->build->batchUnlinkStory = '批量移除需求';
$lang->build->batchUnlinkBug = '批量移除Bug';

View File

@@ -10,20 +10,9 @@
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<?php js::set('confirmUnlinkBug', $lang->build->confirmUnlinkBug)?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['build']);?> <strong><?php echo $build->id;?></strong></span>
<strong><?php echo html::a($this->createLink('build', 'view', 'buildID=' . $build->id), $build->name);?></strong>
<small class='text-muted'> <?php echo $lang->build->linkBug;?> <?php echo html::icon($lang->icons['link']);?></small>
</div>
<div class='actions'><?php echo html::a(inlink('view', "buildID=$build->id"), '<i class="icon-goback icon-level-up icon-large icon-rotate-270"></i> ' . $lang->goback, '', "class='btn'")?></div>
</div>
<div id='querybox' class='show'></div>
<div id='bugList'>
<form method='post' id='unlinkedBugsForm'>
<div id='unlinkBugList'>
<form method='post' id='unlinkedBugsForm' target='hiddenwin' action='<?php echo $this->createLink('build', 'linkBug', "buildID={$build->id}&browseType=$browseType&param=$param");?>'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed'>
<caption class='text-left text-special'><?php echo html::icon('unlink');?> &nbsp;<strong><?php echo $lang->productplan->unlinkedBugs;?></strong></caption>
<thead>
@@ -55,70 +44,17 @@
<tfoot>
<tr>
<td colspan='6' class='text-left'>
<?php if(count($allBugs)) echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('unlinkedBugsForm') . html::selectReverse('unlinkedBugsForm') . '</div>' . html::submitButton($lang->build->linkBug) . '</div>';?>
</td>
</tr>
</tfoot>
</table>
</form>
<hr class='mg-0'>
<form method='post' target='hiddenwin' action="<?php echo inLink('batchUnlinkBug', "buildID=$build->id");?>" id='linkedBugsForm'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed'>
<caption class='text-left text-important'><?php echo html::icon('unlink');?> &nbsp;<strong><?php echo $lang->productplan->linkedBugs;?></strong> (<?php echo count($buildBugs);?>)</caption>
<thead>
<tr class='colhead'>
<th class='w-id {sorter:"currency"}'><?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->bug->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'> <?php echo $lang->assignedToAB;?></th>
<th class='w-user'> <?php echo $lang->bug->resolvedBy;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-50px {sorter:false}'><?php echo $lang->actions?></th>
</tr>
</thead>
<tbody>
<?php $canBatchUnlink = common::hasPriv('build', 'batchUnlinkBug');?>
<?php foreach($buildBugs as $bug):?>
<tr>
<td class='text-center'>
<?php if($canBatchUnlink):?>
<input class='ml-10px' type='checkbox' name='unlinkBugs[]' value='<?php echo $bug->id;?>'/>
<?php endif;?>
<?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), sprintf("%03d", $bug->id));?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->bug->priList, $bug->pri, $bug->pri);?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri);?></span></td>
<td class='text-left nobr'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?></td>
<td><?php echo $users[$bug->openedBy];?></td>
<td><?php echo $users[$bug->assignedTo];?></td>
<td><?php echo $users[$bug->resolvedBy];?></td>
<td class='bug-<?php echo $bug->status?>'><?php echo $lang->bug->statusList[$bug->status];?></td>
<td class='text-center'>
<?php
if(common::hasPriv('build', 'unlinkBug'))
<?php if(count($allBugs))
{
$unlinkURL = $this->createLink('build', 'unlinkBug', "buildID=$build->id&bugID=$bug->id");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"bugList\",confirmUnlinkBug)", "<i class='icon-remove'></i>", '', "title='{$lang->build->unlinkBug}' class='btn-icon'");
echo "<div class='table-actions clearfix'>";
echo "<div class='btn-group'>" . html::selectAll('unlinkedBugsForm') . html::selectReverse('unlinkedBugsForm') . '</div>';
echo html::submitButton($lang->build->linkBug) . html::a(inlink('view', "buildID={$build->id}&type=bug"), $lang->cancel, '', "class='btn'") . '</div>';
}
?>
</td>
</tr>
<?php endforeach;?>
<?php if(count($buildBugs) and $canBatchUnlink):?>
<tfoot>
<tr>
<td colspan='8' class='text-left'>
<?php
echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('linkedBugsForm') . html::selectReverse('linkedBugsForm') . '</div>';
echo html::submitButton($lang->productplan->batchUnlink) . '</div>';
?>
</td>
</tr>
</tfoot>
<?php endif;?>
</tbody>
</table>
</form>
</div>
<script>$(function(){ajaxGetSearchForm()})</script>
<?php include '../../common/view/footer.html.php';?>
<script>$(function(){ajaxGetSearchForm('#bugs .linkBox #querybox')})</script>

View File

@@ -10,20 +10,9 @@
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<?php js::set('confirmUnlinkStory', $lang->build->confirmUnlinkStory)?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['build']);?> <strong><?php echo $build->id;?></strong></span>
<strong><?php echo html::a($this->createLink('build', 'view', 'build=' . $build->id), $build->name);?></strong>
<small class='text-muted'> <?php echo $lang->build->linkStory;?> <?php echo html::icon($lang->icons['link']);?></small>
</div>
<div class='actions'><?php echo html::a(inlink('view', "buildID=$build->id"), '<i class="icon-goback icon-level-up icon-large icon-rotate-270"></i> ' . $lang->goback, '', "class='btn'")?></div>
</div>
<div id='querybox' class='show'></div>
<div id='storyList'>
<form method='post' id='unlinkedStoriesForm'>
<div id='unlinkStoryList'>
<form method='post' id='unlinkedStoriesForm' target='hiddenwin' action='<?php echo $this->createLink('build', 'linkStory', "buildID={$build->id}&browseType=$browseType&param=$param");?>'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed'>
<caption class='text-left text-special'><?php echo html::icon('unlink');?> &nbsp;<strong><?php echo $lang->productplan->unlinkedStories;?></strong></caption>
<thead>
@@ -39,6 +28,7 @@
</tr>
</thead>
<tbody>
<?php echo $build?>
<?php foreach($allStories as $story):?>
<?php if(strpos(",{$build->stories},", ",{$story->id},") !== false) continue; ?>
<tr>
@@ -59,71 +49,17 @@
<tfoot>
<tr>
<td colspan='8' class='text-left'>
<?php if(count($allStories)) echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('unlinkedStoriesForm') . html::selectReverse('unlinkedStoriesForm') . '</div>' . html::submitButton($lang->story->linkStory) . '</div>';?>
<?php if(count($allStories))
{
echo "<div class='table-actions clearfix'>";
echo "<div class='btn-group'>" . html::selectAll('unlinkedStoriesForm') . html::selectReverse('unlinkedStoriesForm') . '</div>';
echo html::submitButton($lang->story->linkStory) . html::a(inlink('view', "buildID={$build->id}&type=story"), $lang->cancel, '', "class='btn'") . '</div>';
}
?>
</td>
</tr>
</tfoot>
</table>
</form>
<hr class='mg-0'>
<form method='post' target='hiddenwin' action="<?php echo inLink('batchUnlinkStory', "buildID=$build->id");?>" id='linkedStoriesForm'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed'>
<caption class='text-left text-important'><?php echo html::icon('link');?> &nbsp;<strong><?php echo $lang->productplan->linkedStories;?></strong> (<?php echo count($buildStories);?>)</caption>
<thead>
<tr class='colhead'>
<th class='w-id {sorter:"currency"}'><?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->story->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'> <?php echo $lang->assignedToAB;?></th>
<th class='w-30px'> <?php echo $lang->story->estimateAB;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-60px'> <?php echo $lang->story->stageAB;?></th>
<th class='w-50px {sorter:false}'><?php echo $lang->actions?></th>
</tr>
</thead>
<tbody>
<?php $canBatchUnlink = common::hasPriv('productPlan', 'batchUnlinkStory');?>
<?php foreach($buildStories as $story):?>
<tr>
<td class='text-center'>
<?php if($canBatchUnlink):?>
<input class='ml-10px' type='checkbox' name='unlinkStories[]' value='<?php echo $story->id;?>'/>
<?php endif;?>
<?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), sprintf("%03d", $story->id));?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->story->priList, $story->pri, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri);?></span></td>
<td class='text-left nobr'><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->title);?></td>
<td><?php echo $users[$story->openedBy];?></td>
<td><?php echo $users[$story->assignedTo];?></td>
<td><?php echo $story->estimate;?></td>
<td class='story-<?php echo $story->status?>'><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
<td class='text-center'>
<?php
if(common::hasPriv('build', 'unlinkStory'))
{
$unlinkURL = $this->createLink('build', 'unlinkStory', "build=$build->id&storyID=$story->id");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"storyList\",confirmUnlinkStory)", '<i class="icon-remove"></i>', '', "title='{$lang->build->unlinkStory}' class='btn-icon'");
}
?>
</td>
</tr>
<?php endforeach;?>
<?php if(count($buildStories) and $canBatchUnlink):?>
<tfoot>
<tr>
<td colspan='9' class='text-left'>
<?php
echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('linkedStoriesForm') . html::selectReverse('linkedStoriesForm') . '</div>' . html::submitButton($lang->productplan->batchUnlink) . '</div>';
?>
</td>
</tr>
</tfoot>
<?php endif;?>
</tbody>
</table>
</form>
</div>
<script>$(function(){ajaxGetSearchForm()})</script>
<?php include '../../common/view/footer.html.php';?>
<script>$(function(){ajaxGetSearchForm('#stories .linkBox #querybox')})</script>

View File

@@ -42,24 +42,21 @@
<div class='row-table'>
<div class='col-main'>
<div class='main'>
<fieldset>
<legend><?php echo $lang->build->desc;?></legend>
<div class='article-content'><?php echo $build->desc;?></div>
</fieldset>
<?php echo $this->fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?>
<div class='tabs'>
<?php $countStories = count($stories); $countBugs = count($bugs); $countNewBugs = count($generatedBugs);?>
<ul class='nav nav-tabs'>
<li class='active'><a href='#stories' data-toggle='tab'><?php echo html::icon($lang->icons['story']) . ' ' . $lang->build->stories;?></a></li>
<li><a href='#bugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug']) . ' ' . $lang->build->bugs;?></a></li>
<li><a href='#newBugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug']) . ' ' . $lang->build->generatedBugs;?></a></li>
<li <?php if($type == 'story') echo "class='active'"?>><a href='#stories' data-toggle='tab'><?php echo html::icon($lang->icons['story'], 'green') . ' ' . $lang->build->stories;?></a></li>
<li <?php if($type == 'bug') echo "class='active'"?>><a href='#bugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug'], 'green') . ' ' . $lang->build->bugs;?></a></li>
<li <?php if($type == 'newbug') echo "class='active'"?>><a href='#newBugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug'], 'red') . ' ' . $lang->build->generatedBugs;?></a></li>
</ul>
<div class='tab-content'>
<div class='tab-pane active' id='stories'>
<div class='tab-pane <?php if($type == 'story') echo 'active'?>' id='stories'>
<?php if(common::hasPriv('build', 'linkStory')):?>
<div class='action'><?php echo html::a(inlink('linkStory',"buildID=$build->id"), '<i class="icon-link"></i> ' . $lang->build->linkStory, '', "class='btn btn-sm'");?></div>
<div class='action'><?php echo html::a("javascript:showLink($build->id, \"story\")", '<i class="icon-link"></i> ' . $lang->build->linkStory, '', "class='btn btn-sm'");?></div>
<div class='linkBox'></div>
<?php endif;?>
<table class='table table-hover table-condensed table-borderless table-fixed' id='storyList'>
<form method='post' target='hiddenwin' action='<?php echo inlink('batchUnlinkStory', "buildID={$build->id}" . (($type == 'story' and $link == 'true') ? "&link=true&param=$param" : ''))?>' id='linkedStoriesForm'>
<table class='table table-hover table-condensed table-striped tablesorter table-fixed' id='storyList'>
<thead>
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
@@ -72,10 +69,16 @@
<th class='w-50px'><?php echo $lang->actions;?></th>
</tr>
</thead>
<?php $canBatchUnlink = common::hasPriv('build', 'batchUnlinkStory');?>
<?php foreach($stories as $storyID => $story):?>
<?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id", '', true);?>
<tr class='text-center'>
<td><?php echo sprintf('%03d', $story->id);?></td>
<td>
<?php if($canBatchUnlink):?>
<input class='ml-10px' type='checkbox' name='unlinkStories[]' value='<?php echo $story->id;?>'/>
<?php endif;?>
<?php echo sprintf('%03d', $story->id);?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->story->priList, $story->pri, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri);?></span></td>
<td class='text-left nobr'><?php echo html::a($storyLink,$story->title, '', "class='preview'");?></td>
<td><?php echo $users[$story->openedBy];?></td>
@@ -97,18 +100,22 @@
<tr>
<td colspan='8'>
<div class='table-actions clearfix'>
<?php if($countStories and $canBatchUnlink) echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('linkedStoriesForm') . html::selectReverse('linkedStoriesForm') . '</div>' . html::submitButton($lang->build->batchUnlink) . '</div>';?>
<div class='text'><?php echo sprintf($lang->build->finishStories, $countStories);?></div>
</div>
</td>
</tr>
</tfoot>
</table>
</form>
</div>
<div class='tab-pane' id='bugs'>
<div class='tab-pane <?php if($type == 'bug') echo 'active'?>' id='bugs'>
<?php if(common::hasPriv('build', 'linkBug')):?>
<div class='action'><?php echo html::a(inlink('linkBug',"buildID=$build->id"), '<i class="icon-bug"></i> ' . $lang->build->linkBug, '', "class='btn btn-sm'");?></div>
<div class='action'><?php echo html::a("javascript:showLink($build->id, \"bug\")", '<i class="icon-bug"></i> ' . $lang->build->linkBug, '', "class='btn btn-sm'");?></div>
<div class='linkBox'></div>
<?php endif;?>
<table class='table table-hover table-condensed table-borderless table-fixed' id='bugList'>
<form method='post' target='hiddenwin' action="<?php echo inLink('batchUnlinkBug', "build=$build->id" . (($type == 'bug' and $link == 'true') ? "&link=true&param=$param" : ''));?>" id='linkedBugsForm'>
<table class='table table-hover table-condensed table-striped tablesorter table-fixed' id='bugList'>
<thead>
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
@@ -121,10 +128,15 @@
<th class='w-50px'><?php echo $lang->actions;?></th>
</tr>
</thead>
<?php $canBatchUnlink = common::hasPriv('build', 'batchUnlinkBug');?>
<?php foreach($bugs as $bug):?>
<?php $bugLink = $this->createLink('bug', 'view', "bugID=$bug->id", '', true);?>
<tr class='text-center'>
<td><?php echo sprintf('%03d', $bug->id);?></td>
<td>
<?php if($canBatchUnlink):?>
<input class='ml-10px' type='checkbox' name='unlinkBugs[]' value='<?php echo $bug->id;?>'/>
<?php endif;?>
<?php echo sprintf('%03d', $bug->id);?>
<td class='text-left nobr'><?php echo html::a($bugLink, $bug->title, '', "class='preview'");?></td>
<td class='bug-<?php echo $bug->status?>'><?php echo $lang->bug->statusList[$bug->status];?></td>
<td><?php echo $users[$bug->openedBy];?></td>
@@ -146,15 +158,17 @@
<tr>
<td colspan='8'>
<div class='table-actions clearfix'>
<?php if($countBugs and $canBatchUnlink) echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('linkedBugsForm') . html::selectReverse('linkedBugsForm') . '</div>' . html::submitButton($lang->build->batchUnlink) . '</div>';?>
<div class='text'><?php echo sprintf($lang->build->resolvedBugs, $countBugs);?></div>
</div>
</td>
</tr>
</tfoot>
</table>
</form>
</div>
<div class='tab-pane' id='newBugs'>
<table class='table table-hover table-condensed table-borderless table-fixed'>
<div class='tab-pane <?php if($type == 'newbug') echo 'active'?>' id='newBugs'>
<table class='table table-hover table-condensed table-striped tablesorter table-fixed'>
<thead>
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
@@ -197,6 +211,10 @@
</div>
<div class='col-side'>
<div class='main-side main'>
<fieldset>
<legend><?php echo $lang->build->desc;?></legend>
<div class='article-content'><?php echo $build->desc;?></div>
</fieldset>
<fieldset>
<legend><?php echo $lang->build->basicInfo?></legend>
<table class='table table-data table-condensed table-borderless table-fixed'>
@@ -226,8 +244,13 @@
</tr>
</table>
</fieldset>
<?php echo $this->fetch('file', 'printFiles', array('files' => $build->files, 'fieldset' => 'true'));?>
<?php include '../../common/view/action.html.php';?>
</div>
</div>
</div>
<?php js::set('param', helper::safe64Decode($param))?>
<?php js::set('link', $link)?>
<?php js::set('buildID', $build->id)?>
<?php js::set('type', $type)?>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -31,6 +31,7 @@ $lang->runInfo = "<div class='row'><div class='u-1 a-center' id='debugbar
$lang->agreement = "I Agree to the <a href='http://zpl.pub/page/zplv11.html' target='_blank'>Z PUBLIC LICENSE 1.1</a>, <span class='text-danger'>and promise to keep the logo, link of ZenTao.</span>";
$lang->reset = 'Reset';
$lang->cancel = 'Cancel';
$lang->refresh = 'Refresh';
$lang->edit = 'Edit';
$lang->copy = 'Copy';

View File

@@ -31,6 +31,7 @@ $lang->runInfo = "<div class='row'><div class='u-1 a-center' id='debugbar
$lang->agreement = "已阅读并同意<a href='http://zpl.pub/page/zplv11.html' target='_blank'>《Z PUBLIC LICENSE授权协议1.1》</a>。<span class='text-danger'>未经许可,不得去除、隐藏或遮掩禅道软件的任何标志及链接。</span>";
$lang->reset = '重填';
$lang->cancel = '取消';
$lang->refresh = '刷新';
$lang->edit = '编辑';
$lang->copy = '复制';

View File

@@ -136,8 +136,11 @@ class release extends control
* @access public
* @return void
*/
public function view($releaseID)
public function view($releaseID, $type = 'story', $link = 'false', $param = '')
{
if($type == 'story') $this->session->set('storyList', $this->app->getURI(true));
if($type == 'bug') $this->session->set('bugList', $this->app->getURI(true));
$this->loadModel('story');
$this->loadModel('bug');
@@ -176,6 +179,9 @@ class release extends control
$this->view->generatedBugs = empty($build->project) ? array() : $this->bug->getProjectBugs($build->project, 'id_desc', null, $build->id);
$this->view->actions = $this->loadModel('action')->getList('release', $releaseID);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->type = $type;
$this->view->link = $link;
$this->view->param = $param;
$this->display();
}
@@ -223,61 +229,104 @@ class release extends control
* @access public
* @return void
*/
public function export($type)
public function export()
{
if(!empty($_POST))
{
if($type == 'story')
$type = $this->post->type;
$html = '';
if($type == 'story' or $type == 'all')
{
$html .= "<h3>{$this->lang->release->stories}</h3>";
$this->loadModel('story');
$stories = $this->dao->select('id, title')->from(TABLE_STORY)->where($this->session->storyQueryCondition)
->beginIF($this->session->storyOrderBy != false)->orderBy($this->session->storyOrderBy)->fi()
->fetchAll('id');
foreach($stories as $story)
{
$story->title = "<a href='" . common::getSysURL() . $this->createLink('story', 'view', "storyID=$story->id") . "' target='_blank'>$story->title</a>";
}
foreach($stories as $story) $story->title = "<a href='" . common::getSysURL() . $this->createLink('story', 'view', "storyID=$story->id") . "' target='_blank'>$story->title</a>";
$this->post->set('fields', array('id' => $this->lang->story->id, 'title' => $this->lang->story->title));
$this->post->set('rows', $stories);
$this->fetch('file', 'export2HTML', $_POST);
$fields = array('id' => $this->lang->story->id, 'title' => $this->lang->story->title);
$rows = $stories;
$html .= '<table><tr>';
foreach($fields as $fieldLabel) $html .= "<th><nobr>$fieldLabel</nobr></th>\n";
$html .= '</tr>';
foreach($rows as $row)
{
$html .= "<tr valign='top'>\n";
foreach($fields as $fieldName => $fieldLabel)
{
$fieldValue = isset($row->$fieldName) ? $row->$fieldName : '';
$html .= "<td><nobr>$fieldValue</nobr></td>\n";
}
$html .= "</tr>\n";
}
$html .= '</table>';
}
else if($type == 'bug')
if($type == 'bug' or $type == 'all')
{
$html .= "<h3>{$this->lang->release->bugs}</h3>";
$this->loadModel('bug');
$bugs = $this->dao->select('id, title')->from(TABLE_BUG)->where($this->session->linkedBugQueryCondition)
->beginIF($this->session->bugOrderBy != false)->orderBy($this->session->bugOrderBy)->fi()
->fetchAll('id');
foreach($bugs as $bug)
{
$bug->title = "<a href='" . common::getSysURL() . $this->createLink('bug', 'view', "bugID=$bug->id") . "' target='_blank'>$bug->title</a>";
}
foreach($bugs as $bug) $bug->title = "<a href='" . common::getSysURL() . $this->createLink('bug', 'view', "bugID=$bug->id") . "' target='_blank'>$bug->title</a>";
$this->post->set('fields', array('id' => $this->lang->bug->id, 'title' => $this->lang->bug->title));
$this->post->set('rows', $bugs);
$this->fetch('file', 'export2HTML', $_POST);
$fields = array('id' => $this->lang->bug->id, 'title' => $this->lang->bug->title);
$rows = $bugs;
$html .= '<table><tr>';
foreach($fields as $fieldLabel) $html .= "<th><nobr>$fieldLabel</nobr></th>\n";
$html .= '</tr>';
foreach($rows as $row)
{
$html .= "<tr valign='top'>\n";
foreach($fields as $fieldName => $fieldLabel)
{
$fieldValue = isset($row->$fieldName) ? $row->$fieldName : '';
$html .= "<td><nobr>$fieldValue</nobr></td>\n";
}
$html .= "</tr>\n";
}
$html .= '</table>';
}
else if($type == 'newBugs')
if($type == 'newbug' or $type == 'all')
{
$this->loadModel('bug');
$html .= "<h3>{$this->lang->release->generatedBugs}</h3>";
$bugs = $this->dao->select('id, title')->from(TABLE_BUG)->where($this->session->newBugsQueryCondition)
->beginIF($this->session->bugOrderBy != false)->orderBy($this->session->bugOrderBy)->fi()
->fetchAll('id');
foreach($bugs as $bug)
{
$bug->title = "<a href='" . common::getSysURL() . $this->createLink('bug', 'view', "bugID=$bug->id") . "' target='_blank'>$bug->title</a>";
}
foreach($bugs as $bug) $bug->title = "<a href='" . common::getSysURL() . $this->createLink('bug', 'view', "bugID=$bug->id") . "' target='_blank'>$bug->title</a>";
$this->post->set('fields', array('id' => $this->lang->bug->id, 'title' => $this->lang->bug->title));
$this->post->set('rows', $bugs);
$this->fetch('file', 'export2HTML', $_POST);
$fields = array('id' => $this->lang->bug->id, 'title' => $this->lang->bug->title);
$rows = $bugs;
$html .= '<table><tr>';
foreach($fields as $fieldLabel) $html .= "<th><nobr>$fieldLabel</nobr></th>\n";
$html .= '</tr>';
foreach($rows as $row)
{
$html .= "<tr valign='top'>\n";
foreach($fields as $fieldName => $fieldLabel)
{
$fieldValue = isset($row->$fieldName) ? $row->$fieldName : '';
$html .= "<td><nobr>$fieldValue</nobr></td>\n";
}
$html .= "</tr>\n";
}
$html .= '</table>';
}
$html = "<html><head><meta charset='utf-8'><title>{$this->post->fileName}</title><style>table, th, td{font-size:12px; border:1px solid gray; border-collapse:collapse;}</style></head><body>$html</body></html>";
die($this->fetch('file', 'sendDownHeader', array('fileName' => $this->post->fileName, 'html', $html)));
}
$this->display();
@@ -294,9 +343,11 @@ class release extends control
*/
public function linkStory($releaseID = 0, $browseType = '', $param = 0)
{
$this->session->set('storyList', $this->app->getURI(true));
if(!empty($_POST['stories'])) $this->release->linkStory($releaseID);
if(!empty($_POST['stories']))
{
$this->release->linkStory($releaseID);
die(js::locate(inlink('view', "releaseID=$releaseID&type=story&link=true&parma=" . helper::safe64Encode("&browseType=$browseType&param=$param")), 'parent'));
}
$release = $this->release->getById($releaseID);
$build = $this->loadModel('build')->getByID($release->build);
@@ -309,7 +360,7 @@ class release extends control
$queryID = ($browseType == 'bySearch') ? (int)$param : 0;
unset($this->config->product->search['fields']['product']);
unset($this->config->product->search['fields']['project']);
$this->config->product->search['actionURL'] = $this->createLink('release', 'linkStory', "releaseID=$releaseID&browseType=bySearch&queryID=myQueryID");
$this->config->product->search['actionURL'] = $this->createLink('release', 'view', "releaseID=$releaseID&type=story&link=true&param=" . helper::safe64Encode('&browseType=bySearch&queryID=myQueryID'));
$this->config->product->search['queryID'] = $queryID;
$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);
@@ -325,13 +376,12 @@ class release extends control
$allStories = $this->story->getProjectStories($build->project);
}
$this->view->title = $release->name . $this->lang->colon . $this->lang->release->linkStory;
$this->view->position[] = html::a($this->createLink('release', 'view', "releaseID=$release->id"), $release->name);
$this->view->position[] = $this->lang->release->linkStory;
$this->view->allStories = $allStories;
$this->view->release = $release;
$this->view->releaseStories = empty($release->stories) ? array() : $this->story->getByList($release->stories);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->browseType = $browseType;
$this->view->param = $param;
$this->display();
}
@@ -372,10 +422,10 @@ class release extends control
* @access public
* @return void
*/
public function batchUnlinkStory($releaseID)
public function batchUnlinkStory($releaseID, $link = 'false', $param = '')
{
$this->release->batchUnlinkStory($releaseID);
die(js::reload('parent'));
die(js::locate($this->createLink('release', 'view', "releaseID=$releaseID&type=story&link=$link&param=$param"), 'parent'));
}
/**
@@ -389,9 +439,11 @@ class release extends control
*/
public function linkBug($releaseID = 0, $browseType = '', $param = 0)
{
$this->session->set('bugList', $this->app->getURI(true));
if(!empty($_POST['bugs'])) $this->release->linkBug($releaseID);
if(!empty($_POST['bugs']))
{
$this->release->linkBug($releaseID);
die(js::locate(inlink('view', "releaseID=$releaseID&type=bug&link=true&parma=" . helper::safe64Encode("&browseType=$browseType&param=$param")), 'parent'));
}
/* Set menu. */
$release = $this->release->getByID($releaseID);
@@ -402,7 +454,7 @@ class release extends control
$this->loadModel('bug');
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
unset($this->config->bug->search['fields']['product']);
$this->config->bug->search['actionURL'] = $this->createLink('release', 'linkBug', "planID=$releaseID&browseType=bySearch&queryID=myQueryID");
$this->config->bug->search['actionURL'] = $this->createLink('release', 'view', "releaseID=$releaseID&type=bug&link=true&param=" . helper::safe64Encode('&browseType=bySearch&queryID=myQueryID'));
$this->config->bug->search['queryID'] = $queryID;
$this->config->bug->search['params']['plan']['values'] = $this->loadModel('productplan')->getForProducts(array($release->product => $release->product));
$this->config->bug->search['params']['module']['values'] = $this->loadModel('tree')->getOptionMenu($release->product, $viewType = 'bug', $startModuleID = 0);
@@ -420,13 +472,12 @@ class release extends control
$allBugs = empty($build->project) ? array() : $this->bug->getReleaseBugs($build->id, $release->product);
}
$this->view->title = $release->name . $this->lang->colon . $this->lang->release->linkBug;
$this->view->position[] = html::a($this->createLink('release', 'view', "releaseID=$release->id"), $release->name);
$this->view->position[] = $this->lang->release->linkBug;
$this->view->allBugs = $allBugs;
$this->view->releaseBugs = empty($release->bugs) ? array() : $this->bug->getByList($release->bugs);
$this->view->release = $release;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->browseType = $browseType;
$this->view->param = $param;
$this->display();
}
@@ -467,9 +518,9 @@ class release extends control
* @access public
* @return void
*/
public function batchUnlinkBug($releaseID)
public function batchUnlinkBug($releaseID, $link = 'false', $param = '')
{
$this->release->batchUnlinkBug($releaseID);
die(js::reload('parent'));
die(js::locate($this->createLink('release', 'view', "releaseID=$releaseID&type=bug&link=$link&param=$param"), 'parent'));
}
}

View File

@@ -1,2 +1,5 @@
.contentDiv { height:190px; overflow-y:auto; margin-bottom: 10px!important}
.contentDiv .panel-heading {line-height: 14px;}
.red {color:red}
.green {color:green}
#unlinkBugList, #unlinkStoryList{margin-bottom:5px;}

View File

@@ -1,2 +1,5 @@
.tabs{position:relative;}
.tabs .tab-content .tab-pane .action{position: absolute; right: 0px; top: 0px;}
.tabs .tab-content .tab-pane .action{position: absolute; right: 110px; top: 0px;}
.tabs .tab-content .tab-pane #querybox{margin:0px}
.tabs .tab-content .tab-pane #querybox form{padding-left:0px;}
.tabs .tab-content .tab-pane #querybox form .btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){display:none;}

13
module/release/js/view.js Normal file
View File

@@ -0,0 +1,13 @@
function showLink(releaseID, type, param)
{
var method = type == 'story' ? 'linkStory' : 'linkBug';
$.get(createLink('release', method, 'releaseID=' + releaseID + (typeof(param) == 'undefined' ? '' : param)), function(data)
{
var obj = type == 'story' ? '.tab-pane#stories .linkBox' : '.tab-pane#bugs .linkBox';
$(obj).html(data);
});
}
$(function()
{
if(link == 'true') showLink(releaseID, type, param);
})

View File

@@ -18,6 +18,7 @@ $lang->release->delete = "Delete";
$lang->release->deleted = 'Deleted';
$lang->release->view = "Info";
$lang->release->browse = "Browse";
$lang->release->batchUnlink = "Batch unlink";
$lang->release->batchUnlinkStory = "Batch unlink story";
$lang->release->batchUnlinkBug = "Batch unlink bug";
@@ -49,3 +50,8 @@ $lang->release->export = 'Export as HTML';
$lang->release->filePath = 'Download : ';
$lang->release->scmPath = 'SCM Path : ';
$lang->release->exportTypeList['all'] = 'All';
$lang->release->exportTypeList['story'] = 'Resolved Stories';
$lang->release->exportTypeList['bug'] = 'Resolved bugs';
$lang->release->exportTypeList['newbug'] = 'Generated bugs';

View File

@@ -18,6 +18,7 @@ $lang->release->delete = "删除发布";
$lang->release->deleted = '已删除';
$lang->release->view = "发布详情";
$lang->release->browse = "浏览发布";
$lang->release->batchUnlink = "批量移除";
$lang->release->batchUnlinkStory = "批量移除需求";
$lang->release->batchUnlinkBug = "批量移除Bug";
@@ -49,3 +50,8 @@ $lang->release->export = '导出HTML';
$lang->release->filePath = '下载地址:';
$lang->release->scmPath = '版本库地址:';
$lang->release->exportTypeList['all'] = '所有';
$lang->release->exportTypeList['story'] = '已完成需求';
$lang->release->exportTypeList['bug'] = '已解决Bug';
$lang->release->exportTypeList['newbug'] = '遗留Bug';

View File

@@ -46,6 +46,7 @@ function closeWindow()
<span class='input-group-addon'><?php echo $lang->setFileName;?></span>
<?php echo html::input('fileName', '', 'class=form-control');?>
<span class='input-group-addon'>.html</span>
<?php echo html::select('type', $lang->release->exportTypeList, 'all', "class='form-control'")?>
</div>
</td>
<td><?php echo html::submitButton($lang->export);?></td>

View File

@@ -10,20 +10,9 @@
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<?php js::set('confirmUnlinkBug', $lang->release->confirmUnlinkBug)?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['release']);?> <strong><?php echo $release->id;?></strong></span>
<strong><?php echo html::a($this->createLink('release', 'view', 'releaseID=' . $release->id), $release->name);?></strong>
<small class='text-muted'> <?php echo $lang->release->linkBug;?> <?php echo html::icon($lang->icons['link']);?></small>
</div>
<div class='actions'><?php echo html::a(inlink('view', "releaseID=$release->id"), '<i class="icon-level-up icon-large icon-rotate-270"></i> ' . $lang->goback, '', "class='btn'")?></div>
</div>
<div id='querybox' class='show'></div>
<div id='bugList'>
<form method='post' id='unlinkedBugsForm'>
<div id='unlinkBugList'>
<form method='post' target='hiddenwin' id='unlinkedBugsForm' action='<?php echo $this->createLink('release', 'linkBug', "releaseID=$release->id&browseType=$browseType&param=$param")?>'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed'>
<caption class='text-left text-special'><?php echo html::icon('unlink');?> &nbsp;<strong><?php echo $lang->productplan->unlinkedBugs;?></strong></caption>
<thead>
@@ -55,70 +44,17 @@
<tfoot>
<tr>
<td colspan='6' class='text-left'>
<?php if(count($allBugs)) echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('unlinkedBugsForm') . html::selectReverse('unlinkedBugsForm') . '</div>' . html::submitButton($lang->release->linkBug) . '</div>';?>
</td>
</tr>
</tfoot>
</table>
</form>
<hr class='mg-0'>
<form method='post' target='hiddenwin' action="<?php echo inLink('batchUnlinkBug', "releaseID=$release->id");?>" id='linkedBugsForm'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed'>
<caption class='text-left text-important'><?php echo html::icon('unlink');?> &nbsp;<strong><?php echo $lang->productplan->linkedBugs;?></strong> (<?php echo count($releaseBugs);?>)</caption>
<thead>
<tr class='colhead'>
<th class='w-id {sorter:"currency"}'><?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->bug->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'> <?php echo $lang->assignedToAB;?></th>
<th class='w-user'> <?php echo $lang->bug->resolvedBy;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-50px {sorter:false}'><?php echo $lang->actions?></th>
</tr>
</thead>
<tbody>
<?php $canBatchUnlink = common::hasPriv('release', 'batchUnlinkBug');?>
<?php foreach($releaseBugs as $bug):?>
<tr>
<td class='text-center'>
<?php if($canBatchUnlink):?>
<input class='ml-10px' type='checkbox' name='unlinkBugs[]' value='<?php echo $bug->id;?>'/>
<?php endif;?>
<?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), sprintf("%03d", $bug->id));?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->bug->priList, $bug->pri, $bug->pri);?>'><?php echo zget($lang->bug->priList, $bug->pri, $bug->pri);?></span></td>
<td class='text-left nobr'><?php echo html::a($this->createLink('bug', 'view', "bugID=$bug->id"), $bug->title);?></td>
<td><?php echo $users[$bug->openedBy];?></td>
<td><?php echo $users[$bug->assignedTo];?></td>
<td><?php echo $users[$bug->resolvedBy];?></td>
<td class='bug-<?php echo $bug->status?>'><?php echo $lang->bug->statusList[$bug->status];?></td>
<td class='text-center'>
<?php
if(common::hasPriv('release', 'unlinkBug'))
<?php if(count($allBugs))
{
$unlinkURL = $this->createLink('release', 'unlinkBug', "releaseID=$release->id&bugID=$bug->id");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"bugList\",confirmUnlinkBug)", "<i class='icon-remove'></i>", '', "title='{$lang->release->unlinkBug}' class='btn-icon'");
echo "<div class='table-actions clearfix'>";
echo "<div class='btn-group'>" . html::selectAll('unlinkedBugsForm') . html::selectReverse('unlinkedBugsForm') . '</div>';
echo html::submitButton($lang->release->linkBug) . html::a(inlink('view', "releaseID=$release->id&type=bug"), $lang->cancel, '', "class='btn'") . '</div>';
}
?>
</td>
</tr>
<?php endforeach;?>
<?php if(count($releaseBugs) and $canBatchUnlink):?>
<tfoot>
<tr>
<td colspan='8' class='text-left'>
<?php
echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('linkedBugsForm') . html::selectReverse('linkedBugsForm') . '</div>';
echo html::submitButton($lang->productplan->batchUnlink) . '</div>';
?>
</td>
</tr>
</tfoot>
<?php endif;?>
</tbody>
</table>
</form>
</div>
<script>$(function(){ajaxGetSearchForm()})</script>
<?php include '../../common/view/footer.html.php';?>
<script>$(function(){ajaxGetSearchForm('#bugs .linkBox #querybox')})</script>

View File

@@ -10,22 +10,11 @@
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<?php include '../../common/view/tablesorter.html.php';?>
<?php js::set('confirmUnlinkStory', $lang->build->confirmUnlinkStory)?>
<div id='titlebar'>
<div class='heading'>
<span class='prefix'><?php echo html::icon($lang->icons['release']);?> <strong><?php echo $release->id;?></strong></span>
<strong><?php echo html::a($this->createLink('release', 'view', 'release=' . $release->id), $release->name);?></strong>
<small class='text-muted'> <?php echo $lang->release->linkStory;?> <?php echo html::icon($lang->icons['link']);?></small>
</div>
<div class='actions'><?php echo html::a(inlink('view', "releaseID=$release->id"), '<i class="icon-level-up icon-large icon-rotate-270"></i> ' . $lang->goback, '', "class='btn'")?></div>
</div>
<div id='querybox' class='show'></div>
<div id='storyList'>
<form method='post' id='unlinkedStoriesForm'>
<div id='unlinkStoryList'>
<form method='post' target='hiddenwin' id='unlinkedStoriesForm' action='<?php echo $this->createLink('release', 'linkStory', "releaseID=$release->id&browseType=$browseType&param=$param")?>'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed'>
<caption class='text-left text-special'><?php echo html::icon('unlink');?> &nbsp;<strong><?php echo $lang->productplan->unlinkedStories;?></strong></caption>
<caption class='text-left text-special'><?php echo html::icon('unlink');?> &nbsp;<strong><?php echo $lang->productplan->unlinkedStories;?></strong></caption>
<thead>
<tr>
<th class='w-id {sorter:"currency"}'><?php echo $lang->idAB;?></th>
@@ -59,71 +48,17 @@
<tfoot>
<tr>
<td colspan='8' class='text-left'>
<?php if(count($allStories)) echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('unlinkedStoriesForm') . html::selectReverse('unlinkedStoriesForm') . '</div>' . html::submitButton($lang->story->linkStory) . '</div>';?>
<?php if(count($allStories))
{
echo "<div class='table-actions clearfix'>";
echo "<div class='btn-group'>" . html::selectAll('unlinkedStoriesForm') . html::selectReverse('unlinkedStoriesForm') . '</div>';
echo html::submitButton($lang->story->linkStory) . html::a(inlink('view', "releaseID=$release->id&type=story"), $lang->cancel, '', "class='btn'") . '</div>';
}
?>
</td>
</tr>
</tfoot>
</table>
</form>
<hr class='mg-0'>
<form method='post' target='hiddenwin' action="<?php echo inLink('batchUnlinkStory', "release=$release->id");?>" id='linkedStoriesForm'>
<table class='table table-condensed table-hover table-striped tablesorter table-fixed'>
<caption class='text-left text-important'><?php echo html::icon('link');?> &nbsp;<strong><?php echo $lang->productplan->linkedStories;?></strong> (<?php echo count($releaseStories);?>)</caption>
<thead>
<tr class='colhead'>
<th class='w-id {sorter:"currency"}'><?php echo $lang->idAB;?></th>
<th class='w-pri'> <?php echo $lang->priAB;?></th>
<th> <?php echo $lang->story->title;?></th>
<th class='w-user'> <?php echo $lang->openedByAB;?></th>
<th class='w-user'> <?php echo $lang->assignedToAB;?></th>
<th class='w-30px'> <?php echo $lang->story->estimateAB;?></th>
<th class='w-status'><?php echo $lang->statusAB;?></th>
<th class='w-60px'> <?php echo $lang->story->stageAB;?></th>
<th class='w-50px {sorter:false}'><?php echo $lang->actions?></th>
</tr>
</thead>
<tbody>
<?php $canBatchUnlink = common::hasPriv('productPlan', 'batchUnlinkStory');?>
<?php foreach($releaseStories as $story):?>
<tr>
<td class='text-center'>
<?php if($canBatchUnlink):?>
<input class='ml-10px' type='checkbox' name='unlinkStories[]' value='<?php echo $story->id;?>'/>
<?php endif;?>
<?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), sprintf("%03d", $story->id));?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->story->priList, $story->pri, $story->pri);?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri);?></span></td>
<td class='text-left nobr'><?php echo html::a($this->createLink('story', 'view', "storyID=$story->id"), $story->title);?></td>
<td><?php echo $users[$story->openedBy];?></td>
<td><?php echo $users[$story->assignedTo];?></td>
<td><?php echo $story->estimate;?></td>
<td class='story-<?php echo $story->status?>'><?php echo $lang->story->statusList[$story->status];?></td>
<td><?php echo $lang->story->stageList[$story->stage];?></td>
<td class='text-center'>
<?php
if(common::hasPriv('release', 'unlinkStory'))
{
$unlinkURL = $this->createLink('release', 'unlinkStory', "release=$release->id&storyID=$story->id");
echo html::a("javascript:ajaxDelete(\"$unlinkURL\",\"storyList\",confirmUnlinkStory)", '<i class="icon-remove"></i>', '', "title='{$lang->release->unlinkStory}' class='btn-icon'");
}
?>
</td>
</tr>
<?php endforeach;?>
<?php if(count($releaseStories) and $canBatchUnlink):?>
<tfoot>
<tr>
<td colspan='9' class='text-left'>
<?php
echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('linkedStoriesForm') . html::selectReverse('linkedStoriesForm') . '</div>' . html::submitButton($lang->productplan->batchUnlink) . '</div>';
?>
</td>
</tr>
</tfoot>
<?php endif;?>
</tbody>
</table>
</form>
</div>
<script>$(function(){ajaxGetSearchForm()})</script>
<?php include '../../common/view/footer.html.php';?>
<script>$(function(){ajaxGetSearchForm('#stories .linkBox #querybox')})</script>

View File

@@ -56,40 +56,24 @@
<div class='row-table'>
<div class='col-main'>
<div class='main'>
<fieldset>
<legend><?php echo $lang->release->desc;?></legend>
<div class='article-content'><?php echo $release->desc;?></div>
</fieldset>
<fieldset>
<legend><?php echo $lang->files?></legend>
<?php
if($release->files)
{
echo $this->fetch('file', 'printFiles', array('files' => $release->files, 'fieldset' => 'false'));
}
elseif($release->filePath)
{
echo $lang->release->filePath . html::a($release->filePath, $release->filePath, '_blank');
}
elseif($release->scmPath)
{
echo $lang->release->scmPath . html::a($release->scmPath, $release->scmPath, '_blank');
}
?>
</fieldset>
<div class='tabs'>
<?php $countStories = count($stories); $countBugs = count($bugs); $countNewBugs = count($generatedBugs);?>
<ul class='nav nav-tabs'>
<li class='active'><a href='#stories' data-toggle='tab'><?php echo html::icon($lang->icons['story']) . ' ' . $lang->release->stories;?></a></li>
<li><a href='#bugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug']) . ' ' . $lang->release->bugs;?></a></li>
<li><a href='#newBugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug']) . ' ' . $lang->release->generatedBugs;?></a></li>
<li <?php if($type == 'story') echo "class='active'"?>><a href='#stories' data-toggle='tab'><?php echo html::icon($lang->icons['story'], 'green') . ' ' . $lang->release->stories;?></a></li>
<li <?php if($type == 'bug') echo "class='active'"?>><a href='#bugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug'], 'green') . ' ' . $lang->release->bugs;?></a></li>
<li <?php if($type == 'newbug') echo "class='active'"?>><a href='#newBugs' data-toggle='tab'><?php echo html::icon($lang->icons['bug'], 'red') . ' ' . $lang->release->generatedBugs;?></a></li>
<?php if($countStories or $countBugs or $countNewBugs):?>
<li class='pull-right'><?php common::printIcon('release', 'export', '', '', 'button', '', '', "export");?></li>
<?php endif;?>
</ul>
<div class='tab-content'>
<div class='tab-pane active' id='stories'>
<div class='tab-pane <?php if($type == 'story') echo 'active'?>' id='stories'>
<?php if(common::hasPriv('release', 'linkStory')):?>
<div class='action'><?php echo html::a(inlink('linkStory',"releaseID=$release->id"), '<i class="icon-link"></i> ' . $lang->release->linkStory, '', "class='btn btn-sm'");?></div>
<div class='action'><?php echo html::a("javascript:showLink({$release->id}, \"story\")", '<i class="icon-link"></i> ' . $lang->release->linkStory, '', "class='btn btn-sm'");?></div>
<div class='linkBox'></div>
<?php endif;?>
<table class='table table-hover table-condensed table-borderless table-fixed' id='storyList'>
<form method='post' target='hiddenwin' action="<?php echo inLink('batchUnlinkStory', "release=$release->id" . (($type == 'story' and $link == 'true') ? "&link=true&param=$param" : ''));?>" id='linkedStoriesForm'>
<table class='table table-hover table-condensed table-striped tablesorter table-fixed' id='storyList'>
<thead>
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
@@ -102,10 +86,16 @@
<th class='w-50px'><?php echo $lang->actions;?></th>
</tr>
</thead>
<?php $canBatchUnlink = common::hasPriv('release', 'batchUnlinkStory');?>
<?php foreach($stories as $storyID => $story):?>
<?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id", '', true);?>
<tr class='text-center'>
<td><?php echo sprintf('%03d', $story->id);?></td>
<td>
<?php if($canBatchUnlink):?>
<input class='ml-10px' type='checkbox' name='unlinkStories[]' value='<?php echo $story->id;?>'/>
<?php endif;?>
<?php echo sprintf('%03d', $story->id);?>
</td>
<td><span class='<?php echo 'pri' . zget($lang->story->priList, $story->pri, $story->pri)?>'><?php echo zget($lang->story->priList, $story->pri, $story->pri);?></span></td>
<td class='text-left nobr'><?php echo html::a($storyLink,$story->title, '', "class='preview'");?></td>
<td><?php echo $users[$story->openedBy];?></td>
@@ -127,19 +117,22 @@
<tr>
<td colspan='8'>
<div class='table-actions clearfix'>
<?php if($countStories) common::printIcon('release', 'export', 'type=story', '', 'button', '', '', "export");?>
<?php if($countStories and $canBatchUnlink) echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('linkedStoriesForm') . html::selectReverse('linkedStoriesForm') . '</div>' . html::submitButton($lang->release->batchUnlink) . '</div>';?>
<div class='text'><?php echo sprintf($lang->release->finishStories, $countStories);?></div>
</div>
</td>
</tr>
</tfoot>
</table>
</form>
</div>
<div class='tab-pane' id='bugs'>
<div class='tab-pane <?php if($type == 'bug') echo 'active'?>' id='bugs'>
<?php if(common::hasPriv('release', 'linkBug')):?>
<div class='action'><?php echo html::a(inlink('linkBug',"releaseID=$release->id"), '<i class="icon-bug"></i> ' . $lang->release->linkBug, '', "class='btn btn-sm'");?></div>
<div class='action'><?php echo html::a("javascript:showLink({$release->id}, \"bug\")", '<i class="icon-bug"></i> ' . $lang->release->linkBug, '', "class='btn btn-sm'");?></div>
<div class='linkBox'></div>
<?php endif;?>
<table class='table table-hover table-condensed table-borderless table-fixed' id='bugList'>
<form method='post' target='hiddenwin' action="<?php echo inLink('batchUnlinkBug', "releaseID=$release->id" . (($type == 'bug' and $link == 'true') ? "&link=true&param=$param" : ''));?>" id='linkedBugsForm'>
<table class='table table-hover table-condensed table-striped tablesorter table-fixed' id='bugList'>
<thead>
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
@@ -152,10 +145,16 @@
<th class='w-50px'><?php echo $lang->actions;?></th>
</tr>
</thead>
<?php $canBatchUnlink = common::hasPriv('release', 'batchUnlinkBug');?>
<?php foreach($bugs as $bug):?>
<?php $bugLink = $this->createLink('bug', 'view', "bugID=$bug->id", '', true);?>
<tr class='text-center'>
<td><?php echo sprintf('%03d', $bug->id);?></td>
<td>
<?php if($canBatchUnlink):?>
<input class='ml-10px' type='checkbox' name='unlinkBugs[]' value='<?php echo $bug->id;?>'/>
<?php endif;?>
<?php echo sprintf('%03d', $bug->id);?>
</td>
<td class='text-left nobr'><?php echo html::a($bugLink, $bug->title, '', "class='preview'");?></td>
<td class='bug-<?php echo $bug->status?>'><?php echo $lang->bug->statusList[$bug->status];?></td>
<td><?php echo $users[$bug->openedBy];?></td>
@@ -177,16 +176,17 @@
<tr>
<td colspan='8'>
<div class='table-actions clearfix'>
<?php if(count($bugs)) common::printIcon('release', 'export', 'type=bug', '', 'button', '', '', 'export');?>
<?php if($countBugs and $canBatchUnlink) echo "<div class='table-actions clearfix'><div class='btn-group'>" . html::selectAll('linkedBugsForm') . html::selectReverse('linkedBugsForm') . '</div>' . html::submitButton($lang->release->batchUnlink) . '</div>';?>
<div class='text'><?php echo sprintf($lang->release->resolvedBugs, $countBugs);?></div>
</div>
</td>
</tr>
</tfoot>
</table>
</form>
</div>
<div class='tab-pane' id='newBugs'>
<table class='table table-hover table-condensed table-borderless table-fixed'>
<div class='tab-pane <?php if($type == 'newbug') echo 'active'?>' id='newBugs'>
<table class='table table-hover table-condensed table-striped tablesorter table-fixed'>
<thead>
<tr>
<th class='w-id'><?php echo $lang->idAB;?></th>
@@ -212,7 +212,6 @@
<tr>
<td colspan='6'>
<div class='table-actions clearfix'>
<?php if(count($generatedBugs)) common::printIcon('release', 'export', 'type=newBugs', '', 'button', '', '', 'export');?>
<div class='text'><?php echo sprintf($lang->release->createdBugs, $countNewBugs);?></div>
</div>
</td>
@@ -226,6 +225,10 @@
</div>
<div class='col-side'>
<div class='main-side main'>
<fieldset>
<legend><?php echo $lang->release->desc;?></legend>
<div class='article-content'><?php echo $release->desc;?></div>
</fieldset>
<fieldset>
<legend><?php echo $lang->release->basicInfo?></legend>
<table class='table table-data table-condensed table-borderless table-fixed'>
@@ -247,8 +250,29 @@
</tr>
</table>
</fieldset>
<fieldset>
<legend><?php echo $lang->files?></legend>
<?php
if($release->files)
{
echo $this->fetch('file', 'printFiles', array('files' => $release->files, 'fieldset' => 'false'));
}
elseif($release->filePath)
{
echo $lang->release->filePath . html::a($release->filePath, $release->filePath, '_blank');
}
elseif($release->scmPath)
{
echo $lang->release->scmPath . html::a($release->scmPath, $release->scmPath, '_blank');
}
?>
</fieldset>
<?php include '../../common/view/action.html.php';?>
</div>
</div>
</div>
<?php js::set('param', helper::safe64Decode($param))?>
<?php js::set('link', $link)?>
<?php js::set('releaseID', $release->id)?>
<?php js::set('type', $type)?>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -697,13 +697,14 @@ function toggleSearch()
* @access public
* @return void
*/
function ajaxGetSearchForm()
function ajaxGetSearchForm(querybox)
{
if($('#querybox').html() == '')
querybox = typeof(querybox) == 'undefined' ? '#querybox' : querybox;
if($(querybox).html() == '')
{
$.get(createLink('search', 'buildForm'), function(data)
{
$('#querybox').html(data);
$(querybox).html(data);
});
}
}