* Finish task #45815.
This commit is contained in:
@@ -23,18 +23,17 @@ class kanban extends control
|
||||
*/
|
||||
public function space($browseType = 'my', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$spaces = $this->kanban->getSpaces($browseType);
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$recTotal = count($spaces);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$spaces = array_chunk($spaces, $pager->recPerPage);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$this->view->title = $this->lang->kanbanspace->common;
|
||||
$this->view->spaces = empty($spaces) ? $spaces : $spaces[$pageID - 1];
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->title = $this->lang->kanbanspace->common;
|
||||
$this->view->spaces = $this->kanban->getSpaces($browseType, $pager);
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
$this->view->usersAvatar = $this->user->getAvatarPairs();
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
#spaces {margin: 0 0; margin-bottom: 15px;}
|
||||
#spaces .spaceTitle {margin-bottom: 15px;}
|
||||
#spaces .spaceTitle > div {display: inline-block;}
|
||||
#spaces .spaceActions {margin-top: 10px;}
|
||||
#spaces .spaceActions > a{margin-left: 10px;}
|
||||
.table-footer .pager>li.disabled>a.pager-item {bottom: -3px;}
|
||||
.space .menu {margin-left: 5px; margin-right:5px;}
|
||||
.space .table-empty-tip {padding: 40px 10px;}
|
||||
|
||||
.kanbans > .col {width: 25% !important;}
|
||||
@media screen and (max-width: 1500px) {.kanbans > .col {width: 25%;}}
|
||||
.kanbans .panel {margin: 0 0; border: 1px solid #DCDCDC; border-radius: 4px; box-shadow: none; cursor: pointer; height: 190px; margin-bottom: 5px;}
|
||||
.kanbans .panel:hover {border-color: #006AF1; box-shadow: 0 0 10px 0 rgba(0,0,100,.25);}
|
||||
.kanbans .panel-heading {padding: 12px 24px 10px 16px;}
|
||||
.kanbans .kanban-name {overflow: hidden; white-space:nowrap}
|
||||
.kanbans .panel .label-closed {background: #AAA !important; color: #FFF; margin-top:-6px;}
|
||||
.kanbans .panel-body {padding: 0 16px 16px;}
|
||||
.kanbans .kanban-desc {color: #838a9d; word-break:break-all;}
|
||||
.kanbans .kanban-footer {position: absolute; bottom: 10px; right: 10px; left: 15px;}
|
||||
.kanbans .kanban-members {float: left; height: 24px; line-height: 24px;}
|
||||
.kanbans .kanban-members > a {display: inline-block; height: 24px;}
|
||||
.kanbans .kanban-members > a + a {margin-left: -5px;}
|
||||
.kanbans .kanban-members > a > .avatar {display: inline-block; width: 24px; height: 24px; line-height: 24px; margin-right: 1px;}
|
||||
.kanbans .kanban-members > span {display: inline-block; color: transparent; width: 2px; height: 2px; background-color: #8990a2; position: relative; border-radius: 50%; top: 3px; margin: 0 3px;}
|
||||
.kanbans .kanban-members > span:before,
|
||||
.kanbans .kanban-members > span:after {content: ''; display: block; position: absolute; width: 2px; height: 2px; background-color: #8990a2; top: 0; border-radius: 50%}
|
||||
.kanbans .kanban-members > span:before {left: -4px;}
|
||||
.kanbans .kanban-members > span:after {right: -4px;}
|
||||
.kanbans .kanban-members-total {display: inline-block; margin-left: 6px; position: relative; top: 3px}
|
||||
.kanbans .kanbanAcl {position: absolute; right: 0px; bottom: 2px; color: #838a9d;}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/* Make cards clickable */
|
||||
var $spaces = $('.kanbans');
|
||||
$spaces.on('click', '.panel', function(e)
|
||||
{
|
||||
if(!$(e.target).closest('.panel-actions').length)
|
||||
{
|
||||
window.location.href = $(this).data('url');
|
||||
}
|
||||
});
|
||||
@@ -28,12 +28,16 @@ $lang->kanban->sortCard = 'Sort Card';
|
||||
$lang->kanban->setting = 'Setting';
|
||||
|
||||
/* Fields. */
|
||||
$lang->kanban->space = 'Space';
|
||||
$lang->kanban->name = 'Name';
|
||||
$lang->kanban->owner = 'Owner';
|
||||
$lang->kanban->team = 'Team';
|
||||
$lang->kanban->desc = 'Description';
|
||||
$lang->kanban->acl = 'ACL';
|
||||
$lang->kanban->space = 'Space';
|
||||
$lang->kanban->name = 'Name';
|
||||
$lang->kanban->owner = 'Owner';
|
||||
$lang->kanban->team = 'Team';
|
||||
$lang->kanban->desc = 'Description';
|
||||
$lang->kanban->acl = 'ACL';
|
||||
$lang->kanban->closed = 'Closed';
|
||||
|
||||
$lang->kanban->empty = 'No Kanban';
|
||||
$lang->kanban->teamSumCount = '%s people in total';
|
||||
|
||||
$lang->kanban->aclList['open'] = 'Open (Accessible with space view permissions)';
|
||||
$lang->kanban->aclList['private'] = 'Private (For the kanban team, whitelist members and space owner only)';
|
||||
|
||||
@@ -28,16 +28,23 @@ $lang->kanban->sortCard = '卡片排序';
|
||||
$lang->kanban->setting = '设置';
|
||||
|
||||
/* Fields. */
|
||||
$lang->kanban->space = '所属空间';
|
||||
$lang->kanban->name = '看板名称';
|
||||
$lang->kanban->owner = '负责人';
|
||||
$lang->kanban->team = '团队';
|
||||
$lang->kanban->desc = '空间描述';
|
||||
$lang->kanban->acl = '访问控制';
|
||||
$lang->kanban->space = '所属空间';
|
||||
$lang->kanban->name = '看板名称';
|
||||
$lang->kanban->owner = '负责人';
|
||||
$lang->kanban->team = '团队';
|
||||
$lang->kanban->desc = '看板描述';
|
||||
$lang->kanban->acl = '访问控制';
|
||||
$lang->kanban->closed = '已关闭';
|
||||
|
||||
$lang->kanban->empty = '暂时没有看板';
|
||||
$lang->kanban->teamSumCount = '共%s人';
|
||||
|
||||
$lang->kanban->aclList['open'] = '继承空间访问权限(能访问当前空间,即可访问)';
|
||||
$lang->kanban->aclList['private'] = '私有(看板团队成员、白名单、空间负责人可访问)';
|
||||
|
||||
$lang->kanban->aclGroup['open'] = '公开';
|
||||
$lang->kanban->aclGroup['private'] = '私有';
|
||||
|
||||
$lang->kanban->type = array();
|
||||
$lang->kanban->type['all'] = "综合看板";
|
||||
$lang->kanban->type['story'] = "{$lang->SRCommon}看板";
|
||||
|
||||
+27
-3
@@ -531,22 +531,31 @@ class kanbanModel extends model
|
||||
* Get spaces.
|
||||
*
|
||||
* @param string $browseType all|my|other|closed
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getSpaces($browseType)
|
||||
public function getSpaces($browseType, $pager)
|
||||
{
|
||||
$account = $this->app->user->account;
|
||||
$spaceIdList = $this->getCanViewObjects('kanbanspace');
|
||||
|
||||
return $this->dao->select('*')->from(TABLE_KANBANSPACE)
|
||||
$spaces = $this->dao->select('*')->from(TABLE_KANBANSPACE)
|
||||
->where('deleted')->eq(0)
|
||||
->beginIF($browseType == 'my')->andWhere('owner')->eq($account)->fi()
|
||||
->beginIF($browseType == 'other')->andWhere('owner')->ne($account)->fi()
|
||||
->beginIF($browseType == 'closed')->andWhere('status')->eq('closed')->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($spaceIdList)->fi()
|
||||
->orderBy('id_desc')
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
|
||||
$kanbanGroup = $this->getGroupBySpaces(array_keys($spaces));
|
||||
foreach($spaces as $spaceID => $space)
|
||||
{
|
||||
if(isset($kanbanGroup[$spaceID])) $space->kanbans = $kanbanGroup[$spaceID];
|
||||
}
|
||||
|
||||
return $spaces;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1337,6 +1346,21 @@ class kanbanModel extends model
|
||||
return $this->dao->findById($spaceID)->from(TABLE_KANBANSPACE)->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get kanban group by space id list.
|
||||
*
|
||||
* @param int $spaceIdList
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getGroupBySpaces($spaceIdList)
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_KANBAN)
|
||||
->where('deleted')->eq(0)
|
||||
->andWhere('space')->in($spaceIdList)
|
||||
->fetchGroup('space', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get column by id.
|
||||
*
|
||||
|
||||
@@ -34,24 +34,97 @@
|
||||
<?php foreach($spaces as $space):?>
|
||||
<div class='row cell' id='spaces'>
|
||||
<div class='space'>
|
||||
<div class='spaceTitle pull-left'>
|
||||
<h4>
|
||||
<?php echo $space->name;?>
|
||||
<?php echo isset($space->kanbans) ? count($space->kanbans) : '';?>
|
||||
</h4>
|
||||
<div class='row menu'>
|
||||
<div class='spaceTitle pull-left'>
|
||||
<div><i class='icon-zone'></i></div>
|
||||
<div>
|
||||
<h4>
|
||||
<?php echo $space->name;?>
|
||||
<?php echo isset($space->kanbans) ? count($space->kanbans) : '';?>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class='spaceActions pull-right'>
|
||||
<?php common::printLink('kanban', 'create', "spaceID={$space->id}", '<i class="icon icon-plus"></i> ' . $lang->kanban->create, '', "class='iframe'", '', true);?>
|
||||
<?php common::printLink('kanban', 'editSpace', "spaceID={$space->id}", '<i class="icon icon-cog-outline"></i> ' . $lang->kanban->setting, '', "class='iframe'", '', true);?>
|
||||
<?php common::printLink('kanban', 'closeSpace', "spaceID={$space->id}", '<i class="icon icon-off"></i> ' . $lang->close, '', "class='iframe'", '', true);?>
|
||||
<?php common::printLink('kanban', 'deleteSpace', "spaceID={$space->id}", '<i class="icon icon-trash"></i> ' . $lang->delete, 'hiddenwin', '', '', true);?>
|
||||
</div>
|
||||
</div>
|
||||
<div class='spaceActions pull-right'>
|
||||
<?php common::printLink('kanban', 'create', "spaceID={$space->id}", '<i class="icon icon-plus"></i> ' . $lang->kanban->create, '', "class='iframe'", '', true);?>
|
||||
<?php common::printLink('kanban', 'editSpace', "spaceID={$space->id}", '<i class="icon icon-cog-outline"></i> ' . $lang->kanban->setting, '', "class='iframe'", '', true);?>
|
||||
<?php common::printLink('kanban', 'closeSpace', "spaceID={$space->id}", '<i class="icon icon-off"></i> ' . $lang->close, '', "class='iframe'", '', true);?>
|
||||
<?php common::printLink('kanban', 'deleteSpace', "spaceID={$space->id}", '<i class="icon icon-trash"></i> ' . $lang->delete, 'hiddenwin', '', '', true);?>
|
||||
<?php if(isset($space->kanbans)):?>
|
||||
<div class='kanbans row'>
|
||||
<?php foreach($space->kanbans as $kanbanID => $kanban):?>
|
||||
<div class='col' data-id='<?php echo $kanbanID?>'>
|
||||
<div class='panel' data-url='<?php echo $this->createLink('kanban', 'view', "kanbanID=$kanbanID");?>'>
|
||||
<div class='panel-heading'>
|
||||
<div class='kanban-name'>
|
||||
<?php if($kanban->status == 'closed'):?>
|
||||
<span class="label label-closed"><?php echo $lang->kanban->closed;?></span>
|
||||
<?php endif;?>
|
||||
<strong title='<?php echo $kanban->name;?>'><?php echo $kanban->name;?></strong>
|
||||
</div>
|
||||
<div class='kanban-actions'>
|
||||
<div class='dropdown'>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<div class='kanban-desc'><?php echo strip_tags(htmlspecialchars_decode($kanban->desc));?></div>
|
||||
<div class='kanban-footer'>
|
||||
<?php $count = 0;?>
|
||||
<?php $teamPairs = array_filter(explode(',', $kanban->team));?>
|
||||
<?php $teamCount = count($teamPairs);?>
|
||||
<div class="clearfix">
|
||||
<?php if(!empty($teamPairs)):?>
|
||||
<div class='kanban-members pull-left'>
|
||||
<?php foreach($teamPairs as $member):?>
|
||||
<?php
|
||||
if($count > 2) continue;
|
||||
if(!isset($users[$member]))
|
||||
{
|
||||
$teamCount --;
|
||||
continue;
|
||||
}
|
||||
$count ++;
|
||||
?>
|
||||
<a href='<?php echo helper::createLink('kanban', 'view', "kanbanID=$kanbanID");?>' title="<?php echo $users[$member];?>">
|
||||
<?php echo html::smallAvatar(array('avatar' => $usersAvatar[$member], 'account' => $member)); ?>
|
||||
</a>
|
||||
<?php endforeach;?>
|
||||
<?php if($teamCount > 3):?>
|
||||
<?php echo '<span>…</span>';?>
|
||||
<a href='<?php echo helper::createLink('kanban', 'view', "kanbanID=$kanbanID");?>' title="<?php echo $users[$member];?>">
|
||||
<?php echo html::smallAvatar(array('avatar' => $usersAvatar[end($teamPairs)], 'account' => $member)); ?>
|
||||
</a>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<div class='kanban-members-total pull-left'><?php echo html::a(helper::createLink('kanban', 'view', "kanbanID=$kanbanID"), sprintf($lang->kanban->teamSumCount, $teamCount));?></div>
|
||||
</div>
|
||||
<div class='kanbanAcl'>
|
||||
<?php $icon = $kanban->acl == 'open' ? 'unlock' : 'lock';?>
|
||||
<i class="<?php echo 'icon-' . $icon;?>"></i>
|
||||
<?php echo zget($lang->kanban->aclGroup, $kanban->acl, '');?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->kanban->empty;?></span></p>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php if(!empty($spaces)):?>
|
||||
<div id='spacesFooter' class='table-footer'>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
<?php endif?>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
Reference in New Issue
Block a user