* Finish task #8194.

This commit is contained in:
holan20180123
2020-11-10 14:06:00 +08:00
parent 159cd5c41d
commit f80458f916
5 changed files with 32 additions and 10 deletions
+6 -1
View File
@@ -1642,6 +1642,10 @@ class project extends control
$bugs = $this->loadModel('bug')->getProjectBugs($projectID);
$stories = $this->loadModel('story')->getProjectStories($projectID, $orderBy);
/* Determines whether an object is editable. */
$changeAllowed = true;
if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false;
$kanbanGroup = $this->project->getKanbanGroupData($stories, $tasks, $bugs, $type);
$kanbanSetting = $this->project->getKanbanSetting();
@@ -1658,9 +1662,10 @@ class project extends control
$this->view->type = $type;
$this->view->kanbanGroup = $kanbanGroup;
$this->view->kanbanColumns = $this->project->getKanbanColumns($kanbanSetting);
$this->view->statusMap = $this->project->getKanbanStatusMap($kanbanSetting);
$this->view->statusMap = $changeAllowed ? $this->project->getKanbanStatusMap($kanbanSetting) : array();
$this->view->statusList = $this->project->getKanbanStatusList($kanbanSetting);
$this->view->colorList = $this->project->getKanbanColorList($kanbanSetting);
$this->view->changeAllowed = $changeAllowed;
$this->display();
}
+4
View File
@@ -18,6 +18,7 @@
$link = $this->createLink('task', 'export', "project=$projectID&orderBy=$orderBy&type=kanban");
if(common::hasPriv('task', 'export')) echo html::a($link, "<i class='icon-export muted'></i> " . $lang->task->export, '', "class='btn btn-link iframe export' data-width='700'");
?>
<?php if($changeAllowed):?>
<div class='btn-group'>
<button type='button' class='btn btn-link dropdown-toggle' data-toggle='dropdown' id='importAction'>
<i class='icon-import muted'></i> <?php echo $lang->import ?>
@@ -42,6 +43,7 @@
$link = common::hasPriv('task', 'create', $checkObject) ? $this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : ''), '', true) : '#';
echo html::a($link, "<i class='icon icon-plus'></i>" . $lang->task->create, '', $misc);
?>
<?php endif;?>
</div>
</div>
<style>
@@ -115,6 +117,7 @@
echo "<span class='group-title' title='{$story->title}'>{$story->title}</span>";
}
?>
<?php if($changeAllowed):?>
<nav class='board-actions nav nav-default'>
<li class='dropdown'>
<a href='javascript:;' data-toggle='dropdown' class='panel-action'><i class='icon icon-ellipsis-v'></i></a>
@@ -130,6 +133,7 @@
</ul>
</li>
</nav>
<?php endif;?>
</div>
<div class="small group-info">
<span class='story-id board-id' title='<?php echo $lang->story->id?>'>#<?php echo $story->id?></span>
+11
View File
@@ -43,6 +43,9 @@ class tree extends control
$this->view->branches = $branches;
}
$this->view->root = $product;
/* Determines whether an object is editable. */
$changeAllowed = (empty($this->config->global->closedProductStatus) or $product->status != 'closed') ? true : false;
}
elseif(strpos($viewType, 'doc') !== false)
{
@@ -192,6 +195,7 @@ class tree extends control
$this->view->parentModules = $parentModules;
$this->view->branch = $branch;
$this->view->tree = $this->tree->getProductStructure($rootID, $viewType);
$this->view->changeAllowed = isset($changeAllowed) ? $changeAllowed : true;
$this->display();
}
@@ -206,12 +210,18 @@ class tree extends control
*/
public function browseTask($rootID, $productID = 0, $currentModuleID = 0)
{
/* Get project. */
$project = $this->loadModel('project')->getById($rootID);
$this->view->root = $project;
/* Get all associated products. */
$products = $this->project->getProducts($rootID);
$this->view->products = $products;
/* Determines whether an object is editable. */
$changeAllowed = (empty($this->config->global->closedProjectStatus) or $project->status != 'closed') ? true : false;
/* Set menu. */
$this->lang->set('menugroup.tree', 'project');
$this->project->setMenu($this->project->getPairs(), $rootID);
$this->lang->tree->menu = $this->lang->project->menu;
@@ -240,6 +250,7 @@ class tree extends control
$this->view->parentModules = $parentModules;
$this->view->currentModuleID = $currentModuleID;
$this->view->tree = $this->tree->getTaskStructure($rootID, $productID);
$this->view->changeAllowed = $changeAllowed;
$this->display();
}
+6 -5
View File
@@ -80,7 +80,7 @@ li.tree-item-story > .tree-actions .tree-action[data-type=delete]{display:none;}
<?php $manageChild = 'manage' . ucfirst($viewType) . 'Child';?>
<?php if(strpos($viewType, 'trainskill') === false and strpos($viewType, 'trainpost') === false) echo strpos($viewType, 'doc') !== false ? $lang->doc->manageType : $lang->tree->$manageChild;?>
</div>
<?php if($viewType == 'story' and $allProduct):?>
<?php if($viewType == 'story' and $allProduct and $changeAllowed):?>
<div class="panel-actions btn-toolbar"><?php echo html::a('javascript:toggleCopy()', $lang->tree->syncFromProduct, '', "class='btn btn-sm btn-primary'")?></div>
<?php endif;?>
</div>
@@ -159,7 +159,7 @@ li.tree-item-story > .tree-actions .tree-action[data-type=delete]{display:none;}
<td></td>
<?php endif;?>
<td colspan="2" class="form-actions">
<?php echo html::submitButton();?>
<?php if($changeAllowed) echo html::submitButton();?>
<?php echo html::a($backLink, $lang->goback, '', "class='btn btn-wide'");?>
<?php echo html::hidden('parentModuleID', $currentModuleID);?>
<?php echo html::hidden('maxOrder', $maxOrder);?>
@@ -265,9 +265,10 @@ $(function()
}
};
if(<?php echo common::hasPriv('tree', 'updateorder') ? 'false' : 'true' ?>) options.actions["sort"] = false;
if(<?php echo common::hasPriv('tree', 'edit') ? 'false' : 'true' ?>) options.actions["edit"] = false;
if(<?php echo common::hasPriv('tree', 'delete') ? 'false' : 'true' ?>) options.actions["delete"] = false;
if(<?php echo (common::hasPriv('tree', 'updateorder') and $changeAllowed) ? 'false' : 'true' ?>) options.actions["sort"] = false;
if(<?php echo (common::hasPriv('tree', 'edit') and $changeAllowed) ? 'false' : 'true' ?>) options.actions["edit"] = false;
if(<?php echo (common::hasPriv('tree', 'delete') and $changeAllowed) ? 'false' : 'true' ?>) options.actions["delete"] = false;
if(<?php echo $changeAllowed ? 'false' : 'true' ?>) options.actions["subModules"] = false;
var $tree = $('#modulesTree').tree(options);
+5 -4
View File
@@ -112,7 +112,7 @@ li.story-item > .tree-actions .tree-action[data-type=delete]{display:none;}
<td></td>
<td colspan='2' class="form-actions">
<?php
echo html::submitButton();
if($changeAllowed) echo html::submitButton();
echo html::a($backLink, $lang->goback, '', "class='btn btn-wide'");
echo html::hidden('parentModuleID', $currentModuleID);
echo html::hidden('maxOrder', $maxOrder);
@@ -216,9 +216,10 @@ $(function()
}
};
if(<?php echo common::hasPriv('tree', 'updateorder') ? 'false' : 'true' ?>) options.actions["sort"] = false;
if(<?php echo common::hasPriv('tree', 'edit') ? 'false' : 'true' ?>) options.actions["edit"] = false;
if(<?php echo common::hasPriv('tree', 'delete') ? 'false' : 'true' ?>) options.actions["delete"] = false;
if(<?php echo (common::hasPriv('tree', 'updateorder') and $changeAllowed) ? 'false' : 'true' ?>) options.actions["sort"] = false;
if(<?php echo (common::hasPriv('tree', 'edit') and $changeAllowed) ? 'false' : 'true' ?>) options.actions["edit"] = false;
if(<?php echo (common::hasPriv('tree', 'delete') and $changeAllowed) ? 'false' : 'true' ?>) options.actions["delete"] = false;
if(<?php echo $changeAllowed ? 'false' : 'true' ?>) options.actions["subModules"] = false;
var $tree = $('#modulesTree').tree(options);