From f20f3d16586d0b2c0e6869804dec4a50e07836c5 Mon Sep 17 00:00:00 2001 From: hufangzhou Date: Thu, 5 Aug 2021 15:08:59 +0800 Subject: [PATCH] * Make the action buttons of story in my module call the isClickable function. --- module/my/control.php | 5 ++++- module/my/view/story.html.php | 10 +++++----- module/story/model.php | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/module/my/control.php b/module/my/control.php index 3e9a8abc7b..8c4ac1e9ae 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -196,10 +196,13 @@ class my extends control /* Append id for secend sort. */ $sort = $this->loadModel('common')->appendOrder($orderBy); + $stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'story'); + if(!empty($stories)) $stories = $this->story->mergeReviewer($stories); + /* Assign. */ $this->view->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->story; $this->view->position[] = $this->lang->my->story; - $this->view->stories = $this->loadModel('story')->getUserStories($this->app->user->account, $type, $sort, $pager, 'story'); + $this->view->stories = $stories; $this->view->users = $this->user->getPairs('noletter'); $this->view->projects = $this->loadModel('project')->getPairsByProgram(); $this->view->type = $type; diff --git a/module/my/view/story.html.php b/module/my/view/story.html.php index e48763c06e..2385c4cde1 100644 --- a/module/my/view/story.html.php +++ b/module/my/view/story.html.php @@ -101,11 +101,11 @@ if($canBeChanged) { $vars = "story={$story->id}"; - common::printIcon('story', 'change', $vars, $story, 'list', 'alter', '', 'iframe', true); - common::printIcon('story', 'review', $vars, $story, 'list', 'search', '', 'iframe', true); - common::printIcon('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); - common::printIcon('story', 'edit', $vars, $story, 'list', '', '', 'iframe', true, "data-width='95%'"); - common::printIcon('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap', '', 'iframe', true, "data-width='95%'"); + echo common::buildIconButton('story', 'change', $vars, $story, 'list', 'alter', '', 'iframe', true); + echo common::buildIconButton('story', 'review', $vars, $story, 'list', 'search', '', 'iframe', true); + echo common::buildIconButton('story', 'close', $vars, $story, 'list', '', '', 'iframe', true); + echo common::buildIconButton('story', 'edit', $vars, $story, 'list', '', '', 'iframe', true, "data-width='95%'"); + echo common::buildIconButton('story', 'createCase', "productID=$story->product&branch=$story->branch&module=0&from=¶m=0&$vars", $story, 'list', 'sitemap', '', 'iframe', true, "data-width='95%'"); } ?> diff --git a/module/story/model.php b/module/story/model.php index 84cebc4e6b..1da88a386c 100644 --- a/module/story/model.php +++ b/module/story/model.php @@ -2708,7 +2708,7 @@ class storyModel extends model ->beginIF($type != 'closedBy' and $this->app->moduleName == 'block')->andWhere('t1.status')->ne('closed')->fi() ->beginIF($type != 'all') ->beginIF($type == 'assignedTo')->andWhere('assignedTo')->eq($account)->fi() - ->beginIF($type == 'reviewBy')->andWhere('t3.reviewer')->eq($account)->andWhere('t3.result')->eq('')->fi() + ->beginIF($type == 'reviewBy')->andWhere('t3.reviewer')->eq($account)->andWhere('t3.result')->eq('')->andWhere('t1.status')->in('draft,changed')->fi() ->beginIF($type == 'openedBy')->andWhere('openedBy')->eq($account)->fi() ->beginIF($type == 'reviewedBy')->andWhere("CONCAT(',', reviewedBy, ',')")->like("%,$account,%")->fi() ->beginIF($type == 'closedBy')->andWhere('closedBy')->eq($account)->fi()