* Code for task#47989.
This commit is contained in:
@@ -195,6 +195,7 @@ $lang->action->desc->archived = '$date, archived by <strong>$actor</
|
||||
$lang->action->desc->restore = '$date, restore by <strong>$actor</strong>.' . "\n";
|
||||
$lang->action->desc->importedcard = '$date, imported to <strong>$extra</strong> by <strong>$actor</strong>.' . "\n";
|
||||
$lang->action->desc->importedplan = '$date, imported to <strong>$extra</strong> by <strong>$actor</strong>.' . "\n";
|
||||
$lang->action->desc->importedrelease = '$date, imported to <strong>$extra</strong> by <strong>$actor</strong>.' . "\n";
|
||||
$lang->action->desc->importedexecution = '$date, imported to <strong>$extra</strong> by <strong>$actor</strong>.' . "\n";
|
||||
|
||||
/* Used to describe the history of operations related to parent-child tasks. */
|
||||
@@ -337,6 +338,7 @@ $lang->action->label->createchild = 'activated';
|
||||
$lang->action->label->executed = 'executed';
|
||||
$lang->action->label->importedcard = 'imported';
|
||||
$lang->action->label->importedplan = 'imported';
|
||||
$lang->action->label->importedrelease = 'imported';
|
||||
$lang->action->label->importedexecution = 'imported';
|
||||
|
||||
/* Dynamic information is grouped by object. */
|
||||
|
||||
@@ -195,6 +195,7 @@ $lang->action->desc->archived = '$date, 由 <strong>$actor</strong>
|
||||
$lang->action->desc->restore = '$date, 由 <strong>$actor</strong> 还原。' . "\n";
|
||||
$lang->action->desc->importedcard = '$date, 由 <strong>$actor</strong> 从看板 <strong>$extra</strong> 导入。' . "\n";
|
||||
$lang->action->desc->importedplan = '$date, 由 <strong>$actor</strong> 从产品计划 <strong>$extra</strong> 导入。' . "\n";
|
||||
$lang->action->desc->importedrelease = '$date, 由 <strong>$actor</strong> 从产品发布 <strong>$extra</strong> 导入。' . "\n";
|
||||
$lang->action->desc->importedexecution = '$date, 由 <strong>$actor</strong> 从项目执行 <strong>$extra</strong> 导入。' . "\n";
|
||||
|
||||
/* 用来描述和父子任务相关的操作历史记录。*/
|
||||
@@ -337,6 +338,7 @@ $lang->action->label->createchild = '激活了';
|
||||
$lang->action->label->executed = '执行了';
|
||||
$lang->action->label->importedcard = '导入了';
|
||||
$lang->action->label->importedplan = '导入了';
|
||||
$lang->action->label->importedrelease = '导入了';
|
||||
$lang->action->label->importedexecution = '导入了';
|
||||
|
||||
/* 动态信息按照对象分组 */
|
||||
|
||||
@@ -882,6 +882,58 @@ class kanban extends control
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Import release.
|
||||
*
|
||||
* @param int $kanbanID
|
||||
* @param int $regionID
|
||||
* @param int $groupID
|
||||
* @param int $columnID
|
||||
* @param int $selectedProductID
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function importRelease($kanbanID = 0, $regionID = 0, $groupID = 0, $columnID = 0, $selectedProductID = 0, $recTotal = 0, $recPerPage = 30, $pageID = 1)
|
||||
{
|
||||
$this->loadModel('product');
|
||||
$this->loadModel('release');
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$productPairs = $this->product->getPairs();
|
||||
$selectedProductID = empty($selectedProductID) ? key($productPairs) : $selectedProductID;
|
||||
|
||||
if($_POST)
|
||||
{
|
||||
$importedIDList = $this->kanban->importObject($kanbanID, $regionID, $groupID, $columnID, 'release');
|
||||
if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError()));
|
||||
|
||||
foreach($importedIDList as $cardID => $releaseID)
|
||||
{
|
||||
$this->loadModel('action')->create('kanbancard', $cardID, 'importedRelease', '', $releaseID);
|
||||
}
|
||||
|
||||
return print(js::locate($this->createLink('kanban', 'view', "kanbanID=$kanbanID"), 'parent.parent'));
|
||||
}
|
||||
|
||||
$this->view->products = $productPairs;
|
||||
$this->view->selectedProductID = $selectedProductID;
|
||||
$this->view->lanePairs = $this->kanban->getLanePairsByGroup($groupID);
|
||||
$this->view->releases2Imported = $this->release->getList($selectedProductID, 'all', 'all', 't1.date_desc', $pager);
|
||||
$this->view->pager = $pager;
|
||||
$this->view->kanbanID = $kanbanID;
|
||||
$this->view->regionID = $regionID;
|
||||
$this->view->groupID = $groupID;
|
||||
$this->view->columnID = $columnID;
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Import execution.
|
||||
*
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Reload card list.
|
||||
*
|
||||
* @param int $kanbanID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function reloadReleaseList(targetID)
|
||||
{
|
||||
location.href = createLink('kanban','importRelease','kanbanID=' + kanbanID + '®ionID=' + regionID + '&groupID=' + groupID + '&columnID=' + columnID + '&targetProductID=' + targetID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set target lane ID.
|
||||
*
|
||||
* @param int $targetLaneID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function setTargetLane(targetLaneID)
|
||||
{
|
||||
$('#targetLane').val(targetLaneID);
|
||||
}
|
||||
@@ -61,9 +61,10 @@ $lang->kanban->showClosed = 'Closed';
|
||||
$lang->kanban->importCard = 'Import Card';
|
||||
$lang->kanban->allKanban = 'All Kanban';
|
||||
$lang->kanban->importPlan = 'Import Plan';
|
||||
$lang->kanban->allProducts = 'All Products';
|
||||
$lang->kanban->importExecution = 'Import Execution';
|
||||
$lang->kanban->importRelease = 'Import Release';
|
||||
$lang->kanban->allProjects = 'All Projects';
|
||||
$lang->kanban->allProducts = 'All Products';
|
||||
|
||||
/* Fields. */
|
||||
$lang->kanban->space = 'Space';
|
||||
|
||||
@@ -61,9 +61,10 @@ $lang->kanban->showClosed = '显示已关闭';
|
||||
$lang->kanban->importCard = '转入卡片';
|
||||
$lang->kanban->allKanban = '所有看板';
|
||||
$lang->kanban->importPlan = '导入产品计划';
|
||||
$lang->kanban->allProducts = '所有产品';
|
||||
$lang->kanban->importExecution = '导入项目执行';
|
||||
$lang->kanban->importRelease = '导入产品发布';
|
||||
$lang->kanban->allProjects = '所有项目';
|
||||
$lang->kanban->allProducts = '所有产品';
|
||||
|
||||
/* Fields. */
|
||||
$lang->kanban->space = '所属空间';
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* The import release view of kanban 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 Qiyu Xie<xieqiyu@cnezsoft.com>
|
||||
* @package kanban
|
||||
* @version $Id: importrelease.html.php 5090 2022-01-19 14:19:24Z xieqiyu@cnezsoft.com $
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<?php js::set('kanbanID', $kanbanID);?>
|
||||
<?php js::set('regionID', $regionID);?>
|
||||
<?php js::set('groupID', $groupID);?>
|
||||
<?php js::set('columnID', $columnID);?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2><?php echo $lang->kanban->importRelease;?></h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class='table-row' style="padding: 10px">
|
||||
<div class='table-col w-150px text-center'><h4><?php echo $lang->kanban->selectedProduct;?></h4></div>
|
||||
<div class='table-col'><?php echo html::select('product', $products, $selectedProductID, "onchange='reloadReleaseList(this.value)' class='form-control chosen'");?></div>
|
||||
</div>
|
||||
<div class='table-row' style="padding: 10px">
|
||||
<div class='table-col w-150px text-center'><h4><?php echo $lang->kanban->selectedLane;?></h4></div>
|
||||
<div class='table-col'><?php echo html::select('lane', $lanePairs, '', "onchange='setTargetLane(this.value)' class='form-control chosen'");?></div>
|
||||
</div>
|
||||
<form class='main-table' method='post' data-ride='table' target='hiddenwin' id='importReleaseForm'>
|
||||
<table class='table table-fixed' id='releaseList'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="c-id">
|
||||
<div class="checkbox-primary check-all" title="<?php echo $lang->selectAll?>">
|
||||
<label></label>
|
||||
</div>
|
||||
<?php echo $lang->idAB;?>
|
||||
</th>
|
||||
<th class='c-name'><?php echo $lang->release->name;?></th>
|
||||
<th class='c-name'><?php echo $lang->release->project;?></th>
|
||||
<th class='c-date'><?php echo $lang->release->build;?></th>
|
||||
<th class='c-date'><?php echo $lang->release->date;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($releases2Imported as $release):?>
|
||||
<tr>
|
||||
<td class='c-id'>
|
||||
<div class="checkbox-primary">
|
||||
<input type='checkbox' name='releases[]' value='<?php echo $release->id;?>'/>
|
||||
<label></label>
|
||||
</div>
|
||||
<?php printf('%03d', $release->id);?>
|
||||
</td>
|
||||
<?php if(common::hasPriv('release', 'view')):?>
|
||||
<td title='<?php echo $release->name;?>'><?php common::printLink('release', 'view', "releaseID=$release->id", $release->name, '', "class='iframe'", true, true);?></td>
|
||||
<?php else:?>
|
||||
<td title='<?php echo $release->name;?>'><?php echo $release->name;?></td>
|
||||
<?php endif;?>
|
||||
<td title='<?php echo $release->project;?>'><?php echo $release->project;?></td>
|
||||
<td title='<?php echo $release->build;?>'><?php echo $release->build;?></td>
|
||||
<td title='<?php echo $release->date;?>'><?php echo $release->date;?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<tr><?php echo html::hidden('targetLane', key($lanePairs));?></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if($releases2Imported):?>
|
||||
<div class='table-footer'>
|
||||
<div class="checkbox-primary check-all"><label><?php echo $lang->selectAll?></label></div>
|
||||
<div class="table-actions btn-toolbar show-always"><?php echo html::submitButton($lang->kanban->importRelease, '', 'btn btn-default');?></div>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</form>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.lite.html.php';?>
|
||||
@@ -47,10 +47,11 @@ class releaseModel extends model
|
||||
* @param int $branch
|
||||
* @param string $type
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getList($productID, $branch = 'all', $type = 'all', $orderBy = 't1.date_desc')
|
||||
public function getList($productID, $branch = 'all', $type = 'all', $orderBy = 't1.date_desc', $pager = null)
|
||||
{
|
||||
return $this->dao->select('t1.*, t2.name as productName, t3.id as buildID, t3.name as buildName, t3.project, t4.name as projectName')
|
||||
->from(TABLE_RELEASE)->alias('t1')
|
||||
@@ -62,6 +63,7 @@ class releaseModel extends model
|
||||
->beginIF($type != 'all')->andWhere('t1.status')->eq($type)->fi()
|
||||
->andWhere('t1.deleted')->eq(0)
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
@@ -480,13 +482,13 @@ class releaseModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Judge btn is clickable or not.
|
||||
*
|
||||
* @param int $release
|
||||
* @param string $action
|
||||
* Judge btn is clickable or not.
|
||||
*
|
||||
* @param int $release
|
||||
* @param string $action
|
||||
* @static
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return bool
|
||||
*/
|
||||
public static function isClickable($release, $action)
|
||||
{
|
||||
@@ -498,7 +500,7 @@ class releaseModel extends model
|
||||
|
||||
/**
|
||||
* Send mail to release related users.
|
||||
*
|
||||
*
|
||||
* @param int $releaseID
|
||||
* @access public
|
||||
* @return void
|
||||
|
||||
Reference in New Issue
Block a user