+ Add zin page for release view.
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
global $lang, $app;
|
||||
$app->loadLang('story');
|
||||
$app->loadLang('build');
|
||||
|
||||
$config->release->dtable = new stdclass();
|
||||
$config->release->dtable->story = new stdclass();
|
||||
$config->release->dtable->bug = new stdclass();
|
||||
$config->release->dtable->leftBug = new stdclass();
|
||||
|
||||
$config->release->dtable->story->fieldList['id']['title'] = $lang->idAB;
|
||||
$config->release->dtable->story->fieldList['id']['name'] = 'id';
|
||||
$config->release->dtable->story->fieldList['id']['type'] = 'checkID';
|
||||
$config->release->dtable->story->fieldList['id']['sortType'] = 'desc';
|
||||
$config->release->dtable->story->fieldList['id']['checkbox'] = true;
|
||||
|
||||
$config->release->dtable->story->fieldList['title']['title'] = $lang->story->title;
|
||||
$config->release->dtable->story->fieldList['title']['name'] = 'title';
|
||||
$config->release->dtable->story->fieldList['title']['type'] = 'title';
|
||||
$config->release->dtable->story->fieldList['title']['link'] = helper::createLink('story', 'view', 'storyID = {id}', '', true);
|
||||
$config->release->dtable->story->fieldList['title']['data-modal'] = 'modal';
|
||||
|
||||
$config->release->dtable->story->fieldList['pri']['title'] = $lang->priAB;
|
||||
$config->release->dtable->story->fieldList['pri']['name'] = 'pri';
|
||||
$config->release->dtable->story->fieldList['pri']['type'] = 'pri';
|
||||
|
||||
$config->release->dtable->story->fieldList['status']['title'] = $lang->statusAB;
|
||||
$config->release->dtable->story->fieldList['status']['name'] = 'status';
|
||||
$config->release->dtable->story->fieldList['status']['type'] = 'status';
|
||||
$config->release->dtable->story->fieldList['status']['statusMap'] = $lang->story->statusList;
|
||||
|
||||
$config->release->dtable->story->fieldList['linkedBuild']['title'] = $lang->build->linkedBuild;
|
||||
$config->release->dtable->story->fieldList['linkedBuild']['name'] = 'linkedBuild';
|
||||
$config->release->dtable->story->fieldList['linkedBuild']['type'] = 'text';
|
||||
|
||||
$config->release->dtable->story->fieldList['openedBy']['title'] = $lang->openedByAB;
|
||||
$config->release->dtable->story->fieldList['openedBy']['name'] = 'openedBy';
|
||||
$config->release->dtable->story->fieldList['openedBy']['type'] = 'user';
|
||||
|
||||
$config->release->dtable->story->fieldList['estimate']['title'] = $lang->story->estimateAB;
|
||||
$config->release->dtable->story->fieldList['estimate']['name'] = 'estimate';
|
||||
$config->release->dtable->story->fieldList['estimate']['type'] = 'number';
|
||||
|
||||
$config->release->dtable->story->fieldList['stage']['title'] = $lang->story->stageAB;
|
||||
$config->release->dtable->story->fieldList['stage']['name'] = 'stage';
|
||||
$config->release->dtable->story->fieldList['stage']['type'] = 'category';
|
||||
$config->release->dtable->story->fieldList['stage']['map'] = $lang->story->stageList;
|
||||
|
||||
$config->release->dtable->story->fieldList['actions']['title'] = $lang->actions;
|
||||
$config->release->dtable->story->fieldList['actions']['name'] = 'actions';
|
||||
$config->release->dtable->story->fieldList['actions']['type'] = 'actions';
|
||||
$config->release->dtable->story->fieldList['actions']['menu'] = array('unlinkStory');
|
||||
|
||||
$config->release->dtable->story->fieldList['actions']['list']['unlinkStory']['icon'] = 'unlink';
|
||||
$config->release->dtable->story->fieldList['actions']['list']['unlinkStory']['hint'] = $lang->release->unlinkStory;
|
||||
$config->release->dtable->story->fieldList['actions']['list']['unlinkStory']['url'] = helper::createLink('release', 'unlinkStory', "releaseID={id}&story={story}");
|
||||
@@ -580,7 +580,7 @@ class release extends control
|
||||
public function batchUnlinkStory($releaseID)
|
||||
{
|
||||
$this->release->batchUnlinkStory($releaseID);
|
||||
echo js::locate($this->createLink('release', 'view', "releaseID=$releaseID&type=story"), 'parent');
|
||||
return $this->sendSuccess(array('load' => true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
$(document).off('click','.dtable-footer .batch-btn').on('click', '.dtable-footer .batch-btn', function()
|
||||
{
|
||||
const dtable = zui.DTable.query($(this).target);
|
||||
const checkedList = dtable.$.getChecks();
|
||||
if(!checkedList.length) return;
|
||||
|
||||
const postData = [];
|
||||
postData[`${type}IdList[]`] = checkedList;
|
||||
|
||||
$.ajaxSubmit({
|
||||
url: $(this).data('url'),
|
||||
data: postData
|
||||
});
|
||||
});
|
||||
@@ -797,23 +797,43 @@ class releaseModel extends model
|
||||
$canBeChanged = common::canBeChanged('release', $release);
|
||||
if($release->deleted || !$canBeChanged || isonlybody()) return '';
|
||||
|
||||
$menu = '';
|
||||
$menu = array();
|
||||
$params = "releaseID=$release->id";
|
||||
|
||||
if(common::hasPriv('release', 'changeStatus', $release))
|
||||
{
|
||||
$changedStatus = $release->status == 'normal' ? 'terminate' : 'normal';
|
||||
$menu .= html::a(inlink('changeStatus', "releaseID=$release->id&status=$changedStatus"), '<i class="icon-' . ($release->status == 'normal' ? 'pause' : 'play') . '"></i> ' . $this->lang->release->changeStatusList[$changedStatus], 'hiddenwin', "class='btn btn-link' title='{$this->lang->release->changeStatusList[$changedStatus]}'");
|
||||
|
||||
$menu[] = array(
|
||||
'text' => $this->lang->release->changeStatusList[$changedStatus],
|
||||
'icon' => $release->status == 'normal' ? 'pause' : 'play',
|
||||
'url' => inlink('changeStatus', "releaseID=$release->id&status=$changedStatus")
|
||||
);
|
||||
}
|
||||
|
||||
$menu .= "<div class='divider'></div>";
|
||||
$menu .= $this->buildFlowMenu('release', $release, 'view', 'direct');
|
||||
$menu .= "<div class='divider'></div>";
|
||||
$menu[] = array(
|
||||
'type' => 'divider'
|
||||
);
|
||||
|
||||
$editClickable = $this->buildMenu('release', 'edit', $params, $release, 'view', '', '', '', '', '', '', false);
|
||||
$deleteClickable = $this->buildMenu('release', 'delete', $params, $release, 'view', '', '', '', '', '', '', false);
|
||||
if(common::hasPriv('release', 'edit') and $editClickable) $menu .= html::a(helper::createLink('release', 'edit', $params), "<i class='icon-common-edit icon-edit'></i> " . $this->lang->edit, '', "class='btn btn-link' title='{$this->lang->edit}'");
|
||||
if(common::hasPriv('release', 'delete') and $deleteClickable) $menu .= html::a(helper::createLink('release', 'delete', $params), "<i class='icon-common-delete icon-trash'></i> " . $this->lang->delete, '', "class='btn btn-link' title='{$this->lang->delete}' target='hiddenwin'");
|
||||
//$menu .= $this->buildFlowMenu('release', $release, 'view', 'direct');
|
||||
|
||||
if(common::hasPriv('release', 'edit'))
|
||||
{
|
||||
$menu[] = array(
|
||||
'text' => $this->lang->edit,
|
||||
'icon' => 'edit',
|
||||
'url' => inlink('edit', $params)
|
||||
);
|
||||
}
|
||||
|
||||
if(common::hasPriv('release', 'delete'))
|
||||
{
|
||||
$menu[] = array(
|
||||
'text' => $this->lang->delete,
|
||||
'icon' => 'delete',
|
||||
'url' => inlink('delete', $params)
|
||||
);
|
||||
}
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* The activate view file of task module of ZenTaoPMS.
|
||||
* @copyright Copyright 2009-2023 禅道软件(青岛)有限公司(ZenTao Software (Qingdao) Co., Ltd. www.zentao.net)
|
||||
* @license ZPL(https://zpl.pub/page/zplv12.html) or AGPL(https://www.gnu.org/licenses/agpl-3.0.en.html)
|
||||
* @author Shujie Tian<tianshujie@easycorp.ltd>
|
||||
* @package task
|
||||
* @link https://www.zentao.net
|
||||
*/
|
||||
namespace zin;
|
||||
global $lang;
|
||||
|
||||
$actions = $this->release->buildOperateViewMenu($release);
|
||||
detailHeader
|
||||
(
|
||||
to::title(entityLabel(set(array('entityID' => $release->id, 'level' => 1, 'text' => $release->name)))),
|
||||
!empty($actions) ? to::suffix(btnGroup(set::items($actions))) : null
|
||||
);
|
||||
|
||||
jsVar('type', $type);
|
||||
|
||||
/* Table data and setting for finished story tab. */
|
||||
$storyFootToolbar = array();
|
||||
$storyTableData = initTableData($stories, $config->release->dtable->story->fieldList, $this->release);
|
||||
|
||||
$canBatchUnlinkStory = common::hasPriv('release', 'batchUnlinkStory');
|
||||
$canBatchCloseStory = common::hasPriv('story', 'batchClose');
|
||||
if($canBatchUnlinkStory) $storyFootToolbar['items'][] = array('class' => 'btn primary size-sm batch-btn', 'text' => $lang->release->batchUnlink, 'btnType' => 'primary', 'data-url' => inlink('batchUnlinkStory', "release={$release->id}"));
|
||||
if($canBatchCloseStory) $storyFootToolbar['items'][] = array('class' => 'btn primary size-sm batch-btn', 'text' => $lang->story->batchClose, 'btnType' => 'primary', 'data-url' => createLink('story', 'batchClose', "productID={$release->product}"));
|
||||
|
||||
detailBody
|
||||
(
|
||||
tabs
|
||||
(
|
||||
set::class('w-full'),
|
||||
tabPane
|
||||
(
|
||||
set::key('finished-story'),
|
||||
set::title($lang->release->stories),
|
||||
set::active(true),
|
||||
dtable
|
||||
(
|
||||
set::userMap($users),
|
||||
set::cols(array_values($config->release->dtable->story->fieldList)),
|
||||
set::data($storyTableData),
|
||||
set::checkable(true),
|
||||
//set::sortLink(jsRaw('createSortLink')),
|
||||
set::footToolbar($storyFootToolbar),
|
||||
set::footPager(
|
||||
usePager(null, 'storyPager'),
|
||||
set::recPerPage($storyPager->recPerPage),
|
||||
set::recTotal($storyPager->recTotal),
|
||||
set::linkCreator(helper::createLink('release', 'view', "releaseID={$release->id}&type={$type}&link={$link}¶m={$param}&orderBy={$orderBy}&recTotal={$storyPager->recTotal}&recPerPage={recPerPage}&page={page}"))
|
||||
),
|
||||
//set::checkInfo(jsRaw('function(checkedIDList){return window.setStatistics(this, checkedIDList);}'))
|
||||
)
|
||||
),
|
||||
)
|
||||
);
|
||||
|
||||
render();
|
||||
Reference in New Issue
Block a user