diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index ab5add374f..362136ace9 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -96,7 +96,7 @@ $lang->my->menu->work['subMenu']->story = "$lang->SRCommon|my|work|mode=st $lang->my->menu->work['subMenu']->bug = "{$lang->bug->common}|my|work|mode=bug"; $lang->my->menu->work['subMenu']->testcase = array('link' => "{$lang->testcase->common}|my|work|mode=testcase&type=assigntome", 'subModule' => 'testtask'); $lang->my->menu->work['subMenu']->testtask = "{$lang->testtask->common}|my|work|mode=testtask&type=wait"; -$lang->my->menu->work['subMenu']->audit = array('link' => "{$lang->review->common}|my|work|mode=audit", 'subModule' => 'review'); +$lang->my->menu->work['subMenu']->audit = array('link' => "{$lang->review->common}|my|work|mode=audit&type=all¶m=&orderBy=time_desc", 'subModule' => 'review'); $lang->my->menu->work['menuOrder'][5] = 'task'; $lang->my->menu->work['menuOrder'][10] = 'requirement'; diff --git a/module/my/control.php b/module/my/control.php index 358d63a930..0455646653 100755 --- a/module/my/control.php +++ b/module/my/control.php @@ -182,8 +182,7 @@ class my extends control $riskCount = $pager->recTotal; /* Get the number of reviews assigned to me. */ - $pendingList = $this->loadModel('approval')->getPendingReviews('review'); - $reviewList = $this->review->getByList($pendingList, 'id_desc', $pager); + $reviewList = $this->my->getReviewList('all', 'time_desc', $pager); $reviewCount = $pager->recTotal; /* Get the number of nc assigned to me. */ @@ -221,6 +220,7 @@ if(isMax !== 0) { var issueCount = $issueCount; var riskCount = $riskCount; + var qaCount = $qaCount; var meetingCount = $meetingCount; } @@ -939,6 +939,7 @@ EOF; * My audits. * * @param string $browseType + * @param string $param * @param string $orderBy * @param int $recTotal * @param int $recPerPage @@ -946,32 +947,22 @@ EOF; * @access public * @return void */ - public function audit($browseType = 'needreview', $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1) + public function audit($browseType = 'all', $param = 0, $orderBy = 'time_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1) { $this->app->loadClass('pager', true); $pager = pager::init($recTotal, $recPerPage, $pageID); - $reviewList = array(); - if($this->config->edition == 'max') + if($this->config->edition == 'max' and ($browseType == 'reviewedbyme' or $browseType == 'createdbyme')) { - $this->loadModel('datatable'); - $this->loadModel('baseline'); - $this->app->loadLang('review'); $this->session->set('reviewList', $this->app->getURI(true)); - $pendingList = $this->loadModel('approval')->getPendingReviews('review'); - if($browseType == 'needreview') - { - $reviewList = $this->loadModel('review')->getByList($pendingList, $orderBy, $pager); - } - else - { - $reviewList = $this->loadModel('review')->getUserReviews($browseType, $orderBy, $pager); - } - $this->view->products = $this->my->getProductPairs(); - $this->view->pendingList = $pendingList; + $reviewList = $this->loadModel('review')->getUserReviews($browseType, $orderBy, $pager); + } + else + { + $reviewList = $this->my->getReviewList($browseType, $orderBy, $pager); } - $this->view->title = $this->lang->my->myReview; + $this->view->title = $this->lang->review->common; $this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter'); $this->view->reviewList = $reviewList; $this->view->recTotal = $recTotal; diff --git a/module/my/lang/de.php b/module/my/lang/de.php index a20327ed31..01f7d19556 100644 --- a/module/my/lang/de.php +++ b/module/my/lang/de.php @@ -80,6 +80,20 @@ $lang->my->storyMenu->reviewedByMe = 'ReviewedByMe'; $lang->my->storyMenu->closedByMe = 'ClosedByMe'; $lang->my->storyMenu->assignedByMe = 'AssignedByMe'; +$lang->my->audit = new stdclass(); +$lang->my->audit->title = 'Title'; +$lang->my->audit->time = 'Time'; +$lang->my->audit->type = 'Type'; +$lang->my->audit->status = 'Status'; + +$lang->my->auditMenu = new stdclass(); +$lang->my->auditMenu->all = 'All'; +$lang->my->auditMenu->story = 'Story'; +$lang->my->auditMenu->testcase = 'Case'; +if($config->edition == 'max' and strpos(",$config->disabledFeatures,", ',waterfall,') === false) $lang->my->auditMenu->project = 'Project'; +if($config->edition != 'open') $lang->my->auditMenu->feedback = 'Feedback'; +if($config->edition != 'open') $lang->my->auditMenu->oa = 'OA'; + $lang->my->projectMenu = new stdclass(); $lang->my->projectMenu->doing = 'Doing'; $lang->my->projectMenu->wait = 'Waiting'; @@ -120,6 +134,7 @@ $lang->my->executionLinkList['execution-all'] = 'Enter the execution $lang->my->executionLinkList['execution-task'] = 'By default, enter the list of the most recently executed task, and you can view the task information under the current iteration'; $lang->my->executionLinkList['execution-executionkanban'] = 'By default, you can enter the execution Kanban to view the execution status of projects in progress'; +$lang->my->confirmReview = 'Do you want to pass it?'; $lang->my->guideChangeTheme = <<"Young Blue" theme is available now!

