diff --git a/db/update16.3.sql b/db/update16.3.sql index ea20af7ca6..1d36ca955e 100644 --- a/db/update16.3.sql +++ b/db/update16.3.sql @@ -2,3 +2,4 @@ ALTER TABLE `zt_project` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER ` ALTER TABLE `zt_product` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `order`; ALTER TABLE `zt_doclib` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `order`; ALTER TABLE `zt_task` ADD `vision` varchar(10) NOT NULL DEFAULT 'rnd' AFTER `deleted`; +ALTER TABLE `zt_projectstory` ADD INDEX `story` (`story`); diff --git a/extension/lite/common/ext/lang/zh-cn/lite.php b/extension/lite/common/ext/lang/zh-cn/lite.php index 586df01c93..ff6e0af7a5 100644 --- a/extension/lite/common/ext/lang/zh-cn/lite.php +++ b/extension/lite/common/ext/lang/zh-cn/lite.php @@ -50,8 +50,8 @@ $lang->kanban->menuOrder[30] = 'settings'; $lang->execution->menu = new stdclass(); $lang->execution->menu->kanban = array('link' => "看板|execution|kanban|executionID=%s"); $lang->execution->menu->list = array('link' => "列表|execution|task|executionID=%s"); -$lang->execution->menu->calendar = array('link' => "日历|execution|calendar|executionID=%s"); -$lang->execution->menu->gantt = array('link' => "甘特图|execution|gantt|executionID=%s"); +if($config->edition != 'open') $lang->execution->menu->calendar = array('link' => "日历|execution|calendar|executionID=%s"); +if($config->edition != 'open') $lang->execution->menu->gantt = array('link' => "甘特图|execution|gantt|executionID=%s"); $lang->execution->menu->tree = array('link' => "树状图|execution|tree|executionID=%s"); $lang->execution->menu->group = array('link' => "分组视图|execution|groupTask|executionID=%s"); diff --git a/extension/lite/execution/ext/control/all.php b/extension/lite/execution/ext/control/all.php deleted file mode 100644 index 72d47d2c42..0000000000 --- a/extension/lite/execution/ext/control/all.php +++ /dev/null @@ -1,66 +0,0 @@ -app->loadLang('my'); - $this->app->loadLang('product'); - $this->app->loadLang('stage'); - $this->app->loadLang('programplan'); - - $from = $this->app->tab; - if($from == 'execution') $this->session->set('executionList', $this->app->getURI(true), 'execution'); - - if($from == 'project') - { - $projects = $this->project->getPairsByProgram(); - $projectID = $this->project->saveState($projectID, $projects); - $project = $this->loadModel('project')->getByID($projectID); - $this->view->project = $project; - $this->project->setMenu($projectID); - } - - if($this->app->viewType == 'mhtml') - { - if($this->app->rawModule == 'project' and $this->app->rawMethod == 'execution') - { - $projects = $this->project->getPairsByProgram(); - $projectID = $this->project->saveState($projectID, $projects); - $this->project->setMenu($projectID); - } - else - { - $executionID = $this->execution->saveState(0, $this->executions); - $this->execution->setMenu($executionID); - } - } - - /* Load pager and get tasks. */ - $this->app->loadClass('pager', $static = true); - $pager = new pager($recTotal, $recPerPage, $pageID); - - $this->view->title = $this->lang->execution->allExecutions; - $this->view->position[] = $this->lang->execution->allExecutions; - - $executionStats = $this->project->getStats($projectID, $status, $productID, 0, 30, $orderBy, $pager); - $executionTeams = array(); - foreach($executionStats as $execution) $executionTeams[$execution->id] = $this->execution->getTeamMembers($execution->id); - - $this->view->executionStats = $executionStats; - $this->view->executionTeams = $executionTeams; - $this->view->productList = $this->loadModel('product')->getProductPairsByProject($projectID); - $this->view->productID = $productID; - $this->view->projectID = $projectID; - $this->view->projects = array('') + $this->project->getPairsByProgram(); - $this->view->pager = $pager; - $this->view->orderBy = $orderBy; - $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->status = $status; - $this->view->from = $from; - $this->view->isStage = (isset($project->model) and $project->model == 'waterfall') ? true : false; - $this->view->users = $this->loadModel('user')->getPairs('noletter|nodeleted'); - $this->view->usersAvatar = $this->user->getAvatarPairs(); - $this->display(); - } -} diff --git a/extension/lite/execution/ext/control/kanban.php b/extension/lite/execution/ext/control/kanban.php index 4bfe4a8f7f..e45f8e5cfd 100644 --- a/extension/lite/execution/ext/control/kanban.php +++ b/extension/lite/execution/ext/control/kanban.php @@ -4,9 +4,69 @@ class myExecution extends execution { public function kanban($executionID, $browseType = 'all', $orderBy = 'id_asc', $groupBy = 'default') { + $this->app->loadLang('kanban'); + common::setMenuVars('execution', $executionID); + $execution = $this->execution->getById($executionID); $this->loadModel('project')->setMenu($execution->project); + $this->lang->kanban->menu->execution['subMenu'] = $this->lang->execution->menu; + $TRActions = ''; + $TRActions .= ""; + $TRActions .= html::a('javascript:fullScreen()', " " . $this->lang->kanban->fullScreen, '', "class='btn btn-link'"); + + $printSettingBtn = (common::hasPriv('kanban', 'createRegion') or (common::hasPriv('kanban', 'setLaneHeight')) or common::hasPriv('execution', 'edit') or common::hasPriv('execution', 'close') or common::hasPriv('execution', 'delete') or !empty($executionActions)); + $executionActions = array(); + foreach($this->config->execution->statusActions as $action) + { + if($this->execution->isClickable($execution, $action)) $executionActions[] = $action; + } + if($this->execution->isClickable($execution, 'delete')) $executionActions[] = 'delete'; + + if($printSettingBtn) + { + $TRActions .= ""; + } + + $canCreateTask = common::hasPriv('task', 'create'); + $canBatchCreateTask = common::hasPriv('task', 'batchCreate'); + if($canCreateTask or $canBatchCreateTask) + { + $TRActions .= ""; + } + $this->lang->TRActions = $TRActions; + + $browseType = 'task'; parent::kanban($executionID, $browseType, $orderBy, $groupBy); } } diff --git a/extension/lite/execution/ext/lang/zh-cn/lite.php b/extension/lite/execution/ext/lang/zh-cn/lite.php index ae7e3be8ba..2d883fb668 100644 --- a/extension/lite/execution/ext/lang/zh-cn/lite.php +++ b/extension/lite/execution/ext/lang/zh-cn/lite.php @@ -5,3 +5,9 @@ unset($lang->execution->featureBar['all']['suspended']); $lang->execution->createKanban = '创建看板'; $lang->execution->noExecution = "暂时没有看板。"; + +$lang->execution->kanbanGroup['default'] = '默认方式'; +$lang->execution->kanbanGroup['story'] = '目标'; +$lang->execution->kanbanGroup['module'] = '所属目录'; +$lang->execution->kanbanGroup['pri'] = '优先级'; +$lang->execution->kanbanGroup['assignedTo'] = '指派人'; diff --git a/extension/lite/execution/ext/model/lite.php b/extension/lite/execution/ext/model/lite.php new file mode 100644 index 0000000000..b3d561d125 --- /dev/null +++ b/extension/lite/execution/ext/model/lite.php @@ -0,0 +1,32 @@ +getById($executionID); + if(isset($this->lang->execution->menu->kanban)) + { + $this->loadModel('project')->setMenu($execution->project); + $this->lang->kanban->menu->execution['subMenu'] = $this->lang->execution->menu; + } + + $kanbanList = $this->getList($execution->project, 'kanban', 'all'); + $currentKanban = zget($kanbanList, $execution->id, ''); + if(empty($currentKanban)) + { + echo(js::alert($this->lang->execution->accessDenied)); + die(js::locate(helper::createLink('project', 'execution', "status=all&projectID={$execution->project}"))); + } + + $modulePageNav = ""; + $modulePageNav .= "
"; + $modulePageNav .= ""; + $modulePageNav .= "
"; + if($this->app->rawMethod == 'task') $this->lang->TRActions = ''; + + $this->lang->modulePageNav = $modulePageNav; +} diff --git a/extension/lite/execution/ext/view/kanban.lite.html.hook.php b/extension/lite/execution/ext/view/kanban.lite.html.hook.php new file mode 100644 index 0000000000..b4e48e22c1 --- /dev/null +++ b/extension/lite/execution/ext/view/kanban.lite.html.hook.php @@ -0,0 +1,3 @@ + diff --git a/extension/lite/kanban/ext/config/lite.php b/extension/lite/kanban/ext/config/lite.php deleted file mode 100644 index bd8e3bb152..0000000000 --- a/extension/lite/kanban/ext/config/lite.php +++ /dev/null @@ -1,3 +0,0 @@ -kanban->create->requiredFields = 'project,name'; -$config->kanban->edit->requiredFields = 'project,name'; diff --git a/extension/lite/kanban/ext/lang/zh-cn/lite.php b/extension/lite/kanban/ext/lang/zh-cn/lite.php deleted file mode 100644 index 9e36cb0feb..0000000000 --- a/extension/lite/kanban/ext/lang/zh-cn/lite.php +++ /dev/null @@ -1,5 +0,0 @@ -kanban->project = '所属项目'; - -$lang->kanban->aclList['extend'] = '继承项目访问权限(能访问当前项目,即可访问)'; -$lang->kanban->aclList['private'] = '私有(看板团队成员、白名单、项目负责人可访问)'; diff --git a/extension/lite/kanban/ext/model/lite.php b/extension/lite/kanban/ext/model/lite.php deleted file mode 100644 index fd0d188790..0000000000 --- a/extension/lite/kanban/ext/model/lite.php +++ /dev/null @@ -1,22 +0,0 @@ -loadModel('project')->getById($projectID); - $teams = $this->project->getTeamMembers($projectID); - - $project->team = join(',', array_keys($teams)); - $project->owner = zget($project, 'PO', 'openedBy'); - - $kanbans = $this->dao->select('*')->from(TABLE_KANBAN) - ->where('project')->eq($projectID) - ->andWhere('deleted')->eq(0) - ->beginIF($status != 'all')->andWhere('status')->eq($status)->fi() - ->fetchAll('id'); - - foreach($kanbans as $kanban) - { - if(!$this->checkKanbanPriv($kanban, 'kanban', array($project->id => $project))) unset($kanbans[$kanban->id]); - } - - return array_values($kanbans); -} diff --git a/extension/lite/kanban/ext/view/create.html.php b/extension/lite/kanban/ext/view/create.html.php deleted file mode 100644 index 01c626e91f..0000000000 --- a/extension/lite/kanban/ext/view/create.html.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @package kanban - * @version $Id: create.html.php 935 2021-12-09 13:48:24Z $ - * @link https://www.zentao.net - */ -?> -getModuleRoot() . 'common/view/header.html.php';?> -getModuleRoot() . 'common/view/kindeditor.html.php';?> -
-
-

kanban->create;?>

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
kanban->project;?> - '') + $this->loadModel('project')->getPairsByModel('all', 0, 'noclosed'); - echo html::select('project', $projects, $spaceID, "class='form-control chosen'"); - echo html::hidden('space', 0); - ?> -
kanban->name;?>
kanban->archived;?>kanban->enableArchived, '0');?>
kanban->owner;?>
kanban->team;?> -
- - fetch('my', 'buildContactLists');?> -
-
kanban->desc;?> - fetch('user', 'ajaxPrintTemplates', 'type=kanban&link=desc');?> - -
kanban->acl;?>kanban->aclList, 'private', "onclick='setWhite(this.value);'", 'block'));?>
whitelist;?>
- -
-
-
-getModuleRoot() . 'common/view/footer.html.php';?> diff --git a/extension/lite/kanban/ext/view/createexeclane.lite.html.hook.php b/extension/lite/kanban/ext/view/createexeclane.lite.html.hook.php new file mode 100644 index 0000000000..7e2162f9bc --- /dev/null +++ b/extension/lite/kanban/ext/view/createexeclane.lite.html.hook.php @@ -0,0 +1,7 @@ + diff --git a/extension/lite/kanban/ext/view/edit.html.php b/extension/lite/kanban/ext/view/edit.html.php deleted file mode 100644 index c6a9f24b4c..0000000000 --- a/extension/lite/kanban/ext/view/edit.html.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @package kanban - * @version $Id: edit.html.php 935 2021-12-09 16:15:24Z $ - * @link https://www.zentao.net - */ -?> -getModuleRoot() . 'common/view/header.html.php';?> -getModuleRoot() . 'common/view/kindeditor.html.php';?> -
-
-

kanban->edit;?>

-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
kanban->project;?> - '') + $this->loadModel('project')->getPairsByModel('all', 0, 'noclosed'); - echo html::select('project', $projects, $kanban->project, "class='form-control chosen'"); - echo html::hidden('space', 0); - ?> -
kanban->name;?>name, "class='form-control'");?>
kanban->archived;?>kanban->enableArchived, $kanban->archived);?>
kanban->owner;?>owner, "class='form-control chosen'");?>
kanban->team;?> -
- team, "class='form-control chosen' multiple data-drop_direction='down'");?> - fetch('my', 'buildContactLists');?> -
-
kanban->desc;?> - fetch('user', 'ajaxPrintTemplates', 'type=kanban&link=desc');?> - desc, "rows='10' class='form-control'");?> -
kanban->acl;?>kanban->aclList, $kanban->acl == 'open' ? 'extend' : $kanban->acl, "onclick='setWhite(this.value);'", 'block'));?>
whitelist;?>whitelist, 'class="form-control chosen" multiple');?>
- -
-
-
-getModuleRoot() . 'common/view/footer.html.php';?> diff --git a/extension/lite/story/ext/model/lite.php b/extension/lite/story/ext/model/lite.php new file mode 100644 index 0000000000..ad083b957f --- /dev/null +++ b/extension/lite/story/ext/model/lite.php @@ -0,0 +1,10 @@ +config->vision == 'lite') + { + $execution = $this->loadModel('execution')->getById($executionID); + if($execution->project) $executionID = $execution->project; + } + return parent::getExecutionStoryPairs($executionID, $productID, $branch, $moduleIdList, $type, $status); +} diff --git a/module/execution/control.php b/module/execution/control.php index dd8f36353c..ee091e030e 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -126,7 +126,7 @@ class execution extends control $execution = $this->commonAction($executionID, $status); $executionID = $execution->id; - if($execution->type == 'kanban') $this->locate($this->createLink('execution', 'kanban', "executionID=$executionID")); + if($execution->type == 'kanban' and $this->config->vision != 'lite') $this->locate($this->createLink('execution', 'kanban', "executionID=$executionID")); /* Get products by execution. */ $products = $this->product->getProductPairsByProject($executionID); diff --git a/module/execution/model.php b/module/execution/model.php index d584e2beec..0b2517bca7 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -3547,15 +3547,29 @@ class executionModel extends model public function fillTasksInTree($node, $executionID) { $node = (object)$node; + a($node); static $storyGroups, $taskGroups; if(empty($storyGroups)) { - $stories = $this->dao->select('t2.*, t1.version as taskVersion')->from(TABLE_PROJECTSTORY)->alias('t1') - ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') - ->where('t1.project')->eq((int)$executionID) - ->andWhere('t2.deleted')->eq(0) - ->orderBy('t1.`order`_desc') - ->fetchAll(); + if($this->config->vision == 'lite') + { + $execution = $this->getById($executionID); + $stories = $this->dao->select('t2.*, t1.version as taskVersion')->from(TABLE_PROJECTSTORY)->alias('t1') + ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') + ->where('t1.project')->eq((int)$execution->project) + ->andWhere('t2.deleted')->eq(0) + ->orderBy('t1.`order`_desc') + ->fetchAll(); + } + else + { + $stories = $this->dao->select('t2.*, t1.version as taskVersion')->from(TABLE_PROJECTSTORY)->alias('t1') + ->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id') + ->where('t1.project')->eq((int)$executionID) + ->andWhere('t2.deleted')->eq(0) + ->orderBy('t1.`order`_desc') + ->fetchAll(); + } $storyGroups = array(); foreach($stories as $story) $storyGroups[$story->product][$story->module][$story->id] = $story; } @@ -3609,6 +3623,7 @@ class executionModel extends model $node->type = 'module'; $stories = isset($storyGroups[$node->root][$node->id]) ? $storyGroups[$node->root][$node->id] : array(); + a($stories); foreach($stories as $story) { $storyItem = new stdclass();