add param currentProgram

This commit is contained in:
zhaohaibo
2020-05-27 13:26:08 +08:00
parent 3842bd351d
commit d4b09b733d
19 changed files with 161 additions and 148 deletions
+2
View File
@@ -132,6 +132,7 @@ class releaseModel extends model
else
{
$build = new stdclass();
$build->program = $this->session->program;
$build->product = (int)$productID;
$build->branch = (int)$branch;
$build->name = $this->post->name;
@@ -152,6 +153,7 @@ class releaseModel extends model
if($this->post->build) $branch = $this->dao->select('branch')->from(TABLE_BUILD)->where('id')->eq($this->post->build)->fetch('branch');
$release = fixer::input('post')
->add('program', $this->session->program)
->add('product', (int)$productID)
->add('branch', (int)$branch)
->setDefault('stories', '')
+13 -13
View File
@@ -16,13 +16,13 @@
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<?php
echo html::a($this->inlink('browse', "productID={$product->id}&branch=$branch&type=all"), "<span class='text'>{$lang->release->all}</span>" . ($type == 'all' ? ' <span class="label label-light label-badge">' . count($releases) . '</span>' : ''), '', "id='allTab' class='btn btn-link" . ('all' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->inlink('browse', "productID={$product->id}&branch=$branch&type=normal"), "<span class='text'>{$lang->release->statusList['normal']}</span>" . ($type == 'normal' ? ' <span class="label label-light label-badge">' . count($releases) . '</span>' : ''), '', "id='normalTab' class='btn btn-link" . ('normal' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->inlink('browse', "productID={$product->id}&branch=$branch&type=terminate"), "<span class='text'>{$lang->release->statusList['terminate']}</span>" . ($type == 'terminate' ? ' <span class="label label-light label-badge">' . count($releases) . '</span>' : ''), '', "id='terminateTab' class='btn btn-link" . ('terminate' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->createLink('release', 'browse', "productID={$product->id}&branch=$branch&type=all", '', '', $this->session->program), "<span class='text'>{$lang->release->all}</span>" . ($type == 'all' ? ' <span class="label label-light label-badge">' . count($releases) . '</span>' : ''), '', "id='allTab' class='btn btn-link" . ('all' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->createLink('release', 'browse', "productID={$product->id}&branch=$branch&type=normal", '', '', $this->session->program), "<span class='text'>{$lang->release->statusList['normal']}</span>" . ($type == 'normal' ? ' <span class="label label-light label-badge">' . count($releases) . '</span>' : ''), '', "id='normalTab' class='btn btn-link" . ('normal' == $type ? ' btn-active-text' : '') . "'");
echo html::a($this->createLink('release', 'browse', "productID={$product->id}&branch=$branch&type=terminate", '', '', $this->session->program), "<span class='text'>{$lang->release->statusList['terminate']}</span>" . ($type == 'terminate' ? ' <span class="label label-light label-badge">' . count($releases) . '</span>' : ''), '', "id='terminateTab' class='btn btn-link" . ('terminate' == $type ? ' btn-active-text' : '') . "'");
?>
</div>
<div class="btn-toolbar pull-right">
<?php common::printLink('release', 'create', "productID=$product->id&branch=$branch", "<i class='icon icon-plus'></i> {$lang->release->create}", '', "class='btn btn-primary'");?>
<?php common::printLink('release', 'create', "productID=$product->id&branch=$branch", "<i class='icon icon-plus'></i> {$lang->release->create}", '', "class='btn btn-primary'", '', '', '', $this->session->program);?>
</div>
</div>
<div id="mainContent" class='main-table'>
@@ -31,7 +31,7 @@
<p>
<span class="text-muted"><?php echo $lang->release->noRelease;?></span>
<?php if(common::hasPriv('release', 'create')):?>
<?php echo html::a($this->createLink('release', 'create', "productID=$product->id&branch=$branch"), "<i class='icon icon-plus'></i> " . $lang->release->create, '', "class='btn btn-info'");?>
<?php echo html::a($this->createLink('release', 'create', "productID=$product->id&branch=$branch", '', '', $this->session->program), "<i class='icon icon-plus'></i> " . $lang->release->create, '', "class='btn btn-info'");?>
<?php endif;?>
</p>
</div>
@@ -53,14 +53,14 @@
<tbody>
<?php foreach($releases as $release):?>
<tr>
<td><?php echo html::a(helper::createLink('release', 'view', "releaseID=$release->id"), sprintf('%03d', $release->id));?></td>
<td><?php echo html::a(helper::createLink('release', 'view', "releaseID=$release->id", '', '', $this->session->program), sprintf('%03d', $release->id));?></td>
<td>
<?php
$flagIcon = $release->marker ? "<icon class='icon icon-flag-alt' title='{$lang->release->marker}'></icon> " : '';
echo html::a(inlink('view', "release=$release->id"), $release->name) . $flagIcon;
echo html::a($this->createLink('release', 'view', "release=$release->id", '', '', $this->session->program), $release->name) . $flagIcon;
?>
</td>
<td title='<?php echo $release->buildName?>'><?php echo empty($release->project) ? $release->buildName : html::a($this->createLink('build', 'view', "buildID=$release->buildID"), $release->buildName);?></td>
<td title='<?php echo $release->buildName?>'><?php echo empty($release->project) ? $release->buildName : html::a($this->createLink('build', 'view', "buildID=$release->buildID", '', '', $this->session->program), $release->buildName);?></td>
<?php if($product->type != 'normal'):?>
<td class='text-center' title='<?php echo zget($branches, $release->branch, '');?>'><?php echo $branches[$release->branch];?></td>
<?php endif;?>
@@ -71,17 +71,17 @@
</td>
<td class='c-actions'>
<?php
if(common::hasPriv('release', 'linkStory')) echo html::a(inlink('view', "releaseID=$release->id&type=story&link=true"), '<i class="icon-link"></i> ', '', "class='btn' title='{$lang->release->linkStory}'");
if(common::hasPriv('release', 'linkBug') and $config->global->flow != 'onlyStory') echo html::a(inlink('view', "releaseID=$release->id&type=bug&link=true"), '<i class="icon-bug"></i> ', '', "class='btn' title='{$lang->release->linkBug}'");
if(common::hasPriv('release', 'linkStory')) echo html::a($this->createLink('release', 'view', "releaseID=$release->id&type=story&link=true", '', '', $this->session->program), '<i class="icon-link"></i> ', '', "class='btn' title='{$lang->release->linkStory}'");
if(common::hasPriv('release', 'linkBug') and $config->global->flow != 'onlyStory') echo html::a($this->createLink('release', 'view', "releaseID=$release->id&type=bug&link=true", '', '', $this->session->program), '<i class="icon-bug"></i> ', '', "class='btn' title='{$lang->release->linkBug}'");
if(common::hasPriv('release', 'changeStatus', $release))
{
$changedStatus = $release->status == 'normal' ? 'terminate' : 'normal';
echo html::a(inlink('changeStatus', "releaseID=$release->id&status=$changedStatus"), '<i class="icon-' . ($release->status == 'normal' ? 'pause' : 'play') . '"></i> ', 'hiddenwin', "class='btn' title='{$lang->release->changeStatusList[$changedStatus]}'");
echo html::a($this->createLink('release', 'changeStatus', "releaseID=$release->id&status=$changedStatus", '', '', $this->session->program), '<i class="icon-' . ($release->status == 'normal' ? 'pause' : 'play') . '"></i> ', 'hiddenwin', "class='btn' title='{$lang->release->changeStatusList[$changedStatus]}'");
}
common::printIcon('release', 'edit', "release=$release->id", $release, 'list');
common::printIcon('release', 'edit', "release=$release->id", $release, 'list', '', '', '', '', '', '', $this->session->program);
if(common::hasPriv('release', 'delete', $release))
{
$deleteURL = $this->createLink('release', 'delete', "releaseID=$release->id&confirm=yes");
$deleteURL = $this->createLink('release', 'delete', "releaseID=$release->id&confirm=yes", '', '', $this->session->program);
echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"releaseList\", confirmDelete)", '<i class="icon-trash"></i>', '', "class='btn' title='{$lang->release->delete}'");
}
?>
+15 -15
View File
@@ -16,7 +16,7 @@
<?php js::set('confirmUnlinkBug', $lang->release->confirmUnlinkBug)?>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<?php $browseLink = $this->session->releaseList ? $this->session->releaseList : inlink('browse', "productID=$release->product");?>
<?php $browseLink = $this->session->releaseList ? $this->session->releaseList : $this->createLink('release', 'browse', "productID=$release->product", '', '', $this->session->program);?>
<?php common::printBack($browseLink, 'btn btn-primary');?>
<div class='divider'></div>
<div class='page-title'>
@@ -38,10 +38,10 @@
if(common::hasPriv('release', 'changeStatus', $release))
{
$changedStatus = $release->status == 'normal' ? 'terminate' : 'normal';
echo html::a(inlink('changeStatus', "releaseID=$release->id&status=$changedStatus"), '<i class="icon-' . ($release->status == 'normal' ? 'pause' : 'play') . '"></i> ' . $lang->release->changeStatusList[$changedStatus], 'hiddenwin', "class='btn btn-link' title='{$lang->release->changeStatusList[$changedStatus]}'");
echo html::a($this->createLink('release', 'changeStatus', "releaseID=$release->id&status=$changedStatus", '', '', $this->session->program), '<i class="icon-' . ($release->status == 'normal' ? 'pause' : 'play') . '"></i> ' . $lang->release->changeStatusList[$changedStatus], 'hiddenwin', "class='btn btn-link' title='{$lang->release->changeStatusList[$changedStatus]}'");
}
if(common::hasPriv('release', 'edit')) echo html::a($this->createLink('release', 'edit', "releaseID=$release->id"), "<i class='icon-common-edit icon-edit'></i> " . $this->lang->edit, '', "class='btn btn-link' title='{$this->lang->edit}'");
if(common::hasPriv('release', 'delete')) echo html::a($this->createLink('release', 'delete', "releaseID=$release->id"), "<i class='icon-common-delete icon-trash'></i> " . $this->lang->delete, '', "class='btn btn-link' title='{$this->lang->delete}' target='hiddenwin'");
if(common::hasPriv('release', 'edit')) echo html::a($this->createLink('release', 'edit', "releaseID=$release->id", '', '', $this->session->program), "<i class='icon-common-edit icon-edit'></i> " . $this->lang->edit, '', "class='btn btn-link' title='{$this->lang->edit}'");
if(common::hasPriv('release', 'delete')) echo html::a($this->createLink('release', 'delete', "releaseID=$release->id", '', '', $this->session->program), "<i class='icon-common-delete icon-trash'></i> " . $this->lang->delete, '', "class='btn btn-link' title='{$this->lang->delete}' target='hiddenwin'");
}
?>
</div>
@@ -59,7 +59,7 @@
<?php endif;?>
<li <?php if($type == 'releaseInfo') echo "class='active'"?>><a href='#releaseInfo' data-toggle='tab'><?php echo html::icon($lang->icons['plan'], 'text-info') . ' ' . $lang->release->view;?></a></li>
<?php if($countStories or ($config->global->flow != 'onlyStory' and ($countBugs or $countLeftBugs))):?>
<li class='pull-right'><div><?php common::printIcon('release', 'export', '', '', 'button', '', '', "export btn-sm");?></div></li>
<li class='pull-right'><div><?php common::printIcon('release', 'export', '', '', 'button', '', '', "export btn-sm", '', '', '', $this->session->program);?></div></li>
<?php endif;?>
</ul>
<div class='tab-content'>
@@ -93,7 +93,7 @@
</thead>
<tbody class='text-center'>
<?php foreach($stories as $storyID => $story):?>
<?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id", '', true);?>
<?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id", '', true, $this->session->program);?>
<tr>
<td class='c-id text-left'>
<?php if($canBatchUnlink):?>
@@ -121,7 +121,7 @@
<?php
if(common::hasPriv('release', 'unlinkStory'))
{
$unlinkURL = $this->createLink('release', 'unlinkStory', "releaseID=$release->id&story=$story->id");
$unlinkURL = $this->createLink('release', 'unlinkStory', "releaseID=$release->id&story=$story->id", '', '', $this->session->program);
echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '<i class="icon-unlink"></i>', '', "class='btn' title='{$lang->release->unlinkStory}'");
}
?>
@@ -137,13 +137,13 @@
<?php
if(common::hasPriv('release', 'batchUnlinkStory'))
{
$unlinkURL = inlink('batchUnlinkStory', "release=$release->id");
$unlinkURL = $this->createLink('release', 'batchUnlinkStory', "release=$release->id", '', '', $this->session->program);
echo html::a('###', $lang->release->batchUnlink, '', "onclick='setFormAction(\"$unlinkURL\", \"hiddenwin\", this)' class='btn'");
}
if(common::hasPriv('story', 'batchClose'))
{
$closeURL = $this->createLink('story', 'batchClose', "productID=$release->product");
$closeURL = $this->createLink('story', 'batchClose', "productID=$release->product", '', '', $this->session->program);
echo html::a("###", $lang->story->batchClose, '', "onclick='setFormAction(\"$closeURL\", \"\", this)' class='btn'");
}
?>
@@ -183,7 +183,7 @@
</thead>
<tbody class='text-center'>
<?php foreach($bugs as $bug):?>
<?php $bugLink = $this->createLink('bug', 'view', "bugID=$bug->id", '', true);?>
<?php $bugLink = $this->createLink('bug', 'view', "bugID=$bug->id", '', true, $this->session->program);?>
<tr>
<td class='c-id text-left'>
<?php if($canBatchUnlink):?>
@@ -206,7 +206,7 @@
<?php
if(common::hasPriv('release', 'unlinkBug'))
{
$unlinkURL = $this->createLink('release', 'unlinkBug', "releaseID=$release->id&bug=$bug->id");
$unlinkURL = $this->createLink('release', 'unlinkBug', "releaseID=$release->id&bug=$bug->id", '', '', $this->session->program);
echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"bugList\", confirmUnlinkBug)", '<i class="icon-unlink"></i>', '', "class='btn' title='{$lang->release->unlinkBug}'");
}
?>
@@ -231,7 +231,7 @@
<div class='actions'><?php echo html::a("javascript:showLink({$release->id}, \"leftBug\")", '<i class="icon-bug"></i> ' . $lang->release->linkBug, '', "class='btn btn-primary'");?></div>
<div class='linkBox cell hidden'></div>
<?php endif;?>
<form class='main-table table-bug' method='post' target='hiddenwin' action="<?php echo inLink('batchUnlinkBug', "releaseID=$release->id&type=leftBug");?>" id='linkedBugsForm' data-ride="table">
<form class='main-table table-bug' method='post' target='hiddenwin' action="<?php echo $this->createLink('release', 'batchUnlinkBug', "releaseID=$release->id&type=leftBug", '', '', $this->session->program);?>" id='linkedBugsForm' data-ride="table">
<table class='table has-sort-head' id='leftBugList'>
<?php $canBatchUnlink = common::hasPriv('release', 'batchUnlinkBug');?>
<?php $vars = "releaseID={$release->id}&type=leftBug&link=$link&param=$param&orderBy=%s";?>
@@ -266,7 +266,7 @@
?>
<tbody class='text-center'>
<?php foreach($leftBugs as $bug):?>
<?php $bugLink = $this->createLink('bug', 'view', "bugID=$bug->id", '', true);?>
<?php $bugLink = $this->createLink('bug', 'view', "bugID=$bug->id", '', true, $this->session->program);?>
<tr>
<td class='c-id text-left'>
<?php if($canBatchUnlink):?>
@@ -292,7 +292,7 @@
<?php
if(common::hasPriv('release', 'unlinkBug'))
{
$unlinkURL = $this->createLink('release', 'unlinkBug', "releaseID=$release->id&bug=$bug->id&type=leftBug");
$unlinkURL = $this->createLink('release', 'unlinkBug', "releaseID=$release->id&bug=$bug->id&type=leftBug", '', '', $this->session->program);
echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"leftBugList\", confirmUnlinkBug)", '<i class="icon-unlink"></i>', '', "class='btn' title='{$lang->release->unlinkBug}'");
}
?>
@@ -336,7 +336,7 @@
<tr>
<th><?php echo $lang->release->build;?></th>
<td title='<?php echo $release->buildName?>'>
<?php echo ($release->project) ? html::a($this->createLink('build', 'view', "buildID=$release->buildID"), $release->buildName, '_blank') : $release->buildName;?>
<?php echo ($release->project) ? html::a($this->createLink('build', 'view', "buildID=$release->buildID", '', '', $this->session->program), $release->buildName, '_blank') : $release->buildName;?>
</td>
</tr>
<tr>