* Fix the issue of viewing card permissions.

This commit is contained in:
tianshujie
2021-12-15 09:50:06 +08:00
parent 54ac398d46
commit 58e48d0e5f
3 changed files with 91 additions and 79 deletions
+8 -6
View File
@@ -194,16 +194,18 @@ function renderLaneName($lane, lane, $kanban, columns, kanban)
*/
function renderKanbanItem(item, $item)
{
var $title = $item.children('.title');
var $title = $item.children('.title');
var privs = item.actions;
var printMoreBtn = (privs.includes('editCard') || privs.includes('archiveCard') || privs.includes('copyCard') || privs.includes('deleteCard') || privs.includes('moveCard') || privs.includes('setCardColor'));
if(!$title.length)
{
$title = $('<a class="title iframe" data-toggle="modal" data-width="80%"></a>')
.appendTo($item);
if(privs.includes('viewCard')) $title = $('<a class="title iframe" data-toggle="modal" data-width="80%"></a>').appendTo($item).attr('href', createLink('kanban', 'viewCard', 'cardID=' + item.id, '', true));
if(!privs.includes('viewCard')) $title = $('<p></p>').appendTo($item);
}
$title.text(item.name);
$title.attr('href', createLink('kanban', 'viewCard', 'cardID=' + item.id, '', true));
if(item.actions.length)
$title.text(item.name);
if(printMoreBtn)
{
$(
[
+1 -1
View File
@@ -569,7 +569,7 @@ class kanbanModel extends model
//->orderBy('`order` asc')
->fetchAll('id');
$actions = array('editCard', 'archiveCard', 'copyCard', 'deleteCard', 'moveCard', 'setCardColor');
$actions = array('editCard', 'archiveCard', 'copyCard', 'deleteCard', 'moveCard', 'setCardColor', 'viewCard');
$cardGroup = array();
foreach($cards as $card)
{
+82 -72
View File
@@ -14,23 +14,21 @@
<?php include '../../common/view/kindeditor.html.php';?>
<div id="mainMenu" class="clearfix">
<div class="btn-toolbar pull-left">
<div class='main-header'>
<div class="page-title">
<span class="label label-id"><?php echo $card->id?></span>
<span class="text" title='<?php echo $card->name;?>'><?php echo $card->name;?></span>
</div>
<div class="page-title">
<span class="label label-id"><?php echo $card->id?></span>
<span class="text" title='<?php echo $card->name;?>'><?php echo $card->name;?></span>
</div>
</div>
</div>
<div id="mainContent" class="main-row">
<div class='main-col col-8'>
<div class='cell'>
<div class='detail'>
<div class="main-col col-8">
<div class="cell">
<div class="detail">
<div class='detail-title'><?php echo $lang->kanbancard->desc;?></div>
<div class="detail-content article-content"><?php echo $card->desc;?></div>
</div>
</div>
<div class='cell'>
<div class="cell">
<?php $actionFormLink = $this->createLink('action', 'comment', "objectType=kanbancard&objectID=$card->id");?>
<?php include '../../common/view/action.html.php';?>
</div>
@@ -38,87 +36,99 @@
<div class="btn-toolbar">
<?php if(!$card->deleted):?>
<?php
common::printLink('kanban', 'assigntocard', "cardID=$card->id", "<i class='icon icon-hand-right'></i><span class='text'>{$lang->kanbancard->assign}</span>", '', "class='btn btn-link iframe' title='{$lang->kanbancard->assign}'", true, true);
common::printLink('kanban', 'archivecard', "cardID=$card->id", "<i class='icon icon-ban-circle'></i><span class='text'>{$lang->kanbancard->archive}</span>", '', "class='btn btn-link iframe' title='{$lang->kanbancard->archive}'", true, true);
common::printLink('kanban', 'assigntoCard', "cardID=$card->id", "<i class='icon icon-hand-right'></i><span class='text'>{$lang->kanbancard->assign}</span>", '', "class='btn btn-link iframe' title='{$lang->kanbancard->assign}'", true, true);
common::printLink('kanban', 'archiveCard', "cardID=$card->id", "<i class='icon icon-ban-circle'></i><span class='text'>{$lang->kanbancard->archive}</span>", '', "class='btn btn-link iframe' title='{$lang->kanbancard->archive}'", true, true);
echo "<div class='divider'></div>";
common::printLink('kanban', 'editcard', "cardID=$card->id", '<i class="icon icon-edit"></i>', '', "class='btn btn-link iframe' data-width='80%' title='{$lang->kanbancard->edit}'", true, true);
common::printLink('kanban', 'copycard', "cardID=$card->id", '<i class="icon icon-copy"></i>', '', "class='btn btn-link iframe' title='{$lang->kanbancard->copy}'", true, true);
common::printLink('kanban', 'deletecard', "cardID=$card->id", '<i class="icon icon-trash"></i>', '', "class='btn btn-link iframe' title='{$lang->kanbancard->delete}'",true, true);
common::printLink('kanban', 'editCard', "cardID=$card->id", '<i class="icon icon-edit"></i>', '', "class='btn btn-link iframe' data-width='80%' title='{$lang->kanbancard->edit}'", true, true);
common::printLink('kanban', 'copyCard', "cardID=$card->id", '<i class="icon icon-copy"></i>', '', "class='btn btn-link iframe' title='{$lang->kanbancard->copy}'", true, true);
common::printLink('kanban', 'deleteCard', "cardID=$card->id", '<i class="icon icon-trash"></i>', '', "class='btn btn-link iframe' title='{$lang->kanbancard->delete}'",true, true);
?>
<?php endif;?>
</div>
</div>
</div>
<div class='side-col col-4'>
<div class='cell'>
<div class="side-col col-4">
<div class="cell">
<div class='tabs'>
<ul class='nav nav-tabs'>
<li class='active'><a href='' data-toggle='tab'><?php echo $lang->kanbancard->legendBasicInfo;?></a></li>
</ul>
<table class="table table-data">
<tr>
<th><?php echo $lang->kanbancard->assignedTo;?></th>
<td>
<?php $assignedToPairs = array_filter(explode(',', $card->assignedTo));?>
<?php if(!empty($assignedToPairs)):?>
<div class='kanban-members pull-left'>
<?php foreach($assignedToPairs as $member):?>
<div title="<?php echo $users[$member];?>">
<?php echo html::smallAvatar(array('avatar' => $usersAvatar[$member], 'account' => $member)); ?>
</div>
<?php endforeach;?>
</div>
<?php endif;?>
</td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->space;?></th>
<td><?php echo $space->name;?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->kanban;?></th>
<td><?php echo $kanban->name;?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->begin;?></th>
<td><?php echo helper::isZeroDate($card->begin) ? '' : $card->begin;?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->end;?></th>
<td><?php echo helper::isZeroDate($card->end) ? '' : $card->end;?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->pri;?></th>
<td><span class='label-pri <?php echo 'label-pri-' . $card->pri;?>' title='<?php echo zget($lang->kanbancard->priList, $card->pri);?>'><?php echo zget($lang->kanbancard->priList, $card->pri);?></span></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->estimate;?></th>
<td><?php echo round($card->estimate, 2) . ' ' . $lang->kanbancard->lblHour;?></td>
</tr>
</table>
<div class='tab-content'>
<div class='tab-pane active' id='basicInfo'>
<table class="table table-data">
<tbody>
<tr>
<th><?php echo $lang->kanbancard->assignedTo;?></th>
<td>
<?php $assignedToPairs = array_filter(explode(',', $card->assignedTo));?>
<?php if(!empty($assignedToPairs)):?>
<div class='kanban-members pull-left'>
<?php foreach($assignedToPairs as $member):?>
<div title="<?php echo $users[$member];?>">
<?php echo html::smallAvatar(array('avatar' => $usersAvatar[$member], 'account' => $member)); ?>
</div>
<?php endforeach;?>
</div>
<?php endif;?>
</td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->space;?></th>
<td><?php echo $space->name;?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->kanban;?></th>
<td><?php echo $kanban->name;?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->begin;?></th>
<td><?php echo helper::isZeroDate($card->begin) ? '' : $card->begin;?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->end;?></th>
<td><?php echo helper::isZeroDate($card->end) ? '' : $card->end;?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->pri;?></th>
<td><span class='label-pri <?php echo 'label-pri-' . $card->pri;?>' title='<?php echo zget($lang->kanbancard->priList, $card->pri);?>'><?php echo zget($lang->kanbancard->priList, $card->pri);?></span></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->estimate;?></th>
<td><?php echo round($card->estimate, 2) . ' ' . $lang->kanbancard->lblHour;?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class='cell'>
<div class="cell">
<div class='tabs'>
<ul class='nav nav-tabs'>
<li class='active'><a href='' data-toggle='tab'><?php echo $lang->kanbancard->legendLifeTime;?></a></li>
</ul>
<table class="table table-data">
<tr>
<th><?php echo $lang->kanbancard->createdBy;?></th>
<td><?php echo zget($users, $card->createdBy) . $lang->at . $card->createdDate;?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->archivedBy;?></th>
<td><?php echo $card->archivedBy ? zget($users, $card->archivedBy) . $lang->at . $card->archivedDate : '';?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->lastEditedBy;?></th>
<td><?php echo $card->lastEditedBy ? zget($users, $card->lastEditedBy) . $lang->at . $card->lastEditedDate : '';?></td>
</tr>
</table>
<div class='tab-content'>
<div class='tab-pane active' id='legendLifeTime'>
<table class="table table-data">
<tbody>
<tr>
<th><?php echo $lang->kanbancard->createdBy;?></th>
<td><?php echo zget($users, $card->createdBy) . $lang->at . $card->createdDate;?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->archivedBy;?></th>
<td><?php echo $card->archivedBy ? zget($users, $card->archivedBy) . $lang->at . $card->archivedDate : '';?></td>
</tr>
<tr>
<th><?php echo $lang->kanbancard->lastEditedBy;?></th>
<td><?php echo $card->lastEditedBy ? zget($users, $card->lastEditedBy) . $lang->at . $card->lastEditedDate : '';?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>