Merge branch 'sprint/179_tianshujie_bug' into 'master'
Sprint/179 tianshujie bug See merge request easycorp/zentaopms!1134
This commit is contained in:
@@ -583,17 +583,17 @@ class kanban extends control
|
||||
*/
|
||||
public function viewArchivedColumn($regionID)
|
||||
{
|
||||
$columns = $this->kanban->getColumnsByObject('region', $regionID, '', '');
|
||||
$columns = $this->kanban->getColumnsByObject('region', $regionID, '');
|
||||
$columnsData = array();
|
||||
foreach($columns as $column)
|
||||
{
|
||||
if($column->archived == 0) continue;
|
||||
if($column->parent > 0)
|
||||
if($column->parent > 0 and isset($columns[$column->parent]))
|
||||
{
|
||||
if(empty($columnsData[$column->parent])) $columnsData[$column->parent] = $columns[$column->parent];
|
||||
$columnsData[$column->parent]->child[$column->id] = $column;
|
||||
}
|
||||
else
|
||||
elseif($column->parent <= 0)
|
||||
{
|
||||
if(empty($columnsData[$column->id])) $columnsData[$column->id] = $column;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ function renderHeaderCol($column, column, $header, kanbanData)
|
||||
var groupID = $column.closest('.kanban-board').data('id');
|
||||
var laneID = column.$kanbanData.lanes[0].id ? column.$kanbanData.lanes[0].id : 0;
|
||||
var columnID = $column.closest('.kanban-col').data('id');
|
||||
var printMoreBtn = (columnPrivs.includes('editColumn') || columnPrivs.includes('setWIP') || columnPrivs.includes('createColumn') || columnPrivs.includes('copyColumn') || columnPrivs.includes('archiveColumn') || columnPrivs.includes('deleteColumn') || columnPrivs.includes('splitColumn'));
|
||||
var printMoreBtn = (columnPrivs.includes('setColumn') || columnPrivs.includes('setWIP') || columnPrivs.includes('createColumn') || columnPrivs.includes('copyColumn') || columnPrivs.includes('archiveColumn') || columnPrivs.includes('deleteColumn') || columnPrivs.includes('splitColumn'));
|
||||
|
||||
/* Render more menu. */
|
||||
if(columnPrivs.includes('createCard') || printMoreBtn)
|
||||
@@ -745,10 +745,9 @@ function createColumnMenu(options)
|
||||
if(!privs.length) return [];
|
||||
|
||||
var items = [];
|
||||
if(privs.includes('editColumn')) items.push({label: kanbanLang.editColumn, icon: 'edit', url: createLink('kanban', 'setColumn', 'columnID=' + column.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal'}});
|
||||
if(privs.includes('setColumn')) items.push({label: kanbanLang.editColumn, icon: 'edit', url: createLink('kanban', 'setColumn', 'columnID=' + column.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal'}});
|
||||
if(privs.includes('setWIP')) items.push({label: kanbanLang.setWIP, icon: 'alert', url: createLink('kanban', 'setWIP', 'columnID=' + column.id), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width' : '500px'}});
|
||||
if(privs.includes('splitColumn')) items.push({label: kanbanLang.splitColumn, icon: 'col-split', url: createLink('kanban', 'splitColumn', 'columnID=' + column.id, '', true), className: 'iframe', attrs: {'data-toggle': 'modal'}});
|
||||
if(privs.includes('setColumn')) items.push({label: kanbanLang.editColumn, icon: '', url: createLink('kanban', 'setColumn', 'columnID=' + column.id + '&executionID=0&from=kanban', '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal'}});
|
||||
if(privs.includes('createColumn'))
|
||||
{
|
||||
items.push({label: kanbanLang.createColumnOnLeft, icon: 'col-add-left', url: createLink('kanban', 'createColumn', 'columnID=' + column.id + '&position=left'), className: 'iframe', attrs: {'data-toggle': 'modal'}});
|
||||
|
||||
@@ -288,6 +288,7 @@ $lang->kanbancard->deadlineAB = 'DL';
|
||||
$lang->kanbancard->beginAB = 'Begin';
|
||||
$lang->kanbancard->to = '~';
|
||||
$lang->kanbancard->archived = 'Archived';
|
||||
$lang->kanbancard->empty = 'No Card';
|
||||
|
||||
$lang->kanbancard->confirmArchive = 'Are you sure to archive this card? After archiving the card, it will be hidden from the column and you can view it in the Region - Archived.';
|
||||
$lang->kanbancard->confirmDelete = 'Are you sure to delete this card? After deleting the card, it will be deleted from the Kanban. You can only view it in the system recycle bin.';
|
||||
|
||||
@@ -288,6 +288,7 @@ $lang->kanbancard->deadlineAB = '截止';
|
||||
$lang->kanbancard->beginAB = '开始';
|
||||
$lang->kanbancard->to = '~';
|
||||
$lang->kanbancard->archived = '已归档';
|
||||
$lang->kanbancard->empty = '暂时没有卡片';
|
||||
|
||||
$lang->kanbancard->confirmArchive = '您确认归档该卡片吗?归档卡片后,该卡片将从列中隐藏,您可以在区域-已归档中查看。';
|
||||
$lang->kanbancard->confirmDelete = '您确认删除该卡片吗?删除卡片后,该卡片将从看板中删除,您只能通过系统回收站查看。';
|
||||
|
||||
+22
-11
@@ -106,7 +106,7 @@ class kanbanModel extends model
|
||||
/* Gets the groups, lanes and columns of the replication region. */
|
||||
$copyGroups = $this->getGroupGroupByRegions($copyRegionID);
|
||||
$copyLaneGroup = $this->getLaneGroupByRegions($copyRegionID);
|
||||
$copyColumnGroup = $this->getColumnGroupByRegions($copyRegionID);
|
||||
$copyColumnGroup = $this->getColumnGroupByRegions($copyRegionID, 'id_asc');
|
||||
|
||||
/* Create groups, lanes, and columns. */
|
||||
foreach($copyGroups[$copyRegionID] as $copyGroupID => $copyGroup)
|
||||
@@ -114,8 +114,9 @@ class kanbanModel extends model
|
||||
$newGroupID = $this->createGroup($kanban->id, $regionID);
|
||||
if(dao::isError()) return false;
|
||||
|
||||
$copyLanes = isset($copyLaneGroup[$copyGroupID]) ? $copyLaneGroup[$copyGroupID] : array();
|
||||
$copyColumns = isset($copyColumnGroup[$copyGroupID]) ? $copyColumnGroup[$copyGroupID] : array();
|
||||
$copyLanes = isset($copyLaneGroup[$copyGroupID]) ? $copyLaneGroup[$copyGroupID] : array();
|
||||
$copyColumns = isset($copyColumnGroup[$copyGroupID]) ? $copyColumnGroup[$copyGroupID] : array();
|
||||
$parentColumns = array();
|
||||
foreach($copyLanes as $copyLane)
|
||||
{
|
||||
unset($copyLane->id);
|
||||
@@ -129,14 +130,23 @@ class kanbanModel extends model
|
||||
|
||||
foreach($copyColumns as $copyColumn)
|
||||
{
|
||||
$copyColumnID = $copyColumn->id;
|
||||
unset($copyColumn->id);
|
||||
unset($copyColumn->actions);
|
||||
unset($copyColumn->asParent);
|
||||
unset($copyColumn->parentType);
|
||||
|
||||
$copyColumn->region = $regionID;
|
||||
$copyColumn->group = $newGroupID;
|
||||
$this->createColumn($regionID, $copyColumn);
|
||||
$copyColumn->region = $regionID;
|
||||
$copyColumn->group = $newGroupID;
|
||||
|
||||
if($copyColumn->parent > 0 and isset($parentColumns[$copyColumn->parent]))
|
||||
{
|
||||
$copyColumn->parent = $parentColumns[$copyColumn->parent];
|
||||
}
|
||||
|
||||
$parentColumnID = $this->createColumn($regionID, $copyColumn);
|
||||
|
||||
if($copyColumn->parent < 0) $parentColumns[$copyColumnID] = $parentColumnID;
|
||||
if(dao::isError()) return false;
|
||||
}
|
||||
}
|
||||
@@ -584,20 +594,21 @@ class kanbanModel extends model
|
||||
/**
|
||||
* Get column group by regions.
|
||||
*
|
||||
* @param array $regions
|
||||
* @param array $regions
|
||||
* @param string $order order|id_asc
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getColumnGroupByRegions($regions)
|
||||
public function getColumnGroupByRegions($regions, $order = 'order')
|
||||
{
|
||||
$columnGroup = $this->dao->select("*")->from(TABLE_KANBANCOLUMN)
|
||||
->where('deleted')->eq('0')
|
||||
->andWhere('archived')->eq('0')
|
||||
->andWhere('region')->in($regions)
|
||||
->orderBy('order')
|
||||
->orderBy($order)
|
||||
->fetchGroup('group');
|
||||
|
||||
$actions = array('createColumn', 'editColumn', 'setWIP', 'archiveColumn', 'restoreColumn', 'deleteColumn', 'createCard', 'splitColumn');
|
||||
$actions = array('createColumn', 'setColumn', 'setWIP', 'archiveColumn', 'restoreColumn', 'deleteColumn', 'createCard', 'splitColumn');
|
||||
|
||||
/* Group by parent. */
|
||||
$parentColumnGroup = array();
|
||||
@@ -2177,7 +2188,7 @@ class kanbanModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getColumnsByObject($objectType = '', $objectID = 0, $archived = 0, $deleted = 0)
|
||||
public function getColumnsByObject($objectType = '', $objectID = 0, $archived = 0, $deleted = '0')
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_KANBANCOLUMN)
|
||||
->where(true)
|
||||
|
||||
@@ -45,6 +45,11 @@
|
||||
<button type="button" class="close" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<?php if(empty($columns)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->kanbancard->empty;?></span></p>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<?php foreach($cards as $card):?>
|
||||
<div class='card-item' data-card='<?php echo $card->id;?>'>
|
||||
<div class='col-xs-10'>
|
||||
@@ -113,6 +118,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<button type="button" class="close" aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class='panel-body'>
|
||||
<?php if(empty($columns)):?>
|
||||
<?php if(empty($columns)):?>
|
||||
<div class="table-empty-tip">
|
||||
<p><span class="text-muted"><?php echo $lang->kanbancolumn->empty;?></span></p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user