Merge branch 'sprint/177_tianshujie_kanban' into 'kanban'

* Fix the issue of viewing card permissions.

See merge request easycorp/zentaopms!946
This commit is contained in:
孙广明
2021-12-15 02:43:35 +00:00
8 changed files with 97 additions and 84 deletions
+1
View File
@@ -2,3 +2,4 @@
.color-picker-item > .icon {color: #fff; display: none}
.checked > .icon {display: inline-block;}
#teamBox .chosen-container .chosen-results {max-height: 180px;}
+9 -7
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 class="title"></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).attr('title', item.name);
if(printMoreBtn)
{
$(
[
@@ -604,7 +606,7 @@ function createLaneMenu(options)
if(!privs.length) return [];
var items = [];
if(privs.includes('setLane')) items.push({label: kanbanLang.editLane, icon: 'edit', url: createLink('kanban', 'setLane', 'laneID=' + lane.id + '&executionID=0&from=kanban'), className: 'iframe', attrs: {'data-toggle': 'modal'}});
if(privs.includes('setLane')) items.push({label: kanbanLang.editLane, icon: 'edit', url: createLink('kanban', 'setLane', 'laneID=' + lane.id + '&executionID=0&from=kanban'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '635px'}});
if(privs.includes('deleteLane')) items.push({label: kanbanLang.deleteLane, icon: 'trash', url: createLink('kanban', 'deleteLane', 'lane=' + lane.id), className: 'confirmer', attrs: {'data-confirmTitle': kanbanlaneLang.confirmDelete, 'data-confirmDetail': kanbanlaneLang.confirmDeleteDetail}});
var bounds = options.$trigger[0].getBoundingClientRect();
+1 -1
View File
@@ -573,7 +573,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)
{
+1 -1
View File
@@ -33,7 +33,7 @@
</tr>
<tr>
<th><?php echo $lang->kanban->team;?></th>
<td colspan='2'>
<td colspan='2' id='teamBox'>
<div class="input-group">
<?php echo html::select('team[]', $users, '', "class='form-control chosen' multiple");?>
<?php echo $this->fetch('my', 'buildContactLists');?>
+1 -1
View File
@@ -29,7 +29,7 @@
</tr>
<tr>
<th><?php echo $lang->kanbanspace->team;?></th>
<td colspan='2'>
<td colspan='2' id='teamBox'>
<div class="input-group">
<?php echo html::select('team[]', $users, '', "class='form-control chosen' multiple");?>
<?php echo $this->fetch('my', 'buildContactLists');?>
+1 -1
View File
@@ -33,7 +33,7 @@
</tr>
<tr>
<th><?php echo $lang->kanban->team;?></th>
<td colspan='2'>
<td colspan='2' id='teamBox'>
<div class="input-group">
<?php echo html::select('team[]', $users, $kanban->team, "class='form-control chosen' multiple");?>
<?php echo $this->fetch('my', 'buildContactLists');?>
+1 -1
View File
@@ -30,7 +30,7 @@
</tr>
<tr>
<th><?php echo $lang->kanbanspace->team;?></th>
<td colspan='2'>
<td colspan='2' id='teamBox'>
<div class="input-group">
<?php echo html::select('team[]', $users, $space->team, "class='form-control chosen' multiple");?>
<?php echo $this->fetch('my', 'buildContactLists');?>
+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>