diff --git a/module/my/lang/de.php b/module/my/lang/de.php index ab213029e8..0207fa2b16 100644 --- a/module/my/lang/de.php +++ b/module/my/lang/de.php @@ -142,6 +142,7 @@ $lang->my->featureBar['todo']['assignedToOther'] = 'Assigned To Other'; $lang->my->featureBar['todo']['cycle'] = 'Recurrence'; $lang->my->featureBar['audit']['all'] = 'All'; +$lang->my->featureBar['audit']['demand'] = 'Demand'; $lang->my->featureBar['audit']['story'] = 'Story'; $lang->my->featureBar['audit']['testcase'] = 'Test case'; if($config->edition == 'max' and (helper::hasFeature('waterfall') or helper::hasFeature('waterfallplus'))) $lang->my->featureBar['audit']['project'] = $lang->projectCommon; diff --git a/module/my/lang/en.php b/module/my/lang/en.php index ab213029e8..0207fa2b16 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -142,6 +142,7 @@ $lang->my->featureBar['todo']['assignedToOther'] = 'Assigned To Other'; $lang->my->featureBar['todo']['cycle'] = 'Recurrence'; $lang->my->featureBar['audit']['all'] = 'All'; +$lang->my->featureBar['audit']['demand'] = 'Demand'; $lang->my->featureBar['audit']['story'] = 'Story'; $lang->my->featureBar['audit']['testcase'] = 'Test case'; if($config->edition == 'max' and (helper::hasFeature('waterfall') or helper::hasFeature('waterfallplus'))) $lang->my->featureBar['audit']['project'] = $lang->projectCommon; diff --git a/module/my/lang/fr.php b/module/my/lang/fr.php index d2a3294e5e..62add39930 100644 --- a/module/my/lang/fr.php +++ b/module/my/lang/fr.php @@ -142,6 +142,7 @@ $lang->my->featureBar['todo']['assignedToOther'] = 'Assigned To Other'; $lang->my->featureBar['todo']['cycle'] = 'Récurrence'; $lang->my->featureBar['audit']['all'] = 'All'; +$lang->my->featureBar['audit']['demand'] = 'Demand'; $lang->my->featureBar['audit']['story'] = 'Story'; $lang->my->featureBar['audit']['testcase'] = 'Test case'; if($config->edition == 'max' and (helper::hasFeature('waterfall') or helper::hasFeature('waterfallplus'))) $lang->my->featureBar['audit']['project'] = $lang->projectCommon; diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index 273b7715a0..af15fd8bb7 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -142,6 +142,7 @@ $lang->my->featureBar['todo']['assignedToOther'] = '指派他人'; $lang->my->featureBar['todo']['cycle'] = '周期'; $lang->my->featureBar['audit']['all'] = '全部'; +$lang->my->featureBar['audit']['demand'] = '需求池需求'; $lang->my->featureBar['audit']['story'] = '需求'; $lang->my->featureBar['audit']['testcase'] = '用例'; if($config->edition == 'max' and (helper::hasFeature('waterfall') or helper::hasFeature('waterfallplus'))) $lang->my->featureBar['audit']['project'] = $lang->projectCommon; diff --git a/module/my/model.php b/module/my/model.php index 9b462d72f1..5764f32749 100644 --- a/module/my/model.php +++ b/module/my/model.php @@ -1016,6 +1016,7 @@ class myModel extends model public function getReviewingTypeList() { $typeList = array(); + if($this->getReviewingDemands('id_desc', true)) $typeList[] = 'demand'; if($this->getReviewingStories('id_desc', true)) $typeList[] = 'story'; if($this->getReviewingCases('id_desc', true)) $typeList[] = 'testcase'; if($this->getReviewingApprovals('id_desc', true)) $typeList[] = 'project'; @@ -1047,6 +1048,7 @@ class myModel extends model public function getReviewingList($browseType, $orderBy = 'time_desc', $pager = null) { $reviewList = array(); + if($browseType == 'all' or $browseType == 'demand') $reviewList = array_merge($reviewList, $this->getReviewingDemands()); 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()); @@ -1083,6 +1085,48 @@ class myModel extends model return $reviewList; } + /** + * Get reviewing demands. + * + * @param string $orderBy + * @param bool $checkExists + * @access public + * @return array + */ + public function getReviewingDemands($orderBy = 'id_desc', $checkExists = false) + { + if(!common::hasPriv('demand', 'review')) return array(); + + $this->app->loadLang('demand'); + $stmt = $this->dao->select("t1.*")->from(TABLE_DEMAND)->alias('t1') + ->leftJoin(TABLE_DEMANDREVIEW)->alias('t2')->on('t1.id = t2.demand 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.vision')->eq($this->config->vision) + ->andWhere('t1.status')->eq('reviewing') + ->orderBy($orderBy) + ->query(); + + $demands = array(); + while($data = $stmt->fetch()) + { + if($checkExists) return true; + $demand = new stdclass(); + $demand->id = $data->id; + $demand->title = $data->title; + $demand->type = 'demand'; + $demand->time = $data->createdDate; + $demand->status = $data->status; + $demands[$demand->id] = $demand; + } + + $actions = $this->dao->select('objectID,`date`')->from(TABLE_ACTION)->where('objectType')->eq('demand')->andWhere('objectID')->in(array_keys($demands))->andWhere('action')->eq('submitreview')->orderBy('`date`')->fetchPairs('objectID', 'date'); + foreach($actions as $demandID => $date) $demands[$demandID]->time = $date; + return array_values($demands); + } + /** * Get reviewing stories. * diff --git a/module/my/view/audit.html.php b/module/my/view/audit.html.php index 20b6198d42..62f264af2d 100644 --- a/module/my/view/audit.html.php +++ b/module/my/view/audit.html.php @@ -64,7 +64,7 @@ $statusList = array(); if(isset($lang->$type->statusList)) $statusList = $lang->$type->statusList; if($type == 'attend') $statusList = $lang->attend->reviewStatusList; - if(!in_array($type, array('story', 'testcase', 'feedback', 'review')) and strpos(",{$config->my->oaObjectType},", ",$type,") === false) + if(!in_array($type, array('demand', 'story', 'testcase', 'feedback', 'review')) and strpos(",{$config->my->oaObjectType},", ",$type,") === false) { if($rawMethod == 'audit') $statusList = $lang->approval->nodeList; if(isset($flows[$review->type])) $statusList = $rawMethod == 'audit' ? $lang->approval->nodeList : $lang->approval->statusList; @@ -124,7 +124,7 @@ { common::printLink($module, 'view', $params, $reviewIcon, '', "class='btn' data-toggle='modal' title='{$lang->review->common}'", true, true); } - elseif(!in_array($module, array('story', 'testcase', 'feedback'))) + elseif(!in_array($module, array('demand', 'story', 'testcase', 'feedback'))) { common::printLink($module, 'approvalreview', $params, $reviewIcon, '', "class='btn' data-toggle='modal' title='{$lang->review->common}'", true, true); }