* Finish task #8194.
This commit is contained in:
@@ -212,6 +212,9 @@ class build extends control
|
||||
$build = $this->build->getById((int)$buildID, true);
|
||||
if(!$build) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
|
||||
/* Determines whether an object is editable. */
|
||||
$changeAllowed = !common::checkParentObjectClosed('build', $build);
|
||||
|
||||
$product = $this->loadModel('product')->getById($build->product);
|
||||
if($product->type != 'normal') $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]);
|
||||
|
||||
@@ -269,6 +272,7 @@ class build extends control
|
||||
$this->view->type = $type;
|
||||
$this->view->bugPager = $bugPager;
|
||||
$this->view->branchName = $build->productType == 'normal' ? '' : $this->loadModel('branch')->getById($build->branch);
|
||||
$this->view->changeAllowed = $changeAllowed;
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ tbody tr td:first-child input{display:none;}
|
||||
</div>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<?php
|
||||
if(!$build->deleted)
|
||||
if(!$build->deleted and $changeAllowed)
|
||||
{
|
||||
echo $this->buildOperateMenu($build, 'view');
|
||||
|
||||
@@ -91,13 +91,13 @@ tbody tr td:first-child input{display:none;}
|
||||
</ul>
|
||||
<div class='tab-content'>
|
||||
<div class='tab-pane <?php if($type == 'story') echo 'active'?>' id='stories'>
|
||||
<?php if(common::hasPriv('build', 'linkStory')):?>
|
||||
<?php if($changeAllowed and common::hasPriv('build', 'linkStory')):?>
|
||||
<div class='actions'><?php echo html::a("javascript:showLink($build->id, \"story\")", '<i class="icon-link"></i> ' . $lang->build->linkStory, '', "class='btn btn-primary'");?></div>
|
||||
<div class='linkBox cell hidden'></div>
|
||||
<?php endif;?>
|
||||
<form class='main-table table-story' data-ride='table' method='post' target='hiddenwin' action='<?php echo inlink('batchUnlinkStory', "buildID={$build->id}")?>' id='linkedStoriesForm'>
|
||||
<table class='table has-sort-head' id='storyList'>
|
||||
<?php $canBatchUnlink = common::hasPriv('build', 'batchUnlinkStory');?>
|
||||
<?php $canBatchUnlink = $changeAllowed and common::hasPriv('build', 'batchUnlinkStory');?>
|
||||
<?php $vars = "buildID={$build->id}&type=story&link=$link¶m=$param&orderBy=%s";?>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
@@ -146,7 +146,7 @@ tbody tr td:first-child input{display:none;}
|
||||
<td><?php echo $lang->story->stageList[$story->stage];?></td>
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
if(common::hasPriv('build', 'unlinkStory'))
|
||||
if($changeAllowed and common::hasPriv('build', 'unlinkStory'))
|
||||
{
|
||||
$unlinkURL = inlink('unlinkStory', "buildID=$build->id&story=$story->id");
|
||||
echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"storyList\", confirmUnlinkStory)", '<i class="icon-unlink"></i>', '', "class='btn btn-icon' title='{$lang->build->unlinkStory}'");
|
||||
@@ -176,13 +176,13 @@ tbody tr td:first-child input{display:none;}
|
||||
</form>
|
||||
</div>
|
||||
<div class='tab-pane <?php if($type == 'bug') echo 'active'?>' id='bugs'>
|
||||
<?php if(common::hasPriv('build', 'linkBug')):?>
|
||||
<?php if($changeAllowed and common::hasPriv('build', 'linkBug')):?>
|
||||
<div class='actions'><?php echo html::a("javascript:showLink($build->id, \"bug\")", '<i class="icon-bug"></i> ' . $lang->build->linkBug, '', "class='btn btn-primary'");?></div>
|
||||
<div class='linkBox cell hidden'></div>
|
||||
<?php endif;?>
|
||||
<form class='main-table table-bug' data-ride='table' method='post' target='hiddenwin' action="<?php echo inLink('batchUnlinkBug', "build=$build->id");?>" id='linkedBugsForm'>
|
||||
<table class='table has-sort-head' id='bugList'>
|
||||
<?php $canBatchUnlink = common::hasPriv('build', 'batchUnlinkBug');?>
|
||||
<?php $canBatchUnlink = $changeAllowed and common::hasPriv('build', 'batchUnlinkBug');?>
|
||||
<?php $vars = "buildID={$build->id}&type=bug&link=$link¶m=$param&orderBy=%s";?>
|
||||
<thead>
|
||||
<tr class='text-center'>
|
||||
@@ -227,7 +227,7 @@ tbody tr td:first-child input{display:none;}
|
||||
<td><?php echo substr($bug->resolvedDate, 5, 11)?></td>
|
||||
<td class='c-actions'>
|
||||
<?php
|
||||
if(common::hasPriv('build', 'unlinkBug'))
|
||||
if($changeAllowed and common::hasPriv('build', 'unlinkBug'))
|
||||
{
|
||||
$unlinkURL = inlink('unlinkBug', "buildID=$build->id&bug=$bug->id");
|
||||
echo html::a("javascript:ajaxDelete(\"$unlinkURL\", \"bugList\", confirmUnlinkBug)", '<i class="icon-unlink"></i>', '', "class='btn btn-icon' title='{$lang->build->unlinkBug}'");
|
||||
|
||||
@@ -945,6 +945,7 @@ class project extends control
|
||||
$this->view->title = $this->projects[$projectID] . $this->lang->colon . $this->lang->testtask->common;
|
||||
$this->view->position[] = html::a($this->createLink('project', 'testtask', "projectID=$projectID"), $this->projects[$projectID]);
|
||||
$this->view->position[] = $this->lang->testtask->common;
|
||||
$this->view->project = $project;
|
||||
$this->view->projectID = $projectID;
|
||||
$this->view->projectName = $this->projects[$projectID];
|
||||
$this->view->pager = $pager;
|
||||
@@ -1047,12 +1048,17 @@ class project extends control
|
||||
$project = $this->commonAction($projectID);
|
||||
$projectID = $project->id;
|
||||
|
||||
/* Determines whether an object is editable. */
|
||||
$changeAllowed = true;
|
||||
if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false;
|
||||
|
||||
$title = $project->name . $this->lang->colon . $this->lang->project->team;
|
||||
$position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name);
|
||||
$position[] = $this->lang->project->team;
|
||||
|
||||
$this->view->title = $title;
|
||||
$this->view->position = $position;
|
||||
$this->view->title = $title;
|
||||
$this->view->position = $position;
|
||||
$this->view->changeAllowed = $changeAllowed;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -1923,6 +1929,7 @@ class project extends control
|
||||
$this->view->title = $title;
|
||||
$this->view->position = $position;
|
||||
$this->view->allProducts = $allProducts;
|
||||
$this->view->project = $project;
|
||||
$this->view->linkedProducts = $linkedProducts;
|
||||
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($allProducts), '', $linkedBranches);
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
</div>
|
||||
<a class="btn btn-link querybox-toggle" id="bysearchTab"><i class="icon icon-search muted"></i> <?php echo $lang->project->byQuery;?></a>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php if(empty($this->config->global->closedProjectStatus) or $project->status != 'closed'):?>
|
||||
<?php common::printLink('build', 'create', "project=$project->id", "<i class='icon icon-plus'></i> " . $lang->build->create, '', "class='btn btn-primary'");?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent">
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
</div>
|
||||
<div class="detail text-center form-actions">
|
||||
<?php echo html::hidden("post", 'post');?>
|
||||
<?php echo html::submitButton();?>
|
||||
<?php if(empty($this->config->global->closedProjectStatus) or $project->status != 'closed') echo html::submitButton();?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -18,14 +18,17 @@
|
||||
</div>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<?php
|
||||
if(commonModel::isTutorialMode())
|
||||
if($changeAllowed)
|
||||
{
|
||||
$wizardParams = helper::safe64Encode("projectID=$project->id");
|
||||
echo html::a($this->createLink('tutorial', 'wizard', "module=project&method=manageMembers¶ms=$wizardParams"), "<i class='icon icon-persons'></i> " . $lang->project->manageMembers, '', "class='btn btn-primary manage-team-btn'");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!empty($app->user->admin) or empty($app->user->rights['rights']['my']['limited'])) common::printLink('project', 'manageMembers', "projectID=$project->id", "<i class='icon icon-persons'></i> " . $lang->project->manageMembers, '', "class='btn btn-primary manage-team-btn'");
|
||||
if(commonModel::isTutorialMode())
|
||||
{
|
||||
$wizardParams = helper::safe64Encode("projectID=$project->id");
|
||||
echo html::a($this->createLink('tutorial', 'wizard', "module=project&method=manageMembers¶ms=$wizardParams"), "<i class='icon icon-persons'></i> " . $lang->project->manageMembers, '', "class='btn btn-primary manage-team-btn'");
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!empty($app->user->admin) or empty($app->user->rights['rights']['my']['limited'])) common::printLink('project', 'manageMembers', "projectID=$project->id", "<i class='icon icon-persons'></i> " . $lang->project->manageMembers, '', "class='btn btn-primary manage-team-btn'");
|
||||
}
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
@@ -52,7 +55,9 @@
|
||||
<th><?php echo $lang->team->hours;?></th>
|
||||
<th><?php echo $lang->team->totalHours;?></th>
|
||||
<th class='w-100px text-center'><?php echo $lang->team->limited;?></th>
|
||||
<?php if($changeAllowed):?>
|
||||
<th class='c-actions-1 w-80px text-center'><?php echo $lang->actions;?></th>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -72,6 +77,7 @@
|
||||
<td><?php echo $member->hours . $lang->project->workHour;?></td>
|
||||
<td><?php echo $memberHours . $lang->project->workHour;?></td>
|
||||
<td class="text-center"><?php echo $lang->team->limitedList[$member->limited];?></td>
|
||||
<?php if($changeAllowed):?>
|
||||
<td class='c-actions text-center'>
|
||||
<?php
|
||||
if (common::hasPriv('project', 'unlinkMember', $member))
|
||||
@@ -81,6 +87,7 @@
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
|
||||
@@ -29,7 +29,9 @@
|
||||
</div>
|
||||
<div class="btn-toolbar pull-right">
|
||||
<?php common::printIcon('testreport', 'browse', "objectID=$projectID&objectType=project", '', 'button','flag muted');?>
|
||||
<?php if(empty($this->config->global->closedProjectStatus) or $project->status != 'closed'):?>
|
||||
<?php common::printLink('testtask', 'create', "product=0&project=$projectID", "<i class='icon icon-plus'></i> " . $lang->testtask->create, '', "class='btn btn-primary'");?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent">
|
||||
|
||||
Reference in New Issue
Block a user