* Finish task#46543.

This commit is contained in:
xieqiyu
2021-12-28 13:38:35 +08:00
parent 03d56f4c19
commit 5ab26fee54
8 changed files with 30 additions and 18 deletions

View File

@@ -296,5 +296,5 @@ $config->newFeatures = array('introduction', 'tutorial', 'youngBlueTheme');
/* Program privs.*/ /* Program privs.*/
$config->programPriv = new stdclass(); $config->programPriv = new stdclass();
$config->programPriv->scrum = array('projectstory', 'projectrelease', 'project', 'build', 'bug', 'testcase', 'testreport', 'caselib', 'doc', 'repo', 'meeting', 'stakeholder'); $config->programPriv->scrum = array('projectstory', 'projectrelease', 'project', 'build', 'bug', 'testcase', 'testreport', 'doc', 'repo', 'meeting', 'stakeholder');
$config->programPriv->waterfall = array_merge($config->programPriv->scrum, array('workestimation', 'durationestimation', 'budget', 'programplan', 'review', 'reviewissue', 'weekly', 'cm', 'milestone', 'design', 'issue', 'risk', 'opportunity', 'measrecord', 'auditplan', 'trainplan', 'gapanalysis', 'pssp', 'researchplan', 'researchreport')); $config->programPriv->waterfall = array_merge($config->programPriv->scrum, array('workestimation', 'durationestimation', 'budget', 'programplan', 'review', 'reviewissue', 'weekly', 'cm', 'milestone', 'design', 'issue', 'risk', 'opportunity', 'measrecord', 'auditplan', 'trainplan', 'gapanalysis', 'pssp', 'researchplan', 'researchreport'));

View File

@@ -289,7 +289,7 @@
<td> <td>
<?php <?php
if($bug->story) echo html::a($this->createLink('story', 'view', "storyID=$bug->story", '', true), "#$bug->story $bug->storyTitle", '', "class='iframe' data-width='80%'"); if($bug->story) echo html::a($this->createLink('story', 'view', "storyID=$bug->story", '', true), "#$bug->story $bug->storyTitle", '', "class='iframe' data-width='80%'");
if($bug->storyStatus == 'active' and $bug->latestStoryVersion > $bug->storyVersion) if($bug->storyStatus == 'active' and $bug->latestStoryVersion > $bug->storyVersion and common::hasPriv('bug', 'confirmStoryChange'))
{ {
echo "(<span class='warning'>{$lang->story->changed}</span> "; echo "(<span class='warning'>{$lang->story->changed}</span> ";
echo html::a($this->createLink('bug', 'confirmStoryChange', "bugID=$bug->id"), $lang->confirm, 'hiddenwin'); echo html::a($this->createLink('bug', 'confirmStoryChange', "bugID=$bug->id"), $lang->confirm, 'hiddenwin');

View File

@@ -1914,19 +1914,23 @@ class docModel extends model
$html = "<div class='dropdown' id='createDropdown'>"; $html = "<div class='dropdown' id='createDropdown'>";
$html .= "<button class='btn btn-primary' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i> " . $this->lang->doc->createAB . " <span class='caret'></span></button>"; $html .= "<button class='btn btn-primary' type='button' data-toggle='dropdown'><i class='icon icon-plus'></i> " . $this->lang->doc->createAB . " <span class='caret'></span></button>";
$html .= "<ul class='dropdown-menu pull-right'>"; $html .= "<ul class='dropdown-menu pull-right'>";
foreach($this->lang->doc->typeList as $typeKey => $typeName)
if(common::hasPriv('doc', 'create'))
{ {
$class = strpos($this->config->doc->officeTypes, $typeKey) !== false ? 'iframe' : ''; foreach($this->lang->doc->typeList as $typeKey => $typeName)
$icon = zget($this->config->doc->iconList, $typeKey); {
$html .= "<li>"; $class = strpos($this->config->doc->officeTypes, $typeKey) !== false ? 'iframe' : '';
$html .= html::a(helper::createLink('doc', 'create', "objectType=$objectType&objectID=$objectID&libID=$libID&moduleID=0&type=$typeKey", '', $class ? true : false), "<i class='icon-$icon icon'></i> " . $typeName, '', "class='$class' data-app='{$this->app->tab}'"); $icon = zget($this->config->doc->iconList, $typeKey);
$html .= "</li>"; $html .= "<li>";
if($typeKey == 'url') $html .= '<li class="divider"></li>'; $html .= html::a(helper::createLink('doc', 'create', "objectType=$objectType&objectID=$objectID&libID=$libID&moduleID=0&type=$typeKey", '', $class ? true : false), "<i class='icon-$icon icon'></i> " . $typeName, '', "class='$class' data-app='{$this->app->tab}'");
$html .= "</li>";
if($typeKey == 'url') $html .= '<li class="divider"></li>';
}
} }
if(common::hasPriv('doc', 'createLib')) if(common::hasPriv('doc', 'createLib'))
{ {
$html .= '<li class="divider"></li>'; if(common::hasPriv('doc', 'create')) $html .= '<li class="divider"></li>';
$html .= '<li>' . html::a(helper::createLink('doc', 'createLib', "type=$objectType&objectID=$objectID"), "<i class='icon-doc-lib icon'></i> " . $this->lang->doc->createLib, '', "class='iframe' data-width='70%'") . '</li>'; $html .= '<li>' . html::a(helper::createLink('doc', 'createLib', "type=$objectType&objectID=$objectID"), "<i class='icon-doc-lib icon'></i> " . $this->lang->doc->createLib, '', "class='iframe' data-width='70%'") . '</li>';
} }
$html .= "</ul></div>"; $html .= "</ul></div>";
@@ -2580,7 +2584,7 @@ EOT;
if($tab != 'doc') $this->loadModel($tab)->setMenu($objectID); if($tab != 'doc') $this->loadModel($tab)->setMenu($objectID);
$this->lang->TRActions = $this->buildCollectButton4Doc(); $this->lang->TRActions = $this->buildCollectButton4Doc();
$this->lang->TRActions .= common::hasPriv('doc', 'create') ? $this->buildCreateButton4Doc($type, $objectID, $libID) : ''; $this->lang->TRActions .= $this->buildCreateButton4Doc($type, $objectID, $libID);
return array($libs, $libID, $object, $objectID); return array($libs, $libID, $object, $objectID);
} }

