Merge branch 'sprint/master_zhouxudong_56374' into 'master'

Sprint/master zhouxudong 56374

See merge request easycorp/zentaopms!3849
This commit is contained in:
王怡栋
2022-06-10 02:01:58 +00:00
11 changed files with 186 additions and 8 deletions
+2 -1
View File
@@ -330,7 +330,8 @@ $lang->resource->kanban->sortRegion = 'sortRegion';
$lang->resource->kanban->sortGroup = 'sortGroup';
$lang->resource->kanban->deleteRegion = 'deleteRegion';
$lang->resource->kanban->createLane = 'createLane';
$lang->resource->kanban->setLane = 'setLane';
$lang->resource->kanban->editLaneName = 'editLaneName';
$lang->resource->kanban->editLaneColor = 'editLaneColor';
$lang->resource->kanban->sortLane = 'sortLane';
$lang->resource->kanban->deleteLane = 'deleteLane';
$lang->resource->kanban->createColumn = 'createColumn';
+2 -1
View File
@@ -635,8 +635,9 @@ $lang->resource->kanban->sortRegion = 'sortRegion';
$lang->resource->kanban->sortGroup = 'sortGroup';
$lang->resource->kanban->deleteRegion = 'deleteRegion';
$lang->resource->kanban->createLane = 'createLane';
$lang->resource->kanban->setLane = 'setLane';
$lang->resource->kanban->sortLane = 'sortLane';
$lang->resource->kanban->editLaneColor = 'editLaneColor';
$lang->resource->kanban->editLaneName = 'editLaneName';
$lang->resource->kanban->deleteLane = 'deleteLane';
$lang->resource->kanban->createColumn = 'createColumn';
$lang->resource->kanban->splitColumn = 'splitColumn';
+61
View File
@@ -1569,6 +1569,67 @@ class kanban extends control
$this->display();
}
/**
* Edit lane's name
*
* @param int $laneID
* @param int $executionID
* @param string $from
* @access public
* @return void
*/
public function editLaneName($laneID, $executionID = 0, $from = 'kanban')
{
if($_POST)
{
$this->kanban->setLane($laneID);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('kanbanlane', $laneID, 'Edited', '', $executionID);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
}
$lane = $this->kanban->getLaneById($laneID);
if(!$lane) return print(js::error($this->lang->notFound) . js::locate($this->createLink('execution', 'kanban', "executionID=$executionID")));
$this->view->title = $from == 'kanban' ? $this->lang->edit . '“' . $lane->name . '”' . $this->lang->kanbanlane->common : zget($this->lang->kanban->laneTypeList, $lane->type) . $this->lang->colon . $this->lang->kanban->setLane;
$this->view->lane = $lane;
$this->view->from = $from;
$this->display();
}
/**
* Edit lane's color
*
* @param int $laneID
* @param int $executionID
* @param string $from
* @access public
* @return void
*/
public function editLaneColor($laneID, $executionID = 0, $from = 'kanban')
{
if($_POST)
{
$this->kanban->setLane($laneID);
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
$this->loadModel('action')->create('kanbanlane', $laneID, 'Edited', '', $executionID);
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
}
$lane = $this->kanban->getLaneById($laneID);
if(!$lane) return print(js::error($this->lang->notFound) . js::locate($this->createLink('execution', 'kanban', "executionID=$executionID")));
$this->view->title = $from == 'kanban' ? $this->lang->edit . '“' . $lane->name . '”' . $this->lang->kanbanlane->common : zget($this->lang->kanban->laneTypeList, $lane->type) . $this->lang->colon . $this->lang->kanban->setLane;
$this->view->lane = $lane;
$this->view->from = $from;
$this->display();
}
/**
* Set lane column info.
*
+4
View File
@@ -0,0 +1,4 @@
td>ul {padding-left: 0;}
li {display: block; float: left; padding: 5px; width: 28px; height: 28px;}
li>a { position: relative; display: block; width: 100%; height: 100%; padding: 0; margin: 0; font-family: ZentaoIcon; font-size: 14px; font-style: normal; font-weight: 400; font-variant: normal; line-height: 1; text-align: center; text-transform: none; border: 1px solid transparent; border-radius: 50%; speak: none; -webkit-font-smoothing: antialiased; }
li>a.active:before {font-size: 14px; content: "\e5ca"}
+13
View File
@@ -0,0 +1,13 @@
/**
* Set lane color.
*
* @param string $color
* @access public
* @return void
*/
function setColor(color)
{
$('.cp-tile').removeClass('active');
$('.cp-tile[data-color="' + color + '"]').addClass('active');
$('#color').val(color);
}
+7 -5
View File
@@ -225,13 +225,14 @@ function renderCount($count, count, column)
*/
function renderLaneName($lane, lane, $kanban, columns, kanban)
{
var canSet = lane.actions.includes('setLane');
var canSort = lane.actions.includes('sortLane') && kanban.lanes.length > 1;
var canDelete = lane.actions.includes('deleteLane');
var canEditLaneColor = lane.actions.includes('editLaneColor');
var canEditLaneName = lane.actions.includes('editLaneName');
var canSort = lane.actions.includes('sortLane') && kanban.lanes.length > 1;
var canDelete = lane.actions.includes('deleteLane');
$lane.parent().toggleClass('sort', canSort);
if(!$lane.children('.actions').length && (canSet || canDelete) && (CRKanban || kanbanInfo.status != 'closed'))
if(!$lane.children('.actions').length && (canEditLaneColor || canEditLaneName || canDelete) && (CRKanban || kanbanInfo.status != 'closed'))
{
$([
'<div class="actions" title="' + kanbanLang.more + '">',
@@ -1094,7 +1095,8 @@ function createLaneMenu(options)
if(!privs.length) return [];
var items = [];
if(privs.includes('setLane')) items.push({label: kanbanLang.setLane, 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('editLaneName')) items.push({label: kanbanLang.editLaneName, icon: 'edit', url: createLink('kanban', 'editLaneName', 'laneID=' + lane.id + '&executionID=0&from=kanban'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '635px'}});
if(privs.includes('editLaneColor')) items.push({label: kanbanLang.editLaneColor, icon: 'color', url: createLink('kanban', 'editLaneColor', '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), attrs: {'target': 'hiddenwin'}});
var bounds = options.$trigger[0].getBoundingClientRect();
+2
View File
@@ -174,7 +174,9 @@ $lang->kanban->WIPType = 'WIP Type';
$lang->kanban->WIPCount = 'WIP Count';
$lang->kanban->noLimit = 'No Limit ∞';
$lang->kanban->setLane = 'Lane Settings';
$lang->kanban->editLaneName = 'Edit Lane Name';
$lang->kanban->laneName = 'Lane Name';
$lang->kanban->editLaneColor = 'Edit Lane Color';
$lang->kanban->laneColor = 'Lane Color';
$lang->kanban->setColumn = 'Column Settings';
$lang->kanban->columnName = 'Column Name';
+2
View File
@@ -174,7 +174,9 @@ $lang->kanban->WIPType = '在制品类型';
$lang->kanban->WIPCount = '在制品数量';
$lang->kanban->noLimit = '不限制∞';
$lang->kanban->setLane = '泳道设置';
$lang->kanban->editLaneName = '修改泳道名';
$lang->kanban->laneName = '泳道名称';
$lang->kanban->editLaneColor = '设置背景色';
$lang->kanban->laneColor = '泳道颜色';
$lang->kanban->setColumn = '看板列设置';
$lang->kanban->columnName = '看板列名称';
+1 -1
View File
@@ -945,7 +945,7 @@ class kanbanModel extends model
->orderBy('order')
->fetchGroup('group');
$actions = array('setLane', 'sortLane', 'deleteLane');
$actions = array('sortLane', 'deleteLane', 'editLaneName', 'editLaneColor');
foreach($laneGroup as $lanes)
{
foreach($lanes as $lane)
+45
View File
@@ -0,0 +1,45 @@
<?php
/**
* The set lane file of task module of ZenTaoPMS.
*
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL (http://zpl.pub/page/zplv12.html)
* @author Yuchun Li <liyuchun@easycorp.ltd>
* @package kanban
* @version $Id: setlane.html.php 935 2021-10-26 16:24:24Z liyuchun@easycorp.ltd $
* @link https://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
<h2>
<?php echo $lang->kanban->editLaneColor;?>
</h2>
</div>
<form class="load-indicator main-form form-ajax" method='post' target='hiddenwin'>
<table align='center' class='table table-form'>
<tr>
<th><?php echo $lang->kanban->laneColor;?></th>
<td colspan='3'>
<?php echo html::hidden('color', $lane->color, "class='form-control'");?>
<ul>
<?php foreach($config->kanban->laneColorList as $color):?>
<li>
<a href='javascript:setColor("<?php echo $color;?>");' class='cp-tile <?php echo $color == $lane->color ? 'active' : '';?>' data-color='<?php echo $color;?>' style='color: #FFF; background: <?php echo $color;?>; border-color: transparent;'></a>
</li>
<?php endforeach;?>
</ul>
</td>
</tr>
<tr>
<td colspan='4' class='text-center form-actions'>
<?php echo html::submitButton();?>
</td>
</tr>
</table>
</form>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>
+47
View File
@@ -0,0 +1,47 @@
<?php
/**
* The set lane file of task module of ZenTaoPMS.
*
* @copyright Copyright 2009-2021 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
* @license ZPL(http://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
* @author Yuchun Li <liyuchun@easycorp.ltd>
* @package kanban
* @version $Id: setlane.html.php 935 2021-10-26 16:24:24Z liyuchun@easycorp.ltd $
* @link https://www.zentao.net
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<div class='main-header'>
<h2>
<?php echo $lang->kanban->editLaneName;?>
</h2>
</div>
<form class="load-indicator main-form form-ajax" method='post' target='hiddenwin'>
<table align='center' class='table table-form'>
<tr>
<th><?php echo $lang->kanban->laneName;?></th>
<td colspan='2'>
<?php echo html::input('name', $lane->name, "class='form-control'");?>
</td>
<td></td>
</tr>
<?php if($from != 'kanban'):?>
<tr>
<th><?php echo $lang->kanban->WIPType;?></th>
<td colspan='2'>
<?php echo html::input('type', zget($lang->kanban->laneTypeList, $lane->type), "class='form-control' disabled");?>
</td>
</tr>
<?php endif;?>
<tr>
<td colspan='4' class='text-center form-actions'>
<?php echo html::submitButton();?>
</td>
</tr>
</table>
</form>
</div>
</div>
<?php include '../../common/view/footer.html.php';?>