Merge branch dev/task-150912 of zentao/zentaopms (#11939)
This commit is contained in:
@@ -3209,6 +3209,12 @@ INSERT INTO `zt_storygrade` (`type`, `grade`, `name`, `status`) VALUES
|
||||
('story', 2, '子', 'enable');
|
||||
|
||||
REPLACE INTO `zt_stage` (`workflowGroup`, `name`, `percent`, `type`, `createdBy`, `createdDate`, `editedBy`, `editedDate`, `deleted`) VALUES
|
||||
('0', '需求', '10', 'request', 'admin', '2020-02-08 21:08:30', 'admin', '2020-02-12 13:50:27', '0'),
|
||||
('0', '设计', '10', 'design', 'admin', '2020-02-08 21:08:30', 'admin', '2020-02-12 13:50:27', '0'),
|
||||
('0', '开发', '50', 'dev', 'admin', '2020-02-08 21:08:30', 'admin', '2020-02-12 13:50:27', '0'),
|
||||
('0', '测试', '15', 'qa', 'admin', '2020-02-08 21:08:30', 'admin', '2020-02-12 13:50:27', '0'),
|
||||
('0', '发布', '10', 'release', 'admin', '2020-02-08 21:08:30', 'admin', '2020-02-12 13:50:27', '0'),
|
||||
('0', '总结评审', '5', 'review', 'admin', '2020-02-08 21:08:45', 'admin', '2020-02-12 13:50:27', '0'),
|
||||
('4', '需求', '10', 'request', 'admin', '2020-02-08 21:08:30', 'admin', '2020-02-12 13:50:27', '0'),
|
||||
('4', '设计', '10', 'design', 'admin', '2020-02-08 21:08:30', 'admin', '2020-02-12 13:50:27', '0'),
|
||||
('4', '开发', '50', 'dev', 'admin', '2020-02-08 21:08:30', 'admin', '2020-02-12 13:50:27', '0'),
|
||||
|
||||
@@ -393,6 +393,7 @@ class adminModel extends model
|
||||
$moduleName = $this->app->rawModule;
|
||||
$methodName = $this->app->rawMethod;
|
||||
$firstParam = $this->app->rawParams ? reset($this->app->rawParams) : '';
|
||||
if($this->config->edition == 'open') $this->config->admin->menuGroup['feature'][] = 'stage|browse';
|
||||
|
||||
foreach($this->config->admin->menuGroup as $menuKey => $menuGroup)
|
||||
{
|
||||
|
||||
+33
-30
@@ -23,37 +23,40 @@ class stage extends control
|
||||
*/
|
||||
public function browse(int $groupID = 0, string $orderBy = "order_asc")
|
||||
{
|
||||
$workflowGroup = $this->loadModel('workflowgroup')->getByID($groupID);
|
||||
if($workflowGroup->projectModel == 'ipd')
|
||||
if($this->config->edition != 'open')
|
||||
{
|
||||
$this->config->stage->dtable->fieldList['type']['statusMap'] = $this->lang->stage->ipdTypeList;
|
||||
|
||||
$this->config->stage->dtable->fieldList['TRpoint']['title'] = $this->lang->stage->TRpoint;
|
||||
$this->config->stage->dtable->fieldList['TRpoint']['type'] = 'desc';
|
||||
$this->config->stage->dtable->fieldList['TRpoint']['width'] = 100;
|
||||
$this->config->stage->dtable->fieldList['TRpoint']['flex'] = false;
|
||||
$this->config->stage->dtable->fieldList['TRpoint']['group'] = 3;
|
||||
|
||||
$this->config->stage->dtable->fieldList['DCPpoint']['title'] = $this->lang->stage->DCPpoint;
|
||||
$this->config->stage->dtable->fieldList['DCPpoint']['type'] = 'desc';
|
||||
$this->config->stage->dtable->fieldList['DCPpoint']['width'] = 100;
|
||||
$this->config->stage->dtable->fieldList['DCPpoint']['flex'] = false;
|
||||
$this->config->stage->dtable->fieldList['DCPpoint']['group'] = 4;
|
||||
|
||||
if(common::hasPriv('stage', 'edit'))
|
||||
$workflowGroup = $this->loadModel('workflowgroup')->getByID($groupID);
|
||||
if($workflowGroup->projectModel == 'ipd')
|
||||
{
|
||||
$this->config->stage->actionList['setTRpoint']['icon'] = 'seal';
|
||||
$this->config->stage->actionList['setTRpoint']['hint'] = $this->lang->stage->setTRpoint;
|
||||
$this->config->stage->actionList['setTRpoint']['url'] = array('module' => 'stage', 'method' => 'setPoint', 'params' => 'type=TR&stageID={id}');
|
||||
$this->config->stage->actionList['setTRpoint']['data-toggle'] = 'modal';
|
||||
$this->config->stage->dtable->fieldList['type']['statusMap'] = $this->lang->stage->ipdTypeList;
|
||||
|
||||
$this->config->stage->actionList['setDCPpoint']['icon'] = 'seal';
|
||||
$this->config->stage->actionList['setDCPpoint']['hint'] = $this->lang->stage->setDCPpoint;
|
||||
$this->config->stage->actionList['setDCPpoint']['url'] = array('module' => 'stage', 'method' => 'setPoint', 'params' => 'type=DCP&stageID={id}');
|
||||
$this->config->stage->actionList['setDCPpoint']['data-toggle'] = 'modal';
|
||||
$this->config->stage->dtable->fieldList['TRpoint']['title'] = $this->lang->stage->TRpoint;
|
||||
$this->config->stage->dtable->fieldList['TRpoint']['type'] = 'desc';
|
||||
$this->config->stage->dtable->fieldList['TRpoint']['width'] = 100;
|
||||
$this->config->stage->dtable->fieldList['TRpoint']['flex'] = false;
|
||||
$this->config->stage->dtable->fieldList['TRpoint']['group'] = 3;
|
||||
|
||||
$this->config->stage->dtable->fieldList['actions']['menu'] = array('setTRpoint', 'setDCPpoint', 'edit', 'delete');
|
||||
$this->config->stage->dtable->fieldList['actions']['list'] = $this->config->stage->actionList;
|
||||
$this->config->stage->dtable->fieldList['DCPpoint']['title'] = $this->lang->stage->DCPpoint;
|
||||
$this->config->stage->dtable->fieldList['DCPpoint']['type'] = 'desc';
|
||||
$this->config->stage->dtable->fieldList['DCPpoint']['width'] = 100;
|
||||
$this->config->stage->dtable->fieldList['DCPpoint']['flex'] = false;
|
||||
$this->config->stage->dtable->fieldList['DCPpoint']['group'] = 4;
|
||||
|
||||
if(common::hasPriv('stage', 'edit'))
|
||||
{
|
||||
$this->config->stage->actionList['setTRpoint']['icon'] = 'seal';
|
||||
$this->config->stage->actionList['setTRpoint']['hint'] = $this->lang->stage->setTRpoint;
|
||||
$this->config->stage->actionList['setTRpoint']['url'] = array('module' => 'stage', 'method' => 'setPoint', 'params' => 'type=TR&stageID={id}');
|
||||
$this->config->stage->actionList['setTRpoint']['data-toggle'] = 'modal';
|
||||
|
||||
$this->config->stage->actionList['setDCPpoint']['icon'] = 'seal';
|
||||
$this->config->stage->actionList['setDCPpoint']['hint'] = $this->lang->stage->setDCPpoint;
|
||||
$this->config->stage->actionList['setDCPpoint']['url'] = array('module' => 'stage', 'method' => 'setPoint', 'params' => 'type=DCP&stageID={id}');
|
||||
$this->config->stage->actionList['setDCPpoint']['data-toggle'] = 'modal';
|
||||
|
||||
$this->config->stage->dtable->fieldList['actions']['menu'] = array('setTRpoint', 'setDCPpoint', 'edit', 'delete');
|
||||
$this->config->stage->dtable->fieldList['actions']['list'] = $this->config->stage->actionList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +90,7 @@ class stage extends control
|
||||
|
||||
$this->view->title = $this->lang->stage->common . $this->lang->hyphen . $this->lang->stage->create;
|
||||
$this->view->groupID = $groupID;
|
||||
$this->view->flow = $this->loadModel('workflowgroup')->getByID($groupID);
|
||||
$this->view->flow = $this->config->edition == 'open' ? new stdClass() : $this->loadModel('workflowgroup')->getByID($groupID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -113,7 +116,7 @@ class stage extends control
|
||||
|
||||
$this->view->title = $this->lang->stage->common . $this->lang->hyphen . $this->lang->stage->batchCreate;
|
||||
$this->view->groupID = $groupID;
|
||||
$this->view->flow = $this->loadModel('workflowgroup')->getByID($groupID);
|
||||
$this->view->flow = $this->config->edition == 'open' ? new stdClass() : $this->loadModel('workflowgroup')->getByID($groupID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
@@ -143,7 +146,7 @@ class stage extends control
|
||||
|
||||
$this->view->title = $this->lang->stage->common . $this->lang->hyphen . $this->lang->stage->edit;
|
||||
$this->view->stage = $stage;
|
||||
$this->view->flow = $this->loadModel('workflowgroup')->getByID($stage->workflowGroup);
|
||||
$this->view->flow = $this->config->edition == 'open' ? new stdClass() : $this->loadModel('workflowgroup')->getByID($stage->workflowGroup);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ declare(strict_types=1);
|
||||
namespace zin;
|
||||
|
||||
$percentItem = '';
|
||||
if(isset($config->setPercent) && $config->setPercent == 1 && $flow->projectModel != 'ipd')
|
||||
if(isset($config->setPercent) && $config->setPercent == 1 && isset($flow->projectModel) && $flow->projectModel != 'ipd')
|
||||
{
|
||||
$percentItem = formBatchItem(
|
||||
set::name('percent'),
|
||||
@@ -40,7 +40,7 @@ formBatchPanel
|
||||
set::label($lang->stage->type),
|
||||
set::width('150px'),
|
||||
set::control('select'),
|
||||
set::items($flow->projectModel == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList)
|
||||
set::items(isset($flow->projectModel) && $flow->projectModel == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList)
|
||||
)
|
||||
);
|
||||
/* ====== Render page ====== */
|
||||
|
||||
@@ -15,13 +15,49 @@ featureBar();
|
||||
$canCreateStage = hasPriv('stage', 'create');
|
||||
$canbatchCreateStage = hasPriv('stage', 'batchCreate');
|
||||
if($canCreateStage) $createItem = array('icon' => 'plus', 'class' => 'primary', 'text' => $lang->stage->create, 'url' => $this->createLink('stage', 'create', "groupID={$groupID}"), 'data-toggle' => 'modal');
|
||||
if($canbatchCreateStage) $batchCreateItem = array('icon' => 'plus', 'class' => 'primary mr-4', 'text' => $lang->stage->batchCreate, 'url' => $this->createLink('stage', 'batchCreate', "groupID={$groupID}"));
|
||||
if($canbatchCreateStage) $batchCreateItem = array('icon' => 'plus', 'class' => 'primary', 'text' => $lang->stage->batchCreate, 'url' => $this->createLink('stage', 'batchCreate', "groupID={$groupID}"));
|
||||
toolbar
|
||||
(
|
||||
!empty($batchCreateItem) ? item(set($batchCreateItem)) : null,
|
||||
!empty($createItem) ? item(set($createItem)) : null
|
||||
);
|
||||
|
||||
if($this->config->edition == 'open')
|
||||
{
|
||||
if(hasPriv('stage', 'settype'))
|
||||
{
|
||||
$menuItems[] = li
|
||||
(
|
||||
setClass('menu-item'),
|
||||
a
|
||||
(
|
||||
set::href(createLink('stage', 'settype')),
|
||||
$lang->stage->setType
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$menuItems[] = li
|
||||
(
|
||||
setClass('menu-item'),
|
||||
a
|
||||
(
|
||||
setClass('active'),
|
||||
set::href(createLink('stage', 'browse')),
|
||||
$lang->stage->browse
|
||||
)
|
||||
);
|
||||
|
||||
sidebar
|
||||
(
|
||||
div
|
||||
(
|
||||
setClass('cell p-2.5 bg-white'),
|
||||
menu($menuItems)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$tableData = initTableData($stages, $config->stage->dtable->fieldList, $this->stage);
|
||||
dtable
|
||||
(
|
||||
|
||||
@@ -10,7 +10,7 @@ declare(strict_types=1);
|
||||
*/
|
||||
namespace zin;
|
||||
$percentRow = '';
|
||||
if(isset($config->setPercent) && $config->setPercent == 1 && $flow->projectModel != 'ipd')
|
||||
if(isset($config->setPercent) && $config->setPercent == 1 && isset($flow->projectModel) && $flow->projectModel != 'ipd')
|
||||
{
|
||||
$percentRow = formRow(
|
||||
formGroup
|
||||
@@ -53,7 +53,7 @@ formPanel
|
||||
set::width('1/2'),
|
||||
set::label($lang->stage->type),
|
||||
set::name('type'),
|
||||
set::items($flow->projectModel == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList)
|
||||
set::items(isset($flow->projectModel) && $flow->projectModel == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -10,7 +10,7 @@ declare(strict_types=1);
|
||||
*/
|
||||
namespace zin;
|
||||
$percentRow = '';
|
||||
if(isset($config->setPercent) && $config->setPercent == 1 && $flow->projectModel != 'ipd')
|
||||
if(isset($config->setPercent) && $config->setPercent == 1 && isset($flow->projectModel) && $flow->projectModel != 'ipd')
|
||||
{
|
||||
$percentRow = formRow(
|
||||
formGroup
|
||||
@@ -59,7 +59,7 @@ formPanel
|
||||
set::label($lang->stage->type),
|
||||
set::name('type'),
|
||||
set::value($stage->type),
|
||||
set::items($flow->projectModel == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList)
|
||||
set::items(isset($flow->projectModel) && $flow->projectModel == 'ipd' ? $lang->stage->ipdTypeList : $lang->stage->typeList)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
@@ -129,6 +129,19 @@ $menuItems[] = li
|
||||
)
|
||||
);
|
||||
|
||||
if($config->edition == 'open' && hasPriv('stage', 'browse'))
|
||||
{
|
||||
$menuItems[] = li
|
||||
(
|
||||
setClass('menu-item'),
|
||||
a
|
||||
(
|
||||
set::href(createLink('stage', 'browse')),
|
||||
$lang->stage->browse
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
div
|
||||
(
|
||||
setClass('row has-sidebar-left'),
|
||||
|
||||
@@ -12490,6 +12490,30 @@ class upgradeModel extends model
|
||||
$stageGroup = $this->dao->select('*')->from(TABLE_STAGE)->where('workflowGroup')->eq(0)->fetchGroup('projectType', 'id');
|
||||
if(empty($stageGroup)) return true;
|
||||
|
||||
if($this->config->edition == 'open')
|
||||
{
|
||||
$typeNamePairs = array();
|
||||
$needDeleteStage = array();
|
||||
foreach($stageGroup as $projectModel => $stageList)
|
||||
{
|
||||
if($projectModel == 'ipd') continue;
|
||||
foreach($stageList as $stageInfo)
|
||||
{
|
||||
if(isset($typeNamePairs[$stageInfo->type]) && in_array($stageInfo->name, $typeNamePairs[$stageInfo->type]))
|
||||
{
|
||||
$needDeleteStage[$stageInfo->id] = $stageInfo->id;
|
||||
continue;
|
||||
}
|
||||
if(!isset($typeNamePairs[$stageInfo->type])) $typeNamePairs[$stageInfo->type] = array();
|
||||
$typeNamePairs[$stageInfo->type][] = $stageInfo->name;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($needDeleteStage)) $this->dao->delete()->from(TABLE_STAGE)->where('id')->in($needDeleteStage)->exec();
|
||||
$this->dao->delete()->from(TABLE_STAGE)->where('projectType')->eq('ipd')->exec();
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->app->loadConfig('project');
|
||||
$this->app->loadConfig('review');
|
||||
$typeCodeGroup = $this->dao->select('projectModel, code, id')->from(TABLE_WORKFLOWGROUP)->where('main')->eq('1')->andWhere('projectModel')->in('waterfall,waterfallplus,ipd')->fetchGroup('projectModel', 'code');
|
||||
@@ -12497,6 +12521,8 @@ class upgradeModel extends model
|
||||
{
|
||||
foreach(array_keys($flowList) as $flowCode)
|
||||
{
|
||||
if(!isset($stageGroup[$projectModel])) continue;
|
||||
|
||||
foreach($stageGroup[$projectModel] as $stage)
|
||||
{
|
||||
if($flowCode == 'tpdproduct' && !in_array($stage->type, $this->config->project->categoryStages['TPD'])) continue;
|
||||
|
||||
Reference in New Issue
Block a user