* Merge comment #6041f625df, Fix bug #33466.

This commit is contained in:
tanghucheng
2023-10-30 23:30:28 -04:00
parent a22d157185
commit 8ccfa2817c
6 changed files with 50 additions and 2 deletions
+1
View File
@@ -151,6 +151,7 @@ $lang->my->moreSelects['todo']['more']['assignedToOther'] = 'Assigned To Other';
$lang->my->moreSelects['todo']['more']['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;
+1
View File
@@ -151,6 +151,7 @@ $lang->my->moreSelects['todo']['more']['assignedToOther'] = 'Assigned To Other';
$lang->my->moreSelects['todo']['more']['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;
+1
View File
@@ -151,6 +151,7 @@ $lang->my->moreSelects['todo']['more']['assignedToOther'] = 'Assigned To Other';
$lang->my->moreSelects['todo']['more']['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;
+1
View File
@@ -151,6 +151,7 @@ $lang->my->moreSelects['todo']['more']['assignedToOther'] = '指派他人';
$lang->my->moreSelects['todo']['more']['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;
+44
View File
@@ -1022,6 +1022,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';
@@ -1053,6 +1054,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());
@@ -1089,6 +1091,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.
*
+2 -2
View File
@@ -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);
}