diff --git a/module/my/lang/en.php b/module/my/lang/en.php index 185ad56a1a..21daaedf37 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -80,6 +80,20 @@ $lang->my->storyMenu->reviewedByMe = 'ReviewedByMe'; $lang->my->storyMenu->closedByMe = 'ClosedByMe'; $lang->my->storyMenu->assignedByMe = 'AssignedByMe'; +$lang->my->audit = new stdclass(); +$lang->my->audit->title = 'Title'; +$lang->my->audit->time = 'Time'; +$lang->my->audit->type = 'Type'; +$lang->my->audit->status = 'Status'; + +$lang->my->auditMenu = new stdclass(); +$lang->my->auditMenu->all = 'All'; +$lang->my->auditMenu->story = 'Story'; +$lang->my->auditMenu->testcase = 'Case'; +if($config->edition == 'max' and strpos(",$config->disabledFeatures,", ',waterfall,') === false) $lang->my->auditMenu->project = 'Project'; +if($config->edition != 'open') $lang->my->auditMenu->feedback = 'Feedback'; +if($config->edition != 'open') $lang->my->auditMenu->oa = 'OA'; + $lang->my->projectMenu = new stdclass(); $lang->my->projectMenu->doing = 'Doing'; $lang->my->projectMenu->wait = 'Waiting'; @@ -120,6 +134,7 @@ $lang->my->executionLinkList['execution-all'] = 'Enter the execution $lang->my->executionLinkList['execution-task'] = 'By default, enter the list of the most recently executed task, and you can view the task information under the current iteration'; $lang->my->executionLinkList['execution-executionkanban'] = 'By default, you can enter the execution Kanban to view the execution status of projects in progress'; +$lang->my->confirmReview = 'Do you want to pass it?'; $lang->my->guideChangeTheme = <<"Young Blue" theme is available now!