View File

@@ -25,10 +25,12 @@
<th><?php echo $lang->group->desc;?></th> <th><?php echo $lang->group->desc;?></th>
<td><?php echo html::textarea('desc', '', "rows=5 class=form-control");?></td> <td><?php echo html::textarea('desc', '', "rows=5 class=form-control");?></td>
</tr> </tr>
<?php if($this->app->tab != 'project'):?>
<tr> <tr>
<th><?php echo $lang->group->limited;?></th> <th><?php echo $lang->group->limited;?></th>
<td><?php echo html::checkbox('limited', '');?></td> <td><?php echo html::checkbox('limited', '');?></td>
</tr> </tr>
<?php endif;?>
<tr> <tr>
<td colspan='2' class='text-center'><?php echo html::submitButton();?></td> <td colspan='2' class='text-center'><?php echo html::submitButton();?></td>
</tr> </tr>

View File

@@ -125,7 +125,11 @@ $config->project->datatable->fieldList['actions']['width'] = '180';
$config->project->datatable->fieldList['actions']['required'] = 'yes'; $config->project->datatable->fieldList['actions']['required'] = 'yes';
$config->project->datatable->fieldList['actions']['pri'] = '1'; $config->project->datatable->fieldList['actions']['pri'] = '1';
$config->project->removePriv['project'] = array('index', 'browse', 'kanban', 'create', 'batchEdit', 'qa', 'updateOrder', 'createGuide', 'programTitle'); $config->project->removePriv['project'] = array('index', 'browse', 'kanban', 'create', 'batchEdit', 'qa', 'updateOrder', 'createGuide', 'programTitle', 'export');
$config->project->removePriv['bug'] = array('batchChangePlan'); $config->project->removePriv['bug'] = array('browse', 'batchChangePlan', 'batchCreate', 'batchEdit', 'batchConfirm', 'batchResolve', 'batchClose', 'batchActivate', 'report', 'batchChangeModule', 'batchChangeBranch');
$config->project->removePriv['doc'] = array('catalog', 'index'); $config->project->removePriv['testcase'] = array('browse', 'batchChangeModule', 'batchChangeBranch');
$config->project->removePriv['auditplan'] = array('delete'); $config->project->removePriv['doc'] = array('catalog', 'index');
$config->project->removePriv['repo'] = array('edit', 'delete', 'maintain', 'setRules');
$config->project->removePriv['testreport'] = array('browse');
$config->project->removePriv['auditplan'] = array('delete');
if(!isset($config->maxVersion)) $config->project->removePriv['stakeholder'] = array('issue', 'viewIssue', 'userIssue');

View File

@@ -2079,8 +2079,8 @@ class projectModel extends model
$this->lang->switcherMenu = $this->getSwitcher($objectID, $this->app->rawModule, $this->app->rawMethod); $this->lang->switcherMenu = $this->getSwitcher($objectID, $this->app->rawModule, $this->app->rawMethod);
/* Reset project priv. */ /* Reset project priv. */
$moduleName = $this->app->getModuleName(); $moduleName = $this->app->rawModule;
$methodName = $this->app->getMethodName(); $methodName = $this->app->rawMethod;
$this->loadModel('common')->resetProjectPriv($objectID); $this->loadModel('common')->resetProjectPriv($objectID);
if(!$this->common->isOpenMethod($moduleName, $methodName) and !commonModel::hasPriv($moduleName, $methodName)) $this->common->deny($moduleName, $methodName, false); if(!$this->common->isOpenMethod($moduleName, $methodName) and !commonModel::hasPriv($moduleName, $methodName)) $this->common->deny($moduleName, $methodName, false);

View File

@@ -1325,6 +1325,8 @@ class testtask extends control
*/ */
public function results($runID, $caseID = 0, $version = 0) public function results($runID, $caseID = 0, $version = 0)
{ {
if($this->app->tab == 'project') $this->loadModel('project')->setMenu($this->session->project);
if($runID) if($runID)
{ {
$case = $this->testtask->getRunById($runID)->case; $case = $this->testtask->getRunById($runID)->case;

View File

@@ -120,7 +120,7 @@
<?php endif; endif; $childId++;?> <?php endif; endif; $childId++;?>
</tr> </tr>
<?php endforeach;?> <?php endforeach;?>
<?php if($result->caseResult == 'fail'):?> <?php if($result->caseResult == 'fail' and common::hasPriv('testcase', 'createBug')):?>
<tr> <tr>
<td></td><td></td><td></td><td></td><td></td><td></td> <td></td><td></td><td></td><td></td><td></td><td></td>
<td><?php echo html::commonButton($lang->testcase->createBug, "onclick='createBug(this)'", "btn btn-primary createBtn");?></td> <td><?php echo html::commonButton($lang->testcase->createBug, "onclick='createBug(this)'", "btn btn-primary createBtn");?></td>