* Finish task #47986.
This commit is contained in:
@@ -1,2 +1,4 @@
|
||||
ALTER TABLE `zt_kanbanspace` ADD `type` varchar(50) NOT NULL AFTER `name`;
|
||||
UPDATE `zt_kanbanspace` SET `type` = 'cooperation';
|
||||
|
||||
ALTER TABLE `zt_kanban` ADD `importObject` varchar(255) NOT NULL AFTER `displayCards`;
|
||||
|
||||
@@ -679,6 +679,7 @@ CREATE TABLE `zt_kanban` (
|
||||
`status` enum('active','closed') NOT NULL default 'active',
|
||||
`order` mediumint(8) NOT NULL DEFAULT '0',
|
||||
`displayCards` smallint(6) NOT NULL default '0',
|
||||
`importObject` varchar(255) NOT NULL,
|
||||
`createdBy` char(30) NOT NULL,
|
||||
`createdDate` datetime NOT NULL,
|
||||
`lastEditedBy` char(30) NOT NULL,
|
||||
|
||||
@@ -675,6 +675,7 @@ $lang->resource->kanban->viewArchivedColumn = 'viewArchivedColumn';
|
||||
$lang->resource->kanban->viewArchivedCard = 'viewArchivedCard';
|
||||
$lang->resource->kanban->restoreCard = 'restoreCard';
|
||||
$lang->resource->kanban->setLaneHeight = 'setLaneHeight';
|
||||
$lang->resource->kanban->import = 'import';
|
||||
|
||||
$lang->kanban->methodOrder[5] = 'space';
|
||||
$lang->kanban->methodOrder[10] = 'createSpace';
|
||||
@@ -720,6 +721,7 @@ $lang->kanban->methodorder[200] = 'viewArchivedCard';
|
||||
$lang->kanban->methodorder[205] = 'archiveColumn';
|
||||
$lang->kanban->methodorder[210] = 'restoreCard';
|
||||
$lang->kanban->methodorder[215] = 'setLaneHeight';
|
||||
$lang->kanban->methodorder[220] = 'import';
|
||||
|
||||
/* Execution. */
|
||||
$lang->resource->execution = new stdclass();
|
||||
|
||||
@@ -1154,4 +1154,30 @@ class kanban extends control
|
||||
if(empty($lanes)) return;
|
||||
return print(html::select('otherLane', $lanes, '', "class='form-control'"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Import.
|
||||
*
|
||||
* @param int $kanbanID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function import($kanbanID)
|
||||
{
|
||||
if(!empty($_POST))
|
||||
{
|
||||
$this->kanban->import($kanbanID);
|
||||
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'parent'));
|
||||
}
|
||||
|
||||
$kanban = $this->kanban->getByID($kanbanID);
|
||||
|
||||
$this->view->enableImport = empty($kanban->importObject) ? 'off' : 'on';
|
||||
$this->view->importObjects = empty($kanban->importObject) ? array() : explode(',', $kanban->importObject);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
}
|
||||
|
||||
2
module/kanban/css/import.css
vendored
Normal file
2
module/kanban/css/import.css
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
#importForm .checkbox-primary:not(:first-child) {margin-left: 10px;}
|
||||
#importForm .checkbox-primary {display: inline-block}
|
||||
33
module/kanban/js/import.js
Normal file
33
module/kanban/js/import.js
Normal file
@@ -0,0 +1,33 @@
|
||||
$(function()
|
||||
{
|
||||
if(enableImport == 'off') $("input[name^='importObjectList']").attr('disabled', 'disabled');
|
||||
|
||||
$("input[name='import']").change(function()
|
||||
{
|
||||
if($(this).val() == 'off')
|
||||
{
|
||||
$("input[name^='importObjectList']").attr('disabled', 'disabled');
|
||||
}
|
||||
else
|
||||
{
|
||||
$("input[name^='importObjectList']").removeAttr('disabled');
|
||||
}
|
||||
})
|
||||
|
||||
$("input[name^='importObjectList']").change(function()
|
||||
{
|
||||
if($("input:checked[name^=importObjectList]").length != 0 && !$('#emptyTip').is('.hidden')) $('#emptyTip').addClass('hidden');
|
||||
})
|
||||
|
||||
$('#submit').click(function()
|
||||
{
|
||||
var enableImport = $("input:checked[name='import']").val();
|
||||
var objectListLength = $("input:checked[name^=importObjectList]").length;
|
||||
|
||||
if(enableImport == 'on' && objectListLength == 0)
|
||||
{
|
||||
$('#emptyTip').removeClass('hidden');
|
||||
return false;
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -55,6 +55,7 @@ $lang->kanban->restoreColumn = 'Restore Column';
|
||||
$lang->kanban->restoreCard = 'Restore Card';
|
||||
$lang->kanban->restore = 'Restore';
|
||||
$lang->kanban->child = 'Child';
|
||||
$lang->kanban->import = 'Import';
|
||||
|
||||
/* Fields. */
|
||||
$lang->kanban->space = 'Space';
|
||||
@@ -158,6 +159,18 @@ $lang->kanban->error = new stdclass();
|
||||
$lang->kanban->error->mustBeInt = 'The WIPs must be positive integer.';
|
||||
$lang->kanban->error->parentLimitNote = 'The WIPs in the parent column cannot be < the sum of the WIPs in the child column.';
|
||||
$lang->kanban->error->childLimitNote = 'The sum of products in the child column cannot be > the number of products in the parent column.';
|
||||
$lang->kanban->error->importObjNotEmpty = 'Please select at least one import object.';
|
||||
|
||||
$lang->kanban->importList = array();
|
||||
$lang->kanban->importList['off'] = 'Import is not enabled';
|
||||
$lang->kanban->importList['on'] = 'Enable the import function, you can only import content that you have permission to view.';
|
||||
|
||||
$lang->kanban->importObjectList = array();
|
||||
$lang->kanban->importObjectList['plan'] = 'Product Plan';
|
||||
$lang->kanban->importObjectList['release'] = 'Release';
|
||||
$lang->kanban->importObjectList['build'] = 'Build';
|
||||
$lang->kanban->importObjectList['execution'] = 'Execution';
|
||||
$lang->kanban->importObjectList['cards'] = 'Other Kanban Cards';
|
||||
|
||||
$lang->kanban->defaultColumn = array();
|
||||
$lang->kanban->defaultColumn['wait'] = 'wait';
|
||||
@@ -308,7 +321,7 @@ $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.';
|
||||
$lang->kanbancard->confirmRestore = 'Are you sure you want to restore this card? After the card is restored, the card will be restored to the "%s" Kanban column.';
|
||||
$lang->kanbancard->confirmRestore = "Are you sure you want to restore this card? After the card is restored, the card will be restored to the '%s' Kanban column.";
|
||||
$lang->kanbancard->confirmRestoreTip = "The card's column has been archived or deleted, please restore '%s' column first.";
|
||||
|
||||
$lang->kanbancard->priList[1] = 1;
|
||||
|
||||
@@ -55,6 +55,7 @@ $lang->kanban->restoreColumn = '还原看板列';
|
||||
$lang->kanban->restoreCard = '还原卡片';
|
||||
$lang->kanban->restore = '还原';
|
||||
$lang->kanban->child = '子';
|
||||
$lang->kanban->import = '导入功能';
|
||||
|
||||
/* Fields. */
|
||||
$lang->kanban->space = '所属空间';
|
||||
@@ -155,9 +156,21 @@ $lang->kanban->my = '我的看板';
|
||||
$lang->kanban->other = '其他';
|
||||
|
||||
$lang->kanban->error = new stdclass();
|
||||
$lang->kanban->error->mustBeInt = '在制品数量必须是正整数。';
|
||||
$lang->kanban->error->parentLimitNote = '父列的在制品数量不能小于子列在制品数量之和';
|
||||
$lang->kanban->error->childLimitNote = '子列在制品数量之和不能大于父列的在制品数量';
|
||||
$lang->kanban->error->mustBeInt = '在制品数量必须是正整数。';
|
||||
$lang->kanban->error->parentLimitNote = '父列的在制品数量不能小于子列在制品数量之和';
|
||||
$lang->kanban->error->childLimitNote = '子列在制品数量之和不能大于父列的在制品数量';
|
||||
$lang->kanban->error->importObjNotEmpty = '请至少选择一个导入对象';
|
||||
|
||||
$lang->kanban->importList = array();
|
||||
$lang->kanban->importList['off'] = '不启用导入功能';
|
||||
$lang->kanban->importList['on'] = '启用导入功能,只能导入自己有权限查看的内容';
|
||||
|
||||
$lang->kanban->importObjectList = array();
|
||||
$lang->kanban->importObjectList['plan'] = '产品计划';
|
||||
$lang->kanban->importObjectList['release'] = '产品发布';
|
||||
$lang->kanban->importObjectList['build'] = '项目版本';
|
||||
$lang->kanban->importObjectList['execution'] = '项目执行';
|
||||
$lang->kanban->importObjectList['cards'] = '其他看板卡片';
|
||||
|
||||
$lang->kanban->defaultColumn = array();
|
||||
$lang->kanban->defaultColumn['wait'] = '未开始';
|
||||
|
||||
@@ -2525,6 +2525,7 @@ class kanbanModel extends model
|
||||
$actions .= "<a data-toggle='dropdown' class='btn btn-link dropdown-toggle setting' type='button'>" . '<i class="icon icon-cog-outline"></i> ' . $this->lang->kanban->setting . '</a>';
|
||||
$actions .= "<ul id='kanbanActionMenu' class='dropdown-menu text-left'>";
|
||||
if(common::hasPriv('kanban', 'createRegion')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'createRegion', "kanbanID=$kanban->id", '', true), '<i class="icon icon-plus"></i>' . $this->lang->kanban->createRegion, '', "class='iframe btn btn-link'") . '</li>';
|
||||
if(common::hasPriv('kanban', 'import')) $actions .= '<li>' . html::a(helper::createLink('kanban', 'import', "kanbanID=$kanban->id", '', true), '<i class="icon icon-import"></i>' . $this->lang->kanban->import, '', "class='iframe btn btn-link'") . '</li>';
|
||||
if($printSetHeight)
|
||||
{
|
||||
$width = $this->app->getClientLang() == 'en' ? '70%' : '60%';
|
||||
@@ -3076,4 +3077,19 @@ class kanbanModel extends model
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import.
|
||||
*
|
||||
* @param int $kanbanID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function import($kanbanID)
|
||||
{
|
||||
$importObjects = $_POST['import'] == 'off' ? array() : $_POST['importObjectList'];
|
||||
$importObjectList = implode(',', $importObjects);
|
||||
|
||||
$this->dao->update(TABLE_KANBAN)->set('importObject')->eq($importObjectList)->where('id')->eq($kanbanID)->exec();
|
||||
}
|
||||
}
|
||||
|
||||
52
module/kanban/view/import.html.php
Normal file
52
module/kanban/view/import.html.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* The import file of kanban module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2022 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Fangzhou Hu <hufangzhou@easycorp.ltd>
|
||||
* @package kanban
|
||||
* @version $Id: import.html.php 935 2022-01-19 14:15:24Z hufangzhou@easycorp.ltd $
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<?php js::set('enableImport', $enableImport);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<?php echo "<span>" . $lang->kanban->import . '</span>';?>
|
||||
</h2>
|
||||
</div>
|
||||
<form method='post' class="load-indicator main-form form-ajax" target='hiddenwin' id='importForm'>
|
||||
<table align='center' class='table table-form'>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
<label class="radio-inline">
|
||||
<input type='radio' name='import' value='off' <?php echo $enableImport == 'off' ? "checked='checked'" : ''; ?> id='importoff'/>
|
||||
<?php echo $lang->kanban->importList['off'];?>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'>
|
||||
<label class="radio-inline">
|
||||
<input type='radio' name='import' value='on' <?php echo $enableImport == 'on' ? "checked='checked'" : ''; ?> id='importon'/>
|
||||
<?php echo $lang->kanban->importList['on'];?>
|
||||
</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'><?php echo html::checkbox('importObjectList', $lang->kanban->importObjectList, $importObjects);?></td>
|
||||
</tr>
|
||||
<tr id='emptyTip' class='hidden'><td colspan='3' style='color: red;'><?php echo $lang->kanban->error->importObjNotEmpty;?></td></tr>
|
||||
<tr>
|
||||
<td class='form-actions'><?php echo html::submitButton();?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
Reference in New Issue
Block a user