diff --git a/module/my/lang/fr.php b/module/my/lang/fr.php index a20327ed31..01f7d19556 100644 --- a/module/my/lang/fr.php +++ b/module/my/lang/fr.php @@ -80,6 +80,20 @@ $lang->my->storyMenu->reviewedByMe = 'ReviewedByMe'; $lang->my->storyMenu->closedByMe = 'ClosedByMe'; $lang->my->storyMenu->assignedByMe = 'AssignedByMe'; +$lang->my->audit = new stdclass(); +$lang->my->audit->title = 'Title'; +$lang->my->audit->time = 'Time'; +$lang->my->audit->type = 'Type'; +$lang->my->audit->status = 'Status'; + +$lang->my->auditMenu = new stdclass(); +$lang->my->auditMenu->all = 'All'; +$lang->my->auditMenu->story = 'Story'; +$lang->my->auditMenu->testcase = 'Case'; +if($config->edition == 'max' and strpos(",$config->disabledFeatures,", ',waterfall,') === false) $lang->my->auditMenu->project = 'Project'; +if($config->edition != 'open') $lang->my->auditMenu->feedback = 'Feedback'; +if($config->edition != 'open') $lang->my->auditMenu->oa = 'OA'; + $lang->my->projectMenu = new stdclass(); $lang->my->projectMenu->doing = 'Doing'; $lang->my->projectMenu->wait = 'Waiting'; @@ -120,6 +134,7 @@ $lang->my->executionLinkList['execution-all'] = 'Enter the execution $lang->my->executionLinkList['execution-task'] = 'By default, enter the list of the most recently executed task, and you can view the task information under the current iteration'; $lang->my->executionLinkList['execution-executionkanban'] = 'By default, you can enter the execution Kanban to view the execution status of projects in progress'; +$lang->my->confirmReview = 'Do you want to pass it?'; $lang->my->guideChangeTheme = <<"Young Blue" theme is available now!

diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index 17feb11ba9..4a651dd083 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -80,6 +80,20 @@ $lang->my->storyMenu->reviewedByMe = '由我评审'; $lang->my->storyMenu->closedByMe = '由我关闭'; $lang->my->storyMenu->assignedByMe = '由我指派'; +$lang->my->audit = new stdclass(); +$lang->my->audit->title = '评审标题'; +$lang->my->audit->time = '提交时间'; +$lang->my->audit->type = '类型'; +$lang->my->audit->status = '状态'; + +$lang->my->auditMenu = new stdclass(); +$lang->my->auditMenu->all = '所有'; +$lang->my->auditMenu->story = '需求'; +$lang->my->auditMenu->testcase = '用例'; +if($config->edition == 'max' and strpos(",$config->disabledFeatures,", ',waterfall,') === false) $lang->my->auditMenu->project = '项目'; +if($config->edition != 'open') $lang->my->auditMenu->feedback = '反馈'; +if($config->edition != 'open') $lang->my->auditMenu->oa = '办公'; + $lang->my->projectMenu = new stdclass(); $lang->my->projectMenu->doing = '进行中'; $lang->my->projectMenu->wait = '未开始'; @@ -120,6 +134,7 @@ $lang->my->executionLinkList['execution-all'] = '默认进入执行 $lang->my->executionLinkList['execution-task'] = '默认进入最近一个执行的任务列表,可以查看当前迭代下的任务信息'; $lang->my->executionLinkList['execution-executionkanban'] = '默认进入执行看板,可以查看进行中项目的执行情况'; +$lang->my->confirmReview = '您确定要执行通过操作吗?'; $lang->my->guideChangeTheme = <<全新“青春蓝”主题上线了!

