* Finish task #8194.
This commit is contained in:
@@ -107,8 +107,15 @@ class docModel extends model
|
||||
}
|
||||
}
|
||||
|
||||
/* Determines whether the doc lib is editable. */
|
||||
$docLib = new stdClass();
|
||||
$docLib->product = $productID;
|
||||
$docLib->project = $projectID;
|
||||
$changeAllowed = common::checkObjectChangeAllowed('doc', $docLib);
|
||||
|
||||
$lib = isset($lib) ? $lib : new stdClass();
|
||||
$actions = $this->setFastMenu($fastLib);
|
||||
$actions .= common::hasPriv('doc', 'createLib') ? html::a(helper::createLink('doc', 'createLib', "type={$type}&objectID={$currentLib}"), "<i class='icon icon-plus'></i> " . $this->lang->doc->createLib, '', "class='btn btn-secondary iframe'") : '';
|
||||
$actions .= ($changeAllowed and common::hasPriv('doc', 'createLib', $lib)) ? html::a(helper::createLink('doc', 'createLib', "type={$type}&objectID={$currentLib}"), "<i class='icon icon-plus'></i> " . $this->lang->doc->createLib, '', "class='btn btn-secondary iframe'") : '';
|
||||
|
||||
$this->lang->TRActions = $actions;
|
||||
}
|
||||
|
||||
+17
-12
@@ -1576,6 +1576,10 @@ class project extends control
|
||||
$project = $this->project->getById($projectID, true);
|
||||
if(!$project) die(js::error($this->lang->notFound) . js::locate('back'));
|
||||
|
||||
/* Determines whether an object is editable. */
|
||||
$changeAllowed = true;
|
||||
if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false;
|
||||
|
||||
$products = $this->project->getProducts($project->id);
|
||||
$linkedBranches = array();
|
||||
foreach($products as $product)
|
||||
@@ -1600,18 +1604,19 @@ class project extends control
|
||||
$this->view->position[] = html::a($this->createLink('project', 'browse', "projectID=$projectID"), $project->name);
|
||||
$this->view->position[] = $this->view->title;
|
||||
|
||||
$this->view->project = $project;
|
||||
$this->view->products = $products;
|
||||
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), '', $linkedBranches);
|
||||
$this->view->planGroups = $this->project->getPlans($products);
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->actions = $this->loadModel('action')->getList('project', $projectID);
|
||||
$this->view->dynamics = $this->loadModel('action')->getDynamic('all', 'all', 'date_desc', $pager, 'all', $projectID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->teamMembers = $this->project->getTeamMembers($projectID);
|
||||
$this->view->docLibs = $this->loadModel('doc')->getLibsByObject('project', $projectID);
|
||||
$this->view->statData = $this->project->statRelatedData($projectID);
|
||||
$this->view->chartData = $chartData;
|
||||
$this->view->project = $project;
|
||||
$this->view->products = $products;
|
||||
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), '', $linkedBranches);
|
||||
$this->view->planGroups = $this->project->getPlans($products);
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->actions = $this->loadModel('action')->getList('project', $projectID);
|
||||
$this->view->dynamics = $this->loadModel('action')->getDynamic('all', 'all', 'date_desc', $pager, 'all', $projectID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->teamMembers = $this->project->getTeamMembers($projectID);
|
||||
$this->view->docLibs = $this->loadModel('doc')->getLibsByObject('project', $projectID);
|
||||
$this->view->statData = $this->project->statRelatedData($projectID);
|
||||
$this->view->chartData = $chartData;
|
||||
$this->view->changeAllowed = $changeAllowed;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<?php echo !empty($story->verify) ? $story->verify : "<div class='text-center text-muted'>" . $lang->noData . '</div>';?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true'));?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $story->files, 'fieldset' => 'true', 'object' => $story));?>
|
||||
|
||||
<details class="detail" open>
|
||||
<summary class="detail-title"><?php echo $lang->story->legendBasicInfo;?></summary>
|
||||
@@ -341,7 +341,7 @@
|
||||
</table>
|
||||
</div>
|
||||
</details>
|
||||
<?php $actionFormLink = $this->createLink('action', 'comment', "objectType=story&objectID=$story->id");?>
|
||||
<?php if(common::checkObjectChangeAllowed('story', $story)) $actionFormLink = $this->createLink('action', 'comment', "objectType=story&objectID=$story->id");?>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
<script>
|
||||
<?php if(isset($pageJS)) echo $pageJS;?>
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<div class='detail-content article-content'>
|
||||
<?php echo (!empty($task->storySpec) || !empty($task->storyFiles)) ? $task->storySpec : "<div class='text-center text-muted'>" . $lang->noData . '</div>';?>
|
||||
</div>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $task->storyFiles, 'fieldset' => 'false'));?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $task->storyFiles, 'fieldset' => 'false', 'object' => $task));?>
|
||||
</div>
|
||||
<div class='detail' open>
|
||||
<div class='detail-title'><?php echo $lang->task->storyVerify;?></div>
|
||||
@@ -78,8 +78,8 @@
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $task->files, 'fieldset' => 'true'));?>
|
||||
<?php $actionFormLink = $this->createLink('action', 'comment', "objectType=task&objectID=$task->id");?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $task->files, 'fieldset' => 'true', 'object' => $task));?>
|
||||
<?php if(common::checkObjectChangeAllowed('task', $task)) $actionFormLink = $this->createLink('action', 'comment', "objectType=task&objectID=$task->id");?>
|
||||
<?php include '../../common/view/action.html.php';?>
|
||||
<script>
|
||||
<?php if(isset($pageJS)) echo $pageJS;?>
|
||||
|
||||
@@ -102,7 +102,7 @@
|
||||
<?php $j++;?>
|
||||
<?php endforeach;?>
|
||||
<div class="col-xs-6">
|
||||
<?php common::printLink('project', 'manageMembers', "projectID=$project->id", "<i class='icon icon-plus hl-primary text-primary'></i> " . $lang->project->manageMembers, '', "class='text-muted'");?>
|
||||
<?php if($changeAllowed) common::printLink('project', 'manageMembers', "projectID=$project->id", "<i class='icon icon-plus hl-primary text-primary'></i> " . $lang->project->manageMembers, '', "class='text-muted'");?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
@@ -133,7 +133,7 @@
|
||||
<?php $i++;?>
|
||||
<?php endforeach;?>
|
||||
<div class="col-xs-6">
|
||||
<?php common::printLink('doc', 'createLib', "type=project&objectID=$project->id", "<i class='icon icon-plus hl-primary text-primary'></i> " . $lang->doc->createLib, '', "class='text-muted iframe' data-width='1000px'");?>
|
||||
<?php if($changeAllowed) common::printLink('doc', 'createLib', "type=project&objectID=$project->id", "<i class='icon icon-plus hl-primary text-primary'></i> " . $lang->doc->createLib, '', "class='text-muted iframe' data-width='1000px'");?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
$divideLang = ($story->type == 'story' || !$story->type) ? $lang->story->subdivide : $lang->story->splitRequirent;
|
||||
$misc = "class='btn divideStory' data-toggle='modal' data-type='iframe' data-width='95%'";
|
||||
$link = $this->createLink('story', 'batchCreate', "productID=$story->product&branch=$story->branch&moduleID=$story->module&storyID=$story->id", '', true);
|
||||
if(common::hasPriv('story', 'batchCreate')) echo html::a($link, "<i class='icon icon-treemap-alt'></i> " . $divideLang, '', $misc);
|
||||
if(common::hasPriv('story', 'batchCreate', $story)) echo html::a($link, "<i class='icon icon-treemap-alt'></i> " . $divideLang, '', $misc);
|
||||
}
|
||||
|
||||
common::printIcon('story', 'assignTo', "storyID=$story->id", $story, 'button', '', '', 'iframe showinonlybody', true);
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<?php if(!isonlybody()):?>
|
||||
<div class='btn-toolbar pull-right'>
|
||||
<button type='button' class='btn btn-secondary fullscreen-btn' title='<?php echo $lang->retrack;?>'><i class='icon icon-fullscreen'></i><?php echo ' ' . $lang->retrack;?></button>
|
||||
<?php common::printLink('testcase', 'create', "productID={$case->product}&branch={$case->branch}&moduleID={$case->module}", "<i class='icon icon-plus'></i>" . $lang->testcase->create, '', "class='btn btn-primary'"); ?>
|
||||
<?php if(common::checkObjectChangeAllowed('testcase', $case)) common::printLink('testcase', 'create', "productID={$case->product}&branch={$case->branch}&moduleID={$case->module}", "<i class='icon icon-plus'></i>" . $lang->testcase->create, '', "class='btn btn-primary'"); ?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
@@ -105,7 +105,7 @@
|
||||
<div class="detail-content article-content"><?php echo nl2br(htmlspecialchars($case->xml));?></div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $case->files, 'fieldset' => 'true'));?>
|
||||
<?php echo $this->fetch('file', 'printFiles', array('files' => $case->files, 'fieldset' => 'true', 'object' => $case));?>
|
||||
</div>
|
||||
<?php $this->printExtendFields($case, 'div', "position=left&inForm=0&inCell=1");?>
|
||||
<div class='main-actions'>
|
||||
@@ -194,7 +194,7 @@
|
||||
if($case->story and $case->storyStatus == 'active' and $case->latestStoryVersion > $case->storyVersion)
|
||||
{
|
||||
echo "(<span class='warning'>{$lang->story->changed}</span> ";
|
||||
if(common::hasPriv('testcase', 'confirmStoryChange')) echo html::a($this->createLink('testcase', 'confirmStoryChange', "caseID=$case->id"), $lang->confirm, 'hiddenwin');
|
||||
if(common::hasPriv('testcase', 'confirmStoryChange', $case)) echo html::a($this->createLink('testcase', 'confirmStoryChange', "caseID=$case->id"), $lang->confirm, 'hiddenwin');
|
||||
echo ")";
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user