From 98dc79b954ea2bfaf2403149e9db95ec6bda99d1 Mon Sep 17 00:00:00 2001 From: "shiyangyangwork@yahoo.cn" Date: Wed, 12 Oct 2011 03:32:43 +0000 Subject: [PATCH] * finish the task #544. --- module/upgrade/model.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 8ecedd6d98..766d2ba9da 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -779,6 +779,26 @@ class upgradeModel extends model /* Update action name. */ } + /** + * Update activated count of Bug. + * + * @access public + * @return void + */ + private function updateActivatedCountOfBug() + { + $bugActivatedActions = $this->dao->select('*')->from(TABLE_ACTION)->where('action')->eq('activated')->andWhere('objectType')->eq('bug')->fetchAll(); + foreach($bugActivatedActions as $action) + { + if(!isset($counts[$action->objectID])) $counts[$action->objectID] = 0; + $counts[$action->objectID] ++; + } + foreach($counts as $key => $count) + { + $this->dao->update(TABLE_BUG)->set('activatedCount')->eq($count)->where('id')->eq($key)->exec(); + } + } + /** * Get the upgrade sql file. *