diff --git a/module/metric/calc/system/rate/rate_of_fixed_bug.php b/module/metric/calc/system/rate/rate_of_fixed_bug.php index bbc4bd259a..b60df67ce8 100755 --- a/module/metric/calc/system/rate/rate_of_fixed_bug.php +++ b/module/metric/calc/system/rate/rate_of_fixed_bug.php @@ -20,7 +20,7 @@ */ class rate_of_fixed_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.status', 't1.resolution'); diff --git a/module/metric/calc/system/scale/count_of_activated_bug.php b/module/metric/calc/system/scale/count_of_activated_bug.php index b0c57fd587..daef3c25aa 100755 --- a/module/metric/calc/system/scale/count_of_activated_bug.php +++ b/module/metric/calc/system/scale/count_of_activated_bug.php @@ -20,7 +20,7 @@ */ class count_of_activated_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.status'); diff --git a/module/metric/calc/system/scale/count_of_annual_closed_feedback.php b/module/metric/calc/system/scale/count_of_annual_closed_feedback.php index 805db3d6ea..e13cf08f99 100755 --- a/module/metric/calc/system/scale/count_of_annual_closed_feedback.php +++ b/module/metric/calc/system/scale/count_of_annual_closed_feedback.php @@ -20,7 +20,7 @@ */ class count_of_annual_closed_feedback extends baseCalc { - public $dataset = 'getFeedbacks'; + public $dataset = 'getFeedbacksWithShadowProduct'; public $fieldList = array('t1.status', 't1.closedDate'); diff --git a/module/metric/calc/system/scale/count_of_annual_created_bug.php b/module/metric/calc/system/scale/count_of_annual_created_bug.php index a12c0bba7d..6167ee2020 100755 --- a/module/metric/calc/system/scale/count_of_annual_created_bug.php +++ b/module/metric/calc/system/scale/count_of_annual_created_bug.php @@ -20,7 +20,7 @@ */ class count_of_annual_created_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.openedDate'); diff --git a/module/metric/calc/system/scale/count_of_annual_created_case.php b/module/metric/calc/system/scale/count_of_annual_created_case.php index 7c867de848..1a2068ca88 100755 --- a/module/metric/calc/system/scale/count_of_annual_created_case.php +++ b/module/metric/calc/system/scale/count_of_annual_created_case.php @@ -20,7 +20,7 @@ */ class count_of_annual_created_case extends baseCalc { - public $dataset = 'getCases'; + public $dataset = 'getCasesWithShadowProduct'; public $fieldList = array('t1.openedDate'); diff --git a/module/metric/calc/system/scale/count_of_annual_created_feedback.php b/module/metric/calc/system/scale/count_of_annual_created_feedback.php index 782e63947e..6f3fe0ccff 100755 --- a/module/metric/calc/system/scale/count_of_annual_created_feedback.php +++ b/module/metric/calc/system/scale/count_of_annual_created_feedback.php @@ -20,7 +20,7 @@ */ class count_of_annual_created_feedback extends baseCalc { - public $dataset = 'getFeedbacks'; + public $dataset = 'getFeedbacksWithShadowProduct'; public $fieldList = array('openedDate'); diff --git a/module/metric/calc/system/scale/count_of_annual_fixed_bug.php b/module/metric/calc/system/scale/count_of_annual_fixed_bug.php index 61eb5f1f1f..925a9f214b 100755 --- a/module/metric/calc/system/scale/count_of_annual_fixed_bug.php +++ b/module/metric/calc/system/scale/count_of_annual_fixed_bug.php @@ -20,7 +20,7 @@ */ class count_of_annual_fixed_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.closedDate', 't1.status', 't1.resolution'); diff --git a/module/metric/calc/system/scale/count_of_bug.php b/module/metric/calc/system/scale/count_of_bug.php index 0a2c4a6bf7..2ddcb95198 100755 --- a/module/metric/calc/system/scale/count_of_bug.php +++ b/module/metric/calc/system/scale/count_of_bug.php @@ -20,7 +20,7 @@ */ class count_of_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.id'); diff --git a/module/metric/calc/system/scale/count_of_case.php b/module/metric/calc/system/scale/count_of_case.php index 56b1a0f67a..5bcbee542a 100755 --- a/module/metric/calc/system/scale/count_of_case.php +++ b/module/metric/calc/system/scale/count_of_case.php @@ -20,7 +20,7 @@ */ class count_of_case extends baseCalc { - public $dataset = 'getCases'; + public $dataset = 'getCasesWithShadowProduct'; public $fieldList = array('t1.id'); diff --git a/module/metric/calc/system/scale/count_of_closed_bug.php b/module/metric/calc/system/scale/count_of_closed_bug.php index f2cba29446..a6f9d84cf0 100755 --- a/module/metric/calc/system/scale/count_of_closed_bug.php +++ b/module/metric/calc/system/scale/count_of_closed_bug.php @@ -20,7 +20,7 @@ */ class count_of_closed_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.status'); diff --git a/module/metric/calc/system/scale/count_of_closed_feedback.php b/module/metric/calc/system/scale/count_of_closed_feedback.php index 7ccacbf740..d71054c8e8 100755 --- a/module/metric/calc/system/scale/count_of_closed_feedback.php +++ b/module/metric/calc/system/scale/count_of_closed_feedback.php @@ -20,7 +20,7 @@ */ class count_of_closed_feedback extends baseCalc { - public $dataset = 'getFeedbacks'; + public $dataset = 'getFeedbacksWithShadowProduct'; public $fieldList = array('t1.status'); diff --git a/module/metric/calc/system/scale/count_of_daily_closed_bug.php b/module/metric/calc/system/scale/count_of_daily_closed_bug.php index 650ec24fca..a178fcb721 100755 --- a/module/metric/calc/system/scale/count_of_daily_closed_bug.php +++ b/module/metric/calc/system/scale/count_of_daily_closed_bug.php @@ -20,7 +20,7 @@ */ class count_of_daily_closed_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.closedDate'); diff --git a/module/metric/calc/system/scale/count_of_feedback.php b/module/metric/calc/system/scale/count_of_feedback.php index 5833877c00..8098218dbc 100755 --- a/module/metric/calc/system/scale/count_of_feedback.php +++ b/module/metric/calc/system/scale/count_of_feedback.php @@ -20,7 +20,7 @@ */ class count_of_feedback extends baseCalc { - public $dataset = 'getFeedbacks'; + public $dataset = 'getFeedbacksWithShadowProduct'; public $fieldList = array('t1.id'); diff --git a/module/metric/calc/system/scale/count_of_fixed_bug.php b/module/metric/calc/system/scale/count_of_fixed_bug.php index 2793d8ff08..53c651af03 100755 --- a/module/metric/calc/system/scale/count_of_fixed_bug.php +++ b/module/metric/calc/system/scale/count_of_fixed_bug.php @@ -20,7 +20,7 @@ */ class count_of_fixed_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.status', 't1.resolution'); diff --git a/module/metric/calc/system/scale/count_of_invalid_story.php b/module/metric/calc/system/scale/count_of_invalid_story.php index 4d8507a9d5..2240c69072 100755 --- a/module/metric/calc/system/scale/count_of_invalid_story.php +++ b/module/metric/calc/system/scale/count_of_invalid_story.php @@ -29,7 +29,6 @@ class count_of_invalid_story extends baseCalc ->where('t1.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) ->andWhere('t1.type')->eq('story') - ->andWhere('t2.shadow')->eq(0) ->andWhere('t1.closedReason')->in('duplicate,willnotdo,bydesign') ->andWhere("t1.vision NOT LIKE '%or%'") ->andWhere("t1.vision NOT LIKE '%lite%'") diff --git a/module/metric/calc/system/scale/count_of_monthly_created_bug.php b/module/metric/calc/system/scale/count_of_monthly_created_bug.php index 1972ffccc4..f1afa0f50a 100755 --- a/module/metric/calc/system/scale/count_of_monthly_created_bug.php +++ b/module/metric/calc/system/scale/count_of_monthly_created_bug.php @@ -20,7 +20,7 @@ */ class count_of_monthly_created_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.openedDate'); diff --git a/module/metric/calc/system/scale/count_of_monthly_fixed_bug.php b/module/metric/calc/system/scale/count_of_monthly_fixed_bug.php index 3ba89510fa..31e180d209 100755 --- a/module/metric/calc/system/scale/count_of_monthly_fixed_bug.php +++ b/module/metric/calc/system/scale/count_of_monthly_fixed_bug.php @@ -20,7 +20,7 @@ */ class count_of_monthly_fixed_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.closedDate', 't1.status', 't1.resolution'); diff --git a/module/metric/calc/system/scale/count_of_resolved_bug.php b/module/metric/calc/system/scale/count_of_resolved_bug.php index 355c81c089..752f61d349 100755 --- a/module/metric/calc/system/scale/count_of_resolved_bug.php +++ b/module/metric/calc/system/scale/count_of_resolved_bug.php @@ -20,7 +20,7 @@ */ class count_of_resolved_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.status'); diff --git a/module/metric/calc/system/scale/count_of_unclosed_bug.php b/module/metric/calc/system/scale/count_of_unclosed_bug.php index 0c6ecb7696..fd29460761 100755 --- a/module/metric/calc/system/scale/count_of_unclosed_bug.php +++ b/module/metric/calc/system/scale/count_of_unclosed_bug.php @@ -20,7 +20,7 @@ */ class count_of_unclosed_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.status'); diff --git a/module/metric/calc/system/scale/count_of_valid_bug.php b/module/metric/calc/system/scale/count_of_valid_bug.php index fb3699bd06..7f26601ce3 100755 --- a/module/metric/calc/system/scale/count_of_valid_bug.php +++ b/module/metric/calc/system/scale/count_of_valid_bug.php @@ -20,7 +20,7 @@ */ class count_of_valid_bug extends baseCalc { - public $dataset = 'getBugs'; + public $dataset = 'getBugsWithShadowProduct'; public $fieldList = array('t1.status', 't1.resolution'); diff --git a/module/metric/calc/system/scale/count_of_valid_story.php b/module/metric/calc/system/scale/count_of_valid_story.php index c8d1632c99..3effec1d7b 100755 --- a/module/metric/calc/system/scale/count_of_valid_story.php +++ b/module/metric/calc/system/scale/count_of_valid_story.php @@ -28,7 +28,6 @@ class count_of_valid_story extends baseCalc ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') ->where('t1.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) - ->andWhere('t2.shadow')->eq(0) ->andWhere('t1.type')->eq('story') ->andWhere('t1.closedReason')->notin('duplicate,willnotdo,bydesign,cancel') ->andWhere("t1.vision NOT LIKE '%or%'") diff --git a/module/metric/calc/user/scale/count_of_assigned_feedback_in_user.php b/module/metric/calc/user/scale/count_of_assigned_feedback_in_user.php index 8f5f04690f..f77810e494 100755 --- a/module/metric/calc/user/scale/count_of_assigned_feedback_in_user.php +++ b/module/metric/calc/user/scale/count_of_assigned_feedback_in_user.php @@ -20,7 +20,7 @@ */ class count_of_assigned_feedback_in_user extends baseCalc { - public $dataset = 'getFeedbacks'; + public $dataset = 'getFeedbacksWithShadowProduct'; public $fieldList = array('t1.assignedTo'); diff --git a/module/metric/calc/user/scale/count_of_daily_review_feedback_in_user.php b/module/metric/calc/user/scale/count_of_daily_review_feedback_in_user.php index 11f62eb8b3..56d7584fd3 100755 --- a/module/metric/calc/user/scale/count_of_daily_review_feedback_in_user.php +++ b/module/metric/calc/user/scale/count_of_daily_review_feedback_in_user.php @@ -20,7 +20,7 @@ */ class count_of_daily_review_feedback_in_user extends baseCalc { - public $dataset = 'getFeedbacks'; + public $dataset = 'getFeedbacksWithShadowProduct'; public $fieldList = array('t1.reviewedBy', 't1.reviewedDate'); diff --git a/module/metric/calc/user/scale/count_of_delayed_bug_in_user.php b/module/metric/calc/user/scale/count_of_delayed_bug_in_user.php index 392a24d6ea..b51b71102c 100755 --- a/module/metric/calc/user/scale/count_of_delayed_bug_in_user.php +++ b/module/metric/calc/user/scale/count_of_delayed_bug_in_user.php @@ -38,7 +38,6 @@ class count_of_delayed_bug_in_user extends baseCalc ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') ->where('t1.deleted')->eq(0) ->andWhere('t2.deleted')->eq(0) - ->andWhere('t2.shadow')->eq(0) ->andWhere('t1.status')->eq('active') ->andWhere('t1.assignedDate')->notZeroDatetime() ->andWhere('DATEDIFF(CURDATE(), assignedDate)')->gt($longlife) diff --git a/module/metric/calc/user/scale/count_of_reviewing_feedback_in_user.php b/module/metric/calc/user/scale/count_of_reviewing_feedback_in_user.php index 3693bd44c3..d6dadc137b 100755 --- a/module/metric/calc/user/scale/count_of_reviewing_feedback_in_user.php +++ b/module/metric/calc/user/scale/count_of_reviewing_feedback_in_user.php @@ -20,7 +20,7 @@ */ class count_of_reviewing_feedback_in_user extends baseCalc { - public $dataset = 'getFeedbacks'; + public $dataset = 'getFeedbacksWithShadowProduct'; public $fieldList = array('t1.status', 't1.assignedTo'); diff --git a/module/metric/dataset.php b/module/metric/dataset.php index 04142abf2f..7d1278cce3 100644 --- a/module/metric/dataset.php +++ b/module/metric/dataset.php @@ -182,6 +182,14 @@ class dataset ->query(); } + /** + * 获取bug数据。 + * Get bug list with shadow product. + * + * @param string $fieldList + * @access public + * @return PDOStatement + */ public function getBugsWithShadowProduct($fieldList) { return $this->dao->select($fieldList) @@ -231,6 +239,23 @@ class dataset ->query(); } + /** + * 获取反馈数据。 + * Get feedback list with shadow product. + * + * @param string $fieldList + * @access public + * @return PDOStatement + */ + public function getFeedbacksWithShadowProduct($fieldList) + { + return $this->dao->select($fieldList)->from(TABLE_FEEDBACK)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') + ->where('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) + ->query(); + } + /** * 获取需求数据。 * Get story list. @@ -392,6 +417,25 @@ class dataset ->query(); } + /** + * 获取用例数据。 + * Get case list with shadow product. + * + * @param string $fieldList + * @access public + * @return PDOStatement + */ + public function getCasesWithShadowProduct($fieldList) + { + return $this->dao->select($fieldList)->from(TABLE_CASE)->alias('t1') + ->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product=t2.id') + ->where('t1.deleted')->eq(0) + ->andWhere('t2.deleted')->eq(0) + ->andWhere("t2.vision NOT LIKE '%or%'") + ->andWhere("t2.vision NOT LIKE '%lite%'") + ->query(); + } + /** * 获取产品数据。 * Get product list. @@ -411,6 +455,24 @@ class dataset ->query(); } + /** + * 获取产品数据。 + * Get product list include shadow product. + * + * @param string $fieldList + * @access public + * @return PDOStatement + */ + public function getProductsWithShadow($fieldList) + { + return $this->dao->select($fieldList) + ->from(TABLE_PRODUCT)->alias('t1') + ->where('t1.deleted')->eq(0) + ->andWhere("t1.vision NOT LIKE '%or%'") + ->andWhere("t1.vision NOT LIKE '%lite%'") + ->query(); + } + /** * 获取项目数据。 * Get all tasks. @@ -618,6 +680,14 @@ class dataset ->query(); } + /** + * 统计合并请求信息。 + * Get merge request. + * + * @param string $fieldList + * @access public + * @return PDOStatement + */ public function getMRs($fieldList) { return $this->dao->select($fieldList)->from(TABLE_MR)->alias('t1')