diff --git a/module/my/model.php b/module/my/model.php index 52b5a6f647..8871e363df 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -968,4 +968,238 @@ class myModel extends model return $requirements; } + /** + * Get review list for me. + * + * @param string $browseType + * @param string $orderBy + * @param object $pager + * @access public + * @return array + */ + public function getReviewList($browseType, $orderBy = 'time_desc', $pager = null) + { + if($this->app->rawMethod != 'work') return array(); + $reviewList = array(); + if($browseType == 'all' or $browseType == 'story') $reviewList = array_merge($reviewList, $this->getReviewingStories()); + if($browseType == 'all' or $browseType == 'testcase') $reviewList = array_merge($reviewList, $this->getReviewingCases()); + if($browseType == 'all' or $browseType == 'project') $reviewList = array_merge($reviewList, $this->getReviewingApprovals()); + if($browseType == 'all' or $browseType == 'feedback') $reviewList = array_merge($reviewList, $this->getReviewingFeedbacks()); + if($browseType == 'all' or $browseType == 'oa') $reviewList = array_merge($reviewList, $this->getReviewingOA()); + + if(empty($reviewList)) return array(); + + $field = $orderBy; + $direction = 'asc'; + if(strpos($orderBy, '_') !== false) list($field, $direction) = explode('_', $orderBy); + + /* Sort review. */ + $reviewGroup = array(); + foreach($reviewList as $review) + { + if(!isset($review->$field)) $field = 'time'; + $reviewGroup[$review->$field][] = $review; + } + if($direction == 'asc') ksort($reviewGroup); + if($direction == 'desc') krsort($reviewGroup); + + $reviewList = array(); + foreach($reviewGroup as $reviews) $reviewList = array_merge($reviewList, $reviews); + + /* Pager. */ + $pager->setRecTotal(count($reviewList)); + $pager->setPageTotal(); + $pager->setPageID($pager->pageID); + $reviewList = array_chunk($reviewList, $pager->recPerPage); + $reviewList = $reviewList[$pager->pageID - 1]; + + return $reviewList; + } + + /** + * Get reviewing stories. + * + * @param string $orderBy + * @access public + * @return array + */ + public function getReviewingStories($orderBy = 'id_desc') + { + if(!common::hasPriv('story', 'review')) return array(); + + $this->app->loadLang('story'); + $stmt = $this->dao->select("t1.*")->from(TABLE_STORY)->alias('t1') + ->leftJoin(TABLE_STORYREVIEW)->alias('t2')->on('t1.id = t2.story and t1.version = t2.version') + ->where('t1.deleted')->eq(0) + ->beginIF(!$this->app->user->admin)->andWhere('t1.product')->in($this->app->user->view->products)->fi() + ->andWhere('t2.reviewer')->eq($this->app->user->account) + ->andWhere('t2.result')->eq('') + ->andWhere('t1.status')->eq('reviewing') + ->orderBy($orderBy) + ->query(); + + $stories = array(); + while($data = $stmt->fetch()) + { + $story = new stdclass(); + $story->id = $data->id; + $story->title = $data->title; + $story->type = 'story'; + $story->time = $data->openedDate; + $story->status = $data->status; + $stories[$story->id] = $story; + } + + $actions = $this->dao->select('objectID,`date`')->from(TABLE_ACTION)->where('objectType')->eq('story')->andWhere('objectID')->in(array_keys($stories))->andWhere('action')->eq('submitreview')->orderBy('`date`')->fetchPairs('objectID', 'date'); + foreach($actions as $storyID => $date) $stories[$storyID]->time = $date; + return array_values($stories); + } + + /** + * Get reviewing cases. + * + * @param string $orderBy + * @access public + * @return array + */ + public function getReviewingCases($orderBy = 'id_desc') + { + if(!common::hasPriv('testcase', 'review')) return array(); + + $this->app->loadLang('testcase'); + $stmt = $this->dao->select('*')->from(TABLE_CASE) + ->where('deleted')->eq('0') + ->andWhere('status')->eq('wait') + ->beginIF(!$this->app->user->admin)->andWhere('product')->in($this->app->user->view->products)->fi() + ->orderBy($orderBy) + ->query(); + + $cases = array(); + while($data = $stmt->fetch()) + { + $case = new stdclass(); + $case->id = $data->id; + $case->title = $data->title; + $case->type = 'testcase'; + $case->time = $data->openedDate; + $case->status = $data->status; + $cases[$case->id] = $case; + } + + return array_values($cases); + } + + /** + * Get reviewing approvals. + * + * @param string $orderBy + * @access public + * @return array + */ + public function getReviewingApprovals($orderBy = 'id_desc') + { + if(!common::hasPriv('review', 'assess')) return array(); + if($this->config->edition != 'max') return array(); + + $pendingList = $this->loadModel('approval')->getPendingReviews('review'); + $projectReviews = $this->loadModel('review')->getByList($pendingList, $orderBy); + + $this->app->loadLang('project'); + $this->session->set('reviewList', $this->app->getURI(true)); + + $reviewList = array(); + foreach($projectReviews as $review) + { + if(!isset($pendingList[$review->id])) continue; + + $data = new stdclass(); + $data->id = $review->id; + $data->title = $review->title; + $data->type = 'project'; + $data->time = $review->createdDate; + $data->status = $review->status; + $reviewList[] = $data; + } + return $reviewList; + } + + /** + * Get reviewing feedbacks. + * + * @param string $orderBy + * @access public + * @return array + */ + public function getReviewingFeedbacks($orderBy = 'id_desc') + { + if(!common::hasPriv('feedback', 'review')) return array(); + if($this->config->edition == 'open') return array(); + + $feedbacks = $this->loadModel('feedback')->getList('review', $orderBy); + $reviewList = array(); + foreach($feedbacks as $feedback) + { + $data = new stdclass(); + $data->id = $feedback->id; + $data->title = $feedback->title; + $data->type = 'feedback'; + $data->time = $feedback->openedDate; + $data->status = $feedback->status; + $reviewList[] = $data; + } + return $reviewList; + } + + /** + * Get reviewing OA. + * + * @param string $orderBy + * @access public + * @return array + */ + public function getReviewingOA($orderBy = 'status') + { + if($this->config->edition == 'open') return array(); + + $users = $this->loadModel('user')->getPairs('noletter'); + $account = $this->app->user->account; + + /* Get dept info. */ + $allDeptList = $this->loadModel('dept')->getPairs('', 'dept'); + $allDeptList['0'] = '/'; + $managedDeptList = array(); + $tmpDept = $this->dept->getDeptManagedByMe($account); + foreach($tmpDept as $d) $managedDeptList[$d->id] = $d->name; + + $oa = array(); + if(common::hasPriv('attend', 'review')) $oa['attend'] = $this->getReviewingAttends($allDeptList, $managedDeptList); + if(common::hasPriv('leave', 'review')) $oa['leave'] = $this->getReviewingLeaves($allDeptList, $managedDeptList, $orderBy); + if(common::hasPriv('overtime', 'review')) $oa['overtime'] = $this->getReviewingOvertimes($allDeptList, $managedDeptList, $orderBy); + if(common::hasPriv('makeup', 'review')) $oa['makeup'] = $this->getReviewingMakeups($allDeptList, $managedDeptList, $orderBy); + if(common::hasPriv('lieu', 'review')) $oa['lieu'] = $this->getReviewingLieus($allDeptList, $managedDeptList, $orderBy); + + $reviewList = array(); + foreach($oa as $type => $reviewings) + { + foreach($reviewings as $object) + { + $review = new stdclass(); + $review->id = $object->id; + $review->type = $type; + $review->time = $type == 'attend' ? $object->date : $object->createdDate; + $review->status = $type == 'attend' ? $object->reviewStatus : $object->status; + if($type == 'attend') + { + $review->title = zget($users, $object->account) . ': ' . $object->date . $this->lang->attend->statusList[$object->status ]; + } + else + { + $review->title = zget($users, $object->createdBy) . ': ' . $object->begin . ' ' . substr($object->start, 0, 5) . ' ~ ' . $object->end . ' ' . substr($object->finish, 0, 5); + } + $reviewList[] = $review; + } + } + + return $reviewList; + } } diff --git a/module/my/view/audit.html.php b/module/my/view/audit.html.php index 276eae79b1..f531608fd7 100644 --- a/module/my/view/audit.html.php +++ b/module/my/view/audit.html.php @@ -4,69 +4,124 @@ rawMethod);?> -
-
- -
-

- noData;?> -

-
- -
-
- -
- getModuleRoot() . 'common/view/datatable.html.php'; - - $setting = $this->datatable->getSetting('review'); - foreach($setting as $key => $value) - { - if($value->id == 'actions') $setting[$key]->width = 80; - } - - $widths = $this->datatable->setFixedFieldWidth($setting); - ?> - ' data-fixed-right-width=''> - - - show) - { - $this->datatable->printHead($value, $orderBy, $vars, false); - } - } - ?> - - - - - - my->reviewPrintCell($value, $review, $users, $products, $pendingList);?> - - - -
- -
+
+ +
+

+ noData;?> +

+
+ +
+ + + recTotal&recPerPage=$pager->recPerPage&pageID=$pager->pageID";?> + + + + + + + + + + + + type; + $typeName = $lang->$type->common; + if($type == 'project') $type = 'review'; + + $statusList = $lang->$type->statusList; + if($type == 'attend') $statusList = $lang->attend->reviewStatusList; + ?> + + + + + + + + + + +
idAB);?> my->audit->title);?> my->audit->type);?> my->audit->time);?>my->audit->status);?>actions?>
id?> title?> time?>status, '')?> + id"; + + $reviewIcon = ''; + $passIcon = ''; + $rejectIcon = ''; + + if($module == 'review') + { + $method = 'assess'; + $params = "reviewID=$review->id&from={$this->app->rawMethod}"; + common::printLink($module, $method, $params, $reviewIcon, '', "class='btn' title='{$lang->review->common}'"); + } + elseif($module == 'attend') + { + extCommonModel::printLink('attend', 'review', "attendID={$review->id}&status=pass", $passIcon, "class='btn' title='{$lang->attend->reviewStatusList['pass']}' data-status='pass' data-toggle='ajax'"); + extCommonModel::printLink('attend', 'review', "attendID={$review->id}&status=reject", $rejectIcon, "class='btn' title='{$lang->attend->reviewStatusList['reject']}' data-toggle='modal'"); + } + elseif($module == 'leave') + { + $leaveMode = $review->status == 'pass' ? 'back' : ''; + extCommonModel::printLink('leave', 'review', "id={$review->id}&status=pass&mode=$leaveMode", $passIcon, "class='btn' title='{$lang->$module->statusList['pass']}' data-status='pass' data-toggle='ajax'"); + extCommonModel::printLink('leave', 'review', "id={$review->id}&status=reject&mode=$leaveMode", $rejectIcon, "class='btn' title='{$lang->$module->statusList['reject']}' data-toggle='modal'"); + } + elseif(strpos('|makeup|overtime|lieu|', "|$module|") !== false) + { + extCommonModel::printLink($module, $method, "id={$review->id}&status=pass", $passIcon, "class='btn' title='{$lang->$module->statusList['pass']}' data-status='pass' data-toggle='ajax'"); + extCommonModel::printLink($module, $method, "id={$review->id}&status=reject", $rejectIcon, "class='btn' title='{$lang->$module->statusList['reject']}' data-toggle='modal'"); + } + else + { + common::printLink($module, $method, $params, $reviewIcon, '', "class='btn iframe' title='{$lang->review->common}'", true, true); + } + ?> +
+ +
+ +
+my->confirmReview);?> getModuleRoot() . 'common/view/footer.html.php'?> diff --git a/module/my/view/task.html.php b/module/my/view/task.html.php index 932f6125f5..2e5ebe192e 100644 --- a/module/my/view/task.html.php +++ b/module/my/view/task.html.php @@ -36,8 +36,8 @@ my->byQuery;?>
-rawMethod == 'work' ? 'workTask' : 'contributeTask';?> -
>
+ rawMethod == 'work' ? 'workTask' : 'contributeTask';?> +
>

task->noTask